/* ===================================================================
   HOME 2026 — editing + presentation pass
   Palette (from design-leader feedback):
     warm near-black #111210 · charcoal #1B1D1A · warm white #F5F4EF
     soft gray #A8AAA4 · periwinkle #8B9CFF · light periwinkle #DDE2FF
     mint #A8E6CF (tiny accent only)
   Contrast-safe inks added for text on light sections:
     periwinkle-ink #3F4FC8 (6.0:1 on #F5F4EF) · gray-ink #5E615A (5.7:1)
   Every section sets its own text colours through the .tone-* classes,
   so nothing inherits a colour from the section before it.
   =================================================================== */

@font-face {
	font-family: "Clash Display";
	src: url("../fonts/ClashDisplay-Medium.woff2") format("woff2"),
	     url("../fonts/ClashDisplay-Medium.woff") format("woff");
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: "Clash Display";
	src: url("../fonts/ClashDisplay-Semibold.woff2") format("woff2"),
	     url("../fonts/ClashDisplay-Semibold.woff") format("woff");
	font-weight: 600;
	font-display: swap;
}

:root {
	--black: #111210;
	--charcoal: #1B1D1A;
	--paper: #F5F4EF;
	--gray: #A8AAA4;
	--gray-ink: #5E615A;
	--peri: #8B9CFF;
	--peri-ink: #3F4FC8;
	--peri-pale: #DDE2FF;
	--mint: #A8E6CF;

	--display: "Clash Display", "Inter", system-ui, sans-serif;
	--body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Three sizes only, plus a label size */
	--fs-display: clamp(2.9rem, 6.4vw, 5.75rem);
	--fs-heading: clamp(1.9rem, 3.4vw, 3rem);
	--fs-body: 1.125rem;
	--fs-label: 0.875rem;
	--fs-number: clamp(2rem, 2.6vw, 2.5rem);

	--wrap: 1320px;
	--gutter: clamp(20px, 4vw, 56px);
	--section-y: clamp(96px, 12vw, 176px);
	--radius-lg: 22px;
	--radius-phone: 40px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Tones: explicit text colours for every section ---------- */
.tone-dark {
	--field-line: rgba(245, 244, 239, 0.4);
	--bg: var(--black);
	--fg: var(--paper);
	--fg-muted: var(--gray);          /* 8.0:1 */
	--accent: var(--peri);            /* 7.4:1 */
	--line: rgba(245, 244, 239, 0.12);
	--surface: var(--charcoal);
}
.tone-charcoal {
	--field-line: rgba(245, 244, 239, 0.4);
	--bg: var(--charcoal);
	--fg: var(--paper);
	--fg-muted: var(--gray);          /* 7.2:1 */
	--accent: var(--peri);            /* 6.7:1 */
	--line: rgba(245, 244, 239, 0.12);
	--surface: #242622;
}
.tone-light {
	--field-line: rgba(17, 18, 16, 0.55);
	--bg: var(--paper);
	--fg: var(--black);               /* 17:1 */
	--fg-muted: var(--gray-ink);      /* 5.7:1 */
	--accent: var(--peri-ink);        /* 6.0:1 */
	--line: rgba(17, 18, 16, 0.12);
	--surface: #EAE9E2;
}
.tone-dark, .tone-charcoal, .tone-light {
	background-color: var(--bg);
	color: var(--fg);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
	margin: 0;
	background: var(--black);
	color: var(--paper);
	font-family: var(--body);
	font-size: var(--fs-body);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
ol { margin: 0; padding: 0; }

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

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

.skip-link {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 200;
	padding: 10px 16px;
	background: var(--paper);
	color: var(--black);
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
}
.skip-link:focus { top: 16px; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Nav (always dark) ---------- */
.site-nav {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(17, 18, 16, 0.86);
	backdrop-filter: saturate(140%) blur(14px);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid rgba(245, 244, 239, 0.08);
	color: var(--paper);
}
.site-nav .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 72px;
	gap: 24px;
}
.wordmark {
	font-family: var(--display);
	font-weight: 600;
	font-size: 1.25rem;
	letter-spacing: 0.005em;
	color: var(--paper);          /* 17:1 on the nav */
	text-decoration: none;
	white-space: nowrap;
}
.site-nav_links {
	display: flex;
	align-items: center;
	gap: 36px;
	font-size: 0.975rem;
}
.site-nav_links a {
	color: var(--paper);
	text-decoration: none;
	opacity: 0.86;
	transition: opacity 0.2s;
}
.site-nav_links a:hover { opacity: 1; }
.site-nav_links .btn { opacity: 1; }
.nav-toggle {
	display: none;
	background: none;
	border: 0;
	color: var(--paper);
	padding: 8px;
	cursor: pointer;
}

/* ---------- Buttons & links ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 24px;
	border-radius: 999px;
	font-family: var(--body);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--peri); color: var(--black); }     /* 7.4:1 */
.btn--primary:hover { background: #A3B0FF; }
.btn--ghost { color: var(--fg, var(--paper)); border-color: var(--line, rgba(245,244,239,.2)); background: transparent; }
.btn--ghost:hover { border-color: var(--fg, var(--paper)); }
.site-nav .btn { min-height: 40px; padding: 0 18px; font-size: 0.925rem; }

.text-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--accent);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}
.text-link svg { transition: transform 0.25s var(--ease); }
.text-link:hover svg { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(32px, 4vw, 56px) 0 clamp(56px, 6vw, 88px);
}
.hero::before {
	/* faint instrument grid — the one "system" motif on the page */
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(139, 156, 255, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(139, 156, 255, 0.07) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(ellipse 70% 70% at 72% 45%, #000 20%, transparent 75%);
	-webkit-mask-image: radial-gradient(ellipse 70% 70% at 72% 45%, #000 20%, transparent 75%);
	pointer-events: none;
}
.hero .wrap {
	position: relative;
	display: grid;
	grid-template-areas: ". show" "intro show" "proof show" ". show";
	grid-template-rows: 1fr auto auto 1fr;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	row-gap: 0;
	column-gap: clamp(40px, 6vw, 96px);
	align-items: center;
}
.hero_role {
	font-size: var(--fs-label);
	font-weight: 500;
	color: var(--fg-muted);
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.live-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--mint);
	box-shadow: 0 0 0 4px rgba(168, 230, 207, 0.16);
	flex: none;
}
.hero_name {
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-display);
	line-height: 0.98;
	letter-spacing: -0.02em;
	color: var(--fg);
	margin-bottom: 28px;
}
.hero_line {
	font-size: clamp(1.3rem, 2.1vw, 1.75rem);
	line-height: 1.35;
	color: var(--fg);
	max-width: 26ch;
	text-wrap: balance;
	margin-bottom: 36px;
}
.hero_line em { font-style: normal; color: var(--accent); }

.proof {
	display: grid;
	grid-template-columns: repeat(3, auto);
	justify-content: start;
	gap: 16px clamp(28px, 4vw, 56px);
	padding-top: 28px;
	border-top: 1px solid var(--line);
	margin-bottom: 36px;
}
.proof_value {
	display: block;
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-number);
	line-height: 1;
	color: var(--fg);
	margin-bottom: 10px;
}
.proof_label {
	display: block;
	font-size: var(--fs-label);
	line-height: 1.4;
	color: var(--fg-muted);
	max-width: 17ch;
}
.hero_ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.hero_intro { grid-area: intro; }
.hero_proof { grid-area: proof; align-self: start; }
.hero_showcase { grid-area: show; justify-self: center; width: 100%; max-width: 312px; }
.hero_caption {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: min(90vw, 440px);
	margin-top: 22px;
	font-size: var(--fs-label);
	line-height: 1.5;
	color: var(--fg-muted);
	text-align: center;
}
.hero_caption a { color: var(--accent); font-weight: 600; }

/* ---------- Media frames ---------- */
.media {
	position: relative;
	overflow: hidden;
	background: var(--surface);
	isolation: isolate;
}
.media > img,
.media > video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.media > video {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.6s var(--ease);
}
/* The poster image stays visible until the video is genuinely playing,
   so a missing file never shows as a black box. */
.media.is-playing > video { opacity: 1; }

.media--screen {
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-lg);
	border: 1px solid var(--line);
}
.media--wide { aspect-ratio: 1440 / 774; }

