/* Christopher Alatorre: standalone site (light / dark) */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&display=swap");

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

:root {
	--font-sans: "DM Sans", system-ui, sans-serif;
	--font-display: "Fraunces", Georgia, serif;
	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--radius: 12px;
	--radius-lg: 20px;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-right: env(safe-area-inset-right, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-left: env(safe-area-inset-left, 0px);
	/* Fixed bar content height (excludes status-bar / notch inset) */
	--header-h: 4.8rem;
	/* Total fixed header height: used for main offset, nav sheet, scroll margins */
	--header-offset: calc(var(--header-h) + var(--safe-top));
	/* Golden dust / sand layer (updated from app.js when pointer moves) */
	--dust-tx: 0px;
	--dust-ty: 0px;
	--dust-glow-x: 50%;
	--dust-glow-y: 42%;
	--dust-bg-x: 50%;
	--dust-bg-y: 50%;
	/* 0 = top of page … 1 = end of scroll — global atmosphere strength */
	--atmosphere-scroll: 0;
	/* Soft warm "sun" behind section titles; app.js lerps toward pointer
	 * within a clamped narrow band near center (fine pointer only) so the
	 * glow breathes with the cursor without ever sliding near the element
	 * edges — that used to clip the ellipse and render as a hard streak. */
	--subtle-light-x: 50%;
	--subtle-light-y: 48%;
}

[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0a0a0c;
	--bg-elevated: #121215;
	--bg-muted: #18181c;
	--fg: #f4f2ed;
	--fg-muted: #9c9890;
	--border: rgba(255, 255, 255, 0.08);
	--accent: #c4a574;
	--accent-soft: rgba(196, 165, 116, 0.15);
	--glow: rgba(196, 165, 116, 0.12);
	--cursor-ring: rgba(244, 242, 237, 0.35);
	--mesh-1: #1a1510;
	--mesh-2: #0d1018;
	--mesh-3: #12100e;
}

[data-theme="light"] {
	color-scheme: light;
	--bg: #faf8f5;
	--bg-elevated: #ffffff;
	--bg-muted: #f0ebe4;
	--fg: #1a1816;
	--fg-muted: #5c5852;
	--border: rgba(26, 24, 22, 0.1);
	--accent: #8b6914;
	--accent-soft: rgba(139, 105, 20, 0.1);
	--glow: rgba(139, 105, 20, 0.08);
	--cursor-ring: rgba(26, 24, 22, 0.25);
	--mesh-1: #ebe4d8;
	--mesh-2: #e8eef5;
	--mesh-3: #f2ece4;
}

html {
	font-size: 62.5%;
	-webkit-font-smoothing: antialiased;
	/* Ensures any area rendered outside the body (edge cases at the very top
	 * of the viewport on iOS) matches the site background instead of falling
	 * back to system white/gray. */
	background: var(--bg);
}

/* Belt-and-suspenders opaque strip anchored at viewport top. Sits ABOVE all
 * page content (including hero) so the Dynamic Island / notch area never
 * shows hero titles bleeding through, regardless of whether iOS reports
 * safe-area-inset-top as 0 (Safari browser tab, non-scrolled state) or a
 * real value (PWA standalone, or Safari tab with URL bar collapsed).
 *
 * Height rule:
 *   max(env(safe-area-inset-top), 44px)
 * - On notched / Dynamic Island devices, covers the full island inset.
 * - On devices with no inset (most Androids, desktop, landscape iPhone),
 *   still paints a 44px block so the area never reveals content above the
 *   first row of the header.
 *
 * z-index 99 = one below the header (100). The header paints its own bg on
 * top of this shield for the full header height; the shield only matters in
 * the zone between y=0 and the header's own top padding. */
/*
 * Solid top bar that covers the iOS status-bar / Dynamic Island zone with
 * the page background so nothing bleeds through it. It sits at z-index
 * above the sticky header so it always paints last — this was the pattern
 * that reliably worked in testing (matching an inline `top:0;z-index:huge`
 * div), after safe-area-inset-based approaches failed: Safari (browser,
 * not PWA) returns env(safe-area-inset-top) = 0 even when the page is
 * actually drawn behind the status bar (which is the default on iOS 15+
 * when the URL bar lives at the bottom of the screen).
 *
 * Hidden on desktop / non-touch viewports — there's nothing to shield.
 */
.top-shield {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 0;
	background: var(--bg);
	z-index: 200;
	pointer-events: none;
}

@media (pointer: coarse) and (orientation: portrait) {
	.top-shield {
		display: block;
		height: max(env(safe-area-inset-top, 0px), var(--ios-status-bar-min));
	}
}

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: 1.6rem;
	font-weight: 400;
	line-height: 1.65;
	color: var(--fg-muted);
	background: var(--bg);
	transition:
		background-color 0.55s var(--ease-out),
		color 0.45s ease;
}

/* Site-wide whisper (hero + rest); kept gentle so the shared lower layer reads primary */
/*
 * Site-wide warm whisper: decorative radial glow + fine grain.
 *
 * IMPORTANT: this pseudo-element used to have `transform: translate3d(...)`
 * and `will-change: transform` for a subtle pointer-following parallax.
 * On iOS Safari, any transform/will-change on body::before (even as a
 * pseudo-element) causes a known WebKit bug where position:fixed siblings
 * (our header, shield, etc.) become positioned relative to the transformed
 * box instead of the viewport — the symptom was the header rendering in
 * the middle of the page instead of pinned at top. We now drive the same
 * drift through background-position only; no transform, no will-change,
 * no broken containing block.
 */
body::before {
	content: "";
	position: fixed;
	inset: -8%;
	pointer-events: none;
	z-index: 0;
	opacity: 0.68;
	background:
		radial-gradient(
			ellipse 95% 72% at var(--dust-glow-x) var(--dust-glow-y),
			color-mix(in srgb, var(--accent) 20%, transparent) 0%,
			transparent 58%
		),
		url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)' opacity='0.5'/%3E%3C/svg%3E");
	background-size:
		100% 100%,
		220px 220px;
	background-position:
		var(--dust-tx, 0px) var(--dust-ty, 0px),
		calc(var(--dust-bg-x) + var(--dust-tx, 0px)) calc(var(--dust-bg-y) + var(--dust-ty, 0px));
	background-repeat: no-repeat, repeat;
	mix-blend-mode: soft-light;
	transition:
		background-position 0.65s var(--ease-out),
		opacity 0.5s ease;
}

[data-theme="light"] body::before {
	opacity: 0.4;
	mix-blend-mode: multiply;
}

body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 9997;
	opacity: 0.035;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	mix-blend-mode: overlay;
}

[data-theme="light"] body::after {
	opacity: 0.04;
}

