/* ─────────────────────────────────────────────────────────
 * brendangraydesign.com — tokens and components (v2)
 *
 * Type: Hanken Grotesk for display, Instrument Sans for everything else.
 *       No monospace and no all caps: hierarchy comes from size, weight and color.
 * Color: near-black ink on white and one accent, #2f5bff (the blue the head's
 *        dots turn when scratched): nav dot, illustration accents, mood fill, hovers.
 * Space: 8px base. Radius: 4 / 12 / 999.
 * ───────────────────────────────────────────────────────── */

:root {
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #6e6e6b;
  --faint: #a3a19b;
  --paper: #ffffff;
  --wash: #f6f6f4;
  --accent: #2f5bff;
  --accent-wash: rgba(47, 91, 255, 0.11);
  --hairline: rgba(17, 17, 17, 0.1);
  --hairline-2: rgba(17, 17, 17, 0.18);

  --display: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px; --s8: 144px;
  --r-sm: 4px; --r-md: 12px; --r-pill: 999px;
  --measure: 62ch;
  --page: 1240px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }   /* the wide hero head box may run past a narrow window */
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-kerning: normal; text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -0.03em; line-height: 0.95; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ico { width: .72em; height: .72em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.02em; transition: transform .35s var(--ease-out); }

.page { max-width: var(--page); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--s2); top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: var(--s1) var(--s2); border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: var(--s2); }
.section-title { font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; }
.section-title.sub { margin-top: var(--s5); }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 50; left: 50%; top: calc(var(--s2) + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-radius: var(--r-pill); box-shadow: 0 0 0 1px var(--hairline), 0 8px 24px -12px rgba(17, 17, 17, 0.18);
  max-width: calc(100vw - 24px);
}
.nav a { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: 15px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a.brand { font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; }
.nav a.ext::after { content: "↗"; font-size: 12px; color: var(--muted); transition: transform .3s var(--ease-out); }
.nav a.ext:hover::after { transform: translate(2px, -2px); }
.nav-dot { position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin: 10px 0 0 -2.5px; border-radius: 50%; background: var(--accent); pointer-events: none; view-transition-name: nav-dot; will-change: transform; }

/* ---------- home hero ----------
 * --head-* are the hero head's size and position, tuned with ?hero-dials (2026-11-15). */
:root { --head-w: 118%; --head-vh: 70vh; --head-max: 620px; --head-min: 380px; --head-col: 1fr; --head-x: 0px; --head-y: 14px; --head-top: 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--head-col, 1fr)); gap: var(--s5); padding-top: var(--s8); }
.hero-left { display: grid; align-content: start; gap: var(--s7); min-width: 0; }
.hero-title { display: grid; gap: var(--s3); padding-top: var(--s4); }
.hero-title h1 { font-size: clamp(64px, 8.6vw, 124px); }
.hero-title .role { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; font-family: var(--display); font-size: clamp(22px, 2.2vw, 30px); color: var(--muted); font-weight: 450; letter-spacing: -0.01em; line-height: 1.1; }
.intro { display: grid; gap: var(--s4); padding-bottom: var(--s7); }
.intro p { font-family: var(--display); font-size: clamp(26px, 2.7vw, 40px); line-height: 1.2; font-weight: 500; letter-spacing: -0.02em; max-width: 22ch; }
.cta { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 20px; text-decoration: none; justify-self: start; }
.cta:hover .ico, a:hover .go .ico, .go:hover .ico { transform: translateX(4px); }

.hero-head { position: sticky; top: var(--head-top, calc(var(--s6) + var(--s2))); translate: var(--head-x, 0px) var(--head-y, 0px); align-self: start; display: grid; gap: var(--s1); justify-items: center; }
#view { position: relative; width: var(--head-w, 100%); height: min(var(--head-vh, 64vh), var(--head-max, 620px)); min-height: var(--head-min, 380px); overflow: hidden; }
#view canvas { display: block; width: 100%; max-width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.hero-head { min-width: 0; width: 100%; grid-template-columns: minmax(0, 1fr); }
#mood { max-width: 100%; }
#mood .txt { flex-wrap: wrap; justify-content: center; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; color: var(--faint); }
#sel { display: none !important; }
#mood { position: static !important; transform: none !important; pointer-events: none; }
#mood .pill { position: relative; overflow: hidden; border-radius: var(--r-pill); padding: 7px 14px; }
#mood .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-wash); border-radius: inherit; transition: width .14s linear; }
#mood .txt { position: relative; display: flex; gap: 6px; align-items: baseline; font-size: 15px; line-height: 1.2; white-space: pre; font-variant-numeric: tabular-nums; }
#mood .txt.light { display: none; }
#mood .eyebrow { color: var(--muted); display: inline-block; overflow: hidden; white-space: pre; transition: width .45s var(--ease-out), opacity .2s ease-out, transform .25s var(--ease-out); }
#mood .eyebrow.out { opacity: 0; transform: translateY(-3px); transition: width .45s var(--ease-out), opacity .12s ease-in, transform .12s ease-in; }
#mood .word { color: var(--ink); font-weight: 500; display: inline-block; overflow: hidden; white-space: pre; transition: width .45s var(--ease-out); }