/* Phone frame: thin bezel, 1:2.17 like a current iPhone Pro.
   The screen content is inset and uncropped (object-fit: contain), so the
   rounded corners never cut into the UI. */
.media--phone {
	aspect-ratio: 1 / 2.17;
	border-radius: 48px;
	background: #050505;
	border: 1px solid #3A3B37;
	box-shadow:
		inset 0 0 0 6px #121311,
		0 40px 80px -30px rgba(0, 0, 0, 0.55);
	overflow: hidden;
}
.media--phone::before {
	/* speaker island */
	content: "";
	position: absolute;
	top: 14px;
	left: 50%;
	width: 30%;
	height: 17px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: #1A1B19;
	z-index: 3;
}
.media--phone > img,
.media--phone > video {
	position: absolute;
	top: 40px;
	bottom: 22px;
	left: 12px;
	right: 12px;
	width: calc(100% - 24px);
	height: calc(100% - 62px);
	object-fit: contain;
	border-radius: 10px;
	background: #050505;
}
.tone-light .media--phone {
	box-shadow:
		inset 0 0 0 6px #121311,
		0 40px 70px -34px rgba(17, 18, 16, 0.45);
}
.hero .media--phone {
	box-shadow:
		inset 0 0 0 6px #121311,
		0 0 120px -10px rgba(139, 156, 255, 0.35),
		0 50px 90px -30px rgba(0, 0, 0, 0.7);
}

