/* ============================================================
   Double-T DINER project page
   Two themes (light default, dark via data-theme), adapted from
   the RPG project page (rpg-robot.github.io)
   ============================================================ */
: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);
  --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: "Open Sans", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Open Sans", 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);
  --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 > *, .three > *, .scoreboard > *, .results-grid > *, .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 { font-family: var(--font-mono); font-size: 0.86em; color: var(--text); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
b { color: var(--text); font-weight: 600; }
.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }

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

/* ---------- nav ---------- */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 100; background: var(--accent); }
.nav { position: sticky; top: 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 .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.brand { display: flex; align-items: center; font-family: var(--font-display); font-weight: 700; letter-spacing: 0.04em; color: var(--text); font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.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); }
.nav-links a.cta.disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.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 ---------- */
.intro { position: relative; height: 100vh; height: 100svh; background: var(--bg); overflow: hidden; }
.intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.intro-unmute { position: absolute; top: 20px; right: 20px; z-index: 2; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px 0 18px; color: #fff; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; border: 0; border-radius: 26px; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.2s, transform 0.2s; }
.intro-unmute:hover { background: rgba(0,0,0,0.9); transform: scale(1.04); }
.intro-unmute svg { width: 26px; height: 26px; }
.intro-unmute[hidden] { display: none; }
@media (max-width: 560px) { .intro-unmute { top: 12px; right: 12px; height: 44px; font-size: 15px; } }
.intro-cue { position: absolute; left: 50%; bottom: 84px; width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,0.5); border-radius: 50%; background: rgba(0,0,0,0.35); animation: cue 1.8s ease-in-out infinite; }
.intro-cue svg { width: 22px; height: 22px; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .intro-cue { animation: none; } }
.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.45; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--hero-dim) 0%, var(--hero-dim) 40%, var(--bg) 100%); }
: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 video { display: none; }
:root[data-theme="light"] .hero-bg::after { background: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.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); }
.hero-grid > :first-child { container-type: inline-size; }
/* The title is about 7.3x its font size wide, so 13.5cqi keeps it on one line. */
.title { font-size: min(74px, max(42px, 6vw), 13.5cqi); font-weight: 700; letter-spacing: -0.035em; line-height: 1.0; color: var(--accent); white-space: nowrap; }
.subtitle { margin-top: 16px; font-family: var(--font-display); font-size: clamp(18px, 2vw, 23px); color: var(--text-2); font-weight: 500; max-width: 560px; text-wrap: balance; }
.authors { margin-top: 22px; font-size: 14.5px; line-height: 1.8; color: var(--text-2); }
.authors sup { font-size: 10px; color: var(--accent); margin-left: 1px; }
.author-nowrap { white-space: nowrap; }
.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); }
.notes sup { color: var(--accent); }
.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.disabled:hover { border-color: var(--line-2); filter: none; }
.btn.primary.disabled:hover { border-color: transparent; }
.btn svg { width: 16px; height: 16px; }
.btn .sub { font-family: var(--font-mono); font-size: 11px; color: inherit; opacity: 0.75; padding-left: 10px; border-left: 1px solid currentColor; }

.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; flex-wrap: wrap; 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; }
.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 .who-tag { position: absolute; left: 12px; top: 12px; font-family: var(--font-mono); font-size: 11px; color: #7ff0e6; background: var(--overlay); border: 1px solid rgba(127,240,230,0.45); padding: 4px 9px; border-radius: 7px; }
.player .list { display: flex; gap: 4px; flex-wrap: nowrap; padding: 10px 12px; background: var(--panel); }
.player .list button { font: 500 11.5px/1 var(--font-body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px; white-space: nowrap; flex: 1 1 auto; min-width: 0; text-align: center; 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; }
.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); white-space: nowrap; }
.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: 780px; 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; }
.callout { margin: 28px 0 40px; padding: 16px 20px; border-left: 3px solid var(--warm); background: color-mix(in srgb, var(--warm) 9%, transparent); border-radius: 0 10px 10px 0; color: var(--text-2); font-size: 15px; max-width: 860px; }

.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 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 { 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; text-transform: uppercase; margin-bottom: 12px; }

