/* Case study + gate styles. Tokens match public/index.html. */
:root {
  --bg: #000;
  --fg: #fff;
  --fg-muted: #b5b5b5;
  --fg-label: #cccccc;
  --fg-subtle: #7a7a7a;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --surface: #0c0c0c;
  --surface-2: #151515;
  --accent: #0a5cff;
  --danger: #ff8a80;
  --topbar-fade: linear-gradient(#000 0%, rgba(0,0,0,.85) 60%, rgba(0,0,0,0));

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1.5rem, 5.625vw, 7rem);
  --section: clamp(5rem, 11vw, 11rem);
  --text-label: clamp(0.75rem, 0.85vw, 0.9375rem);
  --text-body: clamp(1.0625rem, 1.15vw, 1.25rem);
  --text-lead: clamp(1.625rem, 3.1vw, 3.25rem);
  --text-h2: clamp(2.5rem, 5.6vw, 6rem);
  --text-display: clamp(4rem, 14vw, 15rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-sans); font-size: var(--text-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .22em; }
a:hover { text-decoration-color: currentColor; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Shared bits ---------- */
.label {
  margin: 0; font: 400 var(--text-label)/1.4 var(--font-mono);
  letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle);
}
.eyebrow {
  display: flex; align-items: flex-start; gap: 1em; margin: 0;
  font: 400 var(--text-label)/1.4 var(--font-mono); color: var(--fg-label);
}
.eyebrow::before {
  content: ""; flex: none; width: .92em; height: .92em; margin-top: .24em;
  border-radius: .2em; background: var(--accent);
}
.wrap { padding-inline: var(--gutter); }

.topbar {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.1rem var(--gutter);
  font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-label);
  background: var(--topbar-fade);
}
.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--fg); }
.topbar-nav { display: flex; gap: 1.75rem; color: var(--fg-subtle); }
.topbar-nav a[aria-current="true"] { color: var(--fg); }
.topbar-right { color: var(--fg-subtle); }
@media (max-width: 64rem) { .topbar-nav { display: none; } }

/* ---------- Gate ---------- */
.gate {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 6rem);
  align-items: center; padding: 6rem var(--gutter) 4rem;
}
.gate-title { margin-top: .3em; font-size: clamp(3rem, 5vw, 7.5rem); line-height: .95; letter-spacing: -.03em; }
.gate-hook { margin-top: 1.2em; max-width: 30em; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; color: var(--fg-muted); text-wrap: balance; }
.gate-form { margin-top: clamp(2rem, 4vw, 3.5rem); max-width: 30rem; }
.gate-row { display: flex; margin-top: .75rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: .3rem; transition: border-color .2s; }
.gate-row:focus-within { border-color: var(--fg-subtle); }
.gate-row input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg);
  font: 400 1.0625rem/1 var(--font-sans); padding: .85rem 1.1rem; outline: none;
}
.gate-row button {
  flex: none; border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer;
  font: 600 1rem/1 var(--font-sans); padding: .85rem 1.4rem;
}
.gate-row button:hover { background: #2a72ff; }
.gate-error { margin-top: .9rem; font: 400 .9375rem/1.4 var(--font-sans); color: var(--danger); }
.gate-ask { margin-top: 1.5rem; font-size: .9375rem; color: var(--fg-subtle); }
.gate-teaser { margin: 0; }
.gate-frame { position: relative; aspect-ratio: 16 / 9; background: #F3F1EC; overflow: hidden; border-radius: 6px; }
.gate-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gate-teaser figcaption { margin-top: .9rem; }
.gate.no-teaser { grid-template-columns: minmax(0, 40rem); justify-content: center; }
@media (max-width: 64rem) {
  .gate { grid-template-columns: 1fr; align-content: start; padding-top: 7rem; }
  .gate-title { font-size: clamp(3rem, 13vw, 7.5rem); }
}

/* ---------- Case study: hero ---------- */
.hero { padding: clamp(8rem, 18vh, 12rem) var(--gutter) 0; }
.hero h1 { margin-top: .25em; font-size: var(--text-display); line-height: .86; letter-spacing: -.045em; }
.hero-hook { margin-top: .9em; max-width: 22em; font-size: var(--text-lead); line-height: 1.2; color: var(--fg-muted); text-wrap: balance; }
.meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
  margin: clamp(3rem, 7vw, 6rem) 0 0; padding: 1.5rem 0 clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line);
}
.meta div { display: grid; gap: .5rem; align-content: start; }
.meta dt { font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle); }
.meta dd { margin: 0; color: var(--fg-label); line-height: 1.45; }
@media (max-width: 52rem) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Media + placeholders ---------- */
.media { position: relative; margin: 0; aspect-ratio: var(--ratio, 16 / 10); background: var(--surface-2); overflow: hidden; }
.media.bleed { margin-inline: 0; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.media.has-img { aspect-ratio: auto; background: none; }
.media.has-img img { position: static; height: auto; opacity: 1; }
.media.has-img .ph { display: none; }
.media:not(.bleed) { border-radius: 6px; }
/* .fit: whole screenshot on a white card. .crop: fill the frame, anchored top-left. */
.media.fit { background: #fff; }
.media.fit.has-img, .media.crop.has-img { aspect-ratio: var(--ratio, 16 / 10); }
.media.fit.has-img img { position: absolute; height: 100%; object-fit: contain; padding: clamp(.75rem, 2vw, 1.5rem); }
.media.crop.has-img img { position: absolute; height: 100%; object-fit: cover; object-position: top left; }
.ph {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .6rem; padding: 2rem; text-align: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--surface);
}
.ph span { font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-label); background: var(--surface); padding: .35rem .6rem; }
.ph code { font: 400 .8125rem/1.4 var(--font-mono); color: var(--fg-subtle); background: var(--surface); padding: .2rem .5rem; }
figcaption.caption { margin-top: 1rem; font: 400 var(--text-label)/1.5 var(--font-mono); letter-spacing: .02em; color: var(--fg-subtle); }

