/* OS-MPM project page */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #faf8f3;
  --bg-2: #f3efe7;
  --surface: #ffffff;
  --ink: #17202a;
  --ink-2: #3d4854;
  --muted: #6c7682;
  --line: #e5dfd3;
  --line-2: #d6cfc0;

  /* one meaning per colour, used everywhere on the page */
  --coarse: #4a6078;
  --coarse-soft: #e3e9ef;
  --fine: #3f9160;
  --fine-soft: #dff0e4;
  --overlap: #e0932f;
  --overlap-soft: #fbe9cf;

  --accent: #1f5a86;
  --accent-ink: #164566;

  /* chart series (method identity) */
  --series-os: #2a78d6;
  --series-uniform: #eb6834;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --measure: 720px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 42, .04), 0 8px 28px -12px rgba(23, 32, 42, .14);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
p { margin: 0 0 1.05em; }
strong { font-weight: 620; }
.katex { font-size: 1.04em; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.measure { max-width: var(--measure); }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 650; font-size: 19px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { padding: 6px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: background .2s, color .2s; }
.nav nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav nav a.active { color: var(--ink); background: var(--bg-2); }
.nav .cta { margin-left: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font: 560 15px/1 var(--sans); letter-spacing: .005em;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); border-color: var(--ink-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #24313f; color: #fff; }
.btn.small { padding: 8px 14px; font-size: 13.5px; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 34px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.eyebrow .oa { color: var(--fine); }
.hero h1 {
  margin: 22px auto 0; max-width: 980px;
  font-family: var(--serif); font-weight: 600; letter-spacing: -.022em;
  font-size: clamp(1.95rem, 1.15rem + 2.7vw, 3.1rem); line-height: 1.1;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; font-weight: 500; }
.authors { margin: 26px 0 0; display: flex; gap: 6px 34px; justify-content: center; flex-wrap: wrap; font-size: 18.5px; font-weight: 550; }
.authors a { color: var(--ink); text-decoration: none; }
.authors sup { font-weight: 500; color: var(--muted); margin-left: 2px; font-size: .68em; }
.affils { margin: 10px 0 0; display: flex; gap: 2px 26px; justify-content: center; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); }
.affils sup { margin-right: 3px; }
.actions { margin: 30px 0 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lede {
  margin: 34px auto 0; max-width: 760px;
  font-family: var(--serif); font-size: clamp(1.14rem, 1.02rem + .5vw, 1.36rem); line-height: 1.5; color: var(--ink-2);
  text-wrap: pretty;
}
.lede b { color: var(--ink); font-weight: 600; }

/* media card */
.media {
  margin: 44px auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.media video, .media > img { width: 100%; height: auto; background: #fff; }
.media-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); text-align: left;
}
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
.key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.key i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.key i.line { height: 2px; width: 16px; border-radius: 1px; }
.c-coarse { background: var(--coarse); } .c-fine { background: var(--fine); } .c-overlap { background: var(--overlap); }
.c-os { background: var(--series-os); } .c-uniform { background: var(--series-uniform); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 56px 0 0; border-block: 1px solid var(--line); }
.stat { padding: 30px 28px 28px; text-align: left; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 4px; }
.stat .v { font: 620 clamp(2.1rem, 1.5rem + 1.9vw, 2.9rem)/1 var(--sans); letter-spacing: -.035em; color: var(--ink); }
.stat .v small { font-size: .52em; font-weight: 560; letter-spacing: -.01em; color: var(--ink-2); margin-left: 2px; }
.stat .l { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); max-width: 30ch; }

/* ---------- sections ---------- */
section { padding: 92px 0 8px; }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 30px; }
.kicker { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.kicker::after { content: ""; height: 1px; width: 56px; background: color-mix(in srgb, var(--accent) 40%, transparent); }
h2 { margin: 14px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.14; letter-spacing: -.018em; text-wrap: balance; max-width: 22ch; }
h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 620; font-size: 1.42rem; line-height: 1.22; letter-spacing: -.01em; }
h4 { margin: 0 0 6px; font: 640 1rem/1.35 var(--sans); }
.sub { margin-top: 16px; font-size: 1.1rem; color: var(--ink-2); max-width: var(--measure); }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.two.wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.two.wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.sym-b { color: var(--coarse); font-weight: 600; } .sym-s { color: #2f7a4f; font-weight: 600; }

/* figure cards */
figure { margin: 0; }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.fig .plate { padding: 22px 24px; background: #fff; }
.fig .plate.tight { padding: 14px 16px; }
.fig .plate img { width: 100%; height: auto; margin-inline: auto; }
.fig figcaption { padding: 13px 20px 15px; border-top: 1px solid var(--line); font-size: 13.8px; line-height: 1.55; color: var(--ink-2); background: #fdfcfa; }
.fig figcaption b { color: var(--ink); font-weight: 620; }
.fig figcaption .ref { color: var(--muted); white-space: nowrap; }
.zoomable { cursor: zoom-in; }

/* idea illustration */
.idea { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.idea .pane { padding: 22px 22px 18px; }
.idea .pane + .pane { border-left: 1px solid var(--line); }
.idea .pane h4 { font-size: 14px; letter-spacing: .02em; }
.idea .pane p { margin: 2px 0 14px; font-size: 13.5px; color: var(--muted); line-height: 1.45; min-height: 2.9em; }
.idea svg { width: 100%; height: auto; border-radius: 6px; }

/* ---------- method stepper ---------- */
.stepper { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); }
.stepper .side { border-right: 1px solid var(--line); background: #fdfcfa; display: flex; flex-direction: column; }
.stepper .side header { padding: 20px 22px 14px; }
.stepper .side header .t { font: 640 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stepper .side header .h { margin-top: 8px; font-family: var(--serif); font-weight: 620; font-size: 1.22rem; line-height: 1.25; }
.steps { list-style: none; margin: 0; padding: 0 10px 10px; flex: 1; }
.steps li { margin: 2px 0; }
.steps button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  width: 100%; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .2s;
}
.steps button:hover { background: var(--bg-2); }
.steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.steps .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 620 12.5px/1 var(--sans); color: var(--muted); border: 1.5px solid var(--line-2); background: #fff; transition: all .25s; }
.steps .name { font: 600 15px/1.3 var(--sans); color: var(--ink-2); padding-top: 3px; }
.steps .desc { display: none; grid-column: 2; margin-top: 4px; font-size: 13.6px; line-height: 1.5; color: var(--ink-2); }
.steps li.on button { background: #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 18px -10px rgba(23,32,42,.25); }
.steps li.on .num { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.on .name { color: var(--ink); }
.steps li.on .desc { display: block; }
.steps li.done .num { border-color: var(--fine); color: var(--fine); }
.stepper .controls { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.iconbtn { all: unset; box-sizing: border-box; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--ink); border: 1px solid var(--line-2); background: #fff; transition: background .2s, transform .15s; }
.iconbtn:hover { background: var(--bg-2); }
.iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn.play { background: var(--ink); color: #fff; border-color: var(--ink); width: 40px; height: 40px; }
.iconbtn.play:hover { background: #24313f; }
.controls .status { margin-left: auto; font: 500 12.5px/1.3 var(--sans); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.controls .status b { color: var(--ink); font-weight: 620; }
.stage { position: relative; padding: 18px 20px 8px; min-width: 0; }
.stage svg { width: 100%; height: auto; overflow: visible; }
.stage .note { padding: 0 4px 12px; font-size: 12.5px; color: var(--muted); }

/* stage svg parts */
#scene text { font-family: var(--sans); }
#scene .lbl { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); }
#scene .lbl.s { font-size: 11.5px; font-weight: 500; fill: var(--muted); }
#scene .dom-b, #scene .dom-s, #scene .ov, #scene .grid-b, #scene .grid-s, #scene .pb, #scene .ps { transition: opacity .45s ease; }
#scene .dom-b { fill: var(--coarse-soft); }
#scene .dom-s { fill: var(--fine-soft); }
#scene .ov { fill: var(--overlap-soft); }
#scene .grid-b line { stroke: #9fb0c2; stroke-width: 1.1; }
#scene .grid-s line { stroke: #9ccfae; stroke-width: .8; }
#scene .pb circle { fill: var(--coarse); }
#scene .ps circle { fill: var(--fine); }
#scene .gam circle { stroke: #fff; stroke-width: 1.5; transition: r .3s, opacity .3s; }
#scene .gam-b circle { fill: var(--coarse); }
#scene .gam-s circle { fill: #2f7a4f; }
#scene .flow path { fill: none; stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .35s; }
#scene .flow.sb path { stroke: #2f7a4f; }
#scene .flow.bs path { stroke: var(--coarse); }
#scene .flow path.go { stroke-dasharray: 5 7; animation: dash 0.9s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -24; } }
#scene[data-phase="coarse"] .flow.sb path, #scene[data-phase="fine"] .flow.bs path, #scene[data-phase="check"] .flow path { opacity: 1; }
#scene[data-phase="coarse"] .dom-s, #scene[data-phase="coarse"] .grid-s, #scene[data-phase="coarse"] .ps { opacity: .38; }
#scene[data-phase="fine"] .dom-b, #scene[data-phase="fine"] .grid-b, #scene[data-phase="fine"] .pb { opacity: .38; }
#scene[data-phase="coarse"] .gam-b circle, #scene[data-phase="fine"] .gam-s circle, #scene[data-phase="check"] .gam circle { r: 5.2; }
#scene .halo { fill: none; stroke-width: 2; opacity: 0; transition: opacity .35s; }
#scene .halo.b { stroke: var(--coarse); } #scene .halo.s { stroke: #2f7a4f; }
#scene[data-phase="coarse"] .halo.b, #scene[data-phase="advance"] .halo.b, #scene[data-phase="fine"] .halo.s { opacity: 1; }
#scene .tl-track { fill: #eef0f2; }
#scene .tl-b { fill: var(--coarse); } #scene .tl-s { fill: var(--fine); }
#scene .tl-tick { stroke: var(--line-2); stroke-width: 1; }
#scene .interp { stroke: #a9b2bc; stroke-width: 1; stroke-dasharray: 3 3; fill: none; opacity: 0; transition: opacity .3s; }
#scene[data-phase="fine"] .interp { opacity: 1; }
#scene .res-bar { fill: var(--accent); transition: height .5s ease, y .5s ease, opacity .3s; }
#scene .res-bar.ok { fill: var(--fine); }
#scene .eps { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 3; }
#scene .axis { stroke: var(--line-2); stroke-width: 1; }
#scene .badge rect { fill: var(--ink); } #scene .badge text { fill: #fff; font-size: 11.5px; font-weight: 600; }
#scene .verdict { font-size: 12px; font-weight: 640; opacity: 0; transition: opacity .3s; }
#scene .verdict.show { opacity: 1; }

/* ---------- results ---------- */
.result { padding: 54px 0 0; }
.result + .result { margin-top: 54px; border-top: 1px solid var(--line); }
.result p { color: var(--ink-2); }

.tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: 999px; border: 1px solid var(--line); }
.tabs button { all: unset; box-sizing: border-box; padding: 7px 15px; border-radius: 999px; font: 560 13.5px/1 var(--sans); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,32,42,.14); }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tabbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fdfcfa; font-size: 13.5px; color: var(--muted); }

/* speed-up chart */
.speed { --surface-1: #ffffff; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px 18px; }
.speed .title { font: 640 1.02rem/1.35 var(--sans); }
.speed .subtitle { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.speed .rows { margin-top: 18px; display: grid; gap: 0; }
.speed .row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 96px; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.speed .row .name { font-size: 14px; color: var(--ink-2); line-height: 1.35; }
.speed .row .name b { display: block; color: var(--ink); font-weight: 620; font-size: 15px; }
.speed .bars { display: grid; gap: 2px; position: relative; }
.speed .bar { display: flex; align-items: center; gap: 9px; height: 20px; border-radius: 4px; outline: none; }
.speed .bar i { display: block; height: 14px; width: 0; border-radius: 0 4px 4px 0; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.speed .bar.u i { background: var(--series-uniform); } .speed .bar.o i { background: var(--series-os); }
.speed .bar span { font: 500 12.5px/1 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.speed .bar:hover i, .speed .bar:focus-visible i { filter: brightness(.92); }
.speed .x { text-align: right; font: 640 1.75rem/1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.speed .x small { display: block; margin-top: 5px; font: 500 11.5px/1.2 var(--sans); letter-spacing: 0; color: var(--muted); }
.speed .foot { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.speed .foot .legend { color: var(--ink-2); }
.tip { position: fixed; z-index: 80; pointer-events: none; padding: 8px 11px; border-radius: 8px; background: var(--ink); color: #fff; font: 500 12.5px/1.45 var(--sans); box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; max-width: 260px; }
.tip.show { opacity: 1; transform: none; }
.tip b { font-weight: 640; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }

/* ---------- citation ---------- */
.cite { position: relative; margin-top: 26px; background: #16202b; color: #dbe3ea; border-radius: var(--radius); padding: 24px 26px; font: 450 13.6px/1.75 var(--mono); overflow-x: auto; box-shadow: var(--shadow); }
.cite pre { margin: 0; white-space: pre; }
.cite .k { color: #8fb8dc; } .cite .f { color: #9ed3ad; } .cite .p { color: #7f8c99; }
.cite .copy { position: absolute; top: 14px; right: 14px; all: unset; position: absolute; top: 14px; right: 14px; cursor: pointer; padding: 7px 12px; border-radius: 8px; font: 560 12.5px/1 var(--sans); color: #dbe3ea; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); transition: background .2s; }
.cite .copy:hover { background: rgba(255,255,255,.16); }
.cite .copy:focus-visible { outline: 2px solid #8fb8dc; outline-offset: 2px; }
.plain-cite { margin-top: 18px; font-size: 15px; color: var(--ink-2); max-width: 820px; }
.plain-cite i { font-family: var(--serif); font-size: 1.04em; }

footer { margin-top: 96px; padding: 34px 0 44px; border-top: 1px solid var(--line); font-size: 13.8px; color: var(--muted); }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 40px; align-items: start; }
footer p { margin: 0 0 6px; max-width: 760px; }
footer a { color: var(--ink-2); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(18, 24, 31, .82); display: none; place-items: center; padding: 28px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1500px, 100%); max-height: calc(100vh - 56px); width: auto; height: auto; background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.lightbox button { all: unset; position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); cursor: pointer; font-size: 22px; line-height: 1; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .two, .two.wide-right, .two.wide-left { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .stepper { grid-template-columns: minmax(0, 1fr); }
  .stepper .side { border-right: 0; border-top: 1px solid var(--line); order: 2; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { width: min(var(--wrap), 100% - 32px); }
  .nav nav a:not(.cta) { display: none; }
  .hero { padding-top: 40px; }
  .authors { font-size: 17px; gap: 4px 22px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding: 22px 4px; }
  .stat:first-child { border-top: 0; }
  .stat .l { max-width: none; }
  section { padding-top: 64px; }
  .idea { grid-template-columns: minmax(0, 1fr); }
  .idea .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .idea .pane p { min-height: 0; }
  .fig .plate { padding: 12px; }
  .speed { padding: 18px 16px 14px; }
  .speed .row { grid-template-columns: minmax(0, 1fr) 84px; gap: 6px 12px; }
  .speed .row .name { grid-column: 1 / -1; }
  .speed .x { font-size: 1.45rem; }
  footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .cite { padding: 54px 18px 20px; font-size: 12.4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #scene .flow path.go { animation: none; }
  .speed .bar i { transition: none; }
}

@media print {
  .nav, .stepper .controls, .lightbox { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* hero: two synchronised views of the same run */
.media.duo .views { display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.media.duo .view { position: relative; min-width: 0; }
.media.duo .view + .view { border-left: 1px solid var(--line); }
.media.duo video { aspect-ratio: 1104 / 832; object-fit: cover; }
.view-label { position: absolute; left: 16px; top: 14px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.86); border: 1px solid var(--line); font: 600 12.5px/1.3 var(--sans); color: var(--ink-2); backdrop-filter: blur(6px); }
@media (max-width: 760px) {
  .media.duo .views { grid-template-columns: minmax(0, 1fr); }
  .media.duo .view + .view { border-left: 0; border-top: 1px solid var(--line); }
}

/* stepper: animated fills use transforms */
#scene .tl-fill { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
#scene .res-bar { transform-box: fill-box; transform-origin: center bottom; transform: scaleY(0); transition: none; }

/* ---------- refinements ---------- */
sub, sup { line-height: 0; }
.nb { white-space: nowrap; }
.key > span { white-space: normal; }
.idea .pane p { min-height: 4.4em; }

#scene .lbl { font-size: 13.5px; }
#scene .lbl.s { font-size: 12px; }

.speed .row { grid-template-columns: 104px minmax(0, 1fr) 96px; }

@media (min-width: 981px) {
  .result > .two > .fig, .result > .two > .pair { position: sticky; top: 84px; }
}
@media (max-width: 760px) {
  .stage { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stage svg { min-width: 600px; }
  .hero h1 { letter-spacing: -.015em; }
}
.speed .foot { min-width: 0; }
.stage .swipe { display: none; }
@media (max-width: 760px) { .stage .swipe { display: block; position: sticky; left: 0; padding-bottom: 2px; } .stage .note { position: sticky; left: 0; } }

/* ---------- trimmed layout ---------- */
.trio { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trio .card { padding: 20px 22px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trio .card .n { font: 640 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.trio .card h4 { margin-top: 10px; font-family: var(--serif); font-size: 1.16rem; font-weight: 620; }
.trio .card p { margin: 6px 0 0; font-size: 14.8px; line-height: 1.58; color: var(--ink-2); }
.result h3 { font-size: 1.5rem; }
.result p.fine { font-size: 13.5px; color: var(--muted); }
.speed .subtitle { margin-bottom: 4px; }
.scope-note { margin: 54px 0 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); font-size: 15px; color: var(--ink-2); }
.ack { margin-top: 30px; max-width: 860px; font-size: 14.5px; color: var(--muted); }
.ack b { color: var(--ink-2); }
@media (min-width: 981px) { .pair.hc { grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); } }
@media (max-width: 980px) { .trio { grid-template-columns: minmax(0, 1fr); } }
.key.ramp i { width: 96px; height: 10px; border-radius: 3px; }
.c-disp { background: linear-gradient(90deg, #30123b, #4454c3, #448ffe, #1fc9dd, #2aefa1, #7dff56, #c1f334, #f1cb3a, #fe932a, #ea4e0d, #be2102, #7a0403); }
.media.duo .media-bar > span:last-child { flex-basis: 100%; }

/* inclusion: full-width text above a two-by-two figure */
.result p.span { margin: 14px 0 26px; }
.fig .plate.quad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 30px; padding: 20px 24px 24px; }
.quad .cell { min-width: 0; }
.quad .cell h4 { margin: 0 0 8px; font: 620 13.5px/1.35 var(--sans); letter-spacing: 0; color: var(--ink); }
@media (max-width: 760px) {
  .fig .plate.quad { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 14px 12px 16px; }
}