.text-strong {
	color: var(--fg);
	font-weight: 600;
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 500;
	color: var(--fg);
	letter-spacing: -0.02em;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

a:hover {
	opacity: 0.85;
}

a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 1rem;
	z-index: 10000;
	padding: 0.8rem 1.2rem;
	background: var(--accent);
	color: var(--bg);
	font-weight: 600;
	border-radius: 4px;
}

.skip-link:focus {
	left: max(1rem, var(--safe-left));
	top: max(1rem, var(--safe-top));
}

/* --- Scroll progress ---
 * Lives at the bottom edge of the fixed header so it rides with the
 * header when it hides/reveals. No transition: the bar tracks scroll 1:1
 * so it never appears to drift or tilt on its own. */
.scroll-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	z-index: 1;
	transform: scaleX(0);
	transform-origin: left center;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--accent) 70%, transparent),
		var(--accent)
	);
	pointer-events: none;
}

/* --- Layout shell --- */
.shell {
	position: relative;
	z-index: 1;
	max-width: 112rem;
	margin: 0 auto;
	padding: 0 2.4rem;
}

.shell.shell--mascot-accent {
	overflow: visible;
}

@media (min-width: 768px) {
	.shell {
		padding: 0 4rem;
	}
}

/* --- Header --- */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	height: var(--header-offset);
	box-sizing: border-box;
	padding: var(--safe-top) max(2.4rem, var(--safe-right)) 0
		max(2.4rem, var(--safe-left));
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.6rem;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition:
		background-color 0.5s var(--ease-out),
		border-color 0.45s ease,
		transform 0.45s var(--ease-out);
}

/*
 * Opaque strip for the status-bar / Dynamic Island inset. Without this, the
 * frosted header lets hero/mascot show through that band and reads as a “gap”
 * above the logo row on iPhone.
 */
.site-header::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: env(safe-area-inset-top, 0px);
	background: var(--bg);
	pointer-events: none;
	transition: background-color 0.5s var(--ease-out);
}

.site-header.is-scrolled {
	border-bottom-color: var(--border);
}

.site-header.is-hidden {
	transform: translateY(-100%);
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-shrink: 0;
}

@media (max-width: 960px) {
	.nav a {
		font-size: 1.15rem;
		padding: 0.55rem 0.75rem;
	}
}

@media (min-width: 721px) {
	.nav {
		margin-left: auto;
		flex-wrap: nowrap;
	}

	.site-header__actions {
		margin-left: 0.8rem;
	}
}

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	flex-shrink: 0;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-elevated);
	color: var(--fg);
	cursor: pointer;
	transition:
		background 0.35s ease,
		border-color 0.35s ease,
		transform 0.2s ease;
}

.nav-toggle:hover {
	background: var(--bg-muted);
}

.nav-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.nav-toggle__bars {
	position: relative;
	display: block;
	width: 2.2rem;
	height: 1.4rem;
}

.nav-toggle__bar {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transition:
		transform 0.35s var(--ease-out),
		opacity 0.2s ease,
		top 0.35s var(--ease-out);
}

.nav-toggle__bar:nth-child(1) {
	top: 0;
}

.nav-toggle__bar:nth-child(2) {
	top: 7px;
}

.nav-toggle__bar:nth-child(3) {
	top: 14px;
}

.site-header.nav-is-open .nav-toggle__bar:nth-child(1) {
	top: 7px;
	transform: rotate(45deg);
}

.site-header.nav-is-open .nav-toggle__bar:nth-child(2) {
	opacity: 0;
}

.site-header.nav-is-open .nav-toggle__bar:nth-child(3) {
	top: 7px;
	transform: rotate(-45deg);
}

.site-nav-backdrop {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	top: var(--header-offset);
	bottom: 0;
	z-index: 98;
	margin: 0;
	padding: 0;
	border: none;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.42);
	-webkit-tap-highlight-color: transparent;
}

[data-theme="light"] .site-nav-backdrop {
	background: rgba(26, 24, 22, 0.18);
}

.site-nav-backdrop:not([hidden]) {
	display: block;
}

@media (max-width: 720px) {
	.site-header {
		padding: var(--safe-top) max(1.6rem, var(--safe-right)) 0
			max(1.6rem, var(--safe-left));
		gap: 0.5rem;
		justify-content: flex-start;
		/* Slightly more opaque bar so content behind reads less through blur */
		background: color-mix(in srgb, var(--bg) 91%, transparent);
	}

	.site-header__actions {
		margin-left: auto;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.nav {
		position: fixed;
		left: 0;
		right: 0;
		top: var(--header-offset);
		z-index: 99;
		flex-direction: column;
		align-items: stretch;
		flex-wrap: nowrap;
		margin-left: 0;
		max-height: min(72vh, calc(100dvh - var(--header-offset)));
		overflow-x: hidden;
		overflow-y: auto;
		padding: 0.8rem 1.6rem 1.6rem;
		gap: 0.1rem;
		background: color-mix(in srgb, var(--bg) 94%, transparent);
		backdrop-filter: blur(18px);
		-webkit-backdrop-filter: blur(18px);
		border-bottom: 1px solid var(--border);
		box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
		transform: translateY(-120%);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition:
			transform 0.4s var(--ease-out),
			opacity 0.3s ease,
			visibility 0.3s;
	}

	.site-header.nav-is-open .nav {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.nav a {
		padding: 1.05rem 1rem;
		border-radius: 10px;
		font-size: 1.4rem;
	}

	.nav a::after {
		bottom: 10px;
	}
}

.logo {
	font-family: var(--font-display);
	font-size: 1.8rem;
	font-weight: 600;
	color: var(--fg);
	letter-spacing: -0.03em;
	transition: letter-spacing 0.45s var(--ease-out), color 0.3s ease;
}

.logo:hover {
	opacity: 1;
	letter-spacing: 0.02em;
	color: var(--accent);
}

.nav {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.nav a {
	position: relative;
	color: var(--fg-muted);
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	padding: 0.6rem 1rem;
	border-radius: 8px;
	transition:
		color 0.25s ease,
		background 0.25s ease;
}

.nav a:hover {
	color: var(--fg);
	background: var(--accent-soft);
	opacity: 1;
}

.nav a::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 6px;
	width: 0;
	height: 1px;
	background: var(--accent);
	transform: translateX(-50%);
	transition: width 0.35s var(--ease-out);
	opacity: 0.9;
}

.nav a:hover::after {
	width: calc(100% - 2rem);
}

.nav a.is-active {
	color: var(--fg);
	background: var(--accent-soft);
	opacity: 1;
}

.nav a.is-active::after {
	width: calc(100% - 2rem);
}

.theme-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	flex-shrink: 0;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--bg-elevated);
	color: var(--fg);
	cursor: pointer;
	transition:
		background 0.35s ease,
		border-color 0.35s ease,
		transform 0.25s ease;
}