/* ---------- section heads ---------- */
.page-head { display: grid; gap: var(--s3); padding-top: calc(var(--s8) + var(--s2)); padding-bottom: var(--s6); max-width: 760px; }
.page-head h1 { font-size: clamp(52px, 6.4vw, 92px); }
.page-head p { font-size: 21px; color: var(--muted); max-width: 44ch; }
.section-head { display: grid; gap: var(--s2); max-width: 720px; margin-bottom: var(--s5); }
.section-head h2 { font-size: clamp(36px, 4.2vw, 56px); }
.section-head p { color: var(--muted); font-size: 19px; }

/* ---------- recommendations: open type on white, no boxes (About) ---------- */
.about ~ .recs { padding: var(--s8) 0 var(--s7); }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--rec-columns, var(--s7)); align-items: start; }
.rec-col { display: grid; gap: var(--rec-between, var(--s7)); align-content: start; }
.rec { display: grid; gap: 0; justify-items: start; }   /* spacing is margins, so the collapsed text adds no extra gap */
.rec .pull { margin: 0; }
.rec .pull p { font-family: var(--display); font-size: 26px; line-height: 1.28; font-weight: 500; letter-spacing: -0.015em; text-indent: -0.4em; color: var(--ink-2); transition: color .3s; }
.rec:hover .pull p { color: var(--ink); }
.rec .who { display: grid; gap: var(--rec-name-title, 2px); margin-top: var(--rec-quote-name, var(--s3)); font-size: 15px; color: var(--muted); line-height: 1.4; }
.rec .who strong { color: var(--ink); font-weight: 600; }
.rec .toggle { margin-top: var(--rec-title-button, 14px); }
.rec .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); width: 100%; }
.rec .more .inner { overflow: hidden; min-height: 0; display: grid; gap: 14px; color: var(--muted); font-size: 17px; line-height: 1.6; opacity: 0; padding-left: 18px; border-left: 2px solid var(--accent-wash); transition: opacity .35s .05s; }
.rec.open .more { grid-template-rows: 1fr; }
.rec .more .inner { margin-top: 0; transition: opacity .35s .05s, margin-top .5s var(--ease-out); }
.rec.open .more .inner { opacity: 1; margin-top: var(--rec-title-text, var(--s3)); }
.toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); padding: 4px 0; transition: color .2s; }
.toggle:hover { color: var(--accent); }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.toggle svg .v { transform-origin: 6px 6px; transition: transform .35s var(--spring); }
.rec.open .toggle svg .v { transform: rotate(90deg); }

/* ---------- work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6) var(--s4); padding-bottom: var(--s8); }
/* ---------- project cards: Work tiles + featured folders on Home ----------
 * .face holds the illustration, .sheet the real UI (video or still). .show-ui (js/project-cards.js)
 * swaps them with a crossfade. */
