/* ==========================================================================
   shai.design v2
   Motif: a designer's canvas. The dot grid from the LucidFlow system map runs
   through the site, and a light follows your cursor across it.
   Dark: lamplight amber. Light: ink and ultramarine.
   ========================================================================== */

:root, [data-theme="dark"] {
  --bg: #0B0D12;
  --surface: #12151C;
  --surface-2: #1A1E28;
  --ink: #EEF0F4;
  --muted: #98A1B2;
  --line: #242936;
  --accent: #FFB547;
  --accent-ink: #1A1305;
  --glow: rgba(255, 181, 71, .14);
  --dot: rgba(255, 255, 255, .075);
  --dot-hot: rgba(255, 181, 71, .95);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 48px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #ECEEF2;
  --ink: #12151C;
  --muted: #5A6273;
  --line: #DCE0E6;
  --accent: #3340E0;
  --accent-ink: #FFFFFF;
  --glow: rgba(51, 64, 224, .1);
  --dot: rgba(18, 21, 28, .1);
  --dot-hot: rgba(51, 64, 224, .9);
  --shadow: 0 1px 2px rgba(18, 21, 28, .06), 0 16px 40px -16px rgba(18, 21, 28, .22);
  color-scheme: light;
}
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 3.6vw, 2.9rem);
  --step-4: clamp(2.7rem, 6.6vw, 6rem);
  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 68px;
  --r-lg: 24px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ok: #22B573;
}

@view-transition { navigation: auto; }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.025em; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .8125rem; letter-spacing: 0; color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: .8125rem; color: var(--muted); margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-weight: 400; letter-spacing: 0; }
.ai-chip { font-family: var(--mono); font-size: .6875rem; font-weight: 500; padding: .15rem .45rem; border-radius: 6px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--r-sm); }
.skip:focus { top: 1rem; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-size: inherit; }
.linklike:hover { color: var(--ink); text-decoration: underline; }