.phone-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(16px, 3vw, 40px);
	max-width: 620px;
	margin: 0 auto;
}
[data-pair] .phone-pair { display: none; }
[data-pair].is-live .phone-pair { display: grid; }
[data-pair].is-live .pair-still { display: none; }

.phone-pair figcaption,
.media-caption {
	margin-top: 14px;
	font-size: var(--fs-label);
	color: var(--fg-muted);
	text-align: center;
}

/* ---------- Era intro (chapter marker) ---------- */
.era {
	max-width: 780px;
	margin-bottom: clamp(56px, 7vw, 96px);
}
.era_when {
	font-size: var(--fs-label);
	font-weight: 600;
	color: var(--accent);
	margin-bottom: 14px;
}
.era_title {
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-heading);
	line-height: 1.08;
	letter-spacing: -0.01em;
	color: var(--fg);
}
.era_text {
	margin-top: 20px;
	color: var(--fg-muted);
	max-width: 60ch;
}

/* ---------- Project block ---------- */
.section { padding: var(--section-y) 0; }

.project {
	display: grid;
	grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
	gap: clamp(40px, 6vw, 96px);
	align-items: center;
}
.project--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); }
.project--flip .project_media { order: 2; }
.project--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.project_media--phone { max-width: 360px; justify-self: center; width: 100%; }

.project_meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: var(--fs-label);
	margin-bottom: 16px;
}
.project_name { font-weight: 700; color: var(--fg); }
.project_when { color: var(--fg-muted); }

.project_title, .era_title { text-wrap: balance; }
.project_title {
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-heading);
	line-height: 1.08;
	letter-spacing: -0.01em;
	color: var(--fg);
	margin-bottom: 32px;
}
.project_title a { text-decoration: none; }
.project_title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.beats {
	display: grid;
	gap: 18px;
	margin-bottom: 36px;
}
.beat {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}
.beat dt {
	font-size: var(--fs-label);
	font-weight: 600;
	color: var(--accent);
}
.beat dd {
	color: var(--fg);
	line-height: 1.55;
	max-width: 46ch;
}

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
	align-items: start;
	gap: 24px 28px;
	margin-bottom: 36px;
}
.stat_value {
	display: block;
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-number);
	line-height: 1;
	color: var(--fg);
	margin-bottom: 8px;
	white-space: nowrap;
}
.stat--hero { grid-column: 1 / -1; }
.stat--hero .stat_value {
	font-size: clamp(3.4rem, 7vw, 6rem);
	color: var(--accent);
	letter-spacing: -0.02em;
}
.stat_label {
	display: block;
	font-size: var(--fs-label);
	line-height: 1.4;
	color: var(--fg-muted);
	max-width: 20ch;
}