/* ---------- Sections ---------- */
.section { padding: var(--section) var(--gutter) 0; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 1.5rem clamp(2rem, 4vw, 4rem); }
.split > .label { padding-top: .6em; }
.lead { font-size: var(--text-lead); line-height: 1.22; letter-spacing: -.01em; text-wrap: pretty; }
.lead .dim { color: var(--fg-subtle); }
.h2 { font-size: var(--text-h2); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.body { color: var(--fg-muted); max-width: 34em; }
.body + .body { margin-top: 1em; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 5rem); }
.cols > .body + .body { margin-top: 0; } /* side by side, the grid gap spaces them */
.stack-lg > * + * { margin-top: clamp(3rem, 6vw, 6rem); }
.stack-md > * + * { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 52rem) {
  .split, .cols { grid-template-columns: 1fr; }
  .split > .label { padding-top: 0; }
}

.pair { display: grid; grid-template-columns: var(--cols, repeat(2, minmax(0, 1fr))); gap: clamp(.75rem, 1.5vw, 1.5rem); }
.trio { display: grid; grid-template-columns: var(--cols, repeat(3, minmax(0, 1fr))); gap: clamp(.75rem, 1.5vw, 1.5rem); }
@media (max-width: 52rem) { .pair, .trio { grid-template-columns: 1fr; } }