/* Canvas: dot grid, plus a light that follows the pointer --------------------- */
.canvas { position: relative; isolation: isolate; }
.canvas::before, .canvas::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.6px);
  background-size: 24px 24px; background-position: center top;
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.canvas::after {
  background-image: radial-gradient(circle, var(--dot-hot) 1.2px, transparent 1.8px);
  mask-image: radial-gradient(240px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 70%);
  opacity: var(--spot, 0); transition: opacity .4s;
}
.hero::before { mask-image: linear-gradient(to bottom, #000 70%, transparent); }

/* Header ---------------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg) 76%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: .75rem; font-weight: 500; background: var(--ink); color: var(--bg); transition: transform .5s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-weight: 600; letter-spacing: -.01em; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); position: relative; }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.header-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link, .copy-email, .icon-btn { display: inline-flex; align-items: center; gap: .5rem; height: 38px; padding: 0 .85rem; border-radius: 999px; font-size: var(--step--1); font-weight: 500; text-decoration: none; background: transparent; border: 1px solid transparent; cursor: pointer; transition: background .2s, border-color .2s; }
.nav-link:hover, .copy-email:hover, .icon-btn:hover { background: var(--surface-2); }
.nav-link[aria-current="page"] { border-color: var(--line); }
.icon-btn { width: 38px; padding: 0; justify-content: center; }
.icon-btn svg, .copy-email svg { width: 17px; height: 17px; flex: none; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
@media (max-width: 760px) { .status, .nav-hide { display: none; } .copy-email .copy-label { display: none; } .copy-email { width: 38px; padding: 0; justify-content: center; } }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-size: var(--step--1); font-weight: 500; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 48px; padding: 0 1.4rem; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: var(--surface); transition: background .2s, border-color .2s; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; }

/* Hero ------------------------------------------------------------------------ */
.hero { padding: clamp(4.5rem, 12vw, 10rem) 0 clamp(4rem, 9vw, 7rem); overflow-x: clip; }
.hero > .wrap { position: relative; }
.hero .wrap::before { content: ""; position: absolute; z-index: -1; pointer-events: none; left: var(--glow-x, 30%); top: var(--glow-y, 60%); width: min(1100px, 140vw); aspect-ratio: 1; translate: -50% -50%; background: radial-gradient(closest-side, var(--glow), transparent 70%); }
.hero-intro { font-size: var(--step-1); color: var(--muted); margin-bottom: 1.5rem; }
.wave { display: inline-block; transform-origin: 70% 80%; }
.motion .wave { animation: wave 2.4s ease-in-out 1s 1 both; }
@keyframes wave { 0%, 60%, 100% { transform: none; } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-8deg); } }
.hero-title { font-size: var(--step-4); font-weight: 700; letter-spacing: -.05em; line-height: .98; max-width: 21ch; }
.hero-title .line { display: block; }
.hero-sub { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 50ch; margin: 2rem 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-hint { position: absolute; right: 0; bottom: 0; margin: 0; opacity: .8; }
@media (max-width: 760px) { .hero-hint { display: none; } }
.motion .hero-intro, .motion .hero-title .line, .motion .hero-sub, .motion .hero-actions { animation: rise 1s var(--ease) both; }
.motion .hero-title .line:nth-child(2) { animation-delay: .08s; }
.motion .hero-title .line:nth-child(3) { animation-delay: .16s; }
.motion .hero-sub { animation-delay: .26s; }
.motion .hero-actions { animation-delay: .34s; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.mode-switch { display: inline-flex; align-items: center; gap: .3em; font: inherit; letter-spacing: -.04em; padding: .05em .32em .05em .1em; border-radius: 999px; border: .045em solid var(--ink); background: var(--surface); cursor: pointer; white-space: nowrap; transition: border-color .4s, box-shadow .4s; position: relative; top: -.04em; }
.mode-switch .track { position: relative; width: 1.36em; height: .76em; border-radius: 999px; background: var(--surface-2); flex: none; transition: background .4s var(--ease); }
.mode-switch .knob { position: absolute; top: .08em; left: .08em; width: .6em; height: .6em; border-radius: 50%; background: var(--ink); transition: transform .5s var(--ease), background .4s, box-shadow .4s; }
.mode-switch[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 .12em var(--glow), 0 0 1.4em var(--glow); }
.mode-switch[aria-checked="true"] .track { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.mode-switch[aria-checked="true"] .knob { transform: translateX(.6em); background: var(--accent); box-shadow: 0 0 .6em var(--accent); }
.mode-switch:hover .knob { transform: translateX(.08em); }
.mode-switch[aria-checked="true"]:hover .knob { transform: translateX(.52em); }

/* Manifesto: words light up as you scroll ------------------------------------- */
.manifesto { height: 220vh; position: relative; border-top: 1px solid var(--line); }
.manifesto-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; }
.manifesto-text { font-size: clamp(1.8rem, 4.2vw, 3.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; max-width: 24ch; margin: 0; text-wrap: pretty; }
.mw { color: color-mix(in srgb, var(--ink) 16%, transparent); transition: color .35s var(--ease), text-shadow .6s; }
.mw.on { color: var(--ink); }
.mw.hot { color: var(--accent); text-shadow: 0 0 .6em var(--glow); }
html:not(.motion) .manifesto { height: auto; padding: 6rem 0; }
html:not(.motion) .manifesto-sticky { position: static; height: auto; }
html:not(.motion) .mw { color: var(--ink); }

/* Sections -------------------------------------------------------------------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: 2.5rem; }
.section-title { font-size: var(--step-3); letter-spacing: -.04em; }
.section-note { margin: 0; }
.section-link { font-weight: 600; }

/* Work: stacking cards with live previews ------------------------------------- */
.work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; }
.project { position: sticky; top: calc(var(--header-h) + 16px + var(--i, 0) * 12px); }
.project-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; min-height: min(74vh, 600px); padding: clamp(1.5rem, 3.5vw, 2.75rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: border-color .3s; }
.project-card:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.project-title { font-size: clamp(1.6rem, 2.8vw, 2.4rem); letter-spacing: -.035em; margin-bottom: 1rem; }
.project-summary { color: var(--muted); max-width: 42ch; }
.project-cta { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; font-weight: 600; }
.project-cta svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.project-card:hover .project-cta svg { transform: translateX(4px); }
.project-media { position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; }
.project-media::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.5px); background-size: 18px 18px; }
.project-media > img, .project-media > video { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .9s var(--ease); }
.project-card:hover .project-media > img, .project-card:hover .project-media > video { transform: scale(1.03); }
@media (min-width: 861px) { .motion .project-card { transform-origin: 50% 0; transform: scale(calc(1 - var(--q, 0) * .06)); filter: brightness(calc(1 - var(--q, 0) * .25)); } }
@media (max-width: 860px) { .project { position: static; } .project-card { grid-template-columns: 1fr; min-height: 0; } .project-media { order: -1; } }

[data-tilt] { transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)); transition: transform .5s var(--ease); }
[data-tilt].is-tilting { transition: transform .12s linear; }