/* ---------- Timeline ---------- */
.section-title {
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-heading);
	line-height: 1.08;
	color: var(--fg);
	margin-bottom: 48px;
}
.timeline { border-top: 1px solid var(--line); }
.timeline li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 8px 32px;
	padding: 24px 0;
	border-bottom: 1px solid var(--line);
	align-items: baseline;
}
.timeline_org { font-weight: 700; color: var(--fg); }
.timeline_role { color: var(--fg); }
.timeline_when { color: var(--fg-muted); font-size: var(--fs-label); text-align: right; }
.timeline_role a { color: var(--accent); font-weight: 600; }
.timeline_actions { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; margin-top: 44px; }
.tone-light .btn--primary { background: var(--black); color: var(--paper); }
.tone-light .btn--primary:hover { background: #2A2C28; }

/* ---------- Contact ---------- */
.contact {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(40px, 6vw, 96px);
	align-items: start;
}
.contact_heading {
	font-family: var(--display);
	font-weight: 600;
	font-size: var(--fs-heading);
	line-height: 1.1;
	color: var(--fg);
	margin-bottom: 36px;
}
.contact_list li { color: var(--fg-muted); margin-bottom: 8px; }
.contact_list a { color: var(--fg); font-weight: 600; }
.contact_socials { display: flex; gap: 28px; margin-top: 28px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .full { grid-column: 1 / -1; }
.form label {
	display: block;
	font-size: var(--fs-label);
	font-weight: 600;
	color: var(--fg);
	margin-bottom: 8px;
}
.form input,
.form textarea {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--fg);
	background: var(--surface);
	border: 1px solid var(--field-line);
	border-radius: 12px;
	padding: 14px 16px;
}
.form textarea { min-height: 160px; resize: vertical; }
.form input::placeholder, .form textarea::placeholder { color: var(--fg-muted); opacity: 1; }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-status {
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: 12px;
	font-size: 0.95rem;
	color: var(--fg);
	background: rgba(168, 230, 207, 0.18);
	border: 1px solid rgba(168, 230, 207, 0.4);
}
.form-status.is-error { background: rgba(255, 155, 143, 0.12); border-color: rgba(255, 155, 143, 0.45); }

/* ---------- Footer ---------- */
.site-footer {
	padding: 32px 0 40px;
	border-top: 1px solid var(--line);
	font-size: var(--fs-label);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer p, .site-footer a { color: var(--fg-muted); }
.site-footer nav { display: flex; gap: 24px; }

/* ---------- Single orchestrated entrance (hero only) ---------- */
@media (prefers-reduced-motion: no-preference) {
	.hero .enter {
		opacity: 0;
		transform: translateY(16px);
		animation: enter 0.9s var(--ease) forwards;
	}
	.hero .enter:nth-child(2) { animation-delay: 0.06s; }
	.hero .enter:nth-child(3) { animation-delay: 0.12s; }
	.hero .enter:nth-child(4) { animation-delay: 0.18s; }
	.hero .enter:nth-child(5) { animation-delay: 0.24s; }
	.hero_showcase.enter { animation-delay: 0.2s; }
}
@keyframes enter { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.btn, .text-link svg { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.project, .project--flip { grid-template-columns: 1fr; }
	.project--flip .project_media { order: 0; }
	.project_media { max-width: 820px; }
	.project_media--phone { max-width: 320px; }
}
@media (max-width: 900px) {
	.hero .wrap { grid-template-columns: 1fr; grid-template-areas: "intro" "show" "proof"; row-gap: 40px; }
	.hero_showcase { max-width: 250px; }
	.hero_line { margin-bottom: 0; }
	.hero .wrap { grid-template-rows: none; }
	.contact { grid-template-columns: 1fr; }
	.timeline li { grid-template-columns: 1fr; }
	.timeline_when { text-align: left; }
}
@media (max-width: 760px) {
	.nav-toggle { display: inline-flex; }
	.site-nav_links {
		display: none;
		position: absolute;
		top: 72px; left: 0; right: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 22px;
		padding: 24px var(--gutter) 32px;
		background: var(--black);
		border-bottom: 1px solid rgba(245, 244, 239, 0.1);
		font-size: 1.125rem;
	}
	.site-nav.is-open .site-nav_links { display: flex; }
	.proof { grid-template-columns: 1fr 1fr; }
	.form { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
	.proof { grid-template-columns: 1fr 1fr; gap: 20px 24px; }
	.phone-pair { gap: 12px; }
	.media--phone { border-radius: 34px; }
	.media--phone::before { top: 10px; height: 12px; }
	.media--phone > img, .media--phone > video { top: 28px; bottom: 14px; left: 8px; right: 8px; width: calc(100% - 16px); height: calc(100% - 42px); }
}

/* Whole project media is a click target for its case study */
.project_media[data-href] { cursor: pointer; }
.project_media[data-href] .media { transition: transform 0.5s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.project_media[data-href]:hover .media { transform: translateY(-4px); }
}

/* ===================================================================
   ATMOSPHERE
   Dark sections borrow the hero's periwinkle halo so the work glows.
   Light sections read like a designer's sketchbook: warm paper,
   a dotted grid, fine grain, and taped-in screens.
   =================================================================== */

/* ---------- Dark: halo behind the work + faint instrument grid ---------- */
.section.tone-dark, .section.tone-charcoal { position: relative; overflow: hidden; isolation: isolate; }
.section.tone-dark::before, .section.tone-charcoal::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(139, 156, 255, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(139, 156, 255, 0.055) 1px, transparent 1px);
	background-size: 64px 64px;
	-webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 10%, transparent 72%);
	mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 10%, transparent 72%);
	pointer-events: none;
}
.project_media { position: relative; }
.tone-dark .project_media::before,
.tone-charcoal .project_media::before {
	content: "";
	position: absolute;
	inset: -14% -10%;
	z-index: -1;
	background: radial-gradient(closest-side, rgba(139, 156, 255, 0.34), rgba(139, 156, 255, 0.10) 55%, transparent 100%);
	pointer-events: none;
}
.tone-dark .media--screen, .tone-charcoal .media--screen {
	box-shadow: 0 0 0 1px rgba(245, 244, 239, 0.08), 0 40px 90px -40px rgba(139, 156, 255, 0.45);
}

/* ---------- Light: sketchbook paper ---------- */
.tone-light {
	background-color: var(--paper);
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.07 0 0 0 0 0.07 0 0 0 0 0.06 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
		radial-gradient(rgba(17, 18, 16, 0.13) 1px, transparent 1.3px);
	background-size: 180px 180px, 24px 24px;
	background-position: 0 0, 12px 12px;
}
.section.tone-light { position: relative; }
.section.tone-light::after {
	/* soft page-edge shading, like a bound notebook */
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 60%, rgba(120, 110, 90, 0.10) 100%);
}
.section.tone-light > .wrap { position: relative; z-index: 1; }