:root { --pcard-dur: 480ms; }
.pcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); text-decoration: none; color: inherit; align-content: start; }
.pcard:hover { color: inherit; }
.pcard .ill { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); }
.pcard .face, .pcard .sheet { position: absolute; border-radius: var(--r-md); overflow: hidden; }
.pcard .face { inset: 0; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); }
.pcard .face canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard .sheet { background: var(--wash); }
.pcard .sheet :is(img, video) { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pcard .txt { display: grid; gap: 6px; }
.pcard :is(h2, h3) { font-size: 30px; letter-spacing: -0.02em; line-height: 1.05; display: inline-flex; align-items: center; gap: 10px; }
.pcard :is(h2, h3) .arr { display: inline-flex; color: var(--accent); font-size: 22px; opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .45s var(--ease-out); }
.pcard:is(:hover, :focus-visible, .show-ui) :is(h2, h3) .arr { opacity: 1; transform: none; }
.pcard .cap { color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 52ch; margin-top: 4px; text-wrap: balance; }
.pcard .role { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.pcard .role span { color: var(--muted); }
.pcard .role span::after { content: " \2014"; }

/* tile (Work): the UI crossfades in over the illustration */
.work-grid > .pcard:first-child { grid-column: 1 / -1; }
.work-grid > .pcard:first-child .ill { aspect-ratio: 2.3 / 1; }
.pcard--tile .ill { overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); }
.pcard--tile .sheet { inset: 0; opacity: 0; transition: opacity var(--pcard-dur) var(--ease-out); }
.pcard--tile .face { transition: opacity var(--pcard-dur) var(--ease-out); }
.pcard--tile.show-ui .sheet { opacity: 1; }
.pcard--tile.show-ui .face { opacity: 0; }

/* ---------- folder cards (Home) ----------
 * A folder of real screenshots. The back panel has a tab; the lead screenshot stands up out of the
 * folder; the front pocket (title) never moves. On hover the lead lifts a little and the other
 * screenshots fan out behind it. Tuning: the --folder-* properties; ?card-lab on Home has dials. */
:root { --folder-tab-h: 30px; --folder-logo-h: 13px; --folder-lead-rise: 6%; --folder-fan-x: 16%; --folder-fan-y: 36%; --folder-fan-tilt: 7deg; --folder-dur: 520ms; --folder-front: 40%; --folder-touch-delay: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); text-decoration: none; color: inherit; align-content: start; position: relative; }
.fcard:hover { color: inherit; z-index: 2; }
.folder { position: relative; display: block; aspect-ratio: 5 / 4; margin-top: calc(var(--s5) + 8px); }
.folder .back { position: absolute; inset: 0; background: var(--wash); border-radius: 0 var(--r-md) var(--r-md) var(--r-md); box-shadow: inset 0 0 0 1px var(--hairline); }
.folder .back::before { content: ""; position: absolute; left: 0; bottom: calc(100% - 1px); width: 40%; height: var(--folder-tab-h); background: var(--wash); border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: inset 1px 1px 0 0 var(--hairline), inset -1px 0 0 0 var(--hairline); }
/* company logo on the tab: the SVG is only a mask, so any logo comes out in one charcoal */
.folder .tab-logo { position: absolute; left: 0; bottom: 100%; width: 40%; height: var(--folder-tab-h); padding: 0 14px; box-sizing: border-box; }
.folder .tab-logo::after { content: ""; position: absolute; inset: 0 14px; background: var(--ink-2);
  -webkit-mask: var(--logo) left center / auto var(--folder-logo-h) no-repeat; mask: var(--logo) left center / auto var(--folder-logo-h) no-repeat; }
.folder .paper { position: absolute; left: 7%; right: 7%; top: 7%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--paper);
  box-shadow: 0 0 0 1px var(--hairline), 0 14px 30px -18px rgba(17,17,17,.35);
  transition: transform var(--folder-dur) var(--spring); transform-origin: 50% 100%; }
.folder .paper img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
/* at rest the stack sits in the folder, just showing its edges */
.folder .paper--1 { transform: translate(-2%, 1%) rotate(-2deg); }
.folder .paper--2 { transform: translate(2%, 2%) rotate(2deg); }
.folder .paper--lead { transform: translateY(-4%); }
.folder .front { position: absolute; left: 0; right: 0; bottom: 0; height: var(--folder-front); background: var(--paper); border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--hairline), 0 -12px 28px -20px rgba(17,17,17,.35);
  display: flex; flex-direction: column; justify-content: center; padding: var(--s3); gap: 4px; }
.front-title { font-family: var(--display); font-weight: 650; font-size: clamp(24px, 2.3vw, 32px); letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
.front-meta { font-size: 15px; color: var(--muted); }
.fcard:is(:hover, :focus-visible, .open) .paper--lead { transform: translateY(calc(-4% - var(--folder-lead-rise))); }
.fcard:is(:hover, :focus-visible, .open) .paper--1 { transform: translate(calc(-1 * var(--folder-fan-x)), calc(-1 * var(--folder-fan-y))) rotate(calc(-1 * var(--folder-fan-tilt))); }
.fcard:is(:hover, :focus-visible, .open) .paper--2 { transform: translate(var(--folder-fan-x), calc(-.7 * var(--folder-fan-y))) rotate(var(--folder-fan-tilt)); transition-delay: 40ms; }
.fcard .txt { gap: 4px; }
.fcard .cap { color: var(--muted); font-size: 17px; line-height: 1.5; max-width: 52ch; text-wrap: balance; }
.fcard .role { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.fcard .role span { color: var(--muted); }
.fcard .role span::after { content: " \2014"; }
@media (prefers-reduced-motion: reduce) { .folder .paper { transition: none; } }

/* featured on Home */
.featured { padding: var(--s7) 0 var(--s8); }
.featured-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); max-width: none; flex-wrap: wrap; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s5); }