.cursor { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; padding: .5rem .85rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: var(--step--1); font-weight: 600; white-space: nowrap; transform: translate(-50%, -50%) scale(.4); opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.cursor.is-active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* Mini previews (loop only while visible: .is-live) */
.mini { position: relative; width: 82%; font-size: .8125rem; }
.mini *, .mini { animation-play-state: paused; }
.is-live .mini, .is-live .mini * { animation-play-state: running; }
.spark { width: 13px; height: 13px; flex: none; display: inline-block; background: var(--accent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.mini-unstuck { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: center; }
.mu-journal, .mu-card { border-radius: 12px; padding: .9rem; background: var(--surface); border: 1px solid var(--line); display: grid; gap: .45rem; position: relative; }
.mu-journal span { font-weight: 600; color: var(--muted); }
.mu-journal i, .mu-card i { display: block; height: 7px; border-radius: 4px; background: var(--line); }
.mu-journal i { animation: mu-blur 5s var(--ease) infinite; }
.mu-journal i:nth-of-type(2) { width: 80%; } .mu-journal i:nth-of-type(4) { width: 60%; }
.mu-journal b { position: absolute; right: .6rem; top: .7rem; font-size: .6875rem; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-2); animation: mu-fade 5s var(--ease) infinite; }
.mu-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); animation: mu-card 5s var(--ease) infinite; }
.mu-card strong { display: flex; align-items: center; gap: .4rem; }
.mu-card i { background: color-mix(in srgb, var(--accent) 30%, var(--line)); transform-origin: left; animation: mu-line 5s var(--ease) infinite; }
.mu-card i:nth-of-type(2) { animation-delay: .15s; } .mu-card i:nth-of-type(3) { width: 70%; animation-delay: .3s; }
@keyframes mu-blur { 0%, 20% { filter: none; } 35%, 90% { filter: blur(3px); } 100% { filter: none; } }
@keyframes mu-fade { 0%, 25% { opacity: 0; } 35%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mu-card { 0%, 30% { opacity: .25; transform: translateX(8px); } 42%, 92% { opacity: 1; transform: none; } 100% { opacity: .25; } }
@keyframes mu-line { 0%, 40% { transform: scaleX(0); } 55%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }

.mini-ledger { width: 76%; display: grid; gap: .55rem; }
.mini-ledger > * { animation: ml-step 7s var(--ease) infinite both; }
.ml-bubble { justify-self: end; background: var(--ink); color: var(--bg); padding: .5rem .75rem; border-radius: 12px 12px 4px 12px; }
.ml-diff { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; animation-delay: .8s; }
.ml-diff s { color: var(--muted); } .ml-diff b { color: var(--ok); }
.ml-btn { justify-self: start; background: var(--accent); color: var(--accent-ink); padding: .35rem .8rem; border-radius: 999px; font-weight: 600; animation-name: ml-press; animation-delay: 1.6s; }
.ml-row { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); animation-name: ml-flash; animation-delay: 2.4s; }
.ml-row em { font-style: normal; font-size: .75rem; color: var(--accent); }
@keyframes ml-step { 0% { opacity: 0; transform: translateY(8px); } 8%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ml-press { 0% { opacity: 0; } 8% { opacity: 1; transform: none; } 14% { transform: scale(.92); } 20%, 88% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes ml-flash { 0% { opacity: 0; transform: translateY(8px); } 8% { opacity: 1; transform: none; background: color-mix(in srgb, var(--ok) 22%, var(--surface)); } 40%, 88% { opacity: 1; background: var(--surface); } 100% { opacity: 0; } }

.mini-radar { width: 70%; overflow: visible; }
.mr-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.mr-shape { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 10px var(--glow)); }

/* Principles ------------------------------------------------------------------ */
.principles-band { background: var(--surface); border-block: 1px solid var(--line); }
.principles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.principles li { padding-top: 1.25rem; border-top: 1px solid var(--line); position: relative; }
.principles li::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--accent); transition: width 1.2s var(--ease) .2s; }
.principles li.is-in::before { width: 100%; }
html:not(.motion) .principles li::before { width: 100%; }
.principles h3 { font-size: var(--step-1); margin: .75rem 0 .5rem; }
.principles p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* Earlier work ---------------------------------------------------------------- */
.earlier { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.earlier li { display: grid; grid-template-columns: 1.3fr 1fr 2.6fr auto; gap: .5rem 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: padding .4s var(--ease); }
.earlier li:hover { padding-left: .75rem; }
.er-org { font-weight: 600; }
.er-role, .er-what { color: var(--muted); }
@media (max-width: 860px) { .earlier li { grid-template-columns: 1fr auto; } .er-what { grid-column: 1 / -1; } .er-role { grid-column: 1; } }

/* Recommendations ------------------------------------------------------------- */
.recs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.rec figure { margin: 0; height: 100%; display: flex; flex-direction: column; gap: 1.5rem; padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.rec blockquote { margin: 0; }
.rec-pull { font-size: clamp(1.3rem, 2.1vw, 1.65rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.28; margin: 0 0 1rem; }
.rec details { color: var(--muted); font-size: .9375rem; }
.rec summary { cursor: pointer; font-family: var(--mono); font-size: .8125rem; color: var(--ink); width: fit-content; }
.rec details p { margin: .75rem 0 0; line-height: 1.6; }
.rec figcaption { display: flex; align-items: center; gap: .85rem; margin-top: auto; }
.rec img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.quote-name { font-weight: 600; display: block; line-height: 1.3; }
.quote-role { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 760px) { .recs { grid-template-columns: 1fr; } }

/* Footer ---------------------------------------------------------------------- */
.site-footer { padding: clamp(5rem, 11vw, 9rem) 0 2.5rem; border-top: 1px solid var(--line); overflow-x: clip; }
.footer-lede { font-size: var(--step-1); color: var(--muted); margin-bottom: .75rem; }
.footer-email { display: inline-block; font-size: clamp(2rem, 6.6vw, 5.4rem); font-weight: 700; letter-spacing: -.05em; line-height: 1.05; text-decoration: none; word-break: break-word; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 .06em no-repeat; transition: background-size .6s var(--ease), color .3s; padding-bottom: .06em; }
.footer-email:hover { background-size: 100% .06em; color: var(--accent); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; margin-top: 3.5rem; color: var(--muted); font-size: var(--step--1); }
.footer-row p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* Case study ------------------------------------------------------------------ */
.progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); box-shadow: 0 0 12px var(--accent); }
.cs-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 3rem; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); text-decoration: none; font-weight: 500; margin-bottom: 2.5rem; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.back-link:hover svg { transform: translateX(-3px); }
.cs-title { font-size: clamp(2.4rem, 5.4vw, 4.75rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; max-width: 18ch; }
.cs-title .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.cs-title .w > span { display: inline-block; }
.motion .cs-title .w > span { animation: word-up .9s var(--ease) both; animation-delay: calc(var(--i) * 50ms + 80ms); }
@keyframes word-up { from { transform: translateY(105%); } }
.cs-lead { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 62ch; margin-top: 1.75rem; }
.motion .cs-lead, .motion .facts, .motion .tldr { animation: rise .9s var(--ease) both; }
.motion .cs-lead { animation-delay: .35s; } .motion .facts { animation-delay: .45s; } .motion .tldr { animation-delay: .55s; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 2.5rem 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: 1rem 1.25rem 1rem 0; }
.facts dt { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.facts dd { margin: .2rem 0 0; font-weight: 600; }
.tldr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 0; }
.tldr div { padding: 1.2rem 1.3rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.tldr dt { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-bottom: .35rem; }
.tldr dd { margin: 0; font-weight: 500; line-height: 1.45; }
.tldr div:last-child { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 4px var(--glow); }
@media (max-width: 860px) { .tldr { grid-template-columns: 1fr; } }

.cs-hero { margin: 0 0 clamp(3rem, 7vw, 6rem); }
.frame { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.frame .zoom { border: 0; border-radius: 0; }
.tilt { perspective: 2400px; }
.motion .tilt .frame { transform-origin: 50% 100%; transform: translateY(calc((1 - var(--p, 1)) * -3%)) rotateX(calc((1 - var(--p, 1)) * -26deg)) scale(calc(.94 + var(--p, 1) * .06)); will-change: transform; }

.cs-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); padding-bottom: 5rem; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .9375rem; line-height: 1.35; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 960px) { .cs-body { grid-template-columns: 1fr; } .toc { display: none; } }

.prose { max-width: 68ch; min-width: 0; }
.prose > section { padding-bottom: 3.5rem; }
.prose > section + section { padding-top: 3.5rem; border-top: 1px solid var(--line); }
.prose > section.wide { max-width: none; width: min(calc(100vw - 2 * var(--gutter) - 200px - clamp(2rem, 6vw, 5rem)), 1000px); }
@media (max-width: 960px) { .prose > section.wide { width: auto; } }
.prose h2 { font-size: var(--step-3); letter-spacing: -.04em; margin-bottom: 1.25rem; }
.prose h3 { font-size: var(--step-1); margin: 2rem 0 .6rem; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.prose ul { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.prose li { margin-bottom: .55rem; padding-left: .25rem; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }

.figure { margin: 2.5rem 0; }
.zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); cursor: zoom-in; position: relative; }
.zoom img { width: 100%; transition: transform .6s var(--ease); }
.zoom:hover img { transform: scale(1.015); }
.figure figcaption { margin-top: .85rem; font-family: var(--mono); font-size: .8125rem; color: var(--muted); }
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 640px) { .shot-grid { grid-template-columns: 1fr; } }
.motion [data-reveal] { clip-path: inset(8% 5% 8% 5% round 16px); opacity: 0; transform: translateY(28px); transition: clip-path 1.1s var(--ease), opacity .7s var(--ease), transform 1.1s var(--ease); }
.motion [data-reveal].is-in { clip-path: inset(-20px -20px -20px -20px round 0); opacity: 1; transform: none; }
.motion .principles [data-reveal], .motion .principles li[data-reveal] { clip-path: none; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; padding: 0 !important; list-style: none; }
.metrics li { padding: 1.25rem !important; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin: 0; }
.metrics li::marker { content: none; }
.metrics .num { display: block; white-space: nowrap; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; color: var(--ink); margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.metrics .lbl { font-size: var(--step--1); color: var(--muted); line-height: 1.45; }

.next-project { display: grid; gap: .5rem; padding: clamp(2rem, 5vw, 3.5rem); margin-bottom: 4rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .3s; }
.next-project:hover { border-color: var(--accent); }
.next-project .eyebrow { margin: 0; }
.np-title { font-size: var(--step-3); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; display: flex; align-items: center; gap: .75rem; }
.next-project svg { width: .8em; height: .8em; flex: none; transition: transform .3s var(--ease); }
.next-project:hover svg { transform: translateX(6px); }

/* Lightbox -------------------------------------------------------------------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; }
.lightbox::backdrop { background: rgba(6, 8, 12, .94); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; }
.lb-count { font-family: var(--mono); font-size: .8125rem; opacity: .7; }
.lb-stage { display: grid; place-items: center; padding: 0 4.5rem; min-height: 0; overflow: auto; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-caption { text-align: center; padding: 1rem 1.25rem 1.5rem; font-size: var(--step--1); opacity: .8; margin: 0; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-prev, .lb-next { position: fixed; top: 50%; translate: 0 -50%; }
.lb-prev { left: 1rem; } .lb-next { right: 1rem; }
@media (max-width: 640px) { .lb-stage { padding: 0 .75rem; } .lb-prev, .lb-next { top: auto; bottom: 1rem; translate: none; } }

/* Demos ----------------------------------------------------------------------- */
.demo { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: var(--shadow); }
.demo-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.demo-top p { margin: 0; color: var(--muted); font-size: var(--step--1); max-width: 56ch; }
.demo-reset { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .4rem .9rem; font-family: var(--mono); font-size: .75rem; cursor: pointer; }
.demo-reset:hover { border-color: var(--ink); }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: .5rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9375rem; cursor: pointer; color: var(--muted); transition: color .3s; }
.seg button[aria-checked="true"] { color: var(--bg); }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--ink); transform: translateX(calc(var(--seg, 0) * 100%)); transition: transform .5s var(--ease); }