.theme-toggle:hover {
	transform: scale(1.04) rotate(-8deg);
}

.theme-toggle:active {
	transform: scale(0.96) rotate(0deg);
}

.theme-toggle svg {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 1.8rem;
	height: 1.8rem;
	margin: 0;
	transform: translate(-50%, -50%);
	transition: opacity 0.35s ease;
}

[data-theme="dark"] .theme-toggle .icon-sun {
	opacity: 0;
	pointer-events: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
	opacity: 1;
}

[data-theme="light"] .theme-toggle .icon-moon {
	opacity: 0;
	pointer-events: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
	opacity: 1;
}

/* --- Main --- */
main {
	position: relative;
	z-index: 1;
	padding-top: calc(var(--header-offset) + 2rem);
	/* Decorative section astronauts wrap by translating outside their section
	 * bounds; clip the horizontal axis so they never contribute to document
	 * scroll width. `clip` (vs. `hidden`) does NOT create a scroll container,
	 * so position: fixed / sticky descendants keep working. */
	overflow-x: clip;
}

/* Shared fixed canvas: one atmosphere behind all sections (hero stacks above it) */
main > .main-atmosphere {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	background: var(--bg);
}

main > section {
	position: relative;
	z-index: 1;
}

.main-atmosphere::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: calc(0.22 + var(--atmosphere-scroll, 0) * 0.2);
	background:
		radial-gradient(
			ellipse 120% 70% at 50% 0%,
			color-mix(in srgb, var(--accent) 8%, transparent),
			transparent 55%
		),
		linear-gradient(
			to bottom,
			color-mix(in srgb, var(--accent) 4%, transparent) 0%,
			transparent 38%,
			color-mix(in srgb, var(--accent) 5%, transparent) 100%
		);
	transition: opacity 0.55s ease;
}

[data-theme="light"] .main-atmosphere::before {
	opacity: calc(0.1 + var(--atmosphere-scroll, 0) * 0.12);
}

.main-atmosphere__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1;
	opacity: calc(0.08 + var(--atmosphere-scroll, 0) * 0.36);
	mask-image: linear-gradient(
		to bottom,
		transparent 0%,
		rgba(0, 0, 0, 0.2) min(18vh, 12rem),
		black min(38vh, 28rem),
		black 100%
	);
	transition: opacity 0.55s ease;
}

[data-theme="light"] .main-atmosphere__canvas {
	/* Light mode needs much higher canvas opacity than the previous 0.05–0.25:
	 * black grains on cream only read at adequate contrast when the canvas
	 * itself isn't being crushed by CSS opacity on top of the per-grain alpha. */
	opacity: calc(0.55 + var(--atmosphere-scroll, 0) * 0.25);
}

section {
	padding: 7rem 0;
	scroll-margin-top: calc(var(--header-offset) + 1.6rem);
	background: transparent;
}

/* Symmetric vertical rhythm; mascot is absolutely positioned (no longer in-flow) */
#about.section--ambient {
	padding: 6rem 0;
}

.section-label {
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 1.2rem;
}

.section-intro {
	text-align: center;
	max-width: 72rem;
	margin: 0 auto 4.8rem;
	padding: 0 1rem;
}

.section-intro .section-label {
	margin-bottom: 1.4rem;
}

.section-title {
	font-size: clamp(2.8rem, 4.5vw, 3.8rem);
	line-height: 1.18;
	margin: 0 0 1.6rem;
	font-family: var(--font-display);
	font-weight: 500;
	color: var(--fg);
}

/*
 * Warm pointer-tracked "sun" behind each section title. Kept very soft so
 * it reads as atmosphere, not as a light source.
 *
 * Important constraints, earned the hard way:
 *   - NO `filter: blur()`: Safari rasterizes filter primitives to the
 *     element bounding box, and any near-transparent pixels at the box
 *     edges become a faint rectangle visible against the dark backdrop.
 *     Instead, softness comes from the gradient's own color stops fading
 *     gracefully well inside the element's box.
 *   - The JS in app.js clamps the pointer parallax to a narrow band
 *     around center (~45–55% / ~45–52%). Prior versions mapped the whole
 *     viewport to 0–100%: when the cursor approached the right edge, the
 *     ellipse center slid to ~90% of the box and its bright half was
 *     clipped against the element edge, rendering as a hard horizontal
 *     gold streak. Clamping means the glow breathes gently without ever
 *     reaching an edge.
 */
.section-intro .section-title {
	position: relative;
	z-index: 0;
	isolation: isolate;
}

.section-intro .section-title::before {
	content: "";
	position: absolute;
	/* Insets in ABSOLUTE px so the container has guaranteed clearance
	 * around the starlight regardless of the title's own size. With %
	 * insets the container shrinks for short titles and the ellipse's
	 * 100px vertical radius ends up clipped against the top/bottom
	 * edges — that was the "light reaching the border" symptom. */
	left: -500px;
	right: -500px;
	top: -220px;
	bottom: -220px;
	/* Small focused starlight: fixed px size so the ellipse shape stays
	 * constant while its center tracks the cursor via CSS vars. Parallax
	 * range in app.js is narrow (~38–62% x, 40–56% y) so the gradient is
	 * always well inside the container and its soft falloff completes
	 * long before the box edge — nothing to rasterize at the boundary. */
	background: radial-gradient(
		ellipse 200px 100px at var(--subtle-light-x) var(--subtle-light-y),
		color-mix(in srgb, var(--accent) 16%, transparent) 0%,
		color-mix(in srgb, var(--accent) 8%, transparent) 35%,
		color-mix(in srgb, var(--accent) 2%, transparent) 65%,
		transparent 92%
	);
	opacity: 0.65;
	pointer-events: none;
	z-index: -1;
}

[data-theme="light"] .section-intro .section-title::before {
	opacity: 0.45;
	background: radial-gradient(
		ellipse 200px 100px at var(--subtle-light-x) var(--subtle-light-y),
		color-mix(in srgb, var(--accent) 10%, transparent) 0%,
		color-mix(in srgb, var(--accent) 5%, transparent) 38%,
		color-mix(in srgb, var(--accent) 1%, transparent) 68%,
		transparent 92%
	);
}

.section-lead {
	margin: 0 auto;
	max-width: 52rem;
	font-size: 1.75rem;
	line-height: 1.6;
	color: var(--fg-muted);
	font-weight: 400;
}

.section-intro .section-lead {
	text-align: center;
	hyphens: none;
	-webkit-hyphens: none;
	text-wrap: pretty;
}

.section-intro .section-label {
	display: inline-block;
	position: relative;
}

