/* ==========================================================================
   Ron Reel — main stylesheet (spec §6)
   Hand-written; no build step required. If a bundler is added later, it runs
   locally and the built file replaces this one in Git (spec §0.3).
   ========================================================================== */

/* ---------- Fonts (self-hosted in assets/fonts/, see its README). Inter / Inter Tight / JetBrains Mono
   were never downloaded, so their @font-face rules were removed (they only caused 404s);
   those names in font stacks fall back to system fonts. ---------- */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Ailerons"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Ailerons/Ailerons-Typeface.otf") format("opentype"); }
@font-face { font-family: "Orbitron"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens (§6.1–6.3) ---------- */
:root {
	color-scheme: dark;

	/* v2 "cinematic black": true black stage, neutral greys, one hot accent. */
	--bg: #000;
	--surface: #0f0f11;
	--surface-2: #18181b;
	--surface-3: #232327;
	--panel: #0b0b0d;
	--glow-2: #a855f7;
	--heading-weight: 800;
	--hero-case: uppercase;
	--hero-scale: 1;
	--text-size: 17px;
	--line: rgba(255, 255, 255, .08);
	--line-2: rgba(255, 255, 255, .14);
	--line-3: rgba(255, 255, 255, .26);
	--fg: #fff;
	--fg-2: #d4d4d8;
	--mute: #a1a1aa;
	--accent: #ff5a1f; /* overridden inline from Site Settings */
	--ok: #22c55e;
	--err: #f87171;

	--font-display: "Inter Tight", "Segoe UI Variable Display", "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
	--font-body: Inter, "Segoe UI Variable Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

	--r-card: 6px;
	--r-band: 12px;
	--r-btn: 6px;
	--r-pill: 999px;

	--container: 1344px;
	--gutter-x: max(48px, env(safe-area-inset-left), env(safe-area-inset-right));
	--section-gap: 88px;
	--header-h: 72px;
	--tabbar-h: 64px;

	--ease: cubic-bezier(.2, .7, .2, 1);
	--dur: 200ms;
}

@media (max-width: 767px) {
	:root {
		--gutter-x: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
		--section-gap: 56px;
		--header-h: 60px;
	}
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-body);
	font-size: var(--text-size, 17px);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.035em;
	text-wrap: balance;
	margin: 0;
}
h1 { font-size: clamp(36px, 5.4vw, 84px); letter-spacing: -0.045em; }
h2 { font-size: clamp(28px, 3.2vw, 44px); }
h3 { font-size: clamp(19px, 1.6vw, 22px); letter-spacing: -0.02em; line-height: 1.2; }

p { margin: 0; max-width: 65ch; }

a { color: inherit; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--accent);
}
.eyebrow--mono { font-family: var(--font-mono); font-weight: 500; }

.mute { color: var(--mute); }
.tabular { font-variant-numeric: tabular-nums; }
.placeholder { color: var(--mute); font-style: italic; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter-x));
	margin-inline: auto;
	padding-inline: var(--gutter-x);
}

/* Sticky footer: main grows so short pages keep the footer at the bottom. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.site-main { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--section-gap); padding-block: calc(var(--header-h) + 48px) var(--section-gap); }
/* Only a page that actually renders a full-bleed hero (front-page.php, phase 4) drops the top padding. */
.site-main--hero { padding-top: 0; }

/* ---------- Skip link ---------- */
.skip-link {
	position: absolute;
	left: 16px; top: -100px;
	z-index: 1000;
	padding: 12px 18px;
	background: var(--fg); color: var(--bg);
	border-radius: 10px;
	font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top) + 12px); }

/* ---------- Buttons (§6.4) ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: var(--r-pill);
	border: 1px solid transparent;
	font: 600 15px/1 var(--font-body);
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: #dcdce2; }
.btn--secondary { background: transparent; color: var(--fg); border-color: var(--line-3); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--mute); }
.btn--accent { background: var(--accent); color: #0a0a0d; }
.btn--accent:hover { filter: brightness(.92); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* ---------- Header (§5) ---------- */
.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	top: env(safe-area-inset-top);
	z-index: 100;
	height: var(--header-h);
	background: rgba(10, 10, 13, .92);
	border-bottom: 1px solid var(--line);
	-webkit-backdrop-filter: saturate(140%) blur(12px);
	backdrop-filter: saturate(140%) blur(12px);
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* Before the safe-area inset there is nothing to cover on notched phones. */
.site-header::before {
	content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
	height: env(safe-area-inset-top); background: inherit;
}
.has-hero .site-header:not(.is-solid) {
	background: transparent;
	border-bottom-color: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.site-header__inner { display: flex; align-items: center; gap: 32px; height: 100%; }

.brand {
	display: inline-flex; align-items: center; gap: 10px;
	font: 700 20px/1 var(--font-display);
	letter-spacing: -0.03em;
	text-decoration: none;
	min-height: 44px;
}
.brand__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }

.primary-nav { margin-left: auto; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 0 14px;
	border-radius: var(--r-pill);
	color: var(--fg-2);
	font-size: 15px; font-weight: 500;
	text-decoration: none;
	transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-list a:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.nav-list [aria-current="page"], .nav-list .current-menu-item > a { color: var(--fg); }

@media (max-width: 767px) {
	.primary-nav { display: none; }
	.site-header__inner { justify-content: space-between; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--mute); font-size: 14px; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.site-footer .nav-list { flex-wrap: wrap; margin-inline: -10px; }
.site-footer .nav-list a { color: var(--mute); font-size: 14px; padding: 0 10px; }
.site-footer .nav-list a:hover { color: var(--fg); }
.footer-social { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--fg-2); text-decoration: none; }
.footer-social:hover { color: var(--fg); }

/* ---------- Phone tab bar (§5.10) ---------- */
.tabbar { display: none; }

@media (max-width: 767px) {
	body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
	.tabbar {
		display: block;
		position: fixed; inset: auto 0 0 0; z-index: 100;
		padding-bottom: env(safe-area-inset-bottom);
		padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
		background: rgba(17, 17, 22, .96);
		border-top: 1px solid var(--line);
		-webkit-backdrop-filter: blur(12px);
		backdrop-filter: blur(12px);
	}
	.tabbar ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; height: var(--tabbar-h); }
	.tabbar a {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
		height: 100%; min-height: 44px;
		color: var(--mute); font-size: 11.5px; font-weight: 600; text-decoration: none;
	}
	.tabbar a[aria-current="page"] { color: var(--fg); }
	.tabbar a[aria-current="page"] .icon { color: var(--accent); }
	.site-footer__inner { flex-direction: column; align-items: flex-start; }
	.footer-social { margin-left: 0; }
}

/* ---------- Generic content (index.php fallback) ---------- */
.entry { display: flex; flex-direction: column; gap: 20px; }
.entry__content { color: var(--fg-2); max-width: 760px; }
.entry__content > * + * { margin-top: 1em; }

/* ==========================================================================
   Phase 2 — cards, Work, project page
   ========================================================================== */

/* ---------- Shared bits ---------- */
.page-head { display: flex; flex-direction: column; gap: 14px; }
.page-head__lede { color: var(--fg-2); font-size: 18px; }

