/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --band: #f3f5f0;
  --ink: #17201c;
  --muted: #46534d;
  --soft: #65726b;
  --line: #e2e7df;
  --line-strong: #cdd6c9;
  --accent: #3b6b33;
  --accent-strong: #2b5225;
  --accent-band: #e8f1e3;
  --accent-ink: #ffffff;
  --meta: #a5442a;
  --meta-band: #fbebe3;
  --blue: #2c6275;
  --blue-band: #e4eff3;
  --amber: #8a5d0c;
  --amber-band: #f8eed8;
  --secondary-bar: #8d9a92;
  --grid: #e9ede6;
  --shadow: 0 1px 2px rgb(23 32 28 / .05), 0 10px 28px -14px rgb(23 32 28 / .22);
  --shadow-lg: 0 2px 6px rgb(23 32 28 / .04), 0 28px 60px -30px rgb(23 32 28 / .35);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .9, .24, 1);
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

:root[data-theme="dark"] {
  --bg: #0e1311;
  --surface: #151c19;
  --band: #121916;
  --ink: #e8eee9;
  --muted: #b6c3ba;
  --soft: #91a197;
  --line: #26302b;
  --line-strong: #36423b;
  --accent: #93cf80;
  --accent-strong: #b6e3a6;
  --accent-band: #1b2b1b;
  --accent-ink: #0e1a0c;
  --meta: #f0a283;
  --meta-band: #35201a;
  --blue: #8fc4d8;
  --blue-band: #162930;
  --amber: #e7bf6c;
  --amber-band: #30260f;
  --secondary-bar: #66756c;
  --grid: #222b27;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 10px 28px -14px rgb(0 0 0 / .7);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / .3), 0 28px 60px -30px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
body {
  color: var(--ink);
  background: var(--bg);
  font: 16.5px/1.65 var(--font);
  font-feature-settings: "cv05", "cv08", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; width: 100%; height: auto; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
:where(button, a) { -webkit-tap-highlight-color: transparent; }
.wrap { width: min(1080px, calc(100% - 56px)); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 30; padding: 8px 13px; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }

/* ───────────────────────── Header ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.header-inner {
  width: min(1180px, calc(100% - 48px));
  min-height: 62px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 720;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #3b6b33, #2c6275);
  font-size: .86rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
.header-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.header-nav a {
  padding: 5px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s, background .2s;
}
.header-nav a:hover { color: var(--ink); background: var(--band); text-decoration: none; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 13px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: .84rem;
  font-weight: 700;
  transition: filter .2s, transform .2s;
}
.header-pill:hover { text-decoration: none; filter: brightness(1.08); }
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .2s, color .2s;
}
.icon-button:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.icon-button .i { width: 17px; height: 17px; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ───────────────────────── Hero ───────────────────────── */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: 64px 28px; text-align: center; }
.hero-backdrop { position: absolute; inset: 0 0 auto; height: 720px; z-index: -1; pointer-events: none; }
.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 13%, transparent) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero-backdrop span {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
.hero-backdrop span:nth-child(1) { left: calc(50% - 560px); top: -170px; background: color-mix(in srgb, var(--accent) 34%, transparent); }
.hero-backdrop span:nth-child(2) { left: calc(50% + 40px); top: -230px; background: color-mix(in srgb, var(--blue) 30%, transparent); animation-delay: -7s; }
.hero-backdrop span:nth-child(3) { left: calc(50% - 180px); top: 140px; width: 380px; height: 380px; background: color-mix(in srgb, var(--meta) 16%, transparent); animation-delay: -14s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, 24px, 0) scale(1.06); }
  100% { transform: translate3d(-30px, 10px, 0) scale(.96); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px 14px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: var(--shadow);
  font-size: .82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color .2s, color .2s;
}
.hero-badge:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--meta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--meta) 22%, transparent); }
.badge-sep { color: var(--soft); }
.hero h1 { margin: 0 auto 26px; font-weight: 800; }
.wordmark {
  display: block;
  padding-bottom: .04em;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.05em;
  background: linear-gradient(100deg, var(--accent-strong) 5%, var(--accent) 45%, var(--blue) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-line {
  display: block;
  max-width: 800px;
  margin: 14px auto 0;
  color: var(--ink);
  font-size: clamp(1.32rem, 2.7vw, 1.95rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.authors, .affiliations { display: flex; justify-content: center; flex-wrap: wrap; }
.authors { max-width: 860px; margin: 0 auto 6px; gap: 2px 18px; color: var(--ink); font-size: 1.02rem; font-weight: 520; }
.authors a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-decoration-thickness: 1.5px; }
.authors a:hover { color: var(--accent); }
.authors > span, .affiliations > span { white-space: nowrap; }
sup { margin-left: 1px; color: var(--accent); font-size: .66em; font-weight: 700; }
.affiliations { gap: 0 20px; color: var(--soft); font-size: .92rem; }
.affiliations sup { margin-right: 3px; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 28px 0 30px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 19px 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--bg);
  background: var(--ink);
  font-size: .93rem;
  font-weight: 650;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 6px 16px -8px rgb(0 0 0 / .35);
  transition: transform .2s var(--ease), box-shadow .2s, background .2s;
}
.button .i { width: 18px; height: 18px; }
.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 2px 4px rgb(0 0 0 / .08), 0 10px 22px -10px rgb(0 0 0 / .45); }
.button-quiet { border-color: var(--line-strong); color: var(--ink); background: var(--surface); box-shadow: none; }
.button-quiet:hover { border-color: var(--accent); color: var(--accent); }
.hero-lead {
  max-width: 720px;
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.8vw, 1.2rem);
  line-height: 1.55;
  text-wrap: balance;
}
.hero-lead em { color: var(--ink); font-style: normal; font-weight: 650; }