.section-label::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -1rem;
	width: min(10rem, 50vw);
	height: 2px;
	margin-left: calc(min(10rem, 50vw) / -2);
	background: linear-gradient(
		90deg,
		transparent,
		var(--accent),
		transparent
	);
	transform: scaleX(0);
	opacity: 0;
	transition:
		transform 0.85s var(--ease-out),
		opacity 0.5s ease;
}

.section-intro.reveal.is-visible .section-label::after {
	transform: scaleX(1);
	opacity: 1;
}

/* --- Hero --- */
.hero {
	min-height: calc(100vh - var(--header-offset));
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 4rem 0 8rem;
	position: relative;
	overflow: hidden;
}

/* Soft handoff into the rest of the page (does not replace hero grid / stars / mesh) */
.hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: clamp(9rem, 26vh, 20rem);
	pointer-events: none;
	z-index: 2;
	background: linear-gradient(
		to bottom,
		transparent 0%,
		color-mix(in srgb, var(--bg) 12%, transparent) 35%,
		color-mix(in srgb, var(--bg) 55%, transparent) 72%,
		var(--bg) 100%
	);
}

.hero__mesh {
	position: absolute;
	inset: -20%;
	z-index: 0;
	background:
		radial-gradient(ellipse 80% 50% at 20% 40%, var(--mesh-1), transparent 55%),
		radial-gradient(ellipse 60% 45% at 80% 60%, var(--mesh-2), transparent 50%),
		radial-gradient(ellipse 50% 40% at 50% 100%, var(--mesh-3), transparent 45%);
	opacity: 0.9;
	transition:
		opacity 0.6s ease,
		transform 0.45s ease-out;
	pointer-events: none;
	will-change: transform;
}

.hero__grid {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image:
		linear-gradient(var(--border) 1px, transparent 1px),
		linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 64px 64px;
	opacity: 0.35;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
	pointer-events: none;
	transition: transform 0.45s ease-out;
	will-change: transform;
}

.hero__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(60px);
	pointer-events: none;
	z-index: 0;
	opacity: 0.45;
	will-change: transform;
}

.hero__orb--a {
	width: min(45vw, 420px);
	height: min(45vw, 420px);
	left: -8%;
	top: 15%;
	background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
	animation: orb-float 22s ease-in-out infinite;
}

.hero__orb--b {
	width: min(38vw, 340px);
	height: min(38vw, 340px);
	right: -5%;
	bottom: 20%;
	background: radial-gradient(circle, rgba(100, 130, 180, 0.12) 0%, transparent 65%);
	animation: orb-float 18s ease-in-out infinite reverse;
	animation-delay: -4s;
}

.hero__orb--c {
	width: min(28vw, 240px);
	height: min(28vw, 240px);
	left: 40%;
	top: 55%;
	background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
	animation: orb-float 26s ease-in-out infinite;
	animation-delay: -9s;
	opacity: 0.35;
}

.hero__shine {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.03) 45%,
		transparent 55%
	);
	background-size: 200% 100%;
	animation: shine-sweep 14s ease-in-out infinite;
	pointer-events: none;
	mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 0%, transparent 75%);
}

@keyframes orb-float {
	0%,
	100% {
		transform: translate(0, 0) scale(1);
	}
	33% {
		transform: translate(3%, -4%) scale(1.05);
	}
	66% {
		transform: translate(-2%, 3%) scale(0.96);
	}
}

@keyframes shine-sweep {
	0%,
	100% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
}

.hero__shooting-stars {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.hero__shooting-star {
	position: absolute;
	left: 0;
	width: min(42vw, 220px);
	height: 2px;
	border-radius: 2px;
	transform-origin: left center;
	pointer-events: none;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 230, 200, 0.2) 32%,
		rgba(255, 252, 245, 0.92) 88%,
		transparent 100%
	);
	box-shadow:
		0 0 10px 2px rgba(255, 220, 180, 0.22),
		0 0 22px 5px rgba(180, 150, 100, 0.06);
	animation-name: hero-star-shoot;
	animation-timing-function: cubic-bezier(0.2, 0.75, 0.28, 1);
	animation-fill-mode: forwards;
	will-change: transform, opacity;
}

[data-theme="light"] .hero__shooting-star {
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(70, 58, 44, 0.18) 38%,
		rgba(35, 30, 24, 0.5) 90%,
		transparent 100%
	);
	box-shadow: 0 0 8px 1px rgba(40, 34, 28, 0.12);
}

/*
 * Trail matches trajectory: gradient is along local +X; translate runs along local +X first,
 * then rotate (see transform order). Do not use translate(screen) + rotate or the streak reads diagonal.
 */
@keyframes hero-star-shoot {
	0% {
		transform: rotate(var(--hero-star-tilt, -12deg)) translate3d(-28vw, 0, 0);
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	78% {
		opacity: 0.9;
	}
	100% {
		transform: rotate(var(--hero-star-tilt, -12deg)) translate3d(132vw, 0, 0);
		opacity: 0;
	}
}

@media (max-width: 768px) {
	.hero__orb {
		opacity: 0.28;
		filter: blur(48px);
	}
}

.hero .shell--hero {
	position: relative;
	z-index: 3;
	text-align: center;
	max-width: 72rem;
	margin-left: auto;
	margin-right: auto;
}

/* --- Pixi pixel mascots (see assets/pixel-mascot.js) --- */
.pixel-mascot-host {
	--mascot-y: 0;
	position: absolute;
	z-index: 2;
	pointer-events: none;
	transform: translateY(calc(var(--mascot-y) * 1px));
	transition: opacity 0.45s ease;
}

.pixel-mascot-host canvas {
	filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

[data-theme="light"] .pixel-mascot-host canvas {
	filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.12));
}

/*
 * Hero oxygen hose: hero-local (not viewport). Visible socket (wall) + plug (hose cap).
 * Layered SVG paths render a thick white hose with subtle corrugation.
 */
.hero__hose-svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 2;
	overflow: visible;
}

/* Wall-mounted pipe receptacle on the hero right edge, vertically centered */
.hero__hose-socket {
	position: absolute;
	top: 50%;
	right: 0;
	width: 4.4rem;
	height: 7.2rem;
	transform: translateY(-50%);
	border-radius: 0.9rem 0 0 0.9rem;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02) 45%, rgba(0, 0, 0, 0.35)),
		linear-gradient(90deg, color-mix(in srgb, var(--card) 55%, rgba(18, 22, 32, 0.95)),
		color-mix(in srgb, var(--card) 75%, rgba(30, 34, 46, 0.95)));
	border: 1px solid color-mix(in srgb, var(--border) 55%, rgba(255, 255, 255, 0.14));
	border-right: none;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.2),
		inset -10px 0 18px rgba(0, 0, 0, 0.3),
		0 8px 22px rgba(0, 0, 0, 0.32);
	pointer-events: none;
	z-index: 2;
}