/* ---------- case study ---------- */
.cs-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s4) var(--s5); padding-top: calc(var(--s8) + var(--s2)); align-items: end; }
.cs-title { display: grid; gap: var(--s3); }
.cs-head h1 { font-size: clamp(52px, 6.6vw, 96px); }
.cs-head .hook { font-size: 22px; line-height: 1.4; color: var(--muted); max-width: 38ch; }
.cs-ill { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); }
.cs-ill canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin: var(--s4) 0 0; }
.meta div { display: grid; gap: 4px; align-content: start; }
.meta dt { font-size: 14px; color: var(--muted); }
.meta dd { margin: 0; font-size: 16px; line-height: 1.4; }

.shot { margin: var(--s6) 0 0; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline), 0 30px 60px -40px rgba(17,17,17,.4); background: var(--wash) radial-gradient(circle, rgba(17,17,17,.1) 1px, transparent 1.2px) 0 0 / 14px 14px; }
.shot img, .shot video { display: block; width: 100%; height: auto; transform-origin: 50% 0; will-change: transform; }

.cs-body { display: grid; gap: var(--s7); padding: var(--s7) 0; }
.cs-section { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.cs-section > .label { position: sticky; top: 96px; display: flex; align-items: baseline; gap: 10px; font-family: var(--body); font-size: 16px; font-weight: 500; letter-spacing: 0; line-height: 1.3; color: var(--ink); }
.cs-section > .label .n { color: var(--faint); font-weight: 400; }
.cs-section .text { display: grid; gap: var(--s2); min-width: 0; }
.cs-section .text > p, .cs-section .text > ol { max-width: var(--measure); }
.cs-section .text p { font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.cs-section .text > p:first-child { font-size: 23px; line-height: 1.42; font-family: var(--display); font-weight: 500; letter-spacing: -0.012em; color: var(--ink); }
.cs-section ol { margin: var(--s1) 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.cs-section ol li { display: grid; grid-template-columns: 32px 1fr; gap: 6px; font-size: 18px; line-height: 1.5; padding-top: 14px; border-top: 1px solid var(--hairline); }
.cs-section ol li .n { color: var(--accent); font-size: 15px; padding-top: 2px; }

/* before/after compare */
.compare { margin: var(--s3) 0 var(--s2); }
.compare .frame { position: relative; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); touch-action: pan-y; cursor: ew-resize; user-select: none; background: var(--wash); }
.compare img { width: 100%; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .after img { height: 100%; object-fit: cover; object-position: top; }
.compare .bar { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: var(--paper); box-shadow: 0 0 0 1px rgba(17,17,17,.12); }
.compare .knob { position: absolute; top: 50%; left: var(--pos, 50%); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 1px var(--hairline), 0 8px 20px -8px rgba(17,17,17,.45); display: grid; place-items: center; transition: transform .25s var(--spring); }
.compare .knob svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.compare .frame:hover .knob { transform: scale(1.08); }
.compare .frame:active .knob { transform: scale(.94); }
.compare .tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.92); font-size: 13px; color: var(--ink-2); box-shadow: 0 0 0 1px var(--hairline); }
.compare .tag.b { left: 12px; } .compare .tag.a { right: 12px; }
.compare figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }
.compare figcaption .hint { color: var(--faint); }

