/* ============================================================
   RPG — Reconstruct, Practice, Go Real
   Two-theme stylesheet (dark default, light via data-theme)
   ============================================================ */
:root {
  --bg: #0b0e13;
  --bg-2: #10151c;
  --panel: #121820;
  --line: rgba(148, 163, 184, 0.14);
  --line-2: rgba(148, 163, 184, 0.26);
  --text: #e9edf2;
  --text-2: #b9c2cd;
  --muted: #8b96a5;
  --accent: #2fd4c6;
  --accent-ink: #06211e;
  --accent-soft: rgba(47, 212, 198, 0.14);
  --violet: #a78bfa;
  --warm: #f59e0b;
  --fig-bg: #ffffff;
  --overlay: rgba(8, 11, 16, 0.72);
  --shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8);
  --hero-dim: rgba(11, 14, 19, 0.55);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --max: 1120px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --line-2: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-2: #3b4656;
  --muted: #6b7684;
  --accent: #0e9488;
  --accent-ink: #ffffff;
  --accent-soft: rgba(14, 148, 136, 0.12);
  --violet: #7c5cf0;
  --warm: #d97706;
  --shadow: 0 16px 40px -28px rgba(15, 23, 42, 0.35);
  --hero-dim: rgba(246, 247, 249, 0.72);
  color-scheme: light;
}

* { box-sizing: border-box; }
.hero-grid > *, .round > *, .two > *, .results-grid > *, .three > *, .stages > *, .evo > *, .zgrid > *, .scoreboard > *, .versus > *, .card { min-width: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased; transition: background 0.3s, color 0.3s; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
b { color: var(--text); font-weight: 600; }
.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }

/* ---------- nav ---------- */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 100; background: var(--accent); }
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); transition: background 0.3s, border-color 0.3s; }
.nav.nav-on-hero { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.06em; color: var(--text); font-size: 17px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand img { width: 26px; height: 26px; border-radius: 50%; display: block; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { color: var(--text-2); font-size: 13.5px; padding: 6px 10px; border-radius: 8px; transition: 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-links a.cta { color: var(--accent-ink); background: var(--accent); font-weight: 600; margin-left: 6px; }
.nav-links a.cta:hover { filter: brightness(1.08); }
.theme-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; margin-left: 6px; transition: 0.2s; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }
.nav-toggle { display: none; width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; }
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.3s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(90vh, 920px); display: flex; align-items: center; padding: 120px 0 56px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; background: #000; }
.hero-bg video { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
:root[data-theme="light"] .hero-bg video { display: none; }
:root[data-theme="light"] .hero-bg { background: radial-gradient(55% 60% at 85% 10%, rgba(14, 148, 136, 0.16), transparent 60%), radial-gradient(45% 50% at 5% 90%, rgba(14, 148, 136, 0.08), transparent 60%), linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
:root[data-theme="light"] .hero-bg::after { background: none; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--hero-dim) 0%, var(--hero-dim) 40%, var(--bg) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; background: color-mix(in srgb, var(--bg) 60%, transparent); }
.chip.hot { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.title { font-size: clamp(42px, 6vw, 74px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.0; }
.title .grad { color: var(--accent); }
.subtitle { margin-top: 16px; font-family: var(--font-display); font-size: clamp(18px, 2vw, 23px); color: var(--text-2); font-weight: 500; }
.tagline { margin: 16px 0 0; max-width: 540px; font-size: 16.5px; color: var(--text-2); }
.authors { margin-top: 22px; font-size: 14.5px; line-height: 1.8; color: var(--text-2); }
.authors a { color: var(--text-2); border-bottom: 1px dotted var(--line-2); white-space: nowrap; }
.author-nowrap { white-space: nowrap; }
.authors a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.authors a:hover b { color: var(--accent); }
.authors sup { font-size: 10px; color: var(--accent); margin-left: 1px; }
.affil { margin-top: 6px; font-size: 13px; color: var(--muted); }
.affil sup { color: var(--accent); }
.notes { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; border: 1px solid var(--line-2); color: var(--text); background: color-mix(in srgb, var(--bg-2) 80%, transparent); transition: 0.2s; }
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.disabled { opacity: 0.6; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn .sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-2); }

.player { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: #000; box-shadow: var(--shadow); }
.player .screen { position: relative; aspect-ratio: 16 / 9; }
.player video { width: 100%; height: 100%; object-fit: cover; }
.player .lbl { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: #fff; }
.player .lbl b { color: #fff; background: var(--overlay); padding: 5px 10px; border-radius: 7px; font-weight: 600; }
.player .lbl span { color: #cffaf6; background: var(--overlay); padding: 5px 8px; border-radius: 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.player .lbl em, .zmedia .ql em { font-style: normal; color: #fff; font-weight: 600; }
.player .idx { position: absolute; right: 12px; top: 12px; font-family: var(--font-mono); font-size: 11px; color: #fff; background: var(--overlay); padding: 4px 8px; border-radius: 7px; }
.player .list { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; background: var(--panel); }
.player .list button { font: 500 11.5px/1 var(--font-mono); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; cursor: pointer; transition: 0.2s; }
.player .list button:hover { color: var(--text); border-color: var(--line-2); }
.player .list button.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.stats { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--bg-2); padding: 20px 20px; }
.stat .v { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text); }
.stat .v small { font-size: 0.5em; color: var(--muted); font-weight: 500; margin-left: 2px; }
.stat.hi .v { color: var(--accent); }
.stat .l { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.4; text-wrap: balance; }

/* ---------- sections ---------- */
section { padding: 88px 0; position: relative; scroll-margin-top: 70px; }
section + section { border-top: 1px solid var(--line); }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; letter-spacing: -0.03em; margin-top: 12px; max-width: 760px; text-wrap: balance; }
.lede { margin-top: 14px; font-size: 17.5px; color: var(--text-2); max-width: 760px; }
.sec-head { margin-bottom: 36px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.figure { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--fig-bg); padding: 8px; cursor: zoom-in; position: relative; }
.figure img { width: 100%; border-radius: 8px; }
.figure::after { content: "click to enlarge"; position: absolute; right: 14px; bottom: 14px; font: 500 11px var(--font-mono); color: #fff; background: rgba(8, 11, 16, 0.75); padding: 5px 9px; border-radius: 6px; opacity: 0; transition: 0.2s; pointer-events: none; }
.figure:hover::after { opacity: 1; }
.caption { margin-top: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.caption b { color: var(--text-2); }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(5, 8, 12, 0.9); opacity: 0; pointer-events: none; transition: opacity 0.2s; cursor: zoom-out; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: min(1600px, 100%); max-height: 100%; object-fit: contain; background: #fff; padding: 8px; border-radius: 10px; }
.lightbox .x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(8,11,16,0.8); color: #fff; font: 600 18px/1 var(--font-mono); cursor: pointer; }

details.more { margin-top: 16px; }
details.more + details.more { margin-top: 10px; }
details.more summary { cursor: pointer; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 999px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; }
details.more[open] summary::after { content: "−"; }
details.more > *:not(summary) { margin-top: 16px; }
details.abstract { margin: 8px 0 32px; }
details.abstract p { font-size: 15px; color: var(--text-2); max-width: 820px; border-left: 2px solid var(--accent); padding-left: 16px; }

/* three short cards */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 32px; }
.three .card h3 { font-size: 17px; margin-bottom: 8px; }
.three .card p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.three .k { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 12px; }

/* ---------- method ---------- */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stage .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.stage h3 { font-size: 22px; margin: 6px 0 10px; }
.stage p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.round { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.round h3 { font-size: 18px; margin-bottom: 10px; }
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 9px 0 9px 36px; color: var(--text-2); font-size: 14.5px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.steps li:first-child::before { top: 1px; }
.gate { font-family: var(--font-mono); font-size: 13.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--text); overflow-x: auto; white-space: nowrap; margin-top: 12px; }
.gate .kw { color: var(--accent); }
.gate .cm { color: var(--muted); }

/* ---------- results ---------- */
.chart-card { padding: 22px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h3 { font-size: 19px; }
.chart-head p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend span[hidden] { display: none; }
.tip table { border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.tip td { padding: 1px 10px 1px 0; color: var(--text-2); }
.tip td:last-child { text-align: right; padding-right: 0; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.legend i { width: 18px; border-top: 2px solid var(--accent); }
.legend i.dash { border-top-style: dashed; border-color: var(--muted); }
.legend i.task { border-color: var(--violet); }
.curve-wrap { overflow-x: auto; position: relative; }
.curve-egg { position: absolute; left: 0; top: 0; width: var(--egg-w, 80%); height: 100%; object-fit: cover; object-position: 50% 45%; border-radius: 10px; pointer-events: none; z-index: 1;
  opacity: 0; transform: scale(1.035); filter: blur(8px) saturate(0.6); box-shadow: var(--shadow);
  transition: opacity 0.45s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1), filter 0.5s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform, filter; }
.curve-wrap.egg .curve-egg { opacity: 1; transform: scale(1); filter: none; }
#curve > * { transition: opacity 0.4s ease; }
.curve-wrap.egg #curve > :not(.rats-hit):not(.rats-lab):not(.ref.rats) { opacity: 0.15; }
#curve .rats-hit { fill: transparent; cursor: pointer; }
#curve .rats-lab { pointer-events: none; transition: fill 0.25s ease; }
.curve-wrap.egg #curve .rats-lab { fill: var(--accent); }
.curve-wrap.egg #curve .ref.rats { stroke: var(--accent); opacity: 1; }
#curve { width: 100%; height: auto; display: block; font-family: var(--font-mono); }
#curve text { fill: var(--muted); font-size: 11px; }
#curve .lab { fill: var(--text-2); font-size: 11.5px; }
#curve .big { fill: var(--text); font-size: 20px; font-weight: 700; font-family: var(--font-display); }
#curve .grid { stroke: var(--line); }
#curve .ref { stroke: var(--muted); stroke-dasharray: 4 5; opacity: 0.8; }
#curve .ref.gpt { stroke: var(--warm); } #curve .ref.aspire { stroke: var(--violet); }
#curve .area { fill: var(--accent); opacity: 0.1; }
#curve .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
#curve .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
#curve .tline { fill: none; stroke: var(--violet); stroke-width: 2; }
#curve .tdot { fill: var(--violet); stroke: var(--panel); stroke-width: 2; }
#curve .hit { fill: transparent; cursor: crosshair; }
#curve .cross { stroke: var(--line-2); }
#curve .band { fill: var(--violet); opacity: 0.08; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--text); box-shadow: var(--shadow); opacity: 0; transition: opacity 0.12s; max-width: 260px; line-height: 1.45; }
.tip.show { opacity: 1; }
.tip .k { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.tip .v { font-weight: 600; }

.swipe-hint { display: none; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.heat-wrap { overflow-x: auto; margin-top: 6px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; min-width: 720px; width: 100%; }
.heat th { font-family: var(--font-mono); font-weight: 500; color: var(--muted); font-size: 11px; padding: 4px 2px; text-align: center; }
.heat th.t { text-align: left; padding-left: 6px; min-width: 160px; }
.heat td { height: 24px; min-width: 30px; text-align: center; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; transition: transform 0.12s; }
.heat td:hover { transform: scale(1.12); outline: 1px solid var(--text); }
.heat td.name { text-align: left; color: var(--text-2); font-family: var(--font-body); font-size: 13px; padding-left: 6px; white-space: nowrap; }
.heat td.name .split { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: 6px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.heat tr.sel td.name { color: var(--violet); font-weight: 600; }
.heat tr.group td { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; height: 28px; cursor: default; }
.heat tr.group td:hover, .heat tr.total td:hover { transform: none; outline: none; }
.heat tr.total td { font-weight: 700; color: var(--text); font-family: var(--font-mono); cursor: default; }
.heat-legend { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.heat-legend .ramp { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--heat-lo, #14303a), var(--accent)); }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl th { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl td.rpg, table.tbl th.rpg { background: var(--accent-soft); color: var(--text); font-weight: 600; }
table.tbl tr.group td { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: left; }
table.tbl tr.mean td { font-weight: 600; color: var(--text); }
table.tbl td b { color: var(--text); }
table.tbl.wide { min-width: 640px; }
table.tbl.wide th, table.tbl.wide td { white-space: nowrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.mini-head { font-size: 17px; margin-bottom: 4px; }
.mini-sub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.delta { font-family: var(--font-mono); color: var(--accent); font-size: 12px; }
.results-grid { display: grid; gap: 14px; }

/* ---------- simulation gallery ---------- */
.sfilter { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.sgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.stile { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.stile[hidden] { display: none; }
.smedia { position: relative; background: #000; }
.smedia video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.stile figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; border-top: 1px solid var(--line); }
.sname { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.stag { display: none; }

/* ---------- real robot ---------- */
.scoreboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.sb { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.sb.win { border-color: var(--accent); background: var(--accent-soft); }
.sb .who { font-size: 13px; color: var(--text-2); }
.sb .who b { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.sb.win .who b { color: var(--accent); }
.sb .n { margin-top: 6px; font-family: var(--font-display); font-weight: 700; font-size: 36px; letter-spacing: -0.03em; line-height: 1; color: var(--text); }
.sb .n small { font-size: 0.45em; color: var(--muted); font-weight: 500; margin-left: 2px; }
.sb.win .n { color: var(--accent); }
.sb .bar { margin-top: 10px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sb .bar i { display: block; height: 100%; width: var(--w, 0); border-radius: 3px; background: var(--muted); }
.sb.win .bar i { background: var(--accent); }
.sb .sub { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sb .stage-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sb .stage-row b { font-family: var(--font-display); font-size: 17px; color: var(--text-2); }
.sb .stage-row b small { font-size: 0.6em; color: var(--muted); font-weight: 500; }
.sb .bar.thin { height: 3px; margin-top: 6px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { font: 600 13.5px/1 var(--font-body); color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 10px 15px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.tab .sc { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tab.active .sc { color: var(--accent); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.vs-badge { align-self: center; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-2); border: 1px solid var(--line-2); background: var(--panel); }
.vpanel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; position: relative; }
.vpanel.win { border-color: var(--accent); }
.vpanel video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; cursor: pointer; }
.vpanel .meta { position: absolute; left: 10px; top: 10px; z-index: 2; }
.vpanel .meta .chip { background: var(--overlay); color: #fff; border-color: rgba(255,255,255,0.25); }
.vpanel.win .meta .chip { color: #7ff0e6; border-color: rgba(127,240,230,0.5); }
.vpanel .clock { position: absolute; right: 10px; top: 10px; z-index: 2; text-align: right; background: var(--overlay); padding: 5px 10px; border-radius: 8px; font-family: var(--font-mono); color: #fff; }
.vpanel .clock .t { font-size: 16px; font-weight: 600; display: block; font-variant-numeric: tabular-nums; }
.vpanel .clock small { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
.vpanel .foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 24px 12px 12px; background: linear-gradient(180deg, transparent, rgba(5,8,12,0.8)); display: flex; justify-content: space-between; align-items: flex-end; color: #fff; }
.vpanel .foot .who { font-weight: 700; font-size: 15px; font-family: var(--font-display); }
.vpanel .foot .model { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.7); }
.vpanel .foot .speed { font-family: var(--font-mono); font-size: 11px; color: #7ff0e6; border: 1px solid rgba(127,240,230,0.5); border-radius: 6px; padding: 3px 7px; }
.vpanel .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 3; background: rgba(255,255,255,0.15); cursor: pointer; }
.vpanel:hover .prog { height: 6px; }
.vpanel .prog i { display: block; height: 100%; width: 0; background: #cbd5e1; }
.vpanel.win .prog i { background: #2fd4c6; }
.vpanel .stamp { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: rgba(5,8,12,0.6); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 5.5vw, 64px); letter-spacing: -0.04em; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.vpanel.win .stamp { color: #7ff0e6; }
.vpanel .stamp small { display: block; font: 600 11px var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.vpanel .stamp .val { line-height: 1; white-space: nowrap; }
.vpanel .stamp em { font-style: normal; color: rgba(255,255,255,0.6); font-weight: 500; }
.vpanel .stamp small.sub { margin: 12px 0 0; font-size: 11.5px; letter-spacing: 0.04em; text-transform: none; color: #fff; background: rgba(5,8,12,0.6); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 5px 12px; }
.vpanel .stamp.show { opacity: 1; }
.vpanel.paused::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; color: #fff; background: rgba(5,8,12,0.7); pointer-events: none; }
.ladder { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 4px 16px; }
.lrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0; }
.lrow + .lrow { border-top: 1px dashed var(--line); }
.lrow .who { width: 140px; flex: none; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.lrow.win .who { color: var(--accent); }
.lrow .stg { display: flex; flex-direction: column; gap: 6px; }
.lrow .dots { display: flex; gap: 3px; }
.lrow .dots i { width: 14px; height: 8px; border-radius: 2px; background: var(--line); }
.lrow .dots i.on { background: var(--muted); }
.lrow.win .dots i.on { background: var(--accent); }
.lrow .lab { font-size: 12px; color: var(--muted); }
.lrow .lab b { font-family: var(--font-mono); margin-left: 2px; }
.lrow.win .lab b { color: var(--accent); }
.lrow .arr { color: var(--muted); font-size: 16px; padding-bottom: 20px; }
.vdesc { margin-top: 14px; color: var(--text-2); font-size: 14.5px; }

/* ---------- zero-shot ---------- */
.zgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ztile { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.zmedia { position: relative; background: #000; }
.zmedia video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.zmedia .ql { position: absolute; top: 10px; right: 10px; font-family: var(--font-mono); font-size: 10.5px; color: #cffaf6; background: var(--overlay); border-radius: 6px; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.ztile figcaption { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.znum { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1; padding-top: 2px; flex: none; }
.zname { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; }
.zsteps { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.zsteps span { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; }
.zsteps i { color: var(--muted); font-style: normal; }

/* ---------- skills ---------- */
.evo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.evo h4 { font-size: 16.5px; margin-bottom: 4px; }
.evo .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.evo .meta b { color: var(--accent); }
.chain { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--font-mono); font-size: 11.5px; }
.chain span { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; color: var(--text-2); }
.chain.after span { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chain i { color: var(--muted); font-style: normal; }
.chain-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.chain-k.after { color: var(--accent); }

/* ---------- bibtex / footer ---------- */
.bib { position: relative; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 20px 22px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); overflow-x: auto; line-height: 1.7; }
.bib pre { margin: 0; white-space: pre; }
.bib .copy { position: absolute; top: 12px; right: 12px; font: 600 11.5px var(--font-mono); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.ack { margin-top: 28px; font-size: 14.5px; color: var(--muted); }
footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.06em; color: var(--text); }
.foot-meta { flex: 1; }
.foot-links { display: flex; gap: 6px; }
.foot-links a { color: var(--text-2); font-family: var(--font-mono); font-size: 11.5px; padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px; }
.foot-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.foot-credit { width: min(var(--max), 100% - 40px); margin: 16px auto 0; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .three, .stages, .scoreboard, .zgrid { grid-template-columns: 1fr 1fr; }
  .sgrid { grid-template-columns: repeat(4, 1fr); }
  .round, .two, .evo { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; }
  .vs-badge { justify-self: center; }
}
@media (max-width: 760px) {
  section { padding: 56px 0; }
  .sec-head { margin-bottom: 22px; }
  .lede { font-size: 15.5px; }
  .card { padding: 18px 16px; }
  .nav-toggle { display: flex; }
  .nav .wrap { flex-wrap: wrap; height: auto; min-height: 56px; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 20px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: max-height 0.3s, opacity 0.25s; }
  .nav-links.is-open { max-height: 80vh; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 4px; font-size: 16px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a.cta { margin: 10px 0 0; border-radius: 10px; text-align: center; }
  .theme-btn { margin: 12px 0 0; width: 100%; border-radius: 10px; height: 40px; }
  .hero { min-height: 0; padding: 86px 0 36px; }
  .hero-bg video { display: none; }
  .hero-bg { background: url("../videos/demo/sort_utensils.jpg") center / cover no-repeat; }
  :root[data-theme="light"] .hero-bg { background: radial-gradient(70% 50% at 80% 0%, rgba(14, 148, 136, 0.16), transparent 60%), linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 14px; padding: 0 20px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .title { font-size: clamp(38px, 11vw, 46px); }
  .subtitle { font-size: 16px; margin-top: 10px; }
  .tagline { font-size: 14.5px; margin-top: 10px; }
  .authors { font-size: 13.5px; line-height: 1.7; margin-top: 14px; }
  .affil, .notes { font-size: 11.5px; }
  .actions { gap: 8px; margin-top: 16px; }
  .btn { padding: 10px 14px; font-size: 13px; }
  .btn .sub { display: none; }
  .player .list button { font-size: 10.5px; padding: 5px 8px; }
  .stats { margin-top: 26px; }
  .stat { padding: 14px 12px; }
  .stat .v { font-size: 24px; }
  .stat .l { font-size: 11.5px; }
  .three, .stages, .scoreboard, .zgrid { grid-template-columns: 1fr; gap: 10px; }
  .sgrid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .sname { font-size: 11px; }
  .stage h3 { font-size: 20px; }
  .gate { font-size: 12px; }
  .chart-card { padding: 14px 12px; }
  #curve { min-width: 0; }
  .swipe-hint { display: block; }
  .heat { min-width: 0; }
  .heat th.t, .heat td.name { position: sticky; left: 0; z-index: 2; background: var(--panel); min-width: 116px; max-width: 150px; white-space: normal; font-size: 12px; line-height: 1.2; }
  .heat td.name .split { display: none; }
  .heat tr.group td { position: sticky; left: 0; background: var(--panel); }
  .heat td { min-width: 28px; height: 22px; font-size: 10.5px; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 8px; }
  table.tbl th { font-size: 10px; }
  table.tbl.wide td:first-child, table.tbl.wide th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
  .sb .n { font-size: 30px; }
  .tab { padding: 9px 12px; font-size: 12.5px; }
  .vpanel .clock .t { font-size: 14px; }
  .vpanel .foot .model { display: none; }
  .ladder { padding: 2px 12px; }
  .lrow { gap: 10px; }
  .lrow .who { width: 100%; }
  .lrow .arr { display: none; }
  .lrow .dots i { width: 11px; height: 7px; }
  .zsteps, .chain { font-size: 10.5px; }
  .bib { font-size: 11.5px; padding: 16px 14px; }
}