/* Bolts on the socket face */
.hero__hose-socket::before,
.hero__hose-socket::after {
	content: "";
	position: absolute;
	left: 0.62rem;
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 50%;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), rgba(0, 0, 0, 0.45) 70%);
	box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.55);
}

.hero__hose-socket::before {
	top: 0.65rem;
}

.hero__hose-socket::after {
	bottom: 0.65rem;
}

/* Dark inner bore; this is the opening the plug inserts into */
.hero__hose-socket__bore {
	position: absolute;
	top: 50%;
	left: 1.1rem;
	width: 2.9rem;
	height: 2.9rem;
	transform: translateY(-50%);
	border-radius: 50%;
	background:
		radial-gradient(circle at 55% 50%, rgba(0, 0, 0, 0.92) 10%, rgba(0, 0, 0, 0.7) 55%, rgba(18, 22, 32, 0.95) 100%);
	border: 1px solid color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.08));
	box-shadow:
		inset 0 1px 3px rgba(0, 0, 0, 0.7),
		inset 3px 0 6px rgba(0, 0, 0, 0.55),
		inset 0 0 0 2px rgba(0, 0, 0, 0.55);
	pointer-events: none;
}

/*
 * Plug: rendered on top of the bore. JS sets left/top to the bore center (hero-local px),
 * plus a rotation so its "outward" end (left) follows the hose toward the astronaut.
 * transform-origin anchors the plug's right edge at (left,top).
 */
.hero__hose-plug {
	position: absolute;
	top: 0;
	left: 0;
	width: 2.2rem;
	height: 1.6rem;
	transform: translate(-100%, -50%) rotate(0rad);
	transform-origin: 100% 50%;
	border-radius: 0.4rem 0.9rem 0.9rem 0.4rem;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.25)),
		linear-gradient(90deg, #e5e8ef, #c7ccd6 70%, #a9afbc);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.6),
		inset 0 -1px 0 rgba(0, 0, 0, 0.25),
		0 2px 5px rgba(0, 0, 0, 0.4);
	pointer-events: none;
	z-index: 3;
}

/* Collar ring between plug and hose */
.hero__hose-plug__collar {
	position: absolute;
	top: 50%;
	left: -0.35rem;
	width: 0.55rem;
	height: 115%;
	transform: translateY(-50%);
	border-radius: 0.12rem;
	background: linear-gradient(90deg, #d8dbe3, #b2b7c2 60%, #9aa0ad);
	border: 1px solid rgba(255, 255, 255, 0.3);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.45),
		0 1px 2px rgba(0, 0, 0, 0.35);
}

/*
 * Invisible geometric anchor point for the hose endpoint. The hose SVG sits below
 * the astronaut sprite (.hero__hose-svg z-index 2 < .hero-mascot-rig z-index 4),
 * so the stroke terminates behind the tank pixels — no visible dot/port is drawn.
 */
.hero-mascot-rig .pixel-mascot-host--hero .hero-mascot-tether-attach {
	position: absolute;
	left: 60%;
	top: 68%;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

/* Hose stroke layers: off-white body with subtle corrugation + soft shadow + spec */
.hero__hose-path {
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Cast shadow behind the hose; not part of the hose body itself. */
.hero__hose-path--shadow {
	stroke: rgba(0, 0, 0, 0.45);
	stroke-width: 18;
	opacity: 0.45;
	filter: blur(5px);
}

/* Fully opaque white/gray hose body. */
.hero__hose-path--body {
	stroke: #e9edf3;
	stroke-width: 13;
	opacity: 1;
}

/* Solid ribs for corrugated read. */
.hero__hose-path--ribs {
	stroke: #a8afbc;
	stroke-width: 12;
	stroke-linecap: butt;
	stroke-dasharray: 2.4 5.4;
	opacity: 1;
}

/* Solid specular line along the top. */
.hero__hose-path--highlight {
	stroke: #ffffff;
	stroke-width: 1.6;
	opacity: 1;
}

[data-theme="light"] .hero__hose-socket {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.04) 45%, rgba(0, 0, 0, 0.12)),
		linear-gradient(90deg, #d9d4cb, #ebe6dc 70%);
	border-color: color-mix(in srgb, var(--border) 55%, rgba(0, 0, 0, 0.15));
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		inset -10px 0 18px rgba(0, 0, 0, 0.16),
		0 5px 14px rgba(40, 32, 24, 0.14);
}

[data-theme="light"] .hero__hose-socket__bore {
	background:
		radial-gradient(circle at 55% 50%, rgba(20, 20, 24, 0.9) 10%, rgba(44, 40, 34, 0.85) 55%, rgba(60, 52, 42, 0.9) 100%);
	border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .hero__hose-plug {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.12)),
		linear-gradient(90deg, #f4f1ea, #d7d2c8 70%, #b7b1a6);
	border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .hero__hose-plug__collar {
	background: linear-gradient(90deg, #ece7de, #c9c3b7 60%, #a8a294);
	border-color: rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .hero__hose-path--shadow {
	stroke: rgba(40, 32, 24, 0.32);
	opacity: 0.4;
}

[data-theme="light"] .hero__hose-path--body {
	stroke: #e4dfd4;
}

[data-theme="light"] .hero__hose-path--ribs {
	stroke: #8f8878;
}

[data-theme="light"] .hero__hose-path--highlight {
	stroke: #ffffff;
}

.hero-mascot-rig {
	position: absolute;
	left: auto;
	z-index: 4;
	right: calc(env(safe-area-inset-right) - 0.35rem);
	bottom: 3.2rem;
	width: 72rem;
	height: 72rem;
	pointer-events: none;
	opacity: 0.98;
}

.hero-mascot-rig__float {
	width: 100%;
	height: 100%;
	transform-origin: bottom right;
	will-change: transform;
}

.hero-mascot-rig .pixel-mascot-host--hero {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	top: auto;
	z-index: 1;
	width: 100%;
	height: 100%;
	opacity: 1;
}

/*
 * Pixi sets canvas width/height inline from data-mascot-display (720px). Without this,
 * mobile constrains the host (~20rem) but the canvas stays 720px, overflows, and
 * .hero { overflow: hidden } clips the astronaut entirely.
 */
.hero-mascot-rig .pixel-mascot-host--hero canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
}

@media (max-width: 720px) {
	/*
	 * Mobile: start the astronaut on the LEFT so the hose spans across the viewport
	 * from the fixed right-edge socket. Safe-area inset + small outward bleed.
	 */
	.hero-mascot-rig {
		width: min(28rem, 70vw);
		height: min(28rem, 70vw);
		bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
		right: auto;
		left: calc(env(safe-area-inset-left, 0px) - 0.55rem);
		opacity: 0.92;
	}

	.hero-mascot-rig__float {
		transform-origin: bottom left;
	}

	.hero-mascot-rig .pixel-mascot-host--hero {
		transform: translateY(calc(var(--mascot-y) * 1px)) scale(0.96);
		transform-origin: bottom left;
	}

	/*
	 * Mobile: align the wall socket vertically with the astronaut's tank attach point.
	 * The astronaut's attach marker sits at ~68% down inside .hero-mascot-rig (32% from its
	 * bottom), so the socket center is placed rig_bottom + rig_height * 0.32 from the hero
	 * bottom — matching the same custom properties that position the rig itself.
	 */
	.hero__hose-socket {
		top: auto;
		bottom: calc(max(0.75rem, env(safe-area-inset-bottom, 0px)) + min(28rem, 70vw) * 0.32);
		transform: translateY(50%);
	}
}

.shell--mascot-accent > .section-intro,
.shell--mascot-accent > .about-split,
.shell--mascot-accent > .timeline-rail,
.shell--mascot-accent > .pill-grid,
.shell--mascot-accent > .contact-grid,
.shell--mascot-accent > .ai-card {
	position: relative;
	z-index: 1;
	overflow: visible;
}

.hero__kicker {
	font-size: 1.3rem;
	font-weight: 500;
	color: var(--fg-muted);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: 1.6rem;
	opacity: 0;
	animation: fadeUp 0.9s var(--ease-out) 0.15s forwards;
}

.hero h1 {
	font-size: clamp(4rem, 8vw, 7.2rem);
	line-height: 1.05;
	margin: 0 auto 1.6rem;
	max-width: 16ch;
	opacity: 0;
	animation: fadeUp 0.95s var(--ease-out) 0.35s forwards;
}

.hero__tagline {
	font-family: var(--font-display);
	font-size: clamp(1.85rem, 2.8vw, 2.4rem);
	font-weight: 400;
	font-style: italic;
	color: var(--accent);
	margin: 0 auto 2rem;
	max-width: 28ch;
	line-height: 1.35;
	opacity: 0;
	animation: fadeUp 0.95s var(--ease-out) 0.45s forwards;
}

.hero__lead {
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1.65;
	color: var(--fg-muted);
	max-width: 48rem;
	margin: 0 auto 3.2rem;
	opacity: 0;
	animation: fadeUp 0.95s var(--ease-out) 0.58s forwards;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem;
	align-items: center;
	justify-content: center;
	opacity: 0;
	animation: fadeUp 0.95s var(--ease-out) 0.75s forwards;
}

@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 1.25rem 2.4rem;
	font-family: var(--font-sans);
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--bg-elevated);
	color: var(--fg);
	cursor: pointer;
	overflow: hidden;
	transition:
		background 0.35s ease,
		border-color 0.35s ease,
		transform 0.35s var(--ease-out),
		box-shadow 0.35s ease;
}

.btn:not(.btn--magnetic):hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.btn--magnetic:hover {
	box-shadow: 0 14px 44px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .btn:hover {
	box-shadow: 0 14px 52px rgba(0, 0, 0, 0.48);
}

.btn--primary {
	position: relative;
	background: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
	overflow: hidden;
}

.btn--primary::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		110deg,
		transparent 0%,
		rgba(255, 255, 255, 0.18) 45%,
		transparent 60%
	);
	background-size: 220% 100%;
	transform: translateX(-40%);
	transition: transform 0.65s var(--ease-out);
	pointer-events: none;
}