/* prototype links (top and end of each case study) */
.cs-actions { margin-top: var(--s1); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: var(--r-pill); background: var(--ink); color: #fff; text-decoration: none; font-size: 16px; font-weight: 500; transition: background .2s, transform .25s var(--spring); justify-self: start; }
.btn:hover { background: var(--accent); color: #fff; }
.btn:active { transform: scale(.97); }
.btn:hover .ico { transform: translate(2px, -2px); }
.cs-end { display: grid; gap: var(--s3); justify-items: start; padding: 0 0 var(--s7) 232px; }
.cs-end p { font-family: var(--display); font-size: 23px; font-weight: 500; letter-spacing: -0.012em; }

.next { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); padding: var(--s6) 0 var(--s8); }
.next a { display: grid; grid-template-columns: 132px 1fr; gap: var(--s3); align-items: center; text-decoration: none; }
.next a.fwd { grid-template-columns: 1fr 132px; text-align: right; }
.next .mini { aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); position: relative; }
.next .mini canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.next .dir { font-size: 15px; color: var(--muted); }
.next h3 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; margin-top: 6px; transition: color .2s; }
.next a:hover h3 { color: var(--accent); }

/* ---------- fun zone ---------- */
.fun-list { display: grid; gap: var(--s8); padding-bottom: var(--s8); }
.fun { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s6); align-items: center; }
.fun:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.fun:nth-child(even) .media { order: 2; }
.fun .media { display: block; }
.fun .tilt { display: block; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline), 0 24px 50px -36px rgba(17,17,17,.45); transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); background: var(--wash); will-change: transform; }
.fun .tilt img, .fun .tilt video { display: block; width: 100%; height: auto; }
.fun .tilt.active { transition: transform .12s linear, box-shadow .3s; box-shadow: inset 0 0 0 1px var(--hairline), 0 34px 60px -34px rgba(17,17,17,.5); }
.fun .video { position: relative; }
.fun .video video { aspect-ratio: 16 / 9; object-fit: cover; cursor: pointer; }
.fun .sound { all: unset; cursor: pointer; position: absolute; right: 14px; bottom: 14px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(17,17,17,.72); color: #fff; font-size: 14px; backdrop-filter: blur(8px); transition: background .2s; }
.fun .sound:hover { background: var(--accent); }
.fun .sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fun .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.fun .pair figure { margin: 0; }
.fun .pair img { aspect-ratio: 1.18; object-fit: cover; }
.fun .pair figcaption { font-size: 14px; color: var(--muted); padding: 10px 14px; background: var(--paper); border-top: 1px solid var(--hairline); }
.fun .compare { margin: 0; }
/* taste carousel: one exercise per slide, original beside rebuild */
.fun .carousel { display: grid; gap: 14px; min-width: 0; }
.carousel .track { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: var(--r-md); }
.carousel .track::-webkit-scrollbar { display: none; }
.carousel .track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel .slide { scroll-snap-align: start; display: grid; gap: 12px; min-width: 0; }
.carousel .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.carousel figure { margin: 0; display: grid; gap: 8px; }
.carousel .shot-box { aspect-ratio: 4 / 5; border-radius: var(--r-md); background: var(--wash); box-shadow: inset 0 0 0 1px var(--hairline); display: grid; place-items: center; padding: 14px; overflow: hidden; }
.carousel .shot-box { position: relative; }
.carousel .shot-box img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; }
.carousel figcaption { font-size: 14px; color: var(--muted); }
.carousel .cap { font-size: 15px; color: var(--ink-2); }
.carousel .controls { display: flex; align-items: center; gap: 12px; }
.carousel .controls button { all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--hairline-2); transition: background .2s, box-shadow .2s, opacity .2s, transform .25s var(--spring); }
.carousel .controls button:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.carousel .controls button:active { transform: scale(.94); }
.carousel .controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel .controls button[disabled] { opacity: .35; cursor: default; box-shadow: inset 0 0 0 1px var(--hairline); }
.carousel .controls svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.carousel .count { font-size: 15px; color: var(--muted); min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .carousel .track { scroll-behavior: auto; } }

/* static figure in a case study */
.still { margin: var(--s3) 0 var(--s2); }
.still img { width: 100%; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--hairline); background: var(--wash); }
.still figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }
.fun .info { display: grid; gap: var(--s2); align-content: center; }
.fun .tag { font-size: 15px; color: var(--muted); }
.fun h2 { font-size: clamp(36px, 3.6vw, 48px); margin-bottom: 4px; }
.fun .what { font-size: 20px; line-height: 1.5; max-width: 40ch; }
.fun .why { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 44ch; }
.fun .open, .fun .soon { justify-self: start; margin-top: var(--s1); font-size: 16px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.fun .open { border-bottom: 1px solid var(--hairline-2); padding-bottom: 3px; transition: border-color .2s, color .2s; }
.fun .open:hover { border-color: var(--accent); }
.fun .open:hover .ico { transform: translate(2px, -2px); }
.fun .soon { color: var(--faint); font-weight: 400; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); padding-top: calc(var(--s8) + var(--s2)); align-items: start; }
.about .photo { margin: 0; position: sticky; top: 96px; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline); }
.about .copy { display: grid; gap: var(--s4); }
.about h1 { font-size: clamp(52px, 6.4vw, 88px); }
.about .lede { font-family: var(--display); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; }
.about .story { display: grid; gap: var(--s2); color: var(--ink-2); max-width: var(--measure); }