/* taped-in screens */
.tone-light .project_media:has(> .media--screen)::before,
.tone-light .project_media:has(> .media--screen)::after {
	content: "";
	position: absolute;
	z-index: 2;
	width: 92px;
	height: 26px;
	background: rgba(221, 226, 255, 0.78);
	box-shadow: 0 1px 2px rgba(17, 18, 16, 0.12);
	-webkit-mask-image: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px));
	mask-image: linear-gradient(90deg, transparent 0 3px, #000 3px calc(100% - 3px), transparent calc(100% - 3px));
	pointer-events: none;
}
.tone-light .project_media:has(> .media--screen)::before { top: -12px; left: 14%; transform: rotate(-4deg); }
.tone-light .project_media:has(> .media--screen)::after { top: -10px; right: 12%; transform: rotate(3deg); }
.tone-light .media--screen {
	box-shadow: 0 1px 0 rgba(17, 18, 16, 0.06), 0 26px 50px -28px rgba(60, 50, 30, 0.35);
}


@media (max-width: 760px) {
	.tone-light .project_media:has(> .media--screen)::before,
	.tone-light .project_media:has(> .media--screen)::after { width: 64px; height: 20px; }
}

/* Reveal: each project eases in once as it enters (JS adds .js-reveal) */
@media (prefers-reduced-motion: no-preference) {
	.js-reveal .project_copy, .js-reveal .project_media {
		opacity: 0; transform: translateY(24px);
		transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
	}
	.js-reveal .project_media { transition-delay: 0.08s; }
	.js-reveal .is-in .project_copy, .js-reveal .is-in .project_media { opacity: 1; transform: none; }
}

