/* ==========================================================================
   ABACUS project page
   ========================================================================== */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #7a7873;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: rgba(42, 120, 214, 0.08);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #6250d6;
  --btn: #111110;
  --btn-ink: #ffffff;
  --btn-hover: #2b2b29;
  --paper: #ffffff;
  --code-bg: #f3f2ee;
  --alt: #f2f1ec;
  --shadow: 0 1px 2px rgba(17, 17, 16, 0.04), 0 10px 30px -12px rgba(17, 17, 16, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #96948d;
    --line: #2c2c2a;
    --line-strong: #43423e;
    --accent: #5598e7;
    --accent-ink: #86b6ef;
    --accent-wash: rgba(85, 152, 231, 0.12);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #9085e9;
    --btn: #f0efec;
    --btn-ink: #0b0b0b;
    --btn-hover: #d9d8d3;
    --paper: #ecebe7;
    --code-bg: #161615;
    --alt: #121211;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #96948d;
  --line: #2c2c2a;
  --line-strong: #43423e;
  --accent: #5598e7;
  --accent-ink: #86b6ef;
  --accent-wash: rgba(85, 152, 231, 0.12);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #9085e9;
  --btn: #f0efec;
  --btn-ink: #0b0b0b;
  --btn-hover: #d9d8d3;
  --paper: #ecebe7;
  --code-bg: #161615;
  --alt: #121211;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
}

/* ----------------------------------------------------------------- base */
*, *::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(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

p { margin: 0 0 1em; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--btn); color: var(--btn-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 16px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 800px; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.04em; color: var(--ink); font-size: 15px;
}
.brand:hover { text-decoration: none; }
.mark {
  width: 26px; height: 26px; display: inline-block; flex: none;
  background: url("../images/logo.svg") center / contain no-repeat;
}
.mark.sm { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
:root[data-theme="dark"] .paper:not(.zoomable) img { filter: brightness(0.94); }
:root[data-theme="dark"] .mark { background-image: url("../images/logo-dark.svg"); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .paper:not(.zoomable) img { filter: brightness(0.94); }
  :root:where(:not([data-theme="light"])) .mark { background-image: url("../images/logo-dark.svg"); }
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: var(--surface-2); }
.nav-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); cursor: pointer; padding: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .i-sun { display: block; }
  :root:where(:not([data-theme="light"])) .i-moon { display: none; }
}

/* ----------------------------------------------------------------- hero */
.hero { padding: 60px 0 28px; text-align: center; }
.venue {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2);
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.venue-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.title { margin: 0; line-height: 1; }
.title-name {
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.01em;
  font-size: clamp(56px, 9vw, 96px);
}
.subtitle {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(20px, 2.6vw, 28px); line-height: 1.3;
  max-width: 820px; margin: 18px auto 28px; color: var(--ink);
  text-wrap: balance;
}
.authors { font-size: 18px; margin: 0 0 4px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 0; }
.authors a, .authors span:not(.sep) { color: var(--ink); font-weight: 500; }
.authors a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.authors a:hover { text-decoration-color: var(--ink); }
.sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); margin: 0 14px; display: inline-block; }
.affil { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; }
.affil-logos { display: flex; justify-content: center; margin: 0 0 30px; }
.affil-logos img { display: block; width: auto; height: 50px; }
@media (max-width: 560px) { .affil-logos img { height: 44px; } }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink);
  font-size: 15px; font-weight: 600; border: 1px solid var(--btn);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--btn-hover); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn.is-soon {
  background: var(--surface); color: var(--muted); border-color: var(--line);
  cursor: default; pointer-events: none;
}
.soon {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}