body.motion-ok .btn--primary:hover::before {
	transform: translateX(40%);
}

.btn--primary:hover {
	opacity: 0.98;
}

.btn--magnetic {
	transition:
		transform 0.18s ease-out,
		box-shadow 0.35s ease,
		background 0.35s ease,
		border-color 0.35s ease,
		opacity 0.25s ease;
}

.btn--ghost {
	background: transparent;
}

.hero__social {
	display: flex;
	flex-wrap: wrap;
	gap: 1.6rem 2.4rem;
	margin-top: 4rem;
	padding-top: 2.4rem;
	border-top: 1px solid var(--border);
	justify-content: center;
}

.hero__social a {
	position: relative;
	color: var(--fg-muted);
	font-size: 1.35rem;
	font-weight: 500;
	padding-bottom: 2px;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition:
		color 0.3s ease,
		background-size 0.4s var(--ease-out);
}

.hero__social a:hover {
	color: var(--fg);
	opacity: 1;
	background-size: 100% 1px;
}

.hero__scroll-hint {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	margin-top: 3.6rem;
	padding-top: 2rem;
	color: var(--fg-muted);
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	pointer-events: none;
	user-select: none;
}

body.motion-ok .hero__scroll-hint {
	display: flex;
}

.hero__scroll-hint__icon {
	width: 2.2rem;
	height: 2.2rem;
	opacity: 0.65;
	animation: scroll-hint-nudge 2.4s ease-in-out infinite;
}

@keyframes scroll-hint-nudge {
	0%,
	100% {
		transform: translateY(0);
		opacity: 0.55;
	}
	50% {
		transform: translateY(8px);
		opacity: 0.95;
	}
}

/* --- About --- */
.about-split {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4rem;
	/* Single column: stretch full width; center was shrinking/narrowing columns on some viewports */
	align-items: stretch;
	max-width: 96rem;
	margin: 0 auto;
	perspective: 1400px;
}

@media (min-width: 900px) {
	#about .section-intro {
		margin-bottom: 2.75rem;
	}

	.about-split {
		grid-template-columns: minmax(18rem, min(32rem, 40vw)) minmax(0, 1.2fr);
		gap: 2.75rem 3rem;
		/* Vertically center copy with the portrait when the image column is taller */
		align-items: center;
	}

	.about-split__visual {
		width: 100%;
		max-width: min(32rem, 100%);
		justify-self: start;
	}
}

.about-split__visual {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 1rem;
	overflow: visible;
}

.about-split__visual .portrait {
	width: 100%;
}

/* Single-column About: match min-width breakpoint so iPad / 768px get the same layout as phones */
@media (max-width: 899px) {
	#about .section-intro {
		margin-bottom: 2.25rem;
	}

	.about-split {
		/* Space between portrait column and body copy */
		gap: 2.25rem;
	}

	.about-split .prose {
		text-align: justify;
		hyphens: auto;
		-webkit-hyphens: auto;
		text-wrap: pretty;
	}

	.about-split__visual {
		align-items: center;
		gap: 0.35rem;
	}

	/* Narrower than full-bleed shell for balance on small screens */
	.about-split__visual .portrait {
		width: min(78%, 30rem);
		max-width: 30rem;
	}
}