/* ───────────────────────── Figures ───────────────────────── */
.paper-figure { width: 100%; }
.hero-figure { max-width: 940px; margin-inline: auto; }
.figure-frame {
  display: block;
  padding: clamp(10px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
  cursor: zoom-in;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
}
.figure-frame:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.figure-frame img { border-radius: 6px; }
.paper-figure figcaption { padding: 14px 4px 0; color: var(--soft); font-size: .88rem; line-height: 1.55; text-align: left; }
.paper-figure figcaption strong { color: var(--ink); }

/* ───────────────────────── Sections ───────────────────────── */
.section { padding-block: clamp(60px, 8vw, 96px); }
.section-heading { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section-label::before, .section-label::after { content: ""; width: 18px; height: 1.5px; border-radius: 2px; background: currentColor; opacity: .5; }
.section-heading h2 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.section-heading > p:last-child { color: var(--muted); text-wrap: pretty; }
.workflow-section {
  border-block: 1px solid var(--line);
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--band);
}
.workflow-note { max-width: 780px; margin: 16px auto 0; color: var(--soft); font-size: .86rem; text-align: center; text-wrap: pretty; }

/* ───────────────────────── Walkthrough animation ───────────────────────── */
.flow {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.flow-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.no-js .flow-tabs { display: none; }
.flow-tab {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 58px;
  padding: 16px 22px 18px;
  border: 0;
  color: var(--soft);
  background: transparent;
  text-align: left;
  transition: color .25s, background .25s;
}
.flow-tab + .flow-tab { border-left: 1px solid var(--line); }
.flow-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--band) 60%, transparent); }
.flow-tab[aria-selected="true"] { color: var(--ink); }
.flow-tab-num { font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .05em; color: var(--soft); }
.flow-tab[aria-selected="true"] .flow-tab-num { color: var(--accent); }
.flow-tab-name { font-size: .95rem; font-weight: 680; letter-spacing: -.01em; }
.flow-tab-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; background: transparent; }
.flow-tab-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; }
.flow-tab[aria-selected="true"] .flow-tab-bar { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.flow-stage { display: grid; padding: clamp(18px, 3.2vw, 34px); }
.scene { grid-area: 1 / 1; align-self: center; min-width: 0; opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.scene.is-current { opacity: 1; visibility: visible; transition: opacity .4s .16s, visibility 0s; }
.no-js .flow-stage { display: block; }
.no-js .scene { opacity: 1; visibility: visible; }
.no-js .scene + .scene { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.flow.is-paused *, .flow.is-paused *::before, .flow.is-paused *::after { animation-play-state: paused !important; }

.flow-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 18px 12px 24px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--band) 55%, var(--surface));
}
.flow-caption { min-height: 2.9em; display: flex; align-items: center; color: var(--muted); font-size: .92rem; line-height: 1.45; text-wrap: pretty; }
.flow-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 36px;
  padding: 4px 14px 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: .85rem;
  font-weight: 650;
  transition: border-color .2s, color .2s;
}
.flow-toggle:hover { border-color: var(--accent); color: var(--accent); }
.flow-toggle-icon { width: 12px; height: 12px; display: inline-grid; place-items: center; }
.flow-toggle-icon::before { content: ""; width: 10px; height: 11px; border-inline: 3.4px solid currentColor; }
.flow.is-paused .flow-toggle-icon::before { width: 0; height: 0; margin-left: 2px; border-inline: 0; border-left: 10px solid currentColor; border-block: 6px solid transparent; }