/* --------------------------------------------------------------- teaser */
.teaser { padding: 24px 0 24px; }
.figure { margin: 0; }
.figure-teaser { max-width: 520px; margin: 0 auto; }
.figure-teaser figcaption { max-width: none; }
.paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.paper.pad { padding: clamp(10px, 2vw, 24px); }
.paper img { width: 100%; }
.paper.zoom { position: relative; }
.swipe-hint { display: none; }
.zoom-hint {
  position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(17, 17, 16, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
}
.zoom-hint svg { width: 16px; height: 16px; }
.paper.zoom:hover .zoom-hint { opacity: 1; }
@media (hover: none) { .zoom-hint { opacity: 0.85; } }
figcaption {
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
  margin: 14px auto 0; max-width: 820px; text-align: left;
}
figcaption strong { color: var(--ink); font-weight: 600; }

.stats {
  margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  overflow: hidden;
}
.stats > div { padding: 22px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.stats > div:last-child { border-right: 0; }
.stats dt { font-size: 13px; color: var(--ink-2); margin: 0; white-space: nowrap; }
.stats dd { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

/* ------------------------------------------------------------- sections */
.section { padding: 88px 0; content-visibility: auto; contain-intrinsic-size: auto 1400px; }
.cv-all .section { content-visibility: visible; }
.section.alt { background: var(--alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 10px;
}
.h2 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 18px; text-wrap: balance;
}
.h3 { font-size: 19px; font-weight: 650; line-height: 1.35; margin: 0 0 10px; letter-spacing: -0.01em; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 780px; margin: 0 0 40px; }
.prose p { color: var(--ink-2); }
.prose strong, .prose em { color: var(--ink); }
.note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.section .figure + .figure, .section .grid-2 + .figure { margin-top: 40px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.section.alt .card { background: var(--surface); }
.card p:last-child { margin-bottom: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.align-start { align-items: start; }
.grid-2 > *, .grid-3 > *, .split > *, .match > * { min-width: 0; }
.align-center { align-items: center; }

/* ---------------------------------------------------------- positioning */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; margin-bottom: 48px; }
.quad-figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 6px; }
.quad-figure figcaption { text-align: center; margin: 4px 0 14px; font-size: 14px; }
.quad { width: 100%; height: auto; font-family: var(--font); }
.q-axis { stroke: var(--line-strong); stroke-width: 2; }
.q-hi { fill: var(--accent-wash); }
.q-lab { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; fill: var(--muted); }
.q-dot { fill: var(--muted); }
.q-ours { fill: var(--s1); stroke: var(--bg); stroke-width: 3; }
.q-name { font-size: 16px; font-weight: 600; fill: var(--ink); }
.q-ours-t { fill: var(--accent-ink); font-weight: 700; }
.q-note { font-size: 13.5px; fill: var(--muted); }

.table-card { padding: 24px 0 8px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 0 28px; margin-bottom: 10px; }
.table-head .h3 { margin: 0; }
.legend-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 0; flex-wrap: wrap; }
.legend-inline .dot { margin-left: 8px; }
.legend-inline .dot:first-child { margin-left: 0; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
td { font-variant-numeric: tabular-nums; }
.cmp { font-size: 14px; min-width: 820px; }
.cmp th, .cmp td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.cmp thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); vertical-align: bottom; white-space: normal; line-height: 1.35; }
.cmp th:first-child, .cmp td:first-child { text-align: left; padding-left: 28px; }
.cmp tbody th { font-weight: 500; }
.cmp tbody tr:last-child td, .cmp tbody tr:last-child th { border-bottom: 0; }
.cmp tr.ours th, .cmp tr.ours td { background: var(--accent-wash); }
.cmp tr.ours th { font-weight: 700; color: var(--ink); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.dot.y { background: var(--ink); }
.dot.p { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--ink); }
.dot.n { box-shadow: inset 0 0 0 1.5px var(--line-strong); }

/* ------------------------------------------------------------ benchmark */
.steps {
  list-style: none; padding: 0; margin: 32px 0 40px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; position: relative; }
.steps h3 { font-size: 15px; font-weight: 650; margin: 10px 0 6px; line-height: 1.3; }
.steps p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.step-n {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--btn); color: var(--btn-ink);
}