.portrait {
	position: relative;
	border-radius: var(--radius-lg);
	overflow: hidden;
	aspect-ratio: 1;
	background: var(--bg-muted);
	border: 1px solid var(--border);
	transition:
		border-color 0.45s ease,
		box-shadow 0.45s ease,
		transform 0.12s ease-out;
	transform-style: preserve-3d;
}

.portrait.tilt-hover:hover {
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.15),
		0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

[data-theme="dark"] .portrait.tilt-hover:hover {
	box-shadow:
		0 28px 70px rgba(0, 0, 0, 0.55),
		0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.portrait img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s var(--ease-out);
}

.portrait:hover img {
	transform: scale(1.03);
}

.portrait__fallback {
	display: none;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	font-family: var(--font-display);
	font-size: 4rem;
	font-weight: 500;
	color: var(--accent);
	background: linear-gradient(145deg, var(--bg-muted), var(--bg-elevated));
}

.portrait.is-fallback .portrait__fallback {
	display: flex;
}

.portrait.is-fallback img {
	display: none;
}

.prose h2 {
	font-size: clamp(2.6rem, 4vw, 3.6rem);
	margin: 0 0 2rem;
	line-height: 1.15;
}

.prose p {
	margin: 0 0 1.6rem;
	font-size: 1.75rem;
	line-height: 1.7;
}

.prose p:last-child {
	margin-bottom: 0;
}

/* Justified multi-line copy (headings, labels, pills, and meta lines stay flush-start) */
.prose p,
#ai .ai-card p,
#ai .ai-card li,
.timeline li > p:not(.timeline__meta),
#contact .contact-card p {
	text-align: justify;
	hyphens: auto;
	-webkit-hyphens: auto;
	text-wrap: pretty;
}

/* Intro blurbs stay centered; wins over any broad `p` rules in #contact */
#contact .section-intro .section-lead {
	text-align: center;
	hyphens: none;
	-webkit-hyphens: none;
	text-wrap: pretty;
}

.timeline__meta {
	text-align: left;
}

/* --- AI section --- */
.section-ai {
	background: transparent;
	border: none;
	transition: background-color 0.5s ease;
}

.ai-card {
	max-width: 68rem;
	margin: 0 auto;
	padding: 3.2rem 3.6rem;
	border-radius: var(--radius-lg);
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	box-shadow: 0 4px 48px rgba(0, 0, 0, 0.04);
	transition:
		box-shadow 0.45s ease,
		border-color 0.45s ease,
		transform 0.12s ease-out;
	transform-style: preserve-3d;
}

.ai-card.tilt-hover:hover {
	box-shadow:
		0 20px 56px rgba(0, 0, 0, 0.1),
		0 0 0 1px color-mix(in srgb, var(--accent) 18%, var(--border));
}

[data-theme="dark"] .ai-card.tilt-hover:hover {
	box-shadow:
		0 24px 64px rgba(0, 0, 0, 0.45),
		0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.ai-card p {
	font-size: 1.7rem;
	line-height: 1.75;
}

[data-theme="dark"] .ai-card {
	box-shadow: 0 8px 64px rgba(0, 0, 0, 0.35);
}

#ai .ai-card p:first-of-type {
	margin-top: 0;
}

.ai-card ul {
	margin: 2rem 0 0;
	padding: 0;
	list-style: none;
}

.ai-card li {
	position: relative;
	padding-left: 1.8rem;
	margin-bottom: 1.2rem;
	font-size: 1.65rem;
}

.ai-card li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.85em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
}

body.motion-ok .ai-card.reveal:not(.is-visible) li {
	opacity: 0;
	transform: translateX(-12px);
}

body.motion-ok .ai-card.reveal.is-visible li {
	opacity: 1;
	transform: translateX(0);
	transition:
		opacity 0.5s var(--ease-out),
		transform 0.55s var(--ease-out);
}

body.motion-ok .ai-card.reveal.is-visible li:nth-child(1) {
	transition-delay: 0.18s;
}

body.motion-ok .ai-card.reveal.is-visible li:nth-child(2) {
	transition-delay: 0.3s;
}

body.motion-ok .ai-card.reveal.is-visible li:nth-child(3) {
	transition-delay: 0.42s;
}

/* --- Education card (compact list) --- */
.edu-card .edu-rows,
.edu-card .edu-rows li,
.edu-card .edu-rows p,
.edu-card .edu-title,
.edu-card .timeline__org {
	text-align: left;
	hyphens: none;
	-webkit-hyphens: none;
}

.edu-rows {
	margin: 0;
	padding: 0;
	list-style: none;
}

.edu-rows li {
	margin-bottom: 2.4rem;
	padding-bottom: 2.4rem;
	border-bottom: 1px solid var(--border);
}

.edu-rows li:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.edu-rows p {
	margin: 0;
	font-size: 1.55rem;
	line-height: 1.65;
}

h3.edu-title {
	font-family: var(--font-sans);
	font-size: 1.85rem;
	font-weight: 600;
	margin: 0 0 0.4rem;
	color: var(--fg);
}

/* --- Experience --- */
.timeline-rail {
	max-width: 56rem;
	margin: 0 auto;
	padding: 0 1rem;
}

.timeline {
	margin: 0;
	padding: 0;
	list-style: none;
}

.timeline li {
	position: relative;
	padding: 0 0 3.6rem 2.4rem;
	border-left: 1px solid var(--border);
	transition: border-color 0.45s ease;
}

.timeline li:last-child {
	padding-bottom: 0;
}

.timeline li::before {
	content: "";
	position: absolute;
	left: -5px;
	top: 0.4rem;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 4px var(--bg);
}

body.motion-ok .timeline li.reveal.is-visible::before {
	animation: timeline-dot-pop 0.65s var(--ease-out) forwards;
}

@keyframes timeline-dot-pop {
	0% {
		transform: scale(0.6);
		opacity: 0.5;
	}
	55% {
		transform: scale(1.25);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.timeline__meta {
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-muted);
	margin-bottom: 0.4rem;
}

.timeline h3 {
	font-size: 2rem;
	margin: 0 0 0.4rem;
	font-family: var(--font-sans);
	font-weight: 600;
}

.timeline__org {
	font-family: var(--font-display);
	font-size: 1.65rem;
	color: var(--accent);
	margin-bottom: 1rem;
}

.timeline p {
	margin: 0;
	font-size: 1.55rem;
	line-height: 1.7;
}

/* --- Expertise --- */
.pill-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 0.5rem;
}

.pill {
	padding: 0.75rem 1.4rem;
	font-size: 1.35rem;
	font-weight: 500;
	color: var(--fg);
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: 999px;
	transition:
		transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
		border-color 0.35s ease,
		background 0.35s ease,
		box-shadow 0.35s ease;
}