/* Shared pieces */
.node {
  --c: var(--soft);
  --cb: var(--surface);
  --ce: var(--line-strong);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 92px;
  padding: 12px 6px 11px;
  border: 1.5px solid var(--ce);
  border-radius: 13px;
  color: var(--c);
  background: var(--cb);
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.22;
  text-align: center;
  transition: color .35s, background .35s, border-color .35s, box-shadow .35s, transform .35s var(--ease);
}
.node .i { width: 24px; height: 24px; stroke-width: 1.7; }
.node span { color: var(--ink); opacity: .78; transition: opacity .35s; }
.node.is-hot, .node.is-done { transform: translateY(-2px); }
.node.is-hot span, .node.is-done span { opacity: 1; }

.link {
  --lc: var(--accent);
  position: relative;
  align-self: center;
  height: 2px;
  margin-inline: 4px;
  color: var(--line-strong);
  background: currentColor;
  transition: color .3s;
}
.link::before {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  translate: 0 -50%;
  border-left: 6px solid currentColor;
  border-block: 4.5px solid transparent;
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--lc);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc) 22%, transparent);
  opacity: 0;
}
.link.is-hot { color: var(--lc); }
.link.is-hot::after { animation: travel .6s var(--ease) forwards; }
@keyframes travel {
  0% { left: 0; opacity: 0; }
  15%, 80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.gear { transform-origin: 50% 50%; }
.is-spinning .gear { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scene 1 — construction */
.b-source { display: flex; justify-content: center; }
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px 10px 14px;
  border: 1.5px solid color-mix(in srgb, var(--blue) 45%, transparent);
  border-radius: 14px;
  color: var(--blue);
  background: var(--blue-band);
  font-size: .95rem;
  transition: box-shadow .4s, transform .4s var(--ease);
}
.source-chip strong { color: var(--ink); font-weight: 700; }
.source-chip .i { width: 22px; height: 22px; }
.history-lines { display: grid; gap: 3px; width: 34px; padding: 6px 7px; border: 1.5px solid currentColor; border-radius: 5px; }
.history-lines i { display: block; height: 2px; border-radius: 2px; background: currentColor; opacity: .75; }
.history-lines i:nth-child(2) { width: 75%; }
.history-lines i:nth-child(3) { width: 55%; }
.scene-build[data-src] .source-chip { box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 12%, transparent); }

.b-split { position: relative; height: 38px; color: color-mix(in srgb, var(--blue) 55%, var(--line-strong)); }
.split-stem { position: absolute; left: 50%; top: 0; height: 14px; border-left: 2px solid currentColor; translate: -1px 0; }
.split-bar {
  position: absolute;
  left: calc(25% - 9px);
  right: calc(25% - 9px);
  top: 14px;
  height: 20px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  clip-path: inset(0 50% 0 50%);
  transition: clip-path .7s var(--ease);
}
.split-bar::before, .split-bar::after {
  content: "";
  position: absolute;
  bottom: -4px;
  border-top: 7px solid currentColor;
  border-inline: 5px solid transparent;
}
.split-bar::before { left: -6px; }
.split-bar::after { right: -6px; }
.scene-build[data-src] .split-bar { clip-path: inset(-10px -10px -10px -10px); }

.b-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 4px; }
.panel {
  --tone: var(--meta);
  --tone-band: var(--meta-band);
  --panel-bg: color-mix(in srgb, var(--tone-band) 45%, var(--surface));
  padding: 16px 18px 14px;
  border: 1.5px solid color-mix(in srgb, var(--tone) 32%, transparent);
  border-radius: 18px;
  background: var(--panel-bg);
}
.panel-hyper { --tone: var(--accent); --tone-band: var(--accent-band); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 14px; }
.panel-head h3 { color: var(--tone); font-size: 1.12rem; font-weight: 780; letter-spacing: -.02em; }
.panel-head p { color: var(--muted); font-size: .84rem; font-weight: 600; }

.pipe { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) 30px minmax(0, 1fr); grid-template-rows: auto 44px; }
.pipe .link { --lc: var(--tone); }
.loop { grid-column: 1 / -1; grid-row: 2; position: relative; color: var(--line-strong); transition: color .3s; }
.loop-path {
  position: absolute;
  top: 0;
  left: calc((100% - 60px) / 6);
  width: calc((100% - 60px) / 3 + 30px);
  height: 24px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}