/* ---------- Phone frames sized to the recording (ParkShare, Carbon) ----------
   The frame takes its height from the screen recording itself, so nothing is
   letterboxed or cut. The bottom corners follow the phone's own screen curve. */
.media--phone.media--phone-fit {
	aspect-ratio: auto;
	padding: 40px 11px 12px;
	background: #050505;
}
.media--phone.media--phone-fit > img {
	position: relative;
	inset: auto;
	width: 100%;
	height: auto;
	object-fit: fill;
	border-radius: 6px 6px 36px 36px;
}
.media--phone.media--phone-fit > video {
	top: 40px;
	left: 11px;
	right: 11px;
	bottom: 12px;
	width: calc(100% - 22px);
	height: calc(100% - 52px);
	object-fit: cover;
	border-radius: 6px 6px 36px 36px;
}
.phone-pair { align-items: center; }
@media (max-width: 420px) {
	.media--phone.media--phone-fit { padding: 28px 7px 8px; }
	.media--phone.media--phone-fit > video { top: 28px; left: 7px; right: 7px; bottom: 8px; width: calc(100% - 14px); height: calc(100% - 36px); }
	.media--phone.media--phone-fit > img, .media--phone.media--phone-fit > video { border-radius: 4px 4px 26px 26px; }
}

/* Scrollbar in the site palette (was burgundy) */
html { scrollbar-color: #8B9CFF #111210; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #111210 !important; }
::-webkit-scrollbar-thumb { background: #8B9CFF !important; border-radius: 10px; border: 2px solid #111210; }
::-webkit-scrollbar-thumb:hover { background: #A3B0FF !important; }
::-webkit-scrollbar-corner { background: #111210; }

/* ---------- Nav states (homepage) ---------- */
.site-nav .nav-resume { --fg: var(--paper); --line: rgba(245, 244, 239, 0.35); }
.site-nav_links a.is-active {
	color: #A3B0FF;
	opacity: 1;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 8px;
}
@media (max-width: 760px) {
	.site-nav_links { gap: 0; padding: 8px 0 20px; }
	.site-nav_links > a:not(.btn) {
		width: 100%;
		padding: 16px var(--gutter);
		border-bottom: 1px solid rgba(245, 244, 239, 0.08);
		font-size: 1.25rem;
		font-weight: 500;
		text-decoration: none;
	}
	.site-nav_links a.is-active { box-shadow: inset 3px 0 0 var(--peri); text-decoration: none; }
	.site-nav_links .nav-resume {
		margin: 20px var(--gutter) 0;
		background: transparent;
		border: 1px solid rgba(245, 244, 239, 0.35);
		color: var(--paper);
	}
	.site-nav_links .nav-resume::after { content: "↓"; color: var(--gray); }
}

/* ===================================================================
   3D PHONES
   Each phone is a physical object: angled toward the content, tilting as
   it scrolls past, popping forward at the center of the screen, and (on
   desktop) following the cursor with a glass glare. Driven by JS through
   CSS variables; reduced-motion users get flat, still phones.
   =================================================================== */
.media--phone.is-3d {
	--rx: 0deg; --ry: 0deg; --tz: 0px; --s: 1;
	--gx: 50%; --gy: 0%; --glare: 0;
	transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) scale(var(--s));
	transform-style: preserve-3d;
	will-change: transform;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
	/* metal edge + depth, so it reads as a thick object rather than a flat card */
	box-shadow:
		inset 0 0 0 6px #121311,
		inset 0 0 0 7px rgba(245, 244, 239, 0.06),
		0 1px 0 1px #2C2D29,
		0 3px 0 1px #1D1E1B,
		0 6px 0 1px #141512,
		0 calc(30px + var(--tz) * 0.6) calc(70px + var(--tz)) -26px rgba(0, 0, 0, 0.55);
}
.tone-light .media--phone.is-3d {
	box-shadow:
		inset 0 0 0 6px #121311,
		inset 0 0 0 7px rgba(245, 244, 239, 0.06),
		0 1px 0 1px #2C2D29,
		0 3px 0 1px #1D1E1B,
		0 6px 0 1px #141512,
		0 calc(30px + var(--tz) * 0.6) calc(60px + var(--tz)) -28px rgba(60, 50, 30, 0.45);
}
.hero .media--phone.is-3d {
	box-shadow:
		inset 0 0 0 6px #121311,
		inset 0 0 0 7px rgba(245, 244, 239, 0.06),
		0 1px 0 1px #2C2D29,
		0 3px 0 1px #1D1E1B,
		0 6px 0 1px #141512,
		0 0 120px -10px rgba(139, 156, 255, 0.38),
		0 calc(40px + var(--tz) * 0.6) calc(90px + var(--tz)) -30px rgba(0, 0, 0, 0.7);
}
/* glass glare that slides with the tilt */
.media--phone.is-3d::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 4;
	border-radius: inherit;
	pointer-events: none;
	background: radial-gradient(120% 70% at var(--gx) var(--gy), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
	mix-blend-mode: screen;
	opacity: var(--glare);
	transition: opacity 0.4s ease;
}
.project_media[data-href] .media--phone.is-3d { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.project_media[data-href]:hover .media--phone.is-3d { transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) scale(var(--s)); }
}
.phone-pair, .hero_showcase, .project_media--phone { transform-style: preserve-3d; }

/* ===================================================================
   REAL DEVICES (ParkShare, Carbon)
   The recordings already contain an iPhone 17 Pro frame, so that frame is
   the phone: no drawn bezel, corners clipped to the device's own curve
   (64px on a 378px-wide frame), and the 3D tilt moves the real device.
   =================================================================== */
.media--device {
	aspect-ratio: 378 / 790;
	border-radius: 17.4% / 8.4%;
	background: transparent;
	overflow: hidden;
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.media--device > img,
.media--device > video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}
.media--device > img { position: relative; height: auto; }
.media--device.is-3d {
	--rx: 0deg; --ry: 0deg; --tz: 0px; --s: 1; --gx: 50%; --gy: 0%; --glare: 0;
	transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) scale(var(--s));
	will-change: transform;
	transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
	box-shadow: 0 calc(30px + var(--tz) * 0.6) calc(60px + var(--tz)) -26px rgba(0, 0, 0, 0.6);
}
.tone-light .media--device.is-3d { box-shadow: 0 calc(30px + var(--tz) * 0.6) calc(55px + var(--tz)) -28px rgba(60, 50, 30, 0.5); }
.tone-dark .media--device.is-3d, .tone-charcoal .media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 0 #A3A6AB,
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #93969B,
		calc(var(--ex) * 1.5) calc(var(--ey) * 1.5) 0 0 #83868B,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #73767B,
		calc(var(--ex) * 2.5) calc(var(--ey) * 2.5) 0 0 #63666A,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #535559,
		calc(var(--ex) * 3.5) calc(var(--ey) * 3.5) 0 0 #434548,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #353739,
		0 0 100px -20px rgba(139, 156, 255, 0.4),
		calc(var(--ex) * 5 + 8px) calc(var(--ey) * 5 + 40px) 70px -20px rgba(0, 0, 0, 0.75);
}
.media--device.is-3d::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 4;
	border-radius: inherit;
	pointer-events: none;
	background: radial-gradient(120% 70% at var(--gx) var(--gy), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 55%);
	mix-blend-mode: screen;
	opacity: var(--glare);
}
.phone-pair { gap: clamp(20px, 4vw, 48px); max-width: 600px; }