.pill.reveal {
	opacity: 0;
	transform: translateY(14px) scale(0.98);
	transition:
		opacity 0.65s var(--ease-out) calc(var(--reveal-i) * 0.06s),
		transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1)
			calc(var(--reveal-i) * 0.06s);
}

.pill.reveal.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.pill:hover {
	transform: translateY(-5px) scale(1.03);
	border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .pill:hover {
	box-shadow: 0 10px 36px rgba(0, 0, 0, 0.35);
}

.pill-grid--soft .pill {
	border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
}

/* --- Contact --- */
.contact-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	max-width: 72rem;
	margin: 0 auto;
	overflow: visible;
}

.contact-sep {
	opacity: 0.45;
	margin: 0 0.4em;
}

@media (min-width: 600px) {
	.contact-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.contact-card {
	padding: 2.4rem;
	border-radius: var(--radius);
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	transition:
		border-color 0.4s ease,
		box-shadow 0.4s ease,
		transform 0.12s ease-out;
	transform-style: preserve-3d;
}

/* In dark mode, --bg-elevated (#121215) is almost indistinguishable from
 * --bg (#0a0a0c), so the contact cards were dissolving into the starry
 * backdrop. Give them an explicit, clearly lighter gray + a slightly
 * stronger border so they read as tangible cards above the atmosphere. */
[data-theme="dark"] .contact-card {
	background: #1f1f24;
	border-color: rgba(255, 255, 255, 0.12);
}

.contact-card.tilt-hover:hover {
	box-shadow:
		0 18px 48px rgba(0, 0, 0, 0.12),
		0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
}

[data-theme="dark"] .contact-card.tilt-hover:hover {
	box-shadow:
		0 22px 56px rgba(0, 0, 0, 0.42),
		0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.contact-card h3 {
	font-family: var(--font-sans);
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fg-muted);
	margin: 0 0 0.8rem;
}

.contact-card p {
	margin: 0;
	font-size: 1.65rem;
	color: var(--fg);
}

.contact-card a {
	margin: 0;
	font-size: 1.65rem;
	color: var(--fg);
	display: inline-block;
	transition: transform 0.35s var(--ease-out), color 0.25s ease;
}

.contact-card a:hover {
	transform: translateX(4px);
	color: var(--accent);
}

/* --- Footer ---
 * Designed to feel like a clear, deliberate end-of-page band — distinct
 * from the surrounding atmosphere without a hard seam.
 *   1. A gradient wash that darkens toward the bottom: reads as "the lights
 *      dim / page closes" rather than trailing off into stars.
 *   2. A centered accent-tinted hairline at the very top: the visual cue
 *      that content has ended and this is the closing mark.
 *   3. Copy is tightened and centered in the band so nothing floats in a
 *      starry void. */
.site-footer {
	position: relative;
	z-index: 1;
	padding: 4.8rem 0 5.4rem;
	text-align: center;
	font-size: 1.3rem;
	letter-spacing: 0.02em;
	color: var(--fg-muted);
	background: linear-gradient(
		to bottom,
		transparent 0%,
		rgba(0, 0, 0, 0.55) 40%,
		rgba(0, 0, 0, 0.82) 100%
	);
}

[data-theme="light"] .site-footer {
	background: linear-gradient(
		to bottom,
		transparent 0%,
		color-mix(in srgb, var(--fg) 8%, transparent) 40%,
		color-mix(in srgb, var(--fg) 16%, transparent) 100%
	);
}

.site-footer::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: min(80rem, 88%);
	height: 1px;
	pointer-events: none;
	background: linear-gradient(
		to right,
		transparent 0%,
		color-mix(in srgb, var(--accent) 50%, transparent) 50%,
		transparent 100%
	);
}

[data-theme="light"] .site-footer::before {
	background: linear-gradient(
		to right,
		transparent 0%,
		color-mix(in srgb, var(--accent) 38%, transparent) 50%,
		transparent 100%
	);
}

.site-footer a {
	color: var(--fg-muted);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
	text-underline-offset: 4px;
	transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.site-footer a:hover {
	color: var(--fg);
	text-decoration-color: var(--accent);
}

/* --- Reveal on scroll --- */
.reveal {
	--reveal-i: 0;
	opacity: 0;
	transform: translateY(22px);
	transition:
		opacity 0.8s var(--ease-out) calc(var(--reveal-i) * 0.09s),
		transform 0.85s var(--ease-out) calc(var(--reveal-i) * 0.09s);
}

.reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.timeline li.reveal {
	opacity: 0;
	transform: translate(-20px, 20px);
	transition:
		opacity 0.75s var(--ease-out) calc(var(--reveal-i) * 0.1s),
		transform 0.8s var(--ease-out) calc(var(--reveal-i) * 0.1s);
}

.timeline li.reveal.is-visible {
	opacity: 1;
	transform: translate(0, 0);
}

/* --- Click ripple (buttons, theme toggle) --- */
.click-ripple {
	position: absolute;
	width: 8px;
	height: 8px;
	margin: -4px 0 0 -4px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.35);
	pointer-events: none;
	transform: scale(0);
	opacity: 0.85;
}

[data-theme="light"] .click-ripple {
	background: rgba(26, 24, 22, 0.12);
}

.click-ripple--active {
	animation: ripple-expand 0.65s ease-out forwards;
}

@keyframes ripple-expand {
	to {
		transform: scale(42);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.scroll-progress {
		display: none !important;
	}

	.hero__orb,
	.hero__shine {
		animation: none !important;
		opacity: 0.2;
	}

	.reveal {
		opacity: 1;
		transform: none;
	}

	.hero__kicker,
	.hero h1,
	.hero__tagline,
	.hero__lead,
	.hero__actions {
		opacity: 1;
		animation: none;
	}

	.section-mascot {
		display: none;
	}
}

/* --- Decorative section astronauts ---
 * One per non-hero section, animated by assets/section-mascots.js. The container
 * sits BEHIND the shell (section z-index 1, shell z-index 1, this at section
 * stacking base) so the sprite can drift behind text and card content.
 */
.section-mascot {
	position: absolute;
	left: 0;
	top: 0;
	width: 20rem;
	height: 20rem;
	pointer-events: none;
	will-change: transform;
	transform-origin: 50% 55%;
	opacity: 0.88;
	/* No initial transform — the script paints one on mount to avoid a (0,0) flash. */
	z-index: 0;
}

.section-mascot__host {
	width: 100%;
	height: 100%;
	position: relative;
}

/* pixel-mascot.js sets canvas inline width/height from data-mascot-display (200px).
 * Constrain it to the container so the sprite scales cleanly on smaller screens. */
.section-mascot__host canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
	image-rendering: pixelated;
}

@media (max-width: 720px) {
	.section-mascot {
		width: 14rem;
		height: 14rem;
		opacity: 0.78;
	}
}