.loop-path::before {
  content: "";
  position: absolute;
  left: -6.5px;
  top: -6px;
  border-bottom: 7px solid currentColor;
  border-inline: 5.5px solid transparent;
}
.loop-path::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--meta);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--meta) 22%, transparent);
  opacity: 0;
}
.loop-label { position: absolute; top: 14px; left: calc((100% - 60px) / 6); width: calc((100% - 60px) / 3 + 30px); text-align: center; line-height: 1; }
.loop-label span { padding: 0 7px; color: var(--soft); background: var(--panel-bg); font-size: .72rem; font-weight: 650; transition: color .3s; }
.loop.is-hot { color: var(--meta); }
.loop.is-hot .loop-label span { color: var(--meta); }
.loop.is-hot .loop-path::after { animation: loopback .9s ease-in-out forwards; }
@keyframes loopback {
  0% { left: 100%; top: 0; opacity: 0; }
  10% { opacity: 1; }
  25% { left: 100%; top: 100%; }
  75% { left: 0; top: 100%; }
  90% { opacity: 1; }
  100% { left: 0; top: 0; opacity: 0; }
}

.ready {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-4px) scale(.94);
  transition: opacity .4s, transform .45s var(--ease);
}
.ready .i { width: 15px; height: 15px; stroke-width: 2.6; }
.ready.is-on { opacity: 1; transform: none; }

.meter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed color-mix(in srgb, var(--tone) 28%, transparent); font-size: .8rem; }
.meter-label { color: var(--muted); font-weight: 600; }
.pips { display: inline-flex; align-items: center; gap: 5px; color: var(--soft); }
.pips i { width: 18px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--meta) 16%, var(--grid)); transition: background .35s, transform .35s var(--ease); }
.pips i.is-on { background: var(--meta); }
.pips b { margin-left: 2px; font-weight: 700; letter-spacing: .05em; }
.zero { color: var(--accent); font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.users { display: flex; align-items: center; gap: 9px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--tone) 28%, transparent); }
.users-label { margin-right: auto; color: var(--muted); font-size: .8rem; font-weight: 600; }
.u {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  color: var(--soft);
  background: var(--surface);
  font-size: .76rem;
  font-weight: 750;
  transition: color .35s, background .35s, border-color .35s;
}
.u::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--tone);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s;
}
.u.is-run { color: var(--tone); border-color: var(--tone); }
.u.is-run::after { opacity: 1; animation: spin .9s linear infinite; }
.u.is-done { color: #fff; border-color: var(--tone); background: var(--tone); }
:root[data-theme="dark"] .u.is-done { color: var(--bg); }
.u::before {
  content: "✓";
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--panel-bg);
  border-radius: 50%;
  color: #fff;
  background: var(--tone);
  font-size: .55rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .3s, transform .35s var(--ease);
}
:root[data-theme="dark"] .u::before { color: var(--bg); }
.u.is-done::before { opacity: 1; transform: none; }

.panel-meta .node.is-hot { --c: var(--meta); --cb: var(--meta-band); --ce: var(--meta); box-shadow: 0 0 0 4px color-mix(in srgb, var(--meta) 14%, transparent), 0 10px 20px -12px color-mix(in srgb, var(--meta) 60%, transparent); }
.panel-hyper .node.is-hot { --c: var(--accent); --cb: var(--accent-band); --ce: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), 0 10px 20px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.panel-hyper .node.is-done { --c: var(--accent-ink); --cb: var(--accent); --ce: var(--accent); }
.panel-hyper .node.is-done span { color: var(--accent-ink); }
.node.is-flash { animation: flash .75s ease-in-out; }
.node.is-flash.is-flash-2 { animation-name: flash2; }
@keyframes flash { 40% { border-color: var(--accent); background: var(--accent-band); color: var(--accent); transform: translateY(-3px); } }
@keyframes flash2 { 40% { border-color: var(--accent); background: var(--accent-band); color: var(--accent); transform: translateY(-3px); } }