.u-stage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
.u-journal { position: relative; border-radius: var(--r-md); background: var(--surface-2); padding: 1.25rem; overflow: hidden; }
.u-label { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin: 0 0 .75rem; }
.u-journal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; transition: filter .6s var(--ease), opacity .6s; }
.u-journal li p { margin: .15rem 0 0; line-height: 1.5; }
.u-day { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.u-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; font-weight: 600; opacity: 0; transform: scale(.96); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
.u-lock svg { width: 28px; height: 28px; padding: 10px; box-sizing: content-box; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); }
.u-stage:not([data-as="athlete"]) .u-journal ul { filter: blur(7px); opacity: .5; user-select: none; }
.u-stage:not([data-as="athlete"]) .u-lock { opacity: 1; transform: none; }
.u-synth { border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); padding: 1.25rem; height: 100%; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.motion .u-synth:not([hidden]) { animation: rise .6s var(--ease); }
.motion .u-synth:not([hidden]) li { animation: rise .6s var(--ease) both; }
.motion .u-synth:not([hidden]) li:nth-child(2) { animation-delay: .08s; } .motion .u-synth:not([hidden]) li:nth-child(3) { animation-delay: .16s; }
.u-synth-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-weight: 700; margin: 0 0 .75rem; }
.u-synth ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .5rem; }
.u-rec { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-weight: 600; font-size: .9375rem; }
.u-badge { font-family: var(--mono); font-size: .6875rem; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 400; }
.u-spark { width: 14px; height: 14px; flex: none; display: inline-block; background: var(--accent); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@media (max-width: 760px) { .u-stage { grid-template-columns: 1fr; } .seg { width: 100%; } }

.l-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; }
.l-chat { display: grid; grid-template-rows: 1fr auto; border-radius: var(--r-md); background: var(--surface-2); min-height: 340px; overflow: hidden; }
.l-log { padding: 1rem; display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; max-height: 380px; }
.l-msg { max-width: 88%; padding: .6rem .85rem; border-radius: 14px; font-size: .9375rem; line-height: 1.45; }
.l-msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.l-msg.you { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.motion .l-msg { animation: rise .45s var(--ease) both; }
.l-typing { display: inline-flex; gap: 4px; }
.l-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.l-typing i:nth-child(2) { animation-delay: .15s; } .l-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.l-diff { margin-top: .6rem; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; font-size: .875rem; }
.l-diff div { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; padding: .45rem .7rem; border-top: 1px solid var(--line); align-items: center; }
.l-diff div:first-child { border-top: 0; }
.l-diff s { color: var(--muted); }
.l-diff b { color: var(--ok); font-variant-numeric: tabular-nums; }
.l-actions { display: flex; gap: .5rem; margin-top: .7rem; }
.l-actions button { border-radius: 999px; padding: .45rem .95rem; font-weight: 600; font-size: .875rem; cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.l-actions .l-confirm { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.l-input { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); background: var(--surface); }
.l-input input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .9rem; font: inherit; font-size: .9375rem; background: var(--bg); color: var(--ink); }
.l-send { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; flex: none; }
.l-send svg { width: 18px; height: 18px; }
.l-send:disabled { opacity: .35; cursor: default; }
.l-table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.l-table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 440px; }
.l-table th { text-align: left; font-family: var(--mono); font-size: .75rem; color: var(--muted); font-weight: 400; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.l-table td { padding: .75rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.l-table tr:last-child td { border-bottom: 0; }
.l-table td span:not(.who) { display: block; color: var(--muted); font-size: .8125rem; }
.who { display: inline-block; font-family: var(--mono); font-size: .6875rem; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.who.ai { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.l-table tr.flash td { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--ok) 20%, transparent); } }
@media (max-width: 860px) { .l-grid { grid-template-columns: 1fr; } }

/* Radar playground */
.radar { overflow: hidden; }
.rd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.rd-svg { width: 100%; max-width: 460px; margin: 0 auto; overflow: visible; }
.rd-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.rd-axes line { stroke: var(--line); stroke-width: 1; }
.rd-shape { fill: color-mix(in srgb, var(--accent) 20%, transparent); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 14px var(--glow)); transition: points .5s var(--ease); }
.rd-points circle { fill: var(--accent); }
.rd-label { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.rd-label.low { fill: var(--accent); font-weight: 500; }
.rd-score { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.rd-score-n { font-size: clamp(3rem, 7vw, 5rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.rd-score-d { color: var(--muted); }
.rd-growth { margin: .75rem 0 1.25rem; }
.rd-growth strong { color: var(--accent); }
.rd-sliders { display: grid; gap: .55rem; }
.rd-row { display: grid; grid-template-columns: 1fr 1.2fr 1.5rem; gap: .75rem; align-items: center; font-size: .875rem; }
.rd-row output { font-family: var(--mono); text-align: right; }
.rd-row input { accent-color: var(--accent); width: 100%; }
@media (max-width: 760px) { .rd-grid { grid-template-columns: 1fr; } }

/* Diagram: zoomable system map ------------------------------------------------ */
.diagram { display: grid; gap: 1rem; margin: 2rem 0 1rem; }
.dg-canvas { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #FBFBFA; aspect-ratio: 2110 / 1442; }
.dg-world { position: absolute; inset: 0; transform-origin: 0 0; transform: translate(var(--tx, 0%), var(--ty, 0%)) scale(var(--z, 1)); transition: transform 1s var(--ease); }
.dg-world img { width: 100%; height: 100%; }
.dg-dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: .75rem; font-weight: 500; cursor: pointer; display: grid; place-items: center; transform: scale(calc(1 / var(--z, 1))); transition: transform 1s var(--ease); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
[data-theme="light"] .dg-dot { background: #12151C; color: #fff; }
.motion .dg-dot { animation: pulse 2.4s var(--ease) infinite; }
.dg-dot.is-active { background: var(--ink); color: var(--bg); }
[data-theme="light"] .dg-dot.is-active { background: var(--accent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 14px transparent; } }
.dg-reset { position: absolute; right: 12px; top: 12px; font-family: var(--mono); font-size: .75rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid #DDD; background: #fff; color: #12151C; cursor: pointer; opacity: 0; transition: opacity .3s; }
.diagram.is-zoomed .dg-reset { opacity: 1; }
.dg-list { list-style: none; margin: 0; padding: 0 !important; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; align-items: start; }
.dg-list li { margin: 0 !important; padding: 0 !important; }
.dg-list li::marker { content: none; }
.dg-item { display: grid; grid-template-columns: auto 1fr; gap: .1rem .75rem; text-align: left; width: 100%; padding: .7rem .85rem; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; cursor: pointer; transition: background .25s, border-color .25s; }
.dg-item:hover { background: var(--surface); }
.dg-item.is-active { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.dg-n { font-family: var(--mono); font-size: .75rem; color: var(--accent); grid-row: span 2; padding-top: .15rem; }
.dg-t { font-weight: 600; }
.dg-d { grid-column: 2; color: var(--muted); font-size: .875rem; line-height: 1.45; display: none; }
.dg-item.is-active .dg-d { display: block; }
@media (max-width: 760px) { .dg-list { grid-template-columns: 1fr; } }

/* Flow: pinned screen, scrolling steps ---------------------------------------- */
.flow { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 1rem; }
.flow-copy { list-style: none; margin: 0; padding: 0 !important; }
.flow-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 0 !important; margin: 0 !important; opacity: .28; transition: opacity .5s var(--ease); }
.flow-step.is-active { opacity: 1; }
.flow-step::marker { content: none; }
.flow-step h3 { font-size: var(--step-2); letter-spacing: -.03em; margin: .5rem 0 .75rem; }
.flow-step p { margin: 0; }
.flow-n { font-family: var(--mono); font-size: .8125rem; color: var(--accent); }
.flow-inline { display: none; }
.flow-sticky { position: sticky; top: calc(var(--header-h) + 8vh); aspect-ratio: 1440 / 1024; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #1D2040; box-shadow: var(--shadow); }
.flow-frame { position: absolute; inset: 0; border: 0; border-radius: 0; opacity: 0; transform: scale(1.04) translateY(12px); transition: opacity .7s var(--ease), transform .9s var(--ease); pointer-events: none; }
.flow-frame.is-active { opacity: 1; transform: none; pointer-events: auto; }
.flow-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr; }
  .flow-media { display: none; }
  .flow-step { min-height: 0; opacity: 1; padding-bottom: 2.5rem !important; }
  .flow-inline { display: block; margin-top: 1.25rem; border-radius: var(--r-md); border: 1px solid var(--line); }
}
html:not(.motion) .flow-step { opacity: 1; }

/* MacBook reveal (from the original Framer page) ------------------------------ */
.mac { position: relative; height: 320vh; background: #000; color: #fff; }
.mac-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.mac-copy { position: absolute; left: 0; right: 0; top: calc(var(--header-h) + clamp(1.5rem, 6vh, 4rem)); text-align: center; padding-inline: 1.5rem; z-index: 3; pointer-events: none; }
.mac-copy-1 { opacity: calc(1 - var(--c1, 0)); transform: translateY(calc(var(--c1, 0) * -40px)); }
.mac-copy-2 { opacity: var(--c2, 0); transform: translateY(calc((1 - var(--c2, 0)) * 24px)); top: auto; bottom: clamp(1.5rem, 7vh, 4.5rem); }
.mac-kicker { color: #FFB547; font-family: var(--mono); font-size: .875rem; margin: 0 0 .75rem; }
.mac-title { font-size: clamp(2rem, min(5vw, 7vh), 4.25rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; margin: 0 auto; max-width: 15ch; text-wrap: balance; }
.mac-copy-2 .mac-title { font-size: clamp(1.6rem, 3.6vw, 2.75rem); }
.mac-sub { color: rgba(255, 255, 255, .62); max-width: 44ch; margin: .75rem auto 0; font-size: var(--step-1); }
.mac-device { container-type: inline-size; position: relative; width: min(1100px, 94vw, 150vh); aspect-ratio: 750 / 405; translate: 0 calc((1 - var(--open, 0)) * 16vh - var(--open, 0) * 5vh); scale: calc(.78 + var(--open, 0) * .22); }
.mac-base, .mac-wall, .mac-keys { position: absolute; left: 0; top: 0; width: 100%; height: 100%; mix-blend-mode: screen; pointer-events: none; transform: translateY(calc(var(--open, 0) * 22cqw)) scale(calc(1 - var(--open, 0) * .08)); opacity: calc(1 - var(--open, 0) * .82); }
.mac-base, .mac-wall { object-fit: cover; }
.mac-wall { opacity: calc(1 - var(--open, 0) * 1.6); }
.mac-keys { opacity: calc(var(--keys, 0) * (1 - var(--open, 0) * .82)); filter: drop-shadow(0 0 .35cqw rgba(255, 255, 255, .9)) drop-shadow(0 0 1.2cqw rgba(160, 190, 255, .55)); }
.mac-screen { position: absolute; left: 50%; top: 50%; z-index: 2; width: 81.866cqw; aspect-ratio: 614 / 384; margin-left: -40.933cqw; margin-top: -25.6cqw; border-radius: 1.33cqw; overflow: hidden; background: #0b0d12; transform-origin: 50% 50%; transform: perspective(266.67cqw) translateY(calc((1 - var(--open, 0)) * -10.13cqw)) scale(calc(1.11 - var(--open, 0) * .11)) rotateX(calc((1 - var(--open, 0)) * -62deg)); box-shadow: 0 0 0 1px rgba(255, 255, 255, calc(var(--open, 0) * .12)), 0 4cqw 10cqw rgba(0, 0, 0, calc(var(--open, 0) * .8)); will-change: transform; }
.mac-screen video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
@media (max-width: 760px) { .mac { height: 240vh; } .mac-device { width: 112vw; translate: 0 calc((1 - var(--open, 0)) * 6vh); } .mac-sub { font-size: 1rem; } }
html:not(.motion) .mac { height: auto; }
html:not(.motion) .mac-sticky { position: static; height: auto; padding: 4rem 0 3rem; display: flex; flex-direction: column; gap: 2rem; }
html:not(.motion) .mac-copy { position: static; opacity: 1; transform: none; }
html:not(.motion) .mac-device { --open: 1; translate: none; scale: none; aspect-ratio: auto; }
html:not(.motion) .mac-base, html:not(.motion) .mac-wall, html:not(.motion) .mac-keys { display: none; }
html:not(.motion) .mac-screen { position: relative; left: auto; top: auto; margin: 0 auto; transform: none; }

/* Resume ---------------------------------------------------------------------- */
.resume-head { padding: clamp(3rem, 7vw, 5rem) 0 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
.resume-head h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -.05em; line-height: .98; }
.resume-role { font-size: var(--step-2); color: var(--muted); margin-top: .5rem; font-weight: 500; }
.resume-summary { font-size: var(--step-1); line-height: 1.55; max-width: 62ch; color: color-mix(in srgb, var(--ink) 84%, var(--muted)); margin: 0 0 3rem; }
.resume-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 760px) { .resume-head { grid-template-columns: 1fr; } }
.timeline { list-style: none; padding: 0; margin: 0 0 3rem; border-top: 1px solid var(--line); }
.job { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem 3rem; padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
.job-when { padding-top: .4rem; margin: 0; }
.job h2 { font-size: var(--step-2); letter-spacing: -.03em; }
.job-org { color: var(--muted); font-weight: 500; margin: .2rem 0 1rem; }
.job ul { margin: 0; padding-left: 1.1rem; max-width: 70ch; }
.job li { margin-bottom: .45rem; color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.job li::marker { color: var(--accent); }
.job-link { display: inline-block; margin-top: 1rem; font-weight: 600; }
.edu { padding-bottom: 5rem; max-width: 70ch; }
@media (max-width: 760px) { .job { grid-template-columns: 1fr; } }

.nf { min-height: 60vh; display: grid; align-content: center; padding: 6rem 0; }
.nf h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -.05em; margin-bottom: 1rem; }
.nf p { color: var(--muted); }

/* Reduced motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* Print ----------------------------------------------------------------------- */
@media print {
  :root, [data-theme] { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --muted: #444; --line: #ccc; --accent: #000; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .site-header, .site-footer, .toast, .cursor, .progress, .toc, .resume-actions, .skip, .next-project, .back-link { display: none !important; }
  .resume-head { padding: 0 0 12pt; } .resume-head h1 { font-size: 26pt; } .resume-role { font-size: 13pt; }
  .resume-summary { font-size: 10.5pt; margin-bottom: 14pt; }
  .job { grid-template-columns: 120pt 1fr; padding: 10pt 0; gap: 4pt 16pt; break-inside: avoid; }
  .job h2 { font-size: 12.5pt; } .job-org { margin: 0 0 4pt; } .job li { margin-bottom: 2pt; }
  .print-contact { display: block !important; }
  a { text-decoration: none; }
}
.print-contact { display: none; margin-top: 6pt; font-size: 10pt; }

/* v3: process blocks ---------------------------------------------------------- */
.insights { list-style: none; margin: 1.75rem 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.insights li { margin: 0 !important; padding: 1.15rem 1.2rem !important; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .4rem; align-content: start; }
.insights li::marker { content: none; }
.in-t { font-weight: 600; color: var(--ink); display: flex; gap: .5rem; align-items: center; }
.in-t::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent); }
.in-d { color: var(--muted); font-size: .9375rem; line-height: 1.5; }

.steps { list-style: none; margin: 1.75rem 0 !important; padding: 0 !important; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1rem; position: relative; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1px; background: var(--line); }
.steps::after { content: ""; position: absolute; left: 0; top: 14px; height: 1px; width: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.6s var(--ease); }
.steps.is-in::after { transform: scaleX(1); }
html:not(.motion) .steps::after { transform: scaleX(1); }
.steps li { margin: 0 !important; padding: 0 !important; display: grid; gap: .35rem; align-content: start; position: relative; }
.steps li::marker { content: none; }
.st-n { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: .6875rem; background: var(--bg); border: 1px solid var(--line); color: var(--muted); position: relative; z-index: 1; margin-bottom: .5rem; transition: border-color .4s, color .4s, background .4s; transition-delay: calc(var(--d, 0) * 1ms); }
.steps.is-in .st-n { border-color: var(--accent); color: var(--accent); }
.st-t { font-weight: 600; color: var(--ink); }
.st-d { color: var(--muted); font-size: .875rem; line-height: 1.5; }
@media (max-width: 760px) {
  .steps { grid-auto-flow: row; gap: 1.25rem; padding-left: 2.6rem !important; }
  .steps::before, .steps::after { left: 14px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .steps::after { transform-origin: 50% 0; transform: scaleY(0); }
  .steps.is-in::after { transform: scaleY(1); }
  .st-n { position: absolute; left: -2.6rem; top: -.2rem; margin: 0; }
}

.tradeoffs { display: grid; gap: 1rem; margin: 1.75rem 0; }
.to { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.to-col { padding: 1.1rem 1.25rem; }
.to-col p, .to-why { margin: 0; font-size: .9375rem; line-height: 1.5; }
.to-alt p { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent); text-decoration-thickness: 1px; }
.to-pick { border-left: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.to-pick p { color: var(--ink); font-weight: 600; }
.to-why { grid-column: 1 / -1; padding: 1rem 1.25rem 1.15rem; border-top: 1px solid var(--line); color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.to-l { display: block; font-family: var(--mono); font-size: .6875rem; color: var(--muted); margin-bottom: .35rem; }
.to-pick .to-l { color: var(--accent); }
@media (max-width: 640px) { .to { grid-template-columns: 1fr; } .to-pick { border-left: 0; border-top: 1px solid var(--line); } }

.table-wrap { overflow-x: auto; margin: 1.5rem 0 1.75rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 520px; }
.data-table th, .data-table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.data-table thead th { font-family: var(--mono); font-size: .75rem; font-weight: 400; color: var(--muted); background: var(--surface-2); }
.data-table tbody th { font-weight: 600; color: var(--ink); }
.data-table td { color: color-mix(in srgb, var(--ink) 84%, var(--muted)); }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); }
