/*
  Michael Nguyen — portfolio
  Design: "Portfolio Modern" (Claude Design project f62236d7)
  Tokens below are the subset of the Broadsheet design system this page uses.
*/

:root {
	--color-text: #201e1d;
	--color-surface: #eae9e9;
	--color-accent: #0088b0;
	--color-accent-600: #1186ac;
	--color-accent-700: #006786;

	--color-page: #f7f7f6;
	--color-card: #fff;
	--color-hairline: color-mix(in srgb, var(--color-text) 9%, transparent);

	--shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
	--shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

	--font-body: "Instrument Sans", system-ui, sans-serif;
	--font-heading: "Space Grotesk", system-ui, sans-serif;
	--font-brand: "Sora", system-ui, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, monospace;

	--ease-out: cubic-bezier(.2, .7, .2, 1);
	--gutter: clamp(20px, 4vw, 44px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	overflow-x: hidden;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 1.55;
	background-color: var(--color-page);
	background-image: radial-gradient(color-mix(in srgb, #201e1d 8%, transparent) 1px, transparent 1px);
	background-size: 22px 22px;
	background-position: -1px -1px;
}

a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-600); }

img { display: block; max-width: 100%; }

h1, h2, h3 {
	font-family: var(--font-heading);
	letter-spacing: -0.03em;
	font-weight: 600;
	margin: 0;
}

*:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.icon {
	width: 1em;
	height: 1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* — masthead — */

.masthead {
	position: sticky;
	top: 0;
	z-index: 20;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background: color-mix(in srgb, var(--color-page) 78%, transparent);
	border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}

.masthead__inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 14px var(--gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.brand {
	font-family: var(--font-brand);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: -0.03em;
	white-space: nowrap;
}

.topnav {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	min-width: 0;
}

.topnav a {
	padding: 7px 13px;
	border-radius: 999px;
	color: var(--color-text);
	transition: background .2s ease;
}

.topnav a:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }

.topnav__cta {
	padding: 7px 15px;
	background: var(--color-accent);
	color: #fff;
	font-weight: 500;
	white-space: nowrap;
}

.topnav__cta:hover { background: var(--color-accent-600); color: #fff; }

/* — page shell — */

.shell {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 var(--gutter) 96px;
}

.section { scroll-margin-top: 80px; }

.section__head {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: baseline;
	justify-content: space-between;
	padding-bottom: clamp(22px, 3vw, 34px);
}

.section__head h2 {
	font-size: clamp(24px, 2.8vw, 34px);
}

/* — hero — */

.hero {
	scroll-margin-top: 80px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: clamp(28px, 4vw, 64px);
	align-items: center;
	padding: clamp(56px, 9vw, 132px) 0 clamp(40px, 6vw, 80px);
}

.hero h1 {
	font-size: clamp(28px, 4.3vw, 68px);
	line-height: 1.02;
	max-width: 30ch;
}

.hero__avatar {
	width: clamp(150px, 20vw, 232px);
	/* height:auto is load-bearing: the img's height attribute is a
	   presentational hint that would otherwise beat aspect-ratio. */
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 26px;
	box-shadow: var(--shadow-lg);
}

/* — bio — */

.bio {
	padding: clamp(16px, 2.5vw, 32px) 0 0;
}

.bio__body {
	max-width: 76ch;
	font-size: 15px;
	line-height: 1.62;
	color: color-mix(in srgb, var(--color-text) 82%, transparent);
	text-wrap: pretty;
	text-align: justify;
}

.bio__body p { margin: 0 0 12px; }
.bio__body p:last-child { margin: 0; }

/* — card grids — */

.work { padding: clamp(48px, 7vw, 96px) 0 0; }
.life { padding: clamp(64px, 9vw, 140px) 0 0; }

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
	gap: clamp(16px, 1.8vw, 22px);
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--color-card);
	border: 1px solid var(--color-hairline);
	border-radius: 18px;
	overflow: hidden;
	color: inherit;
	box-shadow: var(--shadow-sm);
	transition: transform .35s var(--ease-out), box-shadow .35s ease, border-color .35s ease;
}

.card:hover,
.card:focus-visible {
	color: inherit;
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--color-accent) 45%, transparent);
}

.card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 800 / 430;
	background: var(--color-surface);
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .55s var(--ease-out);
}

.card:hover .card__media img,
.card:focus-visible .card__media img { transform: scale(1.07); }

.card__cue {
	position: absolute;
	right: 10px;
	top: 10px;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--color-accent);
	color: #fff;
	font-size: 15px;
	opacity: 0;
	transform: scale(.7);
	transition: opacity .3s ease, transform .3s var(--ease-out);
}

.card:hover .card__cue,
.card:focus-visible .card__cue { opacity: 1; transform: none; }

.card__body {
	padding: 15px 16px 17px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.card__title {
	font-size: 17px;
	line-height: 1.25;
}

.card__company {
	margin: 0;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--color-accent-700);
}

.card__blurb {
	margin: 2px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: color-mix(in srgb, var(--color-text) 74%, transparent);
	text-wrap: pretty;
}

/* Placeholder panel for Life cards that don't have an image yet.
   Replace the whole .card__media block with an <img> to finish a card. */
.card__media--empty {
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--color-accent) 8%, var(--color-page));
	color: color-mix(in srgb, var(--color-accent-700) 55%, transparent);
	border-bottom: 1px dashed color-mix(in srgb, var(--color-accent) 35%, transparent);
	font-size: 34px;
}

/* — contact — */

.contact {
	padding: clamp(64px, 9vw, 140px) 0 0;
	scroll-margin-top: 80px;
}

.contact__panel {
	background: var(--color-card);
	border: 1px solid var(--color-hairline);
	border-radius: 24px;
	padding: clamp(28px, 4vw, 52px);
	box-shadow: var(--shadow-sm);
}

.contact__panel h2 {
	font-size: clamp(24px, 3vw, 36px);
	margin: 0 0 10px;
}

.contact__lede {
	margin: 0 0 clamp(22px, 3vw, 32px);
	font-size: 16.5px;
	color: color-mix(in srgb, var(--color-text) 72%, transparent);
	max-width: 44ch;
}

.contact__links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 19px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--color-text) 14%, transparent);
	color: var(--color-text);
	font-size: 15px;
	transition: background .2s ease;
}

.pill:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); color: var(--color-text); }

.pill .icon { font-size: 18px; }

.pill--primary {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: #fff;
	font-weight: 500;
}

.pill--primary:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); color: #fff; }

.colophon {
	margin: 26px 0 0;
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: color-mix(in srgb, var(--color-text) 50%, transparent);
}

/* — scroll reveal (script adds .is-armed; without JS everything stays visible) — */

[data-reveal].is-armed {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .7s ease, transform .7s var(--ease-out);
}

[data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* — narrow — */

@media (max-width: 820px) {
	.bio__body { font-size: 13.5px; text-align: left; }
	.hero { gap: 18px; }
	.brand { font-size: 14px; }
	.topnav { flex-wrap: nowrap; gap: 0; font-size: 13px; }
	.topnav a { padding: 6px 8px; white-space: nowrap; }
	.topnav__cta { padding: 6px 12px; }
	.hero__avatar { width: clamp(84px, 24vw, 150px); }
}

/* Below this the brand and four nav items no longer fit on one line and the
   "Get in touch" pill gets clipped; the hero states the name anyway. */
@media (max-width: 520px) {
	.brand { display: none; }
	.masthead__inner { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