/* Scene 2 — inference */
.i-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 44px minmax(0, .82fr) 44px minmax(0, 1.08fr) 44px minmax(0, 1fr);
  align-items: center;
}
.i-in, .i-out { display: grid; gap: 12px; }
.card {
  padding: 13px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .35s, box-shadow .35s, background .35s, transform .35s var(--ease);
}
.card-title { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.card-title .i { width: 15px; height: 15px; }
.i-question { display: flex; align-items: flex-start; gap: 10px; border-color: color-mix(in srgb, var(--blue) 45%, transparent); background: var(--blue-band); }
.i-question .i { width: 20px; height: 20px; margin-top: 2px; color: var(--blue); }
.i-question small, .slot small, .bubble small { display: block; color: var(--soft); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.i-question strong { display: block; min-height: 1.35em; font-size: .9rem; font-weight: 680; line-height: 1.35; }
.typed.is-typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.rec {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--ink);
  background: var(--band);
  font-size: .8rem;
  line-height: 1.3;
  transition: background .4s, opacity .4s, color .4s;
}
.rec + .rec { margin-top: 5px; }
.rec::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--secondary-bar); transition: background .3s, transform .3s; }
.scene-infer[data-r] .rec-1, .scene-infer[data-r] .rec-2 { background: var(--accent-band); }
.scene-infer[data-r] .rec-1::before, .scene-infer[data-r] .rec-2::before { background: var(--accent); transform: rotate(45deg) scale(1.1); }
.scene-infer[data-r] .rec-3 { opacity: .45; }
.scene-infer[data-r] .rec-2 { transition-delay: .15s; }
.scene-infer[data-r] .rec-2::before { transition-delay: .15s; }