/* ---------- Physical depth for the real devices ----------
   A stack of offset shadows draws the titanium side of the phone body,
   on whichever side the tilt reveals; plus a slow idle float. */
.media--device.is-3d, .media--phone.is-3d {
	--ex: 0px; --ey: 1.5px; --ty: 0px;
	transform: perspective(1000px) translateY(var(--ty)) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) scale(var(--s));
	transition: none;
}
.media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #9A9DA3,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #7C7F85,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #5F6267,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #45474B,
		calc(var(--ex) * 5) calc(var(--ey) * 5) 0 0 #303235,
		calc(var(--ex) * 6 + 8px) calc(var(--ey) * 6 + 34px) 60px -18px rgba(0, 0, 0, 0.6);
}
.tone-dark .media--device.is-3d, .tone-charcoal .media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #9A9DA3,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #7C7F85,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #5F6267,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #45474B,
		calc(var(--ex) * 5) calc(var(--ey) * 5) 0 0 #303235,
		0 0 100px -20px rgba(139, 156, 255, 0.4),
		calc(var(--ex) * 6 + 8px) calc(var(--ey) * 6 + 40px) 70px -20px rgba(0, 0, 0, 0.75);
}
.tone-light .media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 0 #A3A6AB,
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #93969B,
		calc(var(--ex) * 1.5) calc(var(--ey) * 1.5) 0 0 #83868B,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #73767B,
		calc(var(--ex) * 2.5) calc(var(--ey) * 2.5) 0 0 #63666A,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #535559,
		calc(var(--ex) * 3.5) calc(var(--ey) * 3.5) 0 0 #434548,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #353739,
		calc(var(--ex) * 5 + 8px) calc(var(--ey) * 5 + 34px) 55px -20px rgba(60, 50, 30, 0.5);
}
.media--device { overflow: visible; }
.media--device > img, .media--device > video { overflow: hidden; }