.data { font-size: 15px; }
.data th, .data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data th:first-child { text-align: left; }
.data thead th { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.data tbody th { font-weight: 500; }
.data tfoot th, .data tfoot td { font-weight: 600; border-bottom: 0; }
.data tfoot tr:first-child th, .data tfoot tr:first-child td { border-top: 1.5px solid var(--line-strong); }
.data tfoot tr.sub th, .data tfoot tr.sub td { font-weight: 400; color: var(--ink-2); padding-top: 4px; padding-bottom: 4px; }
.grid-2 .card p { color: var(--ink-2); }
.grid-2 .card strong { color: var(--ink); }

/* ------------------------------------------------------------- protocol */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0 48px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.stage h3 { font-size: 16px; font-weight: 650; margin: 12px 0 6px; }
.stage p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.stage-n {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.stage-n.s1 { background: #5b7fc0; }
.stage-n.s2 { background: #6aa84f; }
.stage-n.s3 { background: #8e7cc3; }
.stage-n.s4 { background: #7f7f7f; }
.change-row { gap: 40px; margin-bottom: 48px; }
.change-row p { color: var(--ink-2); }

.score { padding: 32px; }
.score-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.score-head .h3 { margin: 0; font-size: 22px; }
.formula { font-size: 22px; color: var(--ink); }
.formula.small { font-size: 17px; margin: 8px 0 12px; min-height: 56px; display: flex; align-items: center; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.factor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.factor h4 { margin: 0; font-size: 16px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.factor h4 span { font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent-wash); padding: 2px 8px; border-radius: 999px; }
.factor p { font-size: 14.5px; color: var(--ink-2); margin: 0; line-height: 1.55; }
math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math; font-size: 1.2em; }
.formula math { color: var(--ink); }

/* -------------------------------------------------------------- results */
.leaderboard { padding: 0 0 22px; overflow: hidden; }
.leaderboard .note { padding: 0 28px; }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 999px; gap: 2px; }
.tabs button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.prop { background: var(--accent-wash); color: var(--accent-ink); }
.tag.open { background: var(--surface-2); color: var(--ink-2); }

.lb { min-width: 640px; }
.lb .short { display: none; }
.lb .nw { white-space: nowrap; }
.lb th, .lb td { padding: 13px 16px; }
.lb thead th { cursor: pointer; user-select: none; position: relative; }
.lb thead th.nosort { cursor: default; }
.lb thead th:hover:not(.nosort) { color: var(--ink); }
.lb thead th .arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); opacity: 0; font-size: 9px; }
.lb thead th[data-col] { padding-right: 26px; }
.lb td { padding-right: 26px; }
.lb thead th.sorted .arrow { opacity: 1; }
.lb thead th:first-child, .lb td:first-child, .lb tbody th:first-child { padding-left: 28px; }
.lb thead th:last-child, .lb td:last-child { padding-right: 40px; }
.lb thead th:last-child .arrow { right: 24px; }
.lb tbody tr:hover { background: var(--surface-2); }
.lb .rank { color: var(--muted); width: 1%; padding-right: 0; text-align: left; font-weight: 500; }
.lb .model { text-align: left; font-weight: 600; }
.lb .model .tag { margin-left: 10px; vertical-align: 1px; }
.lb td.best { font-weight: 700; color: var(--ink); }
.lb td.score-col { font-weight: 600; }
.lb .bar-cell { position: relative; }
.lb .bar {
  position: absolute; left: 12px; right: 12px; bottom: 6px; height: 3px; border-radius: 2px; background: var(--line);
}
.lb .bar > i { display: block; height: 100%; border-radius: 2px; background: var(--s1); }
.lb thead tr.group th { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-bottom: 0; cursor: default; }

.charts { margin-top: 24px; align-items: stretch; }
.chart-card .link-btn { margin-top: auto; padding-top: 12px; }
.chart-card { display: flex; flex-direction: column; }
.chart-head .h3 { margin-bottom: 4px; }
.chart-sub { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; width: 100%; min-height: 312px; }
@media (max-width: 511px) { .chart { min-height: 272px; } }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis line { stroke: var(--line-strong); }
.chart .tick { font-size: 12px; fill: var(--muted); }
.chart .xlabel { font-size: 12.5px; fill: var(--ink-2); }
.chart .val { font-size: 11.5px; fill: var(--ink-2); font-weight: 600; }
.chart .dlabel { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .crosshair { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; line-height: 1.5; min-width: 150px;
  visibility: hidden;
}
.tooltip.on { visibility: visible; }
.tooltip .tt-title { font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.tooltip .tt-row b { margin-left: auto; color: var(--ink); font-weight: 650; padding-left: 12px; }
.tooltip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.link-btn {
  align-self: flex-start; border: 0; background: none; padding: 4px 0;
  color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.chart-card .table-scroll { margin-top: 8px; }
.chart-card table.data { font-size: 14px; }

.facts { margin-top: 24px; }
.fact { border-top: 2px solid var(--ink); padding-top: 16px; }
.fact-n { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 0 0 10px; }
.fact p:last-child { color: var(--ink-2); font-size: 15px; margin: 0; }

/* ---------------------------------------------------------- walkthrough */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.chips button:hover { color: var(--ink); border-color: var(--line-strong); }
.chips button[aria-selected="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.zoomable { display: block; width: 100%; padding: 0; cursor: zoom-in; font: inherit; }
.gallery-figure figcaption { max-width: none; }
.gallery-figure .paper {
  background: #0f0f1c; border-color: #25253a;
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
}
.gallery-figure .paper img { width: 100%; height: 100%; object-fit: contain; }
.gallery-figure img { transition: opacity 0.2s ease; }
.gallery-figure img.loading { opacity: 0.35; }

.match { margin-top: 48px; display: grid; grid-template-columns: 0.9fr 1.6fr; gap: 32px; align-items: center; }
.match-text p { color: var(--ink-2); }
.match-imgs { display: grid; grid-template-columns: 1fr 1fr 1.18fr; gap: 12px; }
.match-imgs figure { margin: 0; }
.match-imgs .paper { border-radius: var(--radius-sm); box-shadow: none; }
.match-imgs figcaption { text-align: center; margin-top: 8px; font-size: 13px; }

/* ------------------------------------------------------------- citation */
.bibtex { position: relative; margin-top: 18px; }
.bibtex pre {
  margin: 0; padding: 22px 24px; background: var(--code-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.copy {
  position: absolute; top: 12px; right: 12px; font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--line-strong); }
.copy.done { color: var(--accent-ink); }

/* --------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer .funding { flex-basis: 100%; font-size: 13px; line-height: 1.55; max-width: 820px; }
.footer a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* ------------------------------------------------------------- lightbox */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(10, 10, 10, 0.82); backdrop-filter: blur(4px); }
.lightbox img { max-width: 96vw; max-height: 90vh; width: auto; border-radius: 12px; background: #fff; }
.lb-close {
  position: absolute; top: -16px; right: -16px; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: #fff; color: #111; font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .score-grid { grid-template-columns: 1fr; }
  .match { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .split, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div { border-bottom: 1px solid var(--line); }
  .stats > div:nth-child(2n) { border-right: 0; }
  .stats > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .section { padding: 64px 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap, .nav-inner { padding: 0 16px; }
  .hero { padding: 48px 0 20px; }
  .steps { grid-template-columns: 1fr; }
  .stages { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .table-card, .leaderboard { padding-left: 0; padding-right: 0; }
  .table-head, .lb-top, .leaderboard .note { padding-left: 20px; padding-right: 20px; }
  .cmp th:first-child, .cmp td:first-child, .lb thead th:first-child, .lb td:first-child, .lb tbody th:first-child { padding-left: 20px; }
  .stats dd { font-size: 26px; }
  .lead { font-size: 17px; }
  .sep { margin: 0 10px; }
  .match-imgs { grid-template-columns: 1fr 1fr; }
  .match-imgs figure:last-child { grid-column: 1 / -1; }
  .lb-close { top: 8px; right: 8px; }
  .authors { flex-direction: column; gap: 2px; }
  .authors .sep { display: none; }
  .lb { min-width: 0; }
  .lb .full { display: none; }
  .lb .short { display: inline; }
  .lb th, .lb td { padding: 11px 8px; }
  .lb td { padding-right: 14px; }
  .lb thead th[data-col] { padding-right: 14px; }
  .lb .rank { display: none; }
  .lb .model { padding-left: 20px; }
  .data th, .data td { padding: 9px 6px; }
  .data { font-size: 14px; }
  .lb thead th .arrow { right: 6px; }
  .lb thead th:last-child, .lb td:last-child { padding-right: 24px; }
  .lb thead th:last-child .arrow { right: 10px; }
  .lb .model { white-space: normal; line-height: 1.3; font-size: 14px; }
  .lb .model .tag { display: table; margin: 4px 0 0; font-size: 11px; padding: 1px 7px; }
  .lb .bar { left: 6px; right: 6px; }
  .tabs button { padding: 7px 12px; }
  .bibtex pre { padding-top: 54px; font-size: 12.5px; }
  .diagram { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .diagram img { width: 880px; max-width: none; }
  .diagram .zoom-hint { display: none; }
  .swipe-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
  .gallery-figure .paper { aspect-ratio: auto; }
  .gallery-figure .paper img { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