/* Gap chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .rec { stroke: var(--fg-label); stroke-width: 2.5; fill: none; }
.chart .exe { stroke: var(--accent); stroke-width: 4; fill: none; }
.chart text { font: 400 15px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; fill: var(--fg-subtle); }
.chart text.acc { fill: var(--accent); }

/* Numbered list (questions, takeaways) */
.numbered { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.numbered li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; padding: clamp(1.25rem, 2.4vw, 2rem) 0; border-bottom: 1px solid var(--line); }
.numbered .n { font: 400 var(--text-label)/2 var(--font-mono); color: var(--accent); }
.numbered .t { font-size: clamp(1.375rem, 2.4vw, 2.5rem); line-height: 1.2; letter-spacing: -.015em; }
.numbered .d { margin-top: .5em; color: var(--fg-muted); max-width: 40em; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats > div { padding: 1.5rem 1.5rem 0 0; }
.stats .v { font-size: clamp(3rem, 7vw, 7rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stats .k { margin-top: .6rem; color: var(--fg-muted); max-width: 16em; }
@media (max-width: 40rem) { .stats { grid-template-columns: 1fr; } .stats > div { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); } }

/* Workflow */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 6), minmax(0, 1fr)); counter-reset: step; }
.flow > li { position: relative; padding: 1.75rem 1.25rem 0 0; border-top: 1px solid var(--line-strong); counter-increment: step; }
.flow > li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--fg); }
.flow .who { font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle); }
.flow .step { margin-top: .4rem; font-size: clamp(1.25rem, 1.8vw, 1.75rem); font-weight: 700; letter-spacing: -.01em; }
.flow .what { margin-top: .5rem; color: var(--fg-muted); font-size: .9375rem; line-height: 1.5; }
.flow .pain { margin-top: 1rem; padding: .75rem .9rem; border-left: 2px solid var(--accent); background: var(--surface-2); font-size: .9375rem; line-height: 1.45; color: var(--fg-label); }
.flow .pain + .pain { margin-top: .5rem; }
@media (max-width: 64rem) {
  .flow { grid-template-columns: 1fr; }
  .flow > li { border-top: 0; border-left: 1px solid var(--line-strong); padding: 0 0 2rem 1.75rem; }
  .flow > li::before { top: .35rem; left: -5px; }
}

/* Insight panel */
.insight { margin-top: var(--section); background: var(--accent); color: #fff; padding: clamp(5rem, 12vw, 10rem) var(--gutter); }
.insight .label { color: rgba(255,255,255,.9); }
.insight h2 { margin-top: .35em; font-size: clamp(3.25rem, 10vw, 11rem); line-height: .9; letter-spacing: -.045em; }
.insight p.sub { margin-top: clamp(2rem, 4vw, 3.5rem); max-width: 30em; font-size: var(--text-lead); line-height: 1.22; color: rgba(255,255,255,.88); }

/* Comparison table */
.table-wrap { overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
table.compare { width: 100%; min-width: 52rem; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 1rem 1.25rem 1rem 0; border-bottom: 1px solid var(--line); }
.compare thead th { font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-label); border-bottom-color: var(--line-strong); }
.compare tbody th { width: 18%; font-weight: 400; color: var(--fg-subtle); }
.compare td { color: var(--fg-label); }
.compare .unk { color: var(--fg-subtle); }
.compare .hi { color: var(--fg); }
.compare .tag { display: inline-block; font: 400 .75rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: .35rem .5rem; border: 1px solid var(--line-strong); border-radius: 4px; }
.compare .tag.high { border-color: var(--accent); color: #fff; background: var(--accent); }

/* Findings grid */
.findings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.findings > div { background: var(--bg); padding: clamp(1.5rem, 2.5vw, 2.5rem); }
.findings .n { font: 400 var(--text-label)/1.4 var(--font-mono); color: var(--accent); }
.findings h3 { margin-top: 1.25rem; font-size: clamp(1.25rem, 1.7vw, 1.625rem); letter-spacing: -.01em; }
.findings p { margin-top: .6rem; color: var(--fg-muted); font-size: 1rem; }
@media (max-width: 64rem) { .findings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .findings { grid-template-columns: 1fr; } }

.gaps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 3rem; }
.gaps li { display: flex; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--fg-label); }
.gaps li::before { content: "×"; flex: none; color: var(--accent); font: 400 1.1rem/1.4 var(--font-mono); }
@media (max-width: 52rem) { .gaps { grid-template-columns: 1fr; } }

/* Features */
.feature { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.feature .copy { position: sticky; top: 6rem; }
.feature h3 { margin-top: .6rem; font-size: clamp(1.75rem, 3vw, 3rem); line-height: 1.05; letter-spacing: -.025em; }
.feature .body { margin-top: 1rem; }
.feature .closes { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--fg-subtle); }
.feature .closes b { display: block; font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-label); margin-bottom: .35rem; }
@media (max-width: 52rem) { .feature { grid-template-columns: 1fr; } .feature .copy { position: static; } }