.phone-pair figcaption { margin-top: 26px; position: relative; z-index: 2; }

/* Final depth stack (authoritative): eight thin titanium layers */
.media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 0 #A3A6AB,
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #93969B,
		calc(var(--ex) * 1.5) calc(var(--ey) * 1.5) 0 0 #83868B,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #73767B,
		calc(var(--ex) * 2.5) calc(var(--ey) * 2.5) 0 0 #63666A,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #535559,
		calc(var(--ex) * 3.5) calc(var(--ey) * 3.5) 0 0 #434548,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #353739,
		calc(var(--ex) * 5 + 8px) calc(var(--ey) * 5 + 34px) 60px -18px rgba(0, 0, 0, 0.6);
}
.tone-dark .media--device.is-3d, .tone-charcoal .media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 0 #A3A6AB,
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #93969B,
		calc(var(--ex) * 1.5) calc(var(--ey) * 1.5) 0 0 #83868B,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #73767B,
		calc(var(--ex) * 2.5) calc(var(--ey) * 2.5) 0 0 #63666A,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #535559,
		calc(var(--ex) * 3.5) calc(var(--ey) * 3.5) 0 0 #434548,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #353739,
		0 0 100px -20px rgba(139, 156, 255, 0.4),
		calc(var(--ex) * 5 + 8px) calc(var(--ey) * 5 + 40px) 70px -20px rgba(0, 0, 0, 0.75);
}
.tone-light .media--device.is-3d {
	box-shadow:
		calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 0 #A3A6AB,
		calc(var(--ex) * 1) calc(var(--ey) * 1) 0 0 #93969B,
		calc(var(--ex) * 1.5) calc(var(--ey) * 1.5) 0 0 #83868B,
		calc(var(--ex) * 2) calc(var(--ey) * 2) 0 0 #73767B,
		calc(var(--ex) * 2.5) calc(var(--ey) * 2.5) 0 0 #63666A,
		calc(var(--ex) * 3) calc(var(--ey) * 3) 0 0 #535559,
		calc(var(--ex) * 3.5) calc(var(--ey) * 3.5) 0 0 #434548,
		calc(var(--ex) * 4) calc(var(--ey) * 4) 0 0 #353739,
		calc(var(--ex) * 5 + 8px) calc(var(--ey) * 5 + 34px) 55px -20px rgba(60, 50, 30, 0.5);
}