.how { padding: var(--s8) 0 var(--s7); }
.how .section-title { font-size: clamp(36px, 4.2vw, 56px); margin-bottom: var(--s5); }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.how-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s2); padding: var(--s4); border-radius: var(--r-md); background: var(--wash); text-decoration: none; color: inherit; transition: background .3s, transform .5s var(--ease-out); }
.how-card:hover { background: #f1f1ee; color: inherit; transform: translateY(-3px); }
.how-card canvas { width: 76px; height: 76px; margin-bottom: var(--s2); }
.how-card .claim { font-family: var(--display); font-size: 25px; line-height: 1.2; font-weight: 550; letter-spacing: -0.015em; }
.how-card .proof { color: var(--muted); font-size: 17px; line-height: 1.55; }
.how-card .go { margin-top: var(--s1); }

.facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s6); padding: var(--s7) 0; }
.facts .section-title { margin-bottom: var(--s3); }
.xp { margin: 0; display: grid; }
.xp div { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s2); padding: 14px 0; border-top: 1px solid var(--hairline); }
.xp dt { font-weight: 500; }
.xp dd { margin: 0; grid-column: 1; color: var(--muted); font-size: 16px; }
.xp dd.when { grid-column: 2; grid-row: 1; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { font-size: 15px; padding: 6px 13px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--hairline-2); }
.contact { padding: var(--s7) 0 var(--s8); display: grid; gap: var(--s2); justify-items: start; }
.contact .contact-row { margin-top: var(--s2); }
.contact .section-title { font-size: clamp(36px, 4.2vw, 56px); }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-btn, .pill-link { all: unset; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; height: 46px; padding: 0 20px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--hairline-2); font-size: 16px; transition: box-shadow .2s, background .2s, color .2s; }
.copy-btn { background: var(--ink); color: #fff; box-shadow: none; }
.copy-btn:hover { background: var(--accent); }
.pill-link:hover { box-shadow: inset 0 0 0 1px rgba(17,17,17,.4); color: var(--ink); }
.pill-link:hover .ico { transform: translate(2px, -2px); }
.copy-btn:focus-visible, .pill-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.copy-btn .ok { display: none; } .copy-btn.done .ok { display: inline; } .copy-btn.done .label { display: none; }
.ico-l { width: 16px; height: 16px; flex: none; }
.about .btn { margin-top: var(--s1); }
.about .btn .ico { width: .8em; height: .8em; }
.about .btn:hover .ico { transform: translateY(2px); }

/* ---------- footer ---------- */
.footer { padding: var(--s4) 0 var(--s5); display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.footer nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- entrance ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s var(--ease-io) both vt-out; }
::view-transition-new(root) { animation: .34s var(--ease-out) both vt-in; }
::view-transition-group(nav-dot) { animation-duration: .5s; animation-timing-function: var(--spring); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  :root { --head-w: 100%; --head-y: 0px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: var(--s7); }
  .hero-left { display: contents; }
  .hero-title { order: 1; padding-top: var(--s3); }
  .hero-head { order: 2; position: static; margin: var(--s3) 0; }
  .intro { order: 3; padding-bottom: var(--s6); }
  .rec-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .rec-col { gap: var(--s6); }
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
  .work-grid > .pcard:first-child .ill { aspect-ratio: 4 / 3; }
  .featured-grid { grid-template-columns: minmax(0, 1fr); }
  .cs-head { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-section { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .cs-section > .label { position: static; }
  .cs-end { padding-left: 0; }
  .next { grid-template-columns: minmax(0, 1fr); }
  .next a, .next a.fwd { grid-template-columns: 96px 1fr; text-align: left; }
  .next a.fwd .mini { order: -1; }
  .fun, .fun:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .fun:nth-child(even) .media { order: 0; }
  .about, .facts { grid-template-columns: minmax(0, 1fr); }
  .about .photo { position: static; max-width: 360px; }
  .how-grid { grid-template-columns: minmax(0, 1fr); }
  .nav a { padding: 0 10px; font-size: 14px; }
  .nav a.brand .full { display: none; }
}
@media (min-width: 861px) { .nav a.brand .short { display: none; } }

/* case study clips: recorded from the prototype, play only while on screen */
.clip { margin: var(--s3) 0 var(--s2); }
.clip.narrow { max-width: 520px; }
.clip-frame { border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--hairline), 0 24px 50px -40px rgba(17,17,17,.45); background: var(--wash); }
.clip video { display: block; width: 100%; height: auto; }
.clip figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }

/* ---------- project timeline (supplier hero) ----------
 * Months map to a 0–1 track: --s/--e are a bar's start and end, --lane its row (1 = nearest the axis).
 * Labels sit above their bars and may run past a short bar; lanes are assigned in content so they don't collide. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.timeline { --lane-h: 64px; margin: var(--s6) 0 0; padding: var(--s5) var(--s5) var(--s4); border-radius: var(--r-md); background: var(--wash); box-shadow: inset 0 0 0 1px var(--hairline); }
.tl-lanes { list-style: none; margin: 0; padding: 0; position: relative; height: calc(var(--lanes) * var(--lane-h)); }
.tl-item { position: absolute; left: calc(var(--s) * 100%); width: calc((var(--e) - var(--s)) * 100%); bottom: calc((var(--lane) - 1) * var(--lane-h)); height: var(--lane-h); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding-bottom: 14px; }
.tl-text { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 15px; line-height: 1.2; transition: opacity .2s ease-out; }
.tl-name { color: var(--ink-2); font-weight: 500; }
.tl-when { color: var(--muted); font-size: 13px; }
.tl-bar { display: block; height: 8px; border-radius: var(--r-pill); background: rgba(17, 17, 17, .14); transform-origin: left center; transition: background .2s, opacity .2s ease-out; }
.tl-item.key .tl-name { color: var(--ink); }
.tl-item.key .tl-bar { background: var(--accent); }
/* hover: one project at a time */
.tl-lanes:has(.tl-item:hover) .tl-item:not(:hover) :is(.tl-text, .tl-bar) { opacity: .35; }
/* axis */
.tl-axis { position: relative; height: 34px; margin-top: 4px; border-top: 1px solid var(--hairline-2); }
.tl-tick { position: absolute; left: calc(var(--x) * 100%); top: 0; padding-top: 10px; transform: translateX(-50%); font-size: 13px; color: var(--faint); }
.tl-tick::before { content: ""; position: absolute; left: 50%; top: -1px; width: 1px; height: 6px; background: var(--hairline-2); }
.tl-tick.year { color: var(--muted); font-weight: 500; }
.tl-tick.year::before { height: 9px; }
.tl-tick:first-child { transform: none; } .tl-tick:first-child::before { left: 0; }
.tl-tick:last-child { transform: translateX(-100%); } .tl-tick:last-child::before { left: auto; right: 0; }
.timeline figcaption { display: flex; align-items: center; gap: 10px; margin-top: var(--s3); font-size: 15px; color: var(--muted); }
.tl-key-swatch { width: 18px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
/* entrance: bars draw in from their start, chained. Keyframes with fill 'backwards' hold the start
   state during each delay and then let go, so the hover transitions below stay instant. */
@media (prefers-reduced-motion: no-preference) {
  .timeline[data-reveal]:not(.in) .tl-bar { transform: scaleX(0); }
  .timeline[data-reveal]:not(.in) .tl-text { opacity: 0; }
  .timeline.in .tl-bar { animation: tl-draw .9s var(--ease-out) calc(var(--i) * 70ms + 150ms) backwards; }
  .timeline.in .tl-text { animation: tl-rise .6s var(--ease-out) calc(var(--i) * 70ms + 350ms) backwards; }
}
@keyframes tl-draw { from { transform: scaleX(0); } }
@keyframes tl-rise { from { opacity: 0; transform: translateY(4px); } }
/* narrow screens: the same data as a list, oldest first */
@media (max-width: 760px) {
  .timeline { padding: var(--s3) var(--s2); }
  .tl-lanes { height: auto; display: grid; gap: 18px; }
  .tl-item { position: static; width: auto; height: auto; padding: 0; gap: 8px; order: calc(var(--s) * 1000); }
  .tl-text { white-space: normal; flex-direction: column; gap: 2px; }
  .tl-bar { margin-left: calc(var(--s) * 100%); width: calc((var(--e) - var(--s)) * 100%); min-width: 8px; }
  .tl-axis { display: none; }
}

/* ---------- home intro (js/intro.js) ----------
 * intro-hold hides the hero before first paint; intro.js takes over with inline opacity and
 * drops the class. The failsafe shows the hero anyway if the script never runs. */
html.intro-hold :is(.nav, .hero-title h1, .hero-title .role, .hero .intro p, .hero .intro .cta, #view, #mood) { opacity: 0; animation: intro-failsafe .3s 1.5s forwards; }
@keyframes intro-failsafe { to { opacity: 1; } }
.intro-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 45; }

/* ---------- type play (js/type-play.js): easter-egg hover states on Home words ----------
 * At rest a .tp word is plain copy. Effects add classes, letter spans or overlay layers, and remove them on leave. */
.tp-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 51; }
[data-tp-hint="dotted"] .tp:hover { text-decoration: underline dotted 1px var(--faint); text-underline-offset: .18em; }
[data-tp-hint="tint"] .tp { color: color-mix(in srgb, var(--ink) 82%, var(--accent)); }
.tpw { white-space: nowrap; }
.tpl { display: inline-block; transition: transform .5s var(--spring); will-change: transform; }
.tp-outline { color: transparent; -webkit-text-stroke: 1px var(--ink); transition: color .2s; }
.tp-ghosted { color: transparent !important; transition: color .12s; }
.tp-layer { position: absolute; z-index: 30; pointer-events: none; white-space: nowrap; }
.tp-plate { mix-blend-mode: multiply; opacity: 0; transition: opacity .2s, transform .45s var(--ease-out); }
.tp-plate.on { opacity: 1; }
.tp-source { background: var(--paper); color: var(--ink); opacity: 0; transform: perspective(400px) rotateX(-80deg); transform-origin: 50% 60%; transition: transform .4s var(--ease-out), opacity .2s; padding-right: 6px; }
.tp-source.on { opacity: 1; transform: none; }
.tp-source .g { color: var(--faint); } .tp-source .t { color: var(--accent); }
.tp-source .caret { display: inline-block; width: 2px; height: .85em; margin-left: 2px; vertical-align: -.08em; background: var(--accent); animation: tp-caret 1s steps(1) infinite; }
@keyframes tp-caret { 50% { opacity: 0; } }
.tp-br { color: var(--faint); opacity: 0; font-size: .8em; transition: opacity .25s, transform .4s var(--spring); }
.tp-br.left { transform: translateX(calc(-100% + 8px)); } .tp-br.left.on { opacity: 1; transform: translateX(calc(-100% - 2px)); }
.tp-br.right { transform: translateX(-8px); } .tp-br.right.on { opacity: 1; transform: translateX(3px); }
.tp-syntax { color: var(--accent) !important; transition: color .2s; }
.tp-lift { color: var(--ink); transform-origin: left 80%; transition: transform .45s var(--spring); }
.tp-lift.on { transform: scale(var(--tp-scale, 1.32)); }
.tp-dim { color: var(--faint) !important; transition: color .3s; }
.tp-ghost { width: 0; overflow: hidden; padding-left: .25em; background: linear-gradient(90deg, var(--paper) 92%, transparent); color: var(--faint); transition: width .45s var(--ease-out); }
.tp-ghost .tab { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 4px; font-size: 12px; line-height: 1.5; vertical-align: .4em; color: var(--muted); box-shadow: inset 0 0 0 1px var(--hairline-2); font-family: var(--body); }
.tp-shimmer { color: transparent; background: linear-gradient(100deg, var(--ink) 30%, var(--accent) 50%, var(--ink) 70%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; animation: tp-shimmer 1.1s var(--ease-out) forwards; }
@keyframes tp-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
[data-tp="learn"] { background: linear-gradient(var(--accent-wash), var(--accent-wash)) no-repeat 0 78% / 0% 50%; transition: background-size .35s var(--ease-out); }
[data-tp="learn"].tp-mark { background-size: 100% 50%; }
@media (prefers-reduced-motion: reduce) { .tpl, .tp-plate, .tp-source, .tp-br, .tp-lift, .tp-ghost, [data-tp="learn"] { transition: none; } .tp-shimmer { animation: none; color: var(--accent); background: none; } }