.i-harness { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 16px 10px; text-align: center; }
.i-harness .gear { width: 34px; height: 34px; color: var(--soft); transition: color .35s; }
.i-harness strong { font-size: .86rem; font-weight: 720; line-height: 1.25; }
.tag { padding: 2px 9px; border-radius: 999px; color: var(--soft); background: var(--band); font-size: .72rem; font-weight: 650; transition: color .35s, background .35s; }
.scene-infer[data-h] .i-harness { border-color: var(--accent); background: color-mix(in srgb, var(--accent-band) 60%, var(--surface)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.scene-infer[data-h] .i-harness .gear { color: var(--accent); }
.scene-infer[data-r] .tag-recall, .scene-infer[data-g] .tag-guide { color: var(--accent-ink); background: var(--accent); }

.i-inputs .card-title { margin-bottom: 8px; }
.slot {
  padding: 6px 10px;
  border-left: 3px solid var(--tone, var(--blue));
  border-radius: 4px 9px 9px 4px;
  background: var(--tone-band, var(--blue-band));
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.32;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .4s, transform .45s var(--ease);
}
.slot + .slot { margin-top: 6px; }
.slot-q { --tone: var(--blue); --tone-band: var(--blue-band); }
.slot-e { --tone: var(--accent); --tone-band: var(--accent-band); }
.slot-g { --tone: var(--amber); --tone-band: var(--amber-band); }
.slot small { color: var(--tone); }
.scene-infer[data-e] .slot-q, .scene-infer[data-e] .slot-e, .scene-infer[data-g] .slot-g { opacity: 1; transform: none; }
.scene-infer[data-e] .slot-e { transition-delay: .12s; }

.i-model { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; text-align: center; }
.i-model .i { width: 30px; height: 30px; color: var(--soft); transition: color .35s; }
.i-model strong { font-size: .84rem; font-weight: 700; line-height: 1.25; }
.scene-infer[data-m] .i-model { border-color: var(--blue); background: color-mix(in srgb, var(--blue-band) 60%, var(--surface)); }
.scene-infer[data-m] .i-model .i { color: var(--blue); }
.scene-infer[data-now="m"] .i-model { box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 14%, transparent); transform: translateY(-2px); }
.bubble {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(6px) scale(.97);
  transform-origin: left bottom;
  transition: opacity .4s, transform .45s var(--ease);
}
.bubble small { color: inherit; opacity: .75; }
.bubble .typed { display: block; min-height: 1.35em; }
.scene-infer[data-a] .bubble { opacity: 1; transform: none; }

/* Scene 3 — cost */
.c-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px 44px; max-width: 900px; margin-inline: auto; padding-block: 18px; }
.c-title { font-size: 1.28rem; font-weight: 750; letter-spacing: -.02em; }
.c-sub { margin-top: 3px; color: var(--soft); font-size: .9rem; }
.c-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 78px; align-items: center; gap: 16px; margin-top: 28px; }
.c-name { font-size: .98rem; font-weight: 720; }
.c-meta { --bc: var(--meta); }
.c-hyper { --bc: var(--accent); }
.c-meta .c-name { color: var(--meta); }
.c-hyper .c-name { color: var(--accent); }
.c-bar { position: relative; height: 24px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.c-bar i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--bc); transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease); }
.c-hyper .c-bar::after {
  content: "";
  position: absolute;
  inset: 0 0 0 var(--w);
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 30%, transparent) 0 3px, transparent 3px 8px);
  opacity: 0;
  transition: opacity .5s;
}
.scene-cost[data-m] .c-meta .c-bar i, .scene-cost[data-h] .c-hyper .c-bar i { transform: none; }
.scene-cost[data-p] .c-hyper .c-bar::after { opacity: 1; }
.c-val { font-size: 1.28rem; font-weight: 780; font-variant-numeric: tabular-nums; text-align: right; opacity: 0; transition: opacity .3s; }
.c-meta .c-val { color: var(--meta); }
.c-hyper .c-val { color: var(--accent); }
.scene-cost[data-m] .c-meta .c-val, .scene-cost[data-h] .c-hyper .c-val { opacity: 1; }
.c-callout { display: grid; gap: 4px; max-width: 210px; padding-left: 40px; border-left: 1px solid var(--line); opacity: .2; transition: opacity .5s; }
.c-callout strong { color: var(--accent); font-size: clamp(3.2rem, 7vw, 4.6rem); font-weight: 820; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.c-callout > span { color: var(--muted); font-size: .92rem; font-weight: 600; line-height: 1.4; }
.scene-cost[data-p] .c-callout { opacity: 1; }

/* ───────────────────────── Results ───────────────────────── */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.metric {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.metric strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: clamp(1.9rem, 3.6vw, 2.55rem);
  font-weight: 780;
  line-height: 1.1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.metric p { color: var(--muted); font-size: .9rem; line-height: 1.48; }

.results-card { padding: 24px 28px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.results-controls { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 13px 22px; }
.control-label { margin-bottom: 6px; color: var(--soft); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.dataset-tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--band); }
.dataset-tabs button {
  min-height: 34px;
  padding: 5px 15px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: .88rem;
  font-weight: 620;
  white-space: nowrap;
  transition: color .2s, background .2s, box-shadow .2s;
}
.dataset-tabs button:hover { color: var(--ink); }
.dataset-tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .1); font-weight: 720; }
.results-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; color: var(--muted); font-size: .87rem; }
.results-legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-dot { width: 10px; height: 10px; display: inline-block; border-radius: 3px; }
.legend-harness, .bar-harness { background: var(--accent); }
.legend-baseline, .bar-baseline { background: var(--secondary-bar); }
.results-panel { margin-top: 14px; }
.results-head, .result-row {
  display: grid;
  grid-template-columns: minmax(133px, .68fr) minmax(0, 2.2fr) minmax(170px, .82fr);
  align-items: center;
  gap: 9px clamp(14px, 2.5vw, 28px);
}
.results-head { min-height: 42px; padding-block: 5px 8px; color: var(--soft); font-size: .86rem; font-weight: 650; }
.result-row { min-height: 80px; padding-block: 14px; border-top: 1px solid var(--line); }
.result-model { font-size: .94rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.score-pair { display: grid; gap: 8px; }
.score-line { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(101px, .52fr); align-items: center; gap: 10px; min-width: 0; font-size: .88rem; line-height: 1.4; }
.score-axis { row-gap: 5px; }
.score-axis p { grid-column: 1 / -1; color: var(--ink); }
.score-axis p span { color: var(--soft); font-weight: 500; }
.score-ticks { grid-column: 1; position: relative; height: 25px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.score-ticks > span { position: absolute; top: 5px; left: var(--tick); transform: translateX(-50%); }
.score-ticks > span::before { content: ""; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid var(--soft); }
.score-ticks > span:first-child { transform: none; }
.score-ticks > span:first-child::before { left: 0; }
.score-ticks > span:last-child { transform: translateX(-100%); }
.score-ticks > span:last-child::before { left: 100%; }
.bar-track { display: block; height: 10px; min-width: 0; overflow: hidden; border-radius: 999px; background: var(--grid); }
.bar-fill { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: grow .8s var(--ease) both; }
.bar-baseline { animation-delay: .08s; }
@keyframes grow { from { transform: scaleX(0); } }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.baseline-name { color: var(--soft); white-space: nowrap; }
.mobile-deploy-heading { display: none; }
.deployment-pair { display: grid; gap: 8px; font-size: .88rem; line-height: 1.4; }
.deployment-pair > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.deployment-pair dt { color: var(--soft); }
.deployment-pair dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.harness-deployment dd { color: var(--accent); }
.results-cost-note { margin-block: 8px 13px; color: var(--soft); font-size: .86rem; line-height: 1.5; }
.results-details { padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.results-details summary { width: fit-content; color: var(--accent); font-size: .9rem; font-weight: 650; cursor: pointer; }
.table-scroll { margin-top: 13px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.results-details table { width: 100%; border-collapse: collapse; text-align: right; font-size: .86rem; font-variant-numeric: tabular-nums; }
.results-details caption { padding: 10px 12px 8px; text-align: left; color: var(--soft); }
.results-details th, .results-details td { padding: 9px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.results-details tr > :first-child, .results-details tr > :nth-child(2) { text-align: left; }
.results-details thead { background: var(--band); }
.results-details tbody tr:hover { background: color-mix(in srgb, var(--band) 60%, transparent); }
.noscript-results { margin-top: 15px; color: var(--muted); }

.efficiency-figure { margin-top: 44px; }
.efficiency-figure .paper-figure { margin-top: 14px; }
.efficiency-figure figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.efficiency-figure figcaption span { flex: 1 1 26rem; }
.efficiency-figure figcaption a { white-space: nowrap; }
.efficiency-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
  align-items: center;
  gap: 22px 40px;
  margin-top: 32px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.efficiency-copy h3, .efficiency-figure h3 { font-size: 1.18rem; font-weight: 750; letter-spacing: -.02em; }
.efficiency-copy p { margin-top: 5px; color: var(--muted); font-size: .96rem; }
.efficiency-copy .efficiency-note { color: var(--soft); font-size: .86rem; }
.efficiency-values { display: grid; gap: 14px; }
.efficiency-values > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; }
.efficiency-values dt { color: var(--muted); font-size: .88rem; font-weight: 650; }
.efficiency-values dd { color: var(--ink); font-size: clamp(1.2rem, 2.3vw, 1.6rem); font-weight: 780; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.efficiency-values .eff-harness dd { color: var(--accent); }
.efficiency-values .eff-bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.eff-bar i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--secondary-bar); }
.eff-harness .eff-bar i { background: var(--accent); }

/* ───────────────────────── Citation & footer ───────────────────────── */
.citation-section { border-top: 1px solid var(--line); background: var(--band); }
.citation-card { max-width: 800px; margin-inline: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.citation-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); color: var(--soft); font-size: .8rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.citation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.citation-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: .84rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color .2s, color .2s;
}
.citation-copy:hover { border-color: var(--accent); color: var(--accent); }
.citation-copy .i { width: 15px; height: 15px; }
#citation-status { color: var(--accent); font-weight: 600; letter-spacing: 0; text-transform: none; }
.citation-card pre { margin: 0; padding: 18px 20px; overflow-x: auto; background: color-mix(in srgb, var(--band) 50%, var(--surface)); }
.citation-card code { font: .84rem/1.7 var(--mono); color: var(--ink); }

.footer { padding-block: 28px 34px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--muted); font-size: .88rem; }
.footer-inner p { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.footer-inner .brand-mark { width: 22px; height: 22px; border-radius: 6px; font-size: .74rem; }
.footer-inner strong { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

#figure-dialog {
  width: min(94vw, 1400px);
  max-width: none;
  max-height: 93dvh;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
#figure-dialog::backdrop { background: rgb(10 16 13 / .72); backdrop-filter: blur(4px); }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.dialog-toolbar p { color: var(--muted); font-size: .9rem; font-weight: 650; }
.dialog-toolbar form { margin: 0; }
.dialog-toolbar button { font-size: 1.35rem; line-height: 1; }
#expanded-figure { max-height: 80dvh; border-radius: 8px; object-fit: contain; background: #fff; }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .header-nav { display: none; }
  .i-grid { grid-template-columns: minmax(0, 1fr) 36px minmax(0, .9fr); row-gap: 8px; }
  .i-grid > .i-link-2 { grid-column: 1 / -1; justify-self: center; width: 30px; margin-block: 14px; rotate: 90deg; }
  .i-inputs { grid-column: 1; }
  .i-out { grid-column: 3; }
  .c-wrap { grid-template-columns: 1fr; }
  .c-callout { max-width: none; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 40px); }
  .header-inner { width: calc(100% - 32px); }
  .hero { padding-top: 44px; }
  .authors { gap: 2px 13px; font-size: .94rem; }
  .affiliations { gap: 0 14px; font-size: .86rem; }
  .flow-tab { flex-direction: column; gap: 0; padding: 12px 14px 14px; }
  .flow-tab-name { font-size: .86rem; line-height: 1.25; }
  .flow-foot { padding-inline: 16px 12px; }
  .b-panels { grid-template-columns: 1fr; gap: 14px; }
  .b-split { height: 22px; }
  .split-stem { height: 22px; }
  .split-bar { display: none; }
  .split-stem::after { content: ""; position: absolute; left: -6px; bottom: -3px; border-top: 7px solid currentColor; border-inline: 5px solid transparent; }
  .results-card { padding: 18px 16px; }
  .results-head, .result-row { grid-template-columns: minmax(95px, .62fr) minmax(0, 2fr) minmax(136px, .78fr); gap: 9px 12px; }
  .score-line { grid-template-columns: minmax(0, 1fr) 40px; gap: 5px 8px; }
  .baseline-name { grid-column: span 2; margin-top: -2px; white-space: normal; }
  .efficiency-card { grid-template-columns: 1fr; padding: 18px; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .metric { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); align-items: center; gap: 14px; padding: 16px 18px; }
  .metric strong { margin: 0; }
}

@media (max-width: 620px) {
  .scene { align-self: start; }
  .i-grid { grid-template-columns: minmax(0, 1fr); }
  .i-grid > .link { grid-column: 1; justify-self: center; width: 22px; margin-block: 12px; rotate: 90deg; }
  .i-inputs, .i-out { grid-column: 1; }
  .i-in { gap: 8px; }
  .i-harness { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px 8px; padding: 11px 10px; }
  .i-harness .gear { width: 24px; height: 24px; }
  .i-out { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: stretch; gap: 8px; }
  .i-model { justify-content: center; padding: 10px 8px; }
  .i-model .i { width: 24px; height: 24px; }
  .results-head { display: block; }
  .results-head-column { display: none; }
  .result-row { grid-template-columns: minmax(0, 1fr); }
  .score-line { grid-template-columns: minmax(0, 1fr) 39px minmax(79px, .46fr); gap: 7px; }
  .baseline-name { grid-column: auto; margin-top: 0; }
  .mobile-deploy-heading { display: block; color: var(--soft); font-size: .85rem; font-weight: 650; }
  .deployment-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .deployment-pair > div { justify-content: start; flex-wrap: wrap; gap: 1px 8px; }
}

@media (max-width: 530px) {
  :root { scroll-padding-top: 72px; }
  .wrap { width: calc(100% - 32px); }
  .header-pill { display: none; }
  .hero { padding-block: 34px 12px; }
  .hero-badge { margin-bottom: 18px; }
  .hero-actions { gap: 8px; margin: 22px 0 24px; }
  .button { min-height: 40px; padding: 7px 15px 7px 13px; font-size: .9rem; }
  .section { padding-block: 52px; }
  .section-heading { margin-bottom: 24px; }
  .paper-figure figcaption { font-size: .85rem; }
  .flow-stage { padding: 14px; }
  .flow-tab { padding: 10px 10px 12px; }
  .flow-tab-num { font-size: .68rem; }
  .flow-tab-name { font-size: .8rem; }
  .flow-foot { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 14px; }
  .flow-caption { min-height: 4.3em; font-size: .88rem; }
  .flow-toggle { align-self: flex-end; }
  .panel { padding: 13px 12px 11px; }
  .pipe { grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); }
  .loop-path, .loop-label { left: calc((100% - 40px) / 6); width: calc((100% - 40px) / 3 + 20px); }
  .node { min-height: 84px; padding-inline: 3px; font-size: .74rem; }
  .node .i { width: 21px; height: 21px; }
  .link { margin-inline: 2px; }
  .c-row { grid-template-columns: 1fr auto; gap: 6px 10px; margin-top: 18px; }
  .c-bar { grid-column: 1 / -1; grid-row: 2; }
  .c-val { grid-row: 1; grid-column: 2; }
  .results-card { padding: 14px 12px; }
  .dataset-picker, .dataset-tabs { width: 100%; }
  .dataset-tabs button { flex: 1; font-size: .82rem; padding-inline: 7px; }
  .metric { grid-template-columns: 1fr; gap: 4px; }
  .footer { padding-block: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Animation engine helpers */
.link.is-lit { color: var(--lc); }
.link.is-hot::after { animation-delay: var(--delay, 0s); }
.scene.is-resetting, .scene.is-resetting *, .scene.is-resetting *::before, .scene.is-resetting *::after { transition: none !important; }