/* ---------- method ---------- */
.stage-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.round { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.round h3 { font-size: 22px; margin: 6px 0 14px; }
.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; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.card.eq .eq-render { margin: 6px 0 4px; overflow-x: auto; overflow-y: hidden; color: var(--text); }
.card.eq .katex-display { margin: 0.6em 0; }

/* ---------- campaigns / scoreboards ---------- */
.scoreboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scoreboard.four { grid-template-columns: repeat(4, 1fr); 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 .kv { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12.5px; color: var(--muted); }
.sb .kv b { font-family: var(--font-display); font-size: 15px; color: var(--text-2); }
.sb-desc { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); }

.sims { margin-top: 28px; }
.ztile { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.zmedia { position: relative; background: #000; aspect-ratio: 16 / 9; }
.zmedia video { width: 100%; height: 100%; 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; }
.ztile figcaption { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--line); }
.znum { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1.1; flex: none; }
.zname { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; }
.zsub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* media not yet in the repo: the frame shows a label until the file lands */
.pending { display: grid; place-items: center; }
.pending::before { content: attr(data-pending); position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font: 500 12px/1.5 var(--font-mono); white-space: pre-line; color: rgba(255,255,255,0.6); background: repeating-linear-gradient(135deg, #0d1117 0 12px, #121820 12px 24px); z-index: 1; }

/* ---------- field ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; color: var(--text-2); }
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; color: var(--text); }
table.tbl td.hi { background: var(--accent-soft); color: var(--text); font-weight: 600; }

.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); }
.vpanel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; position: relative; aspect-ratio: 16 / 9; }
.vpanel.single { max-width: 860px; }
.vpanel video { width: 100%; height: 100%; object-fit: cover; }
.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 .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.win { border-color: var(--accent); }
.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; }
.sims { margin-top: 28px; }
.vdesc { margin-top: 14px; color: var(--text-2); font-size: 14.5px; max-width: 860px; }

/* ---------- field heatmap ---------- */
.heat-legend { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.heat-legend .ramp { width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 4%, var(--panel)), var(--accent)); border: 1px solid var(--line); }
.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: 4px; }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 760px; font-family: var(--font-mono); font-size: 12px; }
.heat th { font-weight: 500; color: var(--muted); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 2px; text-align: center; white-space: nowrap; }
.heat thead tr.grp th { color: var(--text-2); font-size: 11px; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; }
.heat th.name, .heat td.name { text-align: left; padding-left: 6px; min-width: 96px; }
.heat td { height: 30px; min-width: 38px; text-align: center; border-radius: 5px; font-variant-numeric: tabular-nums; color: var(--text); transition: transform 0.12s; }
.heat td.cell { cursor: default; }
.heat td.cell:hover { transform: scale(1.1); outline: 1px solid var(--text); }
.heat td.dark { color: var(--accent-ink); font-weight: 600; }
:root:not([data-theme="light"]) .heat td.dark { color: #04130f; }
.heat td.name { font-family: var(--font-body); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.heat td.name b { font-family: var(--font-mono); font-size: 11px; color: var(--accent); margin-right: 6px; letter-spacing: 0.04em; }
.heat td.score { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.heat td.score.top { color: var(--accent); }
.heat td.sim { color: var(--text-2); }
.heat td.gap, .heat th.gap { min-width: 6px; width: 6px; padding: 0; }
.heat tr.sep td { height: 6px; padding: 0; }
.heat td.zero { color: var(--muted); }
.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; }

/* ---------- results ---------- */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { padding: 22px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-head h3 { font-size: 19px; }
.chart-head p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.legend { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.legend b { color: var(--accent); }

/* ---------- bibtex / footer ---------- */
.bib { position: relative; background: var(--panel); 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; font-family: inherit; }
.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: 40px; font-size: 14.5px; color: var(--muted); }
.ack b { color: var(--text-2); }
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.04em; color: var(--text); }
.foot-meta { flex: 1; }
.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; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .three, .scoreboard, .scoreboard.four { grid-template-columns: 1fr 1fr; }
  .round, .two, .results-grid { grid-template-columns: 1fr; }
}
@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; }
  .chip { flex: none; }
  .title { font-size: min(46px, 13.5cqi); }
  .subtitle { font-size: 16px; 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 { padding: 8px 6px; gap: 2px; }
  .player .list button { font-size: 8.5px; padding: 5px 2px; letter-spacing: -0.01em; }
  .stats { margin-top: 26px; }
  .stat { padding: 14px 12px; }
  .stat .v { font-size: 24px; }
  .stat .l { font-size: 11.5px; }
  .three, .scoreboard { grid-template-columns: 1fr; gap: 10px; }
  .scoreboard.four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sb .n { font-size: 30px; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 8px; }
  table.tbl th { font-size: 10px; }
  table.tbl td:first-child, table.tbl th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
  .tab { padding: 9px 12px; font-size: 12.5px; }
  .bib { font-size: 11.5px; padding: 16px 14px; }
  .swipe-hint { display: block; }
  .heat th.name, .heat td.name { position: sticky; left: 0; z-index: 2; background: var(--panel); min-width: 84px; }
}