/* Results */
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.results > div { background: var(--bg); padding: clamp(1.75rem, 3vw, 3rem); display: grid; align-content: start; gap: .75rem; }
.results .co { font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-label); }
.results .v { font-size: clamp(3.5rem, 8vw, 8.5rem); font-weight: 700; line-height: .95; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.results .v small { font-size: .32em; font-weight: 500; letter-spacing: -.01em; color: var(--fg-muted); margin-right: .3em; }
.results .k { color: var(--fg-muted); }
.results .row { display: flex; align-items: baseline; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.results .row .v2 { font-size: clamp(2rem, 3.6vw, 3.5rem); font-weight: 700; letter-spacing: -.03em; }
.results .src { margin-top: 1rem; font: 400 .8125rem/1.5 var(--font-mono); color: var(--fg-subtle); }
.results .tag { color: var(--accent); }
@media (max-width: 52rem) { .results { grid-template-columns: 1fr; } }
.credit { margin-top: 1.5rem; max-width: 46em; color: var(--fg-subtle); font-size: .9375rem; }

/* Footer */
.footer { padding: var(--section) var(--gutter) clamp(2rem, 9vh, 5rem); }
.footer-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.footer-cta .big { font-size: var(--text-h2); font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.footer-links { display: flex; gap: 1.9em; font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--fg-subtle); }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.frame-marks { display: flex; justify-content: space-between; margin-top: clamp(3rem, 8vh, 5rem); }
.frame-marks span { width: 1.5rem; height: 1rem; border-bottom: 1px solid var(--line-strong); }
.frame-marks span:first-child { border-left: 1px solid var(--line-strong); }
.frame-marks span:last-child { border-right: 1px solid var(--line-strong); }

/* ---------- Light theme: opt in with <html class="theme-light"> ---------- */
:root.theme-light {
  --bg: #fff;
  --fg: #0b0b0b;
  --fg-muted: #4a4a4a;
  --fg-label: #2b2b2b;
  --fg-subtle: #6b6b6b;
  --line: #e6e3dd;
  --line-strong: #d2cec6;
  --surface: #f6f4f0;
  --surface-2: #efece6;
  --topbar-fade: linear-gradient(#fff 0%, rgba(255,255,255,.85) 60%, rgba(255,255,255,0));
  color-scheme: light;
}

/* ---------- Statement-led sections (first used by /work/opstream) ---------- */
:root {
  --plate: #e9e5dd;
  --shot-shadow: 0 1px 2px rgba(28, 24, 18, .08), 0 10px 24px -6px rgba(28, 24, 18, .18), 0 36px 72px -20px rgba(28, 24, 18, .32);
  --text-statement: clamp(1.875rem, 4vw, 4.25rem);
}
/* Labels inside components, styled like .label */
.spec thead th, .spec td::before, .persona .k, .before-after .tag, .credits dt, .ph-chip {
  font: 400 var(--text-label)/1.4 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-subtle);
}
.hero-thesis { margin-top: .8em; max-width: 20em; font-size: var(--text-lead); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.hero-sub { margin-top: 1em; max-width: 34em; font-size: clamp(1.125rem, 1.6vw, 1.5rem); line-height: 1.4; color: var(--fg-muted); text-wrap: pretty; }

/* Two screens overlapping on a soft plate, edge to edge */
.hero-composite {
  margin: 0; overflow: hidden; background: var(--plate);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start;
  padding: clamp(2.5rem, 7vw, 8rem) var(--gutter) clamp(3rem, 8vw, 9rem);
}
.hero-composite img { grid-row: 1; width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shot-shadow); }
.hero-composite .back { grid-column: 1 / span 8; }
.hero-composite .front { grid-column: 7 / span 6; margin-top: 22%; }
@media (max-width: 52rem) {
  .hero-composite .back { grid-column: 1 / span 10; }
  .hero-composite .front { grid-column: 4 / span 9; margin-top: 34%; }
}

.statement { font-size: var(--text-statement); font-weight: 600; line-height: 1.06; letter-spacing: -.03em; text-wrap: balance; max-width: 21em; }
.prose { max-width: 68ch; color: var(--fg-muted); }
.prose > * + * { margin-top: 1em; }
.split-body { grid-column: 2; }
@media (max-width: 52rem) { .split-body { grid-column: auto; } }

.callout {
  max-width: 44em; padding-left: clamp(1rem, 2vw, 1.75rem); border-left: 2px solid var(--accent);
  font-size: clamp(1.25rem, 1.9vw, 1.75rem); line-height: 1.35; letter-spacing: -.01em; color: var(--fg-label); text-wrap: pretty;
}
.callout strong { color: var(--fg); font-weight: 600; }
.insight h2.principle { font-size: clamp(2.25rem, 5.6vw, 6rem); line-height: .98; letter-spacing: -.035em; max-width: 14em; text-wrap: balance; }

/* Two-column rows (lead-ins, credits): lead or term on the left, detail on the right */
.leadins li, .credits > div { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr); gap: .4rem clamp(1.5rem, 3vw, 3rem); border-bottom: 1px solid var(--line); }
@media (max-width: 40rem) { .leadins li, .credits > div { grid-template-columns: 1fr; } }
.leadins { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.leadins li { padding: clamp(1.1rem, 2vw, 1.6rem) 0; }
.leadins strong { font-size: clamp(1.125rem, 1.5vw, 1.375rem); font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.leadins span { color: var(--fg-muted); }
.numbered.decisions .t { font-weight: 600; }

/* Product screens on soft plates */
.fig { margin: 0; display: flex; flex-direction: column; }
.plate { flex: 1; display: grid; place-items: center; padding: clamp(.75rem, 7%, 3.5rem); background: var(--plate); border-radius: 6px; }
.plate img { width: 100%; max-width: var(--max, 100%); height: auto; border-radius: 6px; box-shadow: var(--shot-shadow); }
.full { margin-inline: calc(var(--gutter) * -1); }
.full .plate { border-radius: 0; padding: clamp(2rem, 7vw, 8rem) var(--gutter); }
.full .plate img { max-width: var(--max, 72rem); }
.full > figcaption.caption { padding-inline: var(--gutter); }
/* Image slot on a plate: a placeholder until the file loads (case-study.js), then a plate image like the rest */
.plate > .media { width: 100%; max-width: var(--max, 100%); }
.full .plate > .media { max-width: var(--max, 72rem); }
.plate > .media.has-img { overflow: visible; }
.plate > .media img { max-width: none; }

/* Simple tables that stack on phones */
.spec { width: 100%; border-collapse: collapse; line-height: 1.5; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 1.1rem 1.5rem 1.1rem 0; border-bottom: 1px solid var(--line); }
.spec thead th { border-bottom-color: var(--line-strong); }
.spec tbody th { width: 28%; font-weight: 600; }
.spec td { color: var(--fg-muted); }
@media (max-width: 40rem) {
  .spec thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .spec tr { display: block; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
  .spec th, .spec tbody th, .spec td { display: block; width: auto; padding: 0; border: 0; }
  .spec td { margin-top: .75rem; }
  .spec td::before { content: attr(data-label); display: block; margin-bottom: .2rem; }
}

/* Persona grid: rows line up across the three columns */
.personas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1px; background: var(--line); border: 1px solid var(--line); }
.persona { display: grid; grid-row: span 4; grid-template-rows: subgrid; background: var(--bg); }
.persona > * { padding: 1.1rem clamp(1.25rem, 2.2vw, 2rem); }
.persona > * + * { border-top: 1px solid var(--line); }
.persona h3 { padding-top: clamp(1.5rem, 2.5vw, 2.25rem); font-size: clamp(1.5rem, 2.4vw, 2.25rem); letter-spacing: -.02em; }
.persona .v { margin-top: .35rem; color: var(--fg-label); }
.persona .answer { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.persona .answer .v { color: var(--fg); }
@media (max-width: 52rem) {
  .personas { grid-template-columns: 1fr; gap: 1px; }
  .persona { display: block; grid-row: auto; }
}

/* Stat band */
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats .v small { margin-left: .2em; font-size: .3em; font-weight: 500; letter-spacing: -.01em; color: var(--fg-muted); }
.stats .v sup { margin-left: .08em; font-size: .5em; font-weight: 500; vertical-align: .55em; line-height: 0; color: var(--accent); }
.footnote { margin-top: 1.5rem; max-width: 46em; font-size: .9375rem; color: var(--fg-subtle); }
@media (max-width: 64rem) { .stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .stats.stats-4 { grid-template-columns: 1fr; } }

/* Timeline (a .flow): years as labels, horizontal on desktop and vertical on phones */
.timeline .step { font-size: clamp(1.25rem, 1.6vw, 1.625rem); }

/* Before/after slider: the range input drives --pos */
.before-after { --pos: 50%; position: relative; aspect-ratio: var(--ratio, 16 / 10); overflow: hidden; border-radius: 6px; background: var(--surface-2); }
.before-after .layer { position: absolute; inset: 0; aspect-ratio: auto; }
.before-after .layer img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.before-after .layer.after { clip-path: inset(0 0 0 var(--pos)); }
.before-after .layer .ph { padding: 1rem calc(50% + 1rem) 1rem 1rem; }
.before-after .layer.after .ph { padding: 1rem 1rem 1rem calc(50% + 1rem); background-color: var(--surface-2); }
.before-after::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--fg); pointer-events: none; }
.before-after input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.before-after .handle {
  position: absolute; top: 50%; left: var(--pos); z-index: 1; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; margin: -1.375rem 0 0 -1.375rem; border-radius: 50%;
  background: var(--fg); color: var(--bg); font: 600 1rem/1 var(--font-sans); pointer-events: none;
}
.before-after input:focus-visible ~ .handle { outline: 2px solid var(--accent); outline-offset: 3px; }
html:not(.js) .before-after input, html:not(.js) .before-after .handle { display: none; }
.before-after .tag {
  position: absolute; top: 1rem; z-index: 1; padding: .3rem .55rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface);
  color: var(--fg-label); pointer-events: none;
}
.before-after .tag.before { left: 1rem; }
.before-after .tag.after { right: 1rem; }
@media (max-width: 40rem) {
  .before-after { aspect-ratio: 4 / 3; }
  .before-after .ph code { display: none; }
}

.pull-quote { margin: 0; }
.pull-quote blockquote { margin: 0; font-size: var(--text-lead); line-height: 1.22; letter-spacing: -.01em; text-wrap: pretty; }

/* Credits */
.credits { margin: 0; border-top: 1px solid var(--line); }
.credits > div { padding: 1.1rem 0; }
.credits dt { line-height: 1.9; }
.credits dd { margin: 0; color: var(--fg-label); }
.ph-chip { display: inline-block; padding: .3rem .6rem; border: 1px dashed var(--line-strong); border-radius: 4px; }

/* Block rhythm inside a chapter. Keep it after the component rules: .fig { margin: 0 } would otherwise cancel it. */
.chapter > * + * { margin-top: clamp(3rem, 6vw, 6rem); }
.chapter > .split + .split { margin-top: clamp(2rem, 4vw, 3.5rem); }
/* A hidden image slot leaves no gap: the splits either side sit as if adjacent, and two lists of the same kind join into one */
.chapter > .split + [hidden] + .split { margin-top: clamp(2rem, 4vw, 3.5rem); }
.chapter > .split:has(.leadins) + [hidden] + .split:has(.leadins),
.chapter > .split:has(.decisions) + [hidden] + .split:has(.decisions) { margin-top: 0; }
.chapter > .split:has(.leadins) + [hidden] + .split .leadins,
.chapter > .split:has(.decisions) + [hidden] + .split .decisions { border-top: 0; }

/* Reveal on scroll (only when JS runs and motion is welcome) */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