.badge {
	display: inline-flex; align-items: center;
	padding: 4px 8px;
	border-radius: 6px;
	background: rgba(10, 10, 13, .78);
	color: var(--fg);
	font: 600 12px/1 var(--font-body);
	letter-spacing: .02em;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip {
	display: inline-flex; align-items: center;
	min-height: 32px; padding: 6px 12px;
	border-radius: var(--r-pill);
	background: var(--surface-2);
	border: 1px solid var(--line);
	color: var(--fg-2);
	font-size: 14px; font-weight: 500;
}

/* ---------- Cover (16:9) + category placeholders (§6.1) ---------- */
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-radius: var(--r-card); }
.cover__img, .cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__placeholder { position: absolute; inset: 0; background:
	radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
	radial-gradient(90% 80% at 10% 100%, rgba(120, 120, 140, .18), transparent 60%),
	linear-gradient(160deg, #17171d, #0e0e12); }
.cover--gen-ai-films-ads { background:
	radial-gradient(110% 90% at 80% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 55%),
	radial-gradient(80% 70% at 0% 100%, color-mix(in srgb, var(--glow-2, #a855f7) 18%, transparent), transparent 60%),
	linear-gradient(160deg, #1b1418, #0d0d11); }
.cover--vfx-3d { background:
	radial-gradient(110% 90% at 15% 0%, rgba(56, 189, 248, .22), transparent 55%),
	radial-gradient(80% 70% at 100% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
	linear-gradient(200deg, #12161c, #0c0d11); }
.cover--motion-graphics { background:
	radial-gradient(100% 80% at 50% 0%, rgba(250, 204, 21, .18), transparent 55%),
	radial-gradient(90% 80% at 100% 100%, rgba(236, 72, 153, .16), transparent 60%),
	linear-gradient(180deg, #17151a, #0d0d11); }

/* ---------- Project card (§5.2, §8) ---------- */
.card { position: relative; }
.card__link { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; border-radius: var(--r-card); }
.card__link:focus-visible { outline: none; }
.card__link:focus-visible .card__media { outline: 3px solid var(--accent); outline-offset: 3px; }
.card__media { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card__link:hover .card__media,
.card__link:focus-visible .card__media { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8), 0 0 0 1px var(--line-2); }

.card__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur) var(--ease); }
.card.is-playing .card__preview { opacity: 1; }
.card__progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--progress, 0)); opacity: 0; transition: opacity var(--dur) var(--ease); }
.card.is-playing .card__progress { opacity: 1; }

.card__duration { position: absolute; right: 10px; bottom: 10px; }

.card__body { display: flex; flex-direction: column; gap: 4px; }
.card__title { font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; }
.card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mute); font-size: 14.5px; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: ron-shimmer 1.2s linear infinite; }
.card--skeleton .card__media { aspect-ratio: 16 / 9; border-radius: var(--r-card); }
.card--skeleton .card__body { gap: 10px; padding-top: 14px; }
.skeleton--line { display: block; height: 14px; width: 70%; border-radius: 6px; }
.skeleton--short { width: 40%; }
@keyframes ron-shimmer { to { background-position: -200% 0; } }

/* ---------- Work (§5.2) ---------- */
.work { display: flex; flex-direction: column; gap: 32px; }
.work__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

.pills ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pill {
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 16px;
	border-radius: var(--r-pill);
	border: 1px solid var(--line-2);
	color: var(--fg-2);
	font-size: 15px; font-weight: 500;
	text-decoration: none;
	transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pill:hover { color: var(--fg); border-color: var(--line-3); background: var(--surface-2); }
.pill[aria-current] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill__count { font-size: 12.5px; color: var(--mute); }
.pill[aria-current] .pill__count { color: #52525b; }

.sort { display: flex; align-items: center; gap: 10px; }
.sort__label { color: var(--mute); font-size: 14px; }
.select {
	min-height: 44px; padding: 0 40px 0 14px;
	border-radius: 10px;
	border: 1px solid var(--line-2);
	background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23a1a1aa' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
	color: var(--fg);
	font: 500 15px/1 var(--font-body);
	-webkit-appearance: none; appearance: none;
}

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.grid[aria-busy="true"] { pointer-events: none; }
@media (max-width: 1279px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .grid { grid-template-columns: 1fr; gap: 32px; } .work__controls { flex-direction: column; align-items: stretch; } .sort { justify-content: flex-end; } }

.work__more { display: flex; justify-content: center; gap: 12px; }
.work__more:empty { display: none; }

.state-empty {
	display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
	padding: 40px;
	border: 1px dashed var(--line-2);
	border-radius: var(--r-band);
	background: var(--surface);
}
.state-empty__title { font-size: clamp(22px, 2.2vw, 28px); }
@media (max-width: 767px) { .state-empty { padding: 24px; } }

/* ---------- Project page (§5.3) ---------- */
.project { gap: 56px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--mute); font-size: 14.5px; margin-bottom: 20px; }
.breadcrumb a { color: var(--fg-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.breadcrumb a:hover { color: var(--fg); }

.project__head { display: flex; flex-direction: column; gap: 24px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px 48px; margin: 0; }
.meta-row div { display: flex; flex-direction: column; gap: 4px; }
.meta-row dt { color: var(--mute); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.meta-row dd { margin: 0; font-size: 16px; color: var(--fg); }

.player { position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: var(--r-band); overflow: hidden; background: #000; }
.player__video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__empty { border-radius: var(--r-band); height: 100%; aspect-ratio: auto; }
.player__note { position: absolute; left: 20px; bottom: 16px; font-size: 14px; }
.player__error {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	padding: 24px; text-align: center;
	background: rgba(10, 10, 13, .78);
}
.player__error[hidden] { display: none; }
.player__error-title { font: 700 22px/1.2 var(--font-display); }
.player.has-error .player__video { opacity: .35; }
.player__quality { position: absolute; top: 14px; right: 14px; pointer-events: none; }
.player__quality.is-top { background: var(--accent); color: #0a0a0d; }

/* ---------- Full-reel modal (§7.2) ---------- */
.reel-modal {
	width: min(1344px, calc(100vw - 2 * var(--gutter-x)));
	max-width: none; max-height: none;
	padding: 0; border: 0;
	background: transparent; color: var(--fg);
	overflow: visible;
}
.reel-modal::backdrop { background: rgba(5, 5, 7, .88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.reel-modal__inner { position: relative; display: flex; flex-direction: column; gap: 12px; }
.reel-modal__close {
	align-self: flex-end;
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 1px solid var(--line-3);
	background: var(--surface);
	color: var(--fg);
	font-size: 26px; line-height: 1;
	cursor: pointer;
}
.reel-modal__close:hover { background: var(--surface-3); }

.story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.story__col { display: flex; flex-direction: column; gap: 12px; color: var(--fg-2); }
.story__col h2 { font-family: var(--font-body); }
.key-number { font: 700 clamp(26px, 2.4vw, 34px)/1.1 var(--font-display); letter-spacing: -0.03em; color: var(--accent); margin-top: 8px; }
@media (max-width: 1023px) { .story { grid-template-columns: 1fr; gap: 28px; } }

.breakdown { display: flex; flex-direction: column; gap: 24px; }
.breakdown__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.breakdown__item { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.breakdown__item img { width: 100%; border-radius: var(--r-card); }
.breakdown__item figcaption { color: var(--mute); font-size: 14.5px; }
@media (max-width: 767px) { .breakdown__grid { grid-template-columns: 1fr; } }

/* Before / after slider */
.compare__frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; touch-action: pan-y; cursor: ew-resize; user-select: none; }
.compare__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; pointer-events: none; }
.compare__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--fg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.compare__handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: var(--fg); box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.compare__label { position: absolute; top: 12px; }
.compare__label--before { left: 12px; }
.compare__label--after { right: 12px; }
.compare__range { width: 100%; accent-color: var(--accent); min-height: 32px; }

.tools-credits { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tools-credits > div { display: flex; flex-direction: column; gap: 14px; }
.tools-credits h2 { font-family: var(--font-body); }
.credits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.credits li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 767px) { .tools-credits { grid-template-columns: 1fr; } }

.next-project { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.next-project__card {
	display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 20px; align-items: center;
	padding: 16px; border-radius: var(--r-band);
	background: var(--surface); border: 1px solid var(--line);
	text-decoration: none;
	transition: border-color var(--dur) var(--ease);
}
.next-project__card:hover { border-color: var(--line-3); }
.next-project__cover { border-radius: 12px; }
.next-project__title { display: flex; align-items: center; gap: 10px; margin-top: 6px; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.02em; }
.next-project__cta {
	display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px;
	padding: 24px; border-radius: var(--r-band);
	background: var(--surface); border: 1px solid var(--line);
	color: var(--fg-2);
}
/* Only one published project: no "next" card, so the CTA takes the full row. */
.next-project__cta:only-child { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
@media (max-width: 1023px) { .next-project { grid-template-columns: 1fr; } }
@media (max-width: 479px) { .next-project__card { grid-template-columns: 1fr; } }

/* ==========================================================================
   Phase 4 — Home (§5.1)
   ========================================================================== */

.btn--lg { min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn .icon { width: 18px; height: 18px; }
.btn.is-placeholder { cursor: default; opacity: .75; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-title { font-size: clamp(26px, 2.6vw, 36px); }
.section-title--sm { font-size: clamp(20px, 1.8vw, 24px); }
.section-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--fg-2); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.section-link:hover { color: var(--fg); }
.section-link .icon { width: 16px; height: 16px; }

/* ---------- 1. Hero ---------- */
.hero {
	position: relative;
	min-height: min(88vh, 860px);
	display: flex; align-items: flex-end;
	padding: calc(var(--header-h) + 64px) 0 72px;
	overflow: hidden;
	isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__poster, .hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__poster { display: block; }
.hero__video { opacity: 0; transition: opacity 600ms var(--ease); }
/* Playing layer opacity: see "Hero playlist" near the end. */
/* Left-to-right dark gradient for legibility, plus a fade into the page. */
.hero__shade { position: absolute; inset: 0; background:
	linear-gradient(90deg, rgba(10, 10, 13, .92) 0%, rgba(10, 10, 13, .72) 38%, rgba(10, 10, 13, .15) 75%, rgba(10, 10, 13, 0) 100%),
	linear-gradient(0deg, var(--bg) 0%, rgba(10, 10, 13, 0) 30%),
	linear-gradient(180deg, rgba(10, 10, 13, .6) 0%, rgba(10, 10, 13, 0) 22%); }

.hero__content { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.hero__content h1 { max-width: 13ch; }
.hero__line { color: var(--fg-2); font-size: clamp(17px, 1.4vw, 19px); max-width: 52ch; }
.hero__chip {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 5px 14px 5px 5px;
	border-radius: var(--r-pill);
	background: rgba(17, 17, 22, .7);
	border: 1px solid var(--line-2);
	font-size: 14.5px; font-weight: 500;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.hero__avatar--empty { display: inline-grid; place-items: center; background: var(--accent); color: #0a0a0d; font-weight: 700; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__paused { display: flex; align-items: center; gap: 12px; color: var(--fg-2); font-size: 14px; }
.hero__paused[hidden] { display: none; }

@media (max-width: 767px) {
	.hero { min-height: 520px; padding: calc(var(--header-h) + 32px) 0 40px; }
	.hero__shade { background:
		linear-gradient(0deg, var(--bg) 0%, rgba(10, 10, 13, .85) 45%, rgba(10, 10, 13, .35) 100%); }
	.hero__actions { width: 100%; flex-direction: column; }
	.hero__actions .btn { width: 100%; }
	.hero__paused { flex-wrap: wrap; }
}

/* ---------- 2. Proof strip ---------- */
.proof { display: flex; flex-direction: column; gap: 32px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; border-radius: var(--r-band); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { display: flex; flex-direction: column-reverse; gap: 6px; padding: 24px; background: var(--surface); }
.stat__value { margin: 0; font: 700 clamp(28px, 3vw, 40px)/1 var(--font-display); letter-spacing: -0.04em; color: var(--fg); }
.stat__label { color: var(--mute); font-size: 14px; line-height: 1.4; }
.logos { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.logos__label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.logos__list { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; list-style: none; margin: 0; padding: 0; }
.logos__img { height: 28px; width: auto; opacity: .7; filter: grayscale(1) brightness(1.6); }
@media (max-width: 1023px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .stat { padding: 18px; } }

/* ---------- 3. Audience split ---------- */
.split { display: flex; flex-direction: column; gap: 24px; }
.split__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split__card {
	display: flex; flex-direction: column; gap: 14px;
	padding: 32px;
	border-radius: var(--r-band);
	background: var(--surface);
	border: 1px solid var(--line);
}
.split__card--hiring { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 08%, transparent), var(--surface) 55%); }
.split__title { font-size: clamp(22px, 2vw, 28px); line-height: 1.15; max-width: 22ch; }
.split__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 12px; }
@media (max-width: 767px) { .split__grid { grid-template-columns: 1fr; } .split__card { padding: 24px; } }

/* ---------- 4. Featured ---------- */
.featured { display: flex; flex-direction: column; gap: 24px; }
.featured__grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 24px; }
.featured__item--lead { grid-row: span 2; }
.featured__item--lead .card__title { font-size: clamp(22px, 2vw, 28px); }
/* One featured project: keep the lead card at its 2fr width instead of filling the row. */
.featured__grid--1 .featured__item--lead { grid-row: auto; }
.featured__grid--2 { grid-template-rows: auto; }
.featured__grid--2 .featured__item--lead { grid-row: auto; }
@media (max-width: 1023px) {
	.featured__grid { grid-template-columns: 1fr 1fr; }
	.featured__item--lead { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 767px) { .featured__grid { grid-template-columns: 1fr; } }

/* ---------- 5. Category rows ---------- */
.rows { display: flex; flex-direction: column; gap: 56px; }
.row { display: flex; flex-direction: column; gap: 16px; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.row__nav { display: flex; align-items: center; gap: 8px; }
.row__arrow {
	display: inline-grid; place-items: center;
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	background: var(--surface);
	color: var(--fg);
	font-size: 24px; line-height: 1;
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.row__arrow[hidden] { display: none; }
.row__arrow:disabled { opacity: .3 !important; cursor: default; }
.row:hover .row__arrow, .row__arrow:focus-visible { opacity: 1; }
.row__arrow:hover:not(:disabled) { background: var(--surface-3); }
@media (hover: none) { .row__arrow { display: none; } }

.row__track {
	--peek: 0.4;
	--cols: 4;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((min(100vw, var(--container) + 2 * var(--gutter-x)) - 2 * var(--gutter-x) - (var(--cols) - 1) * 20px) / (var(--cols) + var(--peek)));
	gap: 20px;
	list-style: none; margin: 0;
	padding: 8px var(--gutter-x) 12px;
	padding-left: max(var(--gutter-x), calc((100vw - var(--container)) / 2));
	scroll-padding-left: max(var(--gutter-x), calc((100vw - var(--container)) / 2));
	overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}
.row__track::-webkit-scrollbar { display: none; }
.row__item { scroll-snap-align: start; min-width: 0; }
@media (max-width: 1279px) { .row__track { --cols: 3; --peek: 0.3; } }
@media (max-width: 767px) { .row__track { --cols: 1; --peek: 0.2; gap: 14px; } }

/* ---------- 6. Case studies ---------- */
.cases { display: flex; flex-direction: column; gap: 24px; }
.cases__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.case-card__link {
	display: flex; flex-direction: column; height: 100%;
	border-radius: var(--r-band); overflow: hidden;
	background: var(--surface); border: 1px solid var(--line);
	text-decoration: none;
	transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.case-card__link:hover { border-color: var(--line-3); transform: translateY(-4px); }
.case-card__cover { border-radius: 0; }
.case-card__body { display: flex; flex-direction: column; gap: 10px; padding: 24px; flex: 1; }
.case-card__title { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; }
.case-card__line { color: var(--fg-2); }
.case-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 15px; }
.case-card__more .icon { width: 16px; height: 16px; }
@media (max-width: 767px) { .cases__grid { grid-template-columns: 1fr; } }

/* ---------- 7. Engineering teaser ---------- */
.eng-teaser__panel {
	display: flex; flex-direction: column; gap: 28px;
	padding: 40px;
	border-radius: var(--r-band);
	background: var(--surface);
	border: 1px solid var(--line);
}
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; counter-reset: none; }
.pipeline__step {
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 40px; padding: 8px 14px;
	border-radius: var(--r-pill);
	background: var(--surface-2); border: 1px solid var(--line-2);
	font-weight: 600; font-size: 14.5px;
}
.pipeline__step:not(:last-child)::after { content: "→"; margin-left: 10px; margin-right: -4px; color: var(--mute); font-weight: 400; }
.pipeline__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.eng-teaser__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mini-card {
	display: flex; flex-direction: column; gap: 8px;
	padding: 20px;
	border-radius: var(--r-card);
	background: var(--surface-2); border: 1px solid var(--line);
	text-decoration: none;
	transition: border-color var(--dur) var(--ease);
}
.mini-card:hover { border-color: var(--line-3); }
.mini-card__label { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mini-card__title { font-size: 18px; line-height: 1.25; }
.mini-card__body { color: var(--fg-2); font-size: 15px; }
@media (max-width: 1023px) { .eng-teaser__grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .eng-teaser__panel { padding: 24px; } }

/* ---------- 8. What I do ---------- */
.services { display: flex; flex-direction: column; gap: 24px; }
.services__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.service { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: var(--r-band); background: var(--surface); border: 1px solid var(--line); }
.service__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.service__title { font-size: 20px; }
.service__body { color: var(--fg-2); font-size: 15.5px; }
@media (max-width: 1023px) { .services__grid { grid-template-columns: 1fr; } }

/* ---------- 10. Contact band ---------- */
.band {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
	padding: 40px;
	border-radius: var(--r-band);
	background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%), var(--surface);
	border: 1px solid var(--line);
}
.band__text { display: flex; flex-direction: column; gap: 10px; }
.band__title { font-size: clamp(26px, 3vw, 40px); max-width: 18ch; }
.band__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.band__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 767px) { .band { padding: 24px; } .band__actions, .band__buttons { width: 100%; } .band__buttons .btn { flex: 1; } }

.email-copy { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.email-copy__address { font-weight: 600; font-size: 18px; text-decoration: none; word-break: break-all; }
.email-copy__address:hover { text-decoration: underline; }
.email-copy__btn.is-copied { background: var(--ok); border-color: var(--ok); color: #0a0a0d; }

/* ==========================================================================
   Phase 5 — case study, Engineering, About, Contact, Privacy, 404
   ========================================================================== */

.prose { color: var(--fg-2); font-size: 17px; line-height: 1.7; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { color: var(--fg); margin-top: 1.6em; }
.prose a { color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose strong { color: var(--fg); }

/* ---------- Case study (§5.4) ---------- */
.case { gap: 48px; }
.case__head { display: flex; flex-direction: column; gap: 16px; }
.case__title { max-width: 18ch; }
.case__summary { font-size: clamp(18px, 1.6vw, 21px); color: var(--fg-2); max-width: 60ch; }
.stats--case { margin-top: 12px; }
.case__hero { position: relative; aspect-ratio: 21 / 9; border-radius: var(--r-band); overflow: hidden; background: var(--surface-2); }
.case__hero img { width: 100%; height: 100%; object-fit: cover; }
.case__hero--video { aspect-ratio: auto; background: none; }
.case__hero--video .player { aspect-ratio: 21 / 9; }

.case__layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 64px; justify-content: start; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; display: flex; flex-direction: column; gap: 12px; }
.toc__title { font-size: 12.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line-2); }
.toc__list a { display: block; padding: 8px 0 8px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--mute); font-size: 15px; text-decoration: none; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.toc__list a:hover { color: var(--fg); }
.toc__list a[aria-current] { color: var(--fg); border-left-color: var(--accent); }
@media (max-width: 1023px) {
	.case__layout { grid-template-columns: 1fr; gap: 32px; }
	.toc { position: static; padding: 16px 20px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
	.toc__list { flex-direction: row; flex-wrap: wrap; border-left: 0; gap: 4px 16px; }
	.toc__list a { padding: 8px 0; border-left: 0; margin: 0; }
}

.case__body { display: flex; flex-direction: column; gap: 56px; }
.case__section { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: calc(var(--header-h) + 24px); }
.case__section > h2 { font-size: clamp(24px, 2.2vw, 30px); }
.case__figure { margin: 8px 0 0; }
.case__figure img { border-radius: var(--r-card); width: 100%; }
.constraints { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.constraint { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.constraint__title { font-size: 17px; }
.constraint p { font-size: 15px; }
@media (max-width: 767px) { .constraints { grid-template-columns: 1fr; } }

/* Revenue chart (§6.6) */
.chart { margin: 8px 0 0; padding: 20px; border-radius: var(--r-band); background: var(--surface); border: 1px solid var(--line); }
.chart__svg { width: 100%; height: auto; overflow: visible; }
.chart__stop { stop-color: var(--accent); }
.chart__axis { stroke: var(--line-3); stroke-width: 1; }
.chart__grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 6; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart__dot { fill: var(--bg); stroke: var(--accent); stroke-width: 3; }
.chart__ylabel, .chart__xlabel { fill: var(--mute); font: 500 13px var(--font-body); font-variant-numeric: tabular-nums; }
.chart__value { fill: var(--fg); font: 700 15px var(--font-display); font-variant-numeric: tabular-nums; }
.chart__caption { margin-top: 10px; color: var(--mute); font-size: 13.5px; }
.chart__framing { font-size: 15px; }

/* ---------- Engineering (§5.5) ---------- */
.eng { gap: 72px; }
.eng .section-title { margin-bottom: 24px; }
.eng__head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.eng__intro { display: flex; flex-direction: column; gap: 18px; }
.eng__intro h1 { font-size: clamp(34px, 4.4vw, 64px); max-width: 18ch; }
.summary-card { margin: 0; padding: 8px 24px; border-radius: var(--r-band); background: var(--surface); border: 1px solid var(--line); }
.summary-card div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-card div:last-child { border-bottom: 0; }
.summary-card dt { color: var(--mute); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.summary-card dd { margin: 0; color: var(--fg); font-size: 15.5px; }
@media (max-width: 1023px) { .eng__head { grid-template-columns: 1fr; } }

.arch { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.arch__col { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.arch__col:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 22px; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); color: var(--mute); font-size: 13px; }
.arch__num { color: var(--accent); font-size: 12.5px; font-family: var(--font-mono); }
.arch__name { font-size: 19px; }
.arch__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.arch__items li { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--fg-2); font-size: 14px; }
@media (max-width: 1023px) {
	.arch { grid-template-columns: 1fr; }
	.arch__col:not(:last-child)::after { content: "↓"; right: auto; left: 24px; top: auto; bottom: -17px; }
}
.mono-line { font-family: var(--font-mono); font-size: 13px; color: var(--mute); }
.writeups { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.writeup { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
a.writeup:hover .writeup__title { text-decoration: underline; }
.writeup__title { font-weight: 600; }
.writeup__meta { font-size: 14px; white-space: nowrap; }

/* ---------- About (§5.6) ---------- */
.about { gap: 72px; }
.about .section-title { margin-bottom: 24px; }
.about__intro { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 56px; align-items: start; }
.about__portrait img, .about__portrait-empty { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-band); }
.about__portrait-empty { display: grid; place-items: center; background: var(--surface); border: 1px dashed var(--line-2); }
.about__bio { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
@media (max-width: 1023px) { .about__intro { grid-template-columns: 1fr; gap: 32px; } .about__portrait { max-width: 420px; } }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.timeline__item { position: relative; display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 0 0 28px 24px; }
.timeline__item::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline__years { color: var(--mute); font-size: 14.5px; }
.timeline__title { font-size: 18px; }
.timeline__detail { color: var(--fg-2); margin-top: 6px; }
@media (max-width: 767px) { .timeline__item { grid-template-columns: 1fr; gap: 4px; } }
.skill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-list li { padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--fg-2); font-size: 14px; }
.edu { color: var(--fg-2); }
.edu strong { color: var(--fg); }

/* ---------- Contact (§5.7, §10) ---------- */
.contact__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 64px; align-items: start; }
.contact__info { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--header-h) + 32px); }
.contact__info h1 { font-size: clamp(36px, 4.6vw, 64px); max-width: 14ch; }
.contact__reply { color: var(--fg-2); font-size: 18px; }
@media (max-width: 1023px) { .contact__layout { grid-template-columns: 1fr; gap: 40px; } .contact__info { position: static; } }

.contact__form-wrap { scroll-margin-top: calc(var(--header-h) + 24px); }
.form { display: flex; flex-direction: column; gap: 20px; padding: 32px; border-radius: var(--r-band); background: var(--surface); border: 1px solid var(--line); }
.form[hidden] { display: none; }
@media (max-width: 767px) { .form { padding: 20px; } }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { font-size: 14.5px; font-weight: 600; color: var(--fg); padding: 0; }
.input {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--line-2);
	background: var(--surface-2);
	color: var(--fg);
	font: 400 16px/1.4 var(--font-body);
	transition: border-color var(--dur) var(--ease);
}
.input:hover { border-color: var(--line-3); }
.input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--line-3); }
.input[aria-invalid="true"] { border-color: var(--err); }
.select.input { padding-right: 40px; }
.textarea { min-height: 150px; resize: vertical; }
.field__error, .form__error { color: var(--err); font-size: 14px; }
.field__error[hidden], .form__error[hidden] { display: none; }
.form__error { padding: 12px 14px; border-radius: 10px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); }
.form__error:focus { outline: none; }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle__opt { position: relative; display: flex; }
.toggle__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle__opt span {
	flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 48px; padding: 10px 14px;
	border-radius: 10px; border: 1px solid var(--line-2);
	background: var(--surface-2); color: var(--fg-2);
	font-weight: 500; font-size: 15px;
	transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.toggle__opt input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.toggle__opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 479px) { .toggle { grid-template-columns: 1fr; } }

.form__submit { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.form__consent { font-size: 14px; }
.form__consent a { color: var(--fg-2); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { padding: 24px 28px; border-radius: var(--r-band); background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .4); }
.form-status[hidden] { display: none; }
.form-status:focus { outline: none; }
.form-status__ok { color: var(--fg); font-weight: 600; font-size: 18px; }
.form-status__ok::before { content: "✓ "; color: var(--ok); }

/* ---------- Privacy / 404 ---------- */
.legal { display: flex; flex-direction: column; gap: 32px; max-width: calc(760px + 2 * var(--gutter-x)); margin-inline: 0; }
.not-found { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding-block: 48px; }
.not-found h1 { max-width: 16ch; }

/* ==========================================================================
   v2 — "Cinematic black" (bold, streaming-app look). Overrides the base styles above.
   ========================================================================== */

/* ---------- Type: heavier and tighter ---------- */
h1, h2 { font-weight: 800; }
h1 { letter-spacing: -0.05em; line-height: .98; }
.section-title { font: 800 clamp(24px, 2.4vw, 34px)/1.05 var(--font-display); letter-spacing: -0.035em; }
.page-head h1, .project__head h1, .case__title, .eng__intro h1, .contact__info h1, .not-found h1, .about__bio h1 { font-size: clamp(40px, 6vw, 96px); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; }

/* ---------- Buttons: square-ish, bold ---------- */
.btn { border-radius: var(--r-btn); font: 700 15px/1 var(--font-body); letter-spacing: -0.005em; }
.btn--lg { min-height: 56px; padding: 0 30px; font-size: 18px; gap: 10px; }
.btn--lg .icon { width: 24px; height: 24px; }
.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: rgba(255, 255, 255, .78); }
.btn--glass { background: rgba(109, 109, 110, .55); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn--glass:hover { background: rgba(109, 109, 110, .38); }
.btn--secondary { border-color: var(--line-3); }
.btn--secondary:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
.btn--accent { color: #000; }

/* ---------- Header: gradient over the hero, solid black on scroll ---------- */
.site-header { background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 0; }
.has-hero .site-header:not(.is-solid) { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 82%, transparent) 0%, color-mix(in srgb, var(--bg) 35%, transparent) 60%, transparent 100%); }
.brand { font-size: 22px; font-weight: 800; }
.brand__dot { width: 12px; height: 12px; box-shadow: 0 0 18px var(--accent), 0 0 4px var(--accent); }
.nav-list a { color: #e5e5e5; font-size: 15px; font-weight: 500; border-radius: var(--r-btn); }
.nav-list a:hover { background: transparent; color: #b3b3b3; }
.nav-list [aria-current="page"], .nav-list .current-menu-item > a { color: #fff; font-weight: 700; }
.site-header .btn--sm { border-radius: var(--r-btn); }

/* ---------- 1. Billboard hero ---------- */
.hero {
	min-height: 100vh; min-height: 100svh;
	padding: calc(var(--header-h) + 64px) 0 clamp(88px, 15vh, 170px);
	align-items: flex-end;
}
.hero__shade { background:
	linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 28%, color-mix(in srgb, var(--bg) 28%, transparent) 62%, transparent 100%),
	linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 18%, transparent 42%); }
/* No poster yet: a slow drifting glow + grain stands in for footage. */
.hero__glow {
	position: absolute; inset: -20%;
	background:
		radial-gradient(38% 46% at 72% 34%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
		radial-gradient(30% 40% at 58% 70%, color-mix(in srgb, var(--glow-2, #a855f7) 30%, transparent), transparent 70%),
		radial-gradient(34% 40% at 88% 78%, rgba(14, 165, 233, .22), transparent 70%);
	filter: blur(30px);
	animation: ron-drift 22s ease-in-out infinite alternate;
}
@keyframes ron-drift {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	50% { transform: translate3d(-4%, 3%, 0) scale(1.08); }
	100% { transform: translate3d(3%, -2%, 0) scale(1.02); }
}
.hero__grain {
	position: absolute; inset: 0; opacity: .09; mix-blend-mode: overlay; pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__content { gap: 16px; }
.hero__chip { background: color-mix(in srgb, var(--bg) 45%, transparent); border-color: var(--line-2); font-size: 14px; }
.hero__eyebrow { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; color: #fff; font: 700 13px/1.3 var(--font-body); letter-spacing: .16em; text-transform: uppercase; }
.hero__eyebrow::before { content: ""; flex: none; width: 32px; height: 3px; border-radius: 2px; background: var(--accent); }
.hero__title {
	max-width: 15ch;
	font: 800 calc(clamp(46px, min(7vw, 11vh), 116px) * var(--hero-scale, 1))/.9 var(--font-display);
	letter-spacing: -0.05em;
	text-transform: uppercase;
	text-shadow: 0 4px 40px color-mix(in srgb, var(--bg) 45%, transparent);
}
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 4px 0 0; color: #e5e5e5; font-size: 16px; font-weight: 500; }
.hero__meta > span + span::before { content: "•"; margin: 0 12px; color: var(--mute); }
.hero__meta-strong { color: var(--accent); font-weight: 800; }
.hero__line { color: #e5e5e5; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; max-width: 46ch; text-shadow: 0 1px 12px color-mix(in srgb, var(--bg) 60%, transparent); }
.hero__actions { gap: 12px; margin-top: 12px; }
@media (max-width: 767px) {
	.hero { min-height: 560px; min-height: 88svh; padding-bottom: 48px; }
	.hero__title { font-size: calc(clamp(40px, 12vw, 56px) * var(--hero-scale, 1)); }
	.hero__shade { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 85%, transparent) 38%, color-mix(in srgb, var(--bg) 25%, transparent) 75%, color-mix(in srgb, var(--bg) 55%, transparent) 100%); }
	.hero__actions { flex-direction: row; }
	.hero__actions .btn { flex: 1; width: auto; padding: 0 16px; font-size: 16px; }
}

/* ---------- Tiles: title over the image, zoom on hover ---------- */
.card { position: relative; }
.card__link { display: block; border-radius: var(--r-card); }
.card__media { border-radius: var(--r-card); transform-origin: center; transition: transform 280ms var(--ease), box-shadow 280ms var(--ease); will-change: transform; }
.card__overlay {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	display: flex; flex-direction: column; gap: 4px;
	padding: 56px 16px 14px;
	background: linear-gradient(0deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .6) 45%, rgba(0, 0, 0, 0) 100%);
}
.card__cat { color: var(--accent); font: 800 11px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.card__title { font: 800 clamp(17px, 1.35vw, 20px)/1.15 var(--font-display); letter-spacing: -0.025em; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.card__meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: #d4d4d8; font-size: 13px; }
.card__meta > span + span::before { content: "•"; margin-right: 10px; color: var(--mute); }
.card__duration { top: 10px; right: 10px; bottom: auto; z-index: 3; background: rgba(0, 0, 0, .7); }
.card__progress { z-index: 3; }
.card__preview { z-index: 1; }
.card__play {
	position: absolute; top: 42%; left: 50%; z-index: 3;
	display: grid; place-items: center;
	width: 56px; height: 56px; margin: -28px 0 0 -28px;
	border-radius: 50%; background: rgba(255, 255, 255, .95); color: #000;
	opacity: 0; transform: scale(.8);
	transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.card__play .icon { width: 26px; height: 26px; margin-left: 3px; }
.card.is-playing .card__play { opacity: 0 !important; }
@media (hover: hover) and (pointer: fine) {
	.card:hover, .card:focus-within { z-index: 5; }
	.card__link:hover .card__media,
	.card__link:focus-visible .card__media { transform: scale(1.07); box-shadow: 0 28px 56px -16px rgba(0, 0, 0, .95), 0 0 0 2px rgba(255, 255, 255, .85); }
	.card__link:hover .card__play,
	.card__link:focus-visible .card__play { opacity: 1; transform: scale(1); }
}
.card__link:focus-visible .card__media { outline: 3px solid var(--accent); outline-offset: 3px; }
.card--skeleton .card__media { aspect-ratio: 16 / 9; border-radius: var(--r-card); position: relative; }
.card--skeleton .card__overlay { background: none; gap: 8px; }
.card--skeleton .skeleton--line { background: rgba(255, 255, 255, .08); }

/* Larger type on the lead featured tile. */
.featured__item--lead .card__title { font-size: clamp(24px, 2.6vw, 40px); }
.featured__item--lead .card__overlay { padding: 90px 28px 24px; gap: 8px; }
.featured__item--lead .card__meta { font-size: 15px; }

/* Grids: tighter, like an app catalogue. */
.grid { gap: 28px 16px; }
.featured__grid { gap: 16px; }

/* ---------- Category rows: tight tiles, full-height edge arrows ---------- */
.rows { gap: 36px; }
.row { gap: 4px; contain-intrinsic-size: auto 300px; }
.row__head { display: flex; align-items: baseline; }
.row__title { font: 800 clamp(19px, 1.7vw, 24px)/1.2 var(--font-display); letter-spacing: -0.025em; }
.row__title a { display: inline-flex; align-items: baseline; gap: 12px; min-height: 44px; align-items: center; text-decoration: none; }
.row__explore { color: var(--accent); font: 700 14px/1 var(--font-body); opacity: 0; transform: translateX(-8px); transition: opacity 220ms var(--ease), transform 220ms var(--ease); }
.row:hover .row__explore, .row__title a:focus-visible .row__explore { opacity: 1; transform: none; }
@media (hover: none) { .row__explore { opacity: 1; transform: none; } }

.row__viewport { position: relative; }
.row__track {
	--gap: 10px;
	gap: var(--gap);
	grid-auto-columns: calc((min(100vw, var(--container) + 2 * var(--gutter-x)) - 2 * var(--gutter-x) - (var(--cols) - 1) * var(--gap)) / (var(--cols) + var(--peek)));
	padding-top: 22px; padding-bottom: 30px; /* room for the hover zoom */
}
@media (max-width: 767px) { .row__track { --gap: 10px; } }
.row__arrow {
	position: absolute; top: 22px; bottom: 30px; z-index: 6;
	width: max(48px, calc(var(--gutter-x) - 4px)); height: auto;
	border: 0; border-radius: 0;
	color: #fff; font-size: 52px; font-weight: 300;
	opacity: 0;
	transition: opacity 200ms var(--ease), font-size 160ms var(--ease);
}
.row__arrow--prev { left: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35)); }
.row__arrow--next { right: 0; background: linear-gradient(270deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35)); }
.row__arrow:hover:not(:disabled) { background-color: transparent; font-size: 64px; }
.row:hover .row__arrow:not(:disabled), .row__arrow:focus-visible { opacity: 1; }
.row__arrow:disabled { opacity: 0 !important; pointer-events: none; }

/* ---------- 2. Stats: big numbers, hairline dividers ---------- */
.stats { background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; gap: 0; }
.stat { background: none; padding: 32px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__value { font-size: clamp(40px, 4.8vw, 76px); font-weight: 800; letter-spacing: -0.055em; }
.stat__label { font-size: 14px; color: var(--mute); }
@media (max-width: 1023px) {
	.stat { padding: 24px 20px; }
	.stat:nth-child(odd) { border-left: 0; padding-left: 0; }
	.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- 3. Audience split: two bold panels ---------- */
.split__grid { gap: 16px; }
.split__card {
	position: relative; overflow: hidden;
	min-height: 300px; padding: 40px;
	border-radius: var(--r-band); border: 1px solid var(--line);
	background: radial-gradient(120% 120% at 100% 0%, rgba(255, 255, 255, .07), transparent 55%), var(--panel);
	justify-content: flex-end;
}
.split__card--hiring { background: radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 58%), var(--panel); }
.split__title { font: 800 clamp(28px, 3vw, 44px)/1.02 var(--font-display); letter-spacing: -0.04em; max-width: 16ch; }
@media (max-width: 767px) { .split__card { min-height: 0; padding: 28px; } }

/* ---------- Pills, chips, panels: tighter radii ---------- */
.pill { border-radius: var(--r-btn); font-weight: 600; }
.pill[aria-current] { background: #fff; color: #000; border-color: #fff; }
.chip { border-radius: var(--r-btn); }
.select { border-radius: var(--r-btn); }
.eng-teaser__panel, .service, .case-card__link, .state-empty, .form, .chart, .summary-card, .constraint, .arch__col, .mini-card, .next-project__card, .next-project__cta { border-radius: var(--r-band); }
.eng-teaser__panel { background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%), var(--panel); }
.service { background: var(--panel); }
.service__title { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.case-card__title { font-weight: 800; }
.pipeline__step { border-radius: var(--r-btn); }

/* ---------- Contact band: a full-colour call to action ---------- */
.band {
	border: 0; border-radius: var(--r-band);
	padding: clamp(32px, 5vw, 64px);
	background:
		radial-gradient(80% 140% at 100% 100%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
		radial-gradient(60% 120% at 0% 0%, color-mix(in srgb, var(--glow-2, #a855f7) 18%, transparent), transparent 60%),
		var(--panel);
}
.band__title { font: 800 clamp(32px, 4.4vw, 64px)/.98 var(--font-display); letter-spacing: -0.045em; }

/* ---------- Page heads + footer ---------- */
.page-head__lede { font-size: clamp(17px, 1.4vw, 20px); color: #d4d4d8; }
.site-footer { background: var(--bg); color: #808080; border-top: 1px solid var(--line); }
.site-footer .nav-list a { color: #808080; }
.tabbar { background: color-mix(in srgb, var(--bg) 96%, transparent); }

/* ---------- Customizer: "Colours & type" hooks (inc/customizer.php) ---------- */
h1, h2, h3,
.hero__title, .section-title, .row__title, .card__title, .split__title, .band__title,
.stat__value, .service__title, .case-card__title, .mini-card__title, .key-number,
.next-project__title, .arch__name, .brand {
	font-weight: var(--heading-weight, 800);
}
.hero__title { text-transform: var(--hero-case, uppercase); }

/* Hero playlist: two stacked layers crossfade (hero.js). */
.hero__video { transition: opacity 900ms var(--ease); }
.hero__video.is-active { opacity: 1; }
.hero.is-playing .hero__video:not(.is-active) { opacity: 0; }
.hero.is-playing .hero__glow { opacity: 0; transition: opacity 900ms var(--ease); }
.hero__now {
	position: absolute; right: var(--gutter-x); bottom: clamp(88px, 15vh, 170px);
	display: flex; align-items: center; gap: 10px;
	padding: 8px 14px; border-radius: var(--r-btn);
	background: color-mix(in srgb, var(--bg) 55%, transparent);
	border-left: 3px solid var(--accent);
	font-size: 14px;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero__now[hidden] { display: none; }
.hero__now-label { color: var(--mute); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero__now a { color: #fff; font-weight: 700; text-decoration: none; }
.hero__now a:hover { text-decoration: underline; }
@media (max-width: 767px) { .hero__now { position: static; align-self: flex-start; } }

/* ==========================================================================
   Immersive motion (reveal.js). Only active while <html> has .reveal, which is never set
   for prefers-reduced-motion and is removed again if the script doesn't run.
   ========================================================================== */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* ---------- Video-first intro ---------- */
.hero__cue {
	position: absolute; left: 50%; bottom: 26px; z-index: 2;
	display: flex; flex-direction: column; align-items: center; gap: 10px;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, .8); text-decoration: none;
	font: 700 11px/1 var(--font-body); letter-spacing: .28em; text-transform: uppercase;
	opacity: calc(1 - var(--hero-p, 0) * 5);
}
.hero__cue-line { position: relative; width: 1px; height: 44px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.hero__cue-line::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: #fff; animation: ron-cue 1.8s var(--ease-out) infinite; }
@keyframes ron-cue { to { top: 100%; } }
@media (max-width: 767px) { .hero__cue { display: none; } }

html.reveal-intro .site-header { transition: opacity 900ms var(--ease-out), background-color var(--dur) var(--ease); }
html.reveal-intro:not(.intro-done) .site-header { opacity: 0; pointer-events: none; }
html.reveal-intro .hero__shade { transition: opacity 1400ms var(--ease-out); }
html.reveal-intro:not(.intro-done) .hero__shade { opacity: .45; }  /* footage first, brighter */

html.reveal-intro .hero__content > * {
	transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out);
}
html.reveal-intro .hero:not(.is-revealed) .hero__content > * { opacity: 0; transform: translateY(34px); }
.hero.is-revealed .hero__content > :nth-child(1) { transition-delay: 0ms; }
.hero.is-revealed .hero__content > :nth-child(2) { transition-delay: 120ms; }
.hero.is-revealed .hero__content > :nth-child(3) { transition-delay: 220ms; }
.hero.is-revealed .hero__content > :nth-child(4) { transition-delay: 380ms; }
.hero.is-revealed .hero__content > :nth-child(5) { transition-delay: 480ms; }
.hero.is-revealed .hero__content > :nth-child(n+6) { transition-delay: 600ms; }

/* ---------- Hero parallax (--hero-p: 0 at top → 1 after one screen) ---------- */
html.reveal .hero__media { transform: scale(calc(1 + var(--hero-p, 0) * .12)); transform-origin: 60% 40%; will-change: transform; }
html.reveal .hero__media::after { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: calc(var(--hero-p, 0) * .7); pointer-events: none; }
html.reveal .hero__content { transform: translateY(calc(var(--hero-p, 0) * -90px)); opacity: calc(1 - var(--hero-p, 0) * 1.3); }

/* ---------- Scroll journey ---------- */
html.reveal [data-r] {
	opacity: 0;
	transform: translateY(44px);
	transition: opacity 800ms var(--ease-out) calc(var(--ri, 0) * 90ms), transform 1000ms var(--ease-out) calc(var(--ri, 0) * 90ms);
}
html.reveal .row__item[data-r] { transform: translateX(70px); }
html.reveal .stat[data-r] { transform: translateY(24px); }
/* No clip-path mask here: a fully clipped element has zero visible area, so the
   IntersectionObserver never reports it and the title would stay hidden. */
html.reveal .section-title[data-r], html.reveal .row__title[data-r] { transform: translateY(28px); }
html.reveal .band[data-r], html.reveal .player[data-r], html.reveal .case__hero[data-r] { transform: translateY(60px) scale(.97); }
html.reveal [data-r].is-in { opacity: 1; transform: none; }
html.reveal [data-r].is-in { transition-delay: calc(var(--ri, 0) * 90ms); }
/* After the entrance, cards keep their own hover transitions snappy. */
html.reveal .card[data-r].is-in { transition-duration: 800ms, 1000ms; }

/* ---------- Motion (§6.5) ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.card__link:hover .card__media,
	.card__link:focus-visible .card__media { transform: none; }
	.skeleton { animation: none; }
	.row__track { scroll-behavior: auto; }
	.hero__glow { animation: none; }
	.card__link:hover .card__media, .card__link:focus-visible .card__media { transform: none !important; }
	.case-card__link:hover { transform: none; }
}

/* The #journey scroll target after the hero must not add an extra flex gap. */
.journey-anchor { display: block; height: 0; margin-bottom: calc(var(--section-gap) * -1); scroll-margin-top: var(--header-h); }

/* ==========================================================================
   Immersive v3 (immersive.js). Everything here is scoped to html.immersive, which the
   <head> switch only sets on 768 px+ screens with a mouse/trackpad and no reduced motion
   (and removes again after 4 s if immersive.js never starts).
   ========================================================================== */

/* ---------- Lenis (from lenis@1.1.22/dist/lenis.css) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- Preloader: counter, then three panels lift away ---------- */
.preloader { display: none; }
html.ron-preload { overflow: hidden; }
html.ron-preload .preloader { display: block; position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.preloader__panel {
	position: absolute; top: 0; bottom: 0; width: calc(100% / 3 + 1px); background: var(--bg);
	transition: transform 1000ms cubic-bezier(.76, 0, .24, 1);
}
.preloader__panel:nth-child(1) { left: 0; }
.preloader__panel:nth-child(2) { left: calc(100% / 3); transition-delay: 80ms; }
.preloader__panel:nth-child(3) { left: calc(200% / 3); transition-delay: 160ms; }
.preloader__panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); opacity: .9; }
.preloader__inner {
	position: absolute; left: var(--gutter-x); right: var(--gutter-x); bottom: 48px;
	display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px 24px;
	transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out);
}
.preloader__name { display: inline-flex; align-items: center; gap: 10px; font: var(--heading-weight, 800) 18px/1 var(--font-display); letter-spacing: -0.02em; text-transform: uppercase; }
.preloader__count { font: var(--heading-weight, 800) clamp(96px, 14vw, 220px)/.8 var(--font-display); letter-spacing: -0.06em; color: var(--fg); }
.preloader__bar { grid-column: 1 / -1; height: 2px; background: var(--line-2); overflow: hidden; border-radius: var(--r-pill); }
.preloader__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.preloader.is-done .preloader__inner { opacity: 0; transform: translateY(-30px); }
.preloader.is-done .preloader__panel { transform: translateY(-101%); }

/* ---------- Split-text reveals ---------- */
.st-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.st-i { display: inline-block; transition: transform 1100ms var(--ease-out) calc(var(--wi, 0) * 55ms); }
/* Hero headline: rises word by word when the intro hands over (reveal.js adds .is-revealed). */
html.immersive.reveal-intro .hero:not(.is-revealed) .hero__content > .hero__title.st { opacity: 1; transform: none; }
html.immersive.reveal-intro .hero:not(.is-revealed) .hero__title .st-i { transform: translateY(110%); }
.hero.is-revealed .hero__title .st-i { transition-delay: calc(120ms + var(--wi, 0) * 70ms); }
/* Section titles: words rise instead of the whole block (the block stays observable). */
html.immersive.reveal .section-title.st[data-r] { opacity: 1; transform: none; }
html.immersive.reveal .section-title.st[data-r]:not(.is-in) .st-i { transform: translateY(110%); }

/* ---------- Custom cursor (decorative) ---------- */
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor [data-cursor] { cursor: none; }
html.has-cursor input, html.has-cursor textarea, html.has-cursor select, html.has-cursor [contenteditable] { cursor: auto; }
.cursor { position: fixed; left: 0; top: 0; z-index: 10001; pointer-events: none; opacity: 0; transition: opacity 200ms var(--ease); }
.cursor.is-on { opacity: 1; }
.cursor.is-text { opacity: 0; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; will-change: transform; }
.cursor__dot::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: transform 200ms var(--ease); }
.cursor__ring::before {
	content: ""; position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%;
	border: 1px solid color-mix(in srgb, var(--fg) 45%, transparent);
	transition: transform 320ms var(--ease-out), background-color 240ms var(--ease), border-color 240ms var(--ease);
}
.cursor.is-link .cursor__ring::before { transform: scale(1.45); border-color: var(--accent); }
.cursor.is-down .cursor__ring::before { transform: scale(.8); }
.cursor.has-label .cursor__ring::before { transform: scale(2.6); background: var(--accent); border-color: var(--accent); }
.cursor.has-label .cursor__dot::before { transform: scale(0); }
.cursor__label {
	position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) scale(.6); opacity: 0;
	color: #000; font: 800 12px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
	transition: opacity 200ms var(--ease), transform 320ms var(--ease-out);
}
.cursor.has-label .cursor__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Drag-to-scroll rows */
html.immersive .row__track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
html.immersive .row__track.is-dragging .card__link { pointer-events: none; }

/* ---------- WebGL ---------- */
.hero__gl { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; opacity: 0; transition: opacity 900ms var(--ease); }
.hero.has-gl .hero__gl { opacity: 1; }
.card__gl { position: absolute; inset: 0; z-index: 1; width: 100% !important; height: 100% !important; pointer-events: none; opacity: 0; transition: opacity 260ms var(--ease); }
.card__gl.is-on { opacity: 1; }

/* ---------- Pinned Featured sequence ---------- */
.featured--replaced { display: none !important; }
.fseq { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--bg); isolation: isolate; }
.fseq__stage { position: absolute; inset: 0; }
.fseq__slide { position: absolute; inset: 0; display: flex; align-items: flex-end; will-change: clip-path; }
.fseq__media { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 60%; }
.fseq__img, .fseq__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fseq__video { opacity: 0; transition: opacity 900ms var(--ease); }
.fseq__slide.is-active .fseq__video.is-ready { opacity: 1; }
.fseq__glow { position: absolute; inset: -20%; background: radial-gradient(60% 50% at 70% 40%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), radial-gradient(50% 50% at 20% 70%, color-mix(in srgb, var(--glow-2) 30%, transparent), transparent 70%); animation: ron-drift 16s ease-in-out infinite alternate; }
.fseq__shade { position: absolute; inset: 0; background:
	linear-gradient(90deg, color-mix(in srgb, var(--bg) 85%, transparent) 0%, color-mix(in srgb, var(--bg) 30%, transparent) 50%, transparent 80%),
	linear-gradient(0deg, color-mix(in srgb, var(--bg) 80%, transparent) 0%, transparent 45%); }
.fseq__info { position: relative; z-index: 2; width: 100%; padding-bottom: 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.fseq__num { margin: 0; color: var(--accent); font: 700 13px/1 var(--font-mono); letter-spacing: .1em; }
.fseq__cat { margin: 0; color: var(--accent); font: 800 12px/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; }
.fseq__title { margin: 0; max-width: 16ch; font: var(--heading-weight, 800) clamp(44px, 6.4vw, 108px)/.92 var(--font-display); letter-spacing: -0.045em; text-transform: var(--hero-case, uppercase); }
.fseq__title a { color: inherit; text-decoration: none; }
.fseq__title a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
.fseq__meta { display: flex; margin: 0; color: var(--fg-2); font-size: 17px; font-weight: 500; }
.fseq__meta > span + span::before { content: "\2022"; margin: 0 12px; color: var(--mute); }
.fseq__cta { margin-top: 8px; }
.fseq__head { position: absolute; top: calc(var(--header-h) + 18px); left: 0; right: 0; z-index: 3; pointer-events: none; }
.fseq__head .section-head { pointer-events: auto; }
.fseq__progress { position: absolute; left: 0; right: 0; bottom: 40px; z-index: 3; display: flex; align-items: center; gap: 18px; color: var(--mute); font: 600 13px/1 var(--font-mono); }
.fseq__count b { color: var(--fg); font-weight: 700; }
.fseq__bar { flex: 1; max-width: 320px; height: 2px; background: var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.fseq__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.fseq__hint { margin-left: auto; letter-spacing: .24em; text-transform: uppercase; font-family: var(--font-body); font-size: 11px; font-weight: 700; }
.fseq a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

/* ---------- Page transitions ---------- */
.pt { position: fixed; inset: 0; z-index: 10002; }
.pt__curtain { position: absolute; inset: 0; background: var(--bg); transform: translateY(100%); transition: transform 620ms cubic-bezier(.76, 0, .24, 1) 80ms; }
.pt__curtain::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.pt__zoom {
	position: fixed; background: var(--surface-2) center / cover no-repeat; border-radius: var(--r-card);
	transition: left 640ms cubic-bezier(.76, 0, .24, 1), top 640ms cubic-bezier(.76, 0, .24, 1), width 640ms cubic-bezier(.76, 0, .24, 1), height 640ms cubic-bezier(.76, 0, .24, 1), border-radius 640ms, opacity 300ms var(--ease) 440ms;
}
.pt.is-go .pt__curtain { transform: none; }
.pt.is-go .pt__zoom { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; opacity: 0; }
/* Incoming page: a curtain that lifts by itself (pure CSS, so it can never get stuck). */
html.pt-in body::before {
	content: ""; position: fixed; inset: 0; z-index: 10002; pointer-events: none;
	background: var(--bg); border-bottom: 3px solid var(--accent);
	animation: ron-pt-in 900ms cubic-bezier(.76, 0, .24, 1) 120ms both;
}
@keyframes ron-pt-in { from { transform: none; } to { transform: translateY(-101%); } }
html.pt-in .site-main { animation: ron-pt-main 1100ms var(--ease-out) 200ms both; }
@keyframes ron-pt-main { from { transform: translateY(60px) scale(.985); opacity: .3; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.preloader, .cursor, .pt, .hero__gl, .card__gl { display: none !important; }
	html.pt-in body::before { display: none; }
}

/* ==========================================================================
   One display font everywhere (user, 2026-11-27). The heading font is a Customizer choice
   (default Ailerons: caps only, one regular weight). --display-ls comes with that choice;
   font-synthesis stops browsers faking a bold Ailerons.
   ========================================================================== */
html { font-synthesis-weight: none; }
h1, h2, h3, h4, .brand, .player__error-title, .key-number, .next-project__title, .stat__value, .chart__value,
.section-title, .hero__title, .card__title, .row__title, .split__title, .band__title,
.preloader__name, .preloader__count, .fseq__title, .arch__name, .service__title, .case-card__title, .mini-card__title {
	letter-spacing: var(--display-ls, -0.03em);
}
/* Body text in the chosen body font (Ailerons by default) — form fields and buttons follow it. */
body { letter-spacing: var(--body-ls, normal); }
button, input, select, textarea { font-family: inherit; letter-spacing: inherit; }

/* Project page with one story column and Tools only (client/role/length/brief/result/credits removed). */
.story--single { grid-template-columns: minmax(0, 70ch); }
.tools-credits--single { grid-template-columns: 1fr; }

/* Work "All" view: one section per category (archive-project.php). */
.work--sections { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px); }
.work-section { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: calc(var(--header-h) + 16px); }
.work-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.work-section__empty { margin: 0; padding: 28px 0; }

/* Header dynamics (header.js): compact after scrolling, tucks away on scroll down, back on scroll up;
   an accent underline glides under the hovered nav link and rests under the current page. */
.site-header { transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 450ms cubic-bezier(.16, 1, .3, 1), height 350ms var(--ease); }
.site-header.is-compact { height: calc(var(--header-h) - 10px); }
.site-header.is-hidden { transform: translateY(calc(-100% - env(safe-area-inset-top))); }
.primary-nav { position: relative; }
.nav-list a { position: relative; transition: color var(--dur) var(--ease); }
.nav-list a:hover, .nav-list a:focus-visible { color: #fff; }
.nav-ind {
	position: absolute; left: 0; bottom: 6px; height: 2px; width: 0;
	border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent);
	opacity: 0; pointer-events: none;
	transition: transform 450ms cubic-bezier(.16, 1, .3, 1), width 450ms cubic-bezier(.16, 1, .3, 1), opacity 250ms;
}
.nav-ind.is-on { opacity: 1; }
.nav-ind.is-instant { transition: none; }
@media (prefers-reduced-motion: reduce) {
	.site-header, .nav-ind { transition: none; }
}

/* Ambient particle field (particles.js, every page except Home): a fixed canvas under the content. */
.bg-particles { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
