:root {
  color-scheme: light;
  --page: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --ink: #0b0b0b;
  --ink-2: #4a4945;
  --muted: #85837c;
  --grid: #e4e3dc;
  --axis: #c9c8bd;
  --border: rgba(11, 11, 11, 0.09);
  --focus: #2a78d6;
  --accent: #2a78d6;
  --glow: rgba(42, 120, 214, 0.14);
  /* One colour per model, in leaderboard order. */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  /* Sequential blue for pass rates, q0 (none) to q5 (all). */
  --q0: #e6effa; --q1: #b9d3f4; --q2: #86b2ec; --q3: #4d8fe0; --q4: #256abf; --q5: #184f95;
  --q0-ink: #0b0b0b; --q1-ink: #0b0b0b; --q2-ink: #0b0b0b; --q3-ink: #ffffff; --q4-ink: #ffffff; --q5-ink: #ffffff;
  --pass: #256abf;
  --fail: #e4e3dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b0b0c;
    --surface: #151516;
    --surface-2: #1d1d1f;
    --ink: #f2f1ee;
    --ink-2: #bdbcb4;
    --muted: #85837c;
    --grid: #2a2a2b;
    --axis: #3a3a3b;
    --border: rgba(255, 255, 255, 0.08);
    --focus: #5598e7;
    --accent: #5598e7;
    --glow: rgba(85, 152, 231, 0.16);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --q0: #142338; --q1: #12355f; --q2: #1c5cab; --q3: #2a78d6; --q4: #5598e7; --q5: #9cc4f2;
    --q0-ink: #ffffff; --q1-ink: #ffffff; --q2-ink: #ffffff; --q3-ink: #ffffff; --q4-ink: #0b0b0b; --q5-ink: #0b0b0b;
    --pass: #5598e7;
    --fail: #2a2a2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--axis); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0; font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 5px); gap: 2px; }
.brand-mark i { width: 5px; height: 5px; border-radius: 1.5px; background: var(--fail); }
.brand-mark i.on { background: var(--pass); }
.brand span { color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-size: 14px; transition: background .2s, color .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

/* Hero */
.hero { position: relative; padding: 96px 0 56px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
}
@keyframes drift { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1 var(--mono); color: var(--ink-2); padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--s3); box-shadow: 0 0 0 0 var(--s3); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s3) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { font-size: clamp(36px, 6vw, 64px); margin: 22px 0 18px; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(17px, 2.1vw, 20px); color: var(--ink-2); max-width: 60ch; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 40px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font: 600 clamp(26px, 3.4vw, 34px)/1.1 var(--font); letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 14px; }

/* Sections */
section { padding: 56px 0 8px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.note { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* Tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; position: relative; }
.tabs button {
  position: relative; z-index: 1; border: 0; background: none; color: var(--ink-2); cursor: pointer;
  font: 500 14px/1 var(--font); padding: 9px 14px; border-radius: 999px; transition: color .25s;
}
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs .pill { position: absolute; z-index: 0; top: 4px; height: calc(100% - 8px); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--border); transition: left .35s var(--ease), width .35s var(--ease), top .35s var(--ease); }

/* Leaderboard */
.board { list-style: none; margin: 0; padding: 0; position: relative; }
.board-axis { display: grid; grid-template-columns: 36px minmax(180px, 260px) minmax(0, 1fr) 64px; gap: 16px; color: var(--muted); font: 12px var(--mono); padding: 0 0 8px; }
.board-axis .ticks { display: flex; justify-content: space-between; }
.row {
  display: grid; grid-template-columns: 36px minmax(180px, 260px) minmax(0, 1fr) 64px; gap: 16px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--grid);
}
.row .rank { font: 500 14px var(--mono); color: var(--muted); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.who strong { display: block; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { position: relative; height: 22px; }
.track .lines { position: absolute; inset: -14px 0; background: repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 25%); pointer-events: none; }
.track .lines::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.bar { position: absolute; left: 0; top: 4px; height: 14px; width: 0; border-radius: 0 7px 7px 0; transition: width 1s var(--ease); }
.ci { position: absolute; top: 10px; height: 2px; background: var(--ink-2); opacity: 0; transition: left 1s var(--ease), width 1s var(--ease), opacity .4s; }
.ci::before, .ci::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: var(--ink-2); }
.ci::before { left: 0; } .ci::after { right: 0; }
.board.show-ci .ci { opacity: .7; }
.value { font: 600 20px/1 var(--font); letter-spacing: -0.02em; text-align: right; }
.value small { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Heatmap */
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; }
.heat th { font: 500 13px var(--font); color: var(--ink-2); text-align: center; padding: 4px; }
.heat th small { display: block; color: var(--muted); font: 11px var(--mono); }
.heat th.model { text-align: left; white-space: nowrap; padding-right: 12px; }
.heat td { height: 48px; border-radius: 8px; text-align: center; font-weight: 600; min-width: 72px; transition: transform .2s; }
.heat td.overall { box-shadow: inset 0 0 0 2px var(--ink); }
.heat td.none { background: var(--surface-2); color: var(--muted); font-weight: 400; }
.scale { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.scale i { display: inline-block; width: 28px; height: 10px; }
.scale i:first-of-type { border-radius: 3px 0 0 3px; } .scale i:last-of-type { border-radius: 0 3px 3px 0; }
.scale .ramp { display: inline-flex; }

/* Attempt grid */
.grid-scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.attempts { display: grid; gap: 6px 3px; align-items: center; width: max-content; min-width: 100%; }
.attempts .fam { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--axis); padding-bottom: 4px; white-space: nowrap; overflow: hidden; }
.attempts .label { font-size: 14px; font-weight: 500; white-space: nowrap; padding-right: 16px; display: flex; gap: 8px; align-items: center; position: sticky; left: -24px; background: var(--surface); z-index: 1; }
.task { display: flex; gap: 2px; height: 28px; padding: 3px; border-radius: 6px; cursor: default; transition: background .15s; }
.task:hover, .task:focus-visible { background: var(--surface-2); }
.task i { flex: 1; width: 6px; border-radius: 2px; background: var(--fail); transform-origin: bottom; }
.task i.ok { background: var(--pass); }
.task.none i { background: transparent; border: 1px dashed var(--axis); }
.gap { width: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 13px; margin-top: 16px; align-items: center; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 6px; height: 14px; border-radius: 2px; display: inline-block; }
.tip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--page);
  font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; max-width: 240px;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.on { opacity: 1; transform: none; }

/* Efficiency table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 500 13px var(--font); color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--axis); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--grid); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.scroll { overflow-x: auto; }

/* Prose (methodology) */
.prose { max-width: 720px; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); margin: 0 0 16px; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin: 0 0 .5em; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 600; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.toc a { text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); transition: border-color .2s, color .2s; }
.toc a:hover { color: var(--ink); border-color: var(--axis); }

.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 8px; }
.kind { position: relative; overflow: hidden; }
.kind h3 { font-size: 18px; margin: 0 0 4px; }
.kind .tag { font: 12px var(--mono); color: var(--muted); }
.kind p { color: var(--ink-2); font-size: 15px; margin: 12px 0 0; }
.kind p b { color: var(--ink); font-weight: 600; }
.kind .weight { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 0; transition: width 1.2s var(--ease) .2s; }
.in .kind .weight, .kind.in .weight { width: var(--w); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--grid); }
.steps .progress { position: absolute; left: 17px; top: 18px; width: 2px; height: 0; background: var(--accent); transition: height 1.6s var(--ease); }
.steps.in .progress { height: calc(100% - 36px); }
.steps li { position: relative; padding: 0 0 24px 56px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font: 600 14px var(--mono);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.steps li h3 { margin: 6px 0 4px; font-size: 17px; }
.steps li p { margin: 0; }

.formula { font: 14px/1.8 var(--mono); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; color: var(--ink-2); overflow-x: auto; margin: 0 0 1em; }
.formula b { color: var(--ink); font-weight: 600; }
.weights { display: grid; gap: 10px; margin: 4px 0 20px; }
.weights div { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 14px; color: var(--ink-2); }
.weights .w-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.weights .w-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 1s var(--ease); }
.weights b { text-align: right; font: 500 13px var(--mono); color: var(--ink); }

.callout { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; margin: 0 0 1em; }

/* Footer */
footer { margin-top: 80px; border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Motion: content is visible without JS; with JS it fades up as it scrolls into view. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .reveal { transition-duration: .9s; }
@keyframes pop { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.js .attempts.in .task i { animation: pop .5s var(--ease) both; animation-delay: var(--d, 0s); }
.js .attempts:not(.in) .task i { transform: scaleY(0); }
.js .heat td { opacity: 0; transform: scale(.92); transition: opacity .5s var(--ease), transform .5s var(--ease); transition-delay: var(--d, 0s); }
.js .heat.in td { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .heat td { opacity: 1; transform: none; }
  .js .attempts:not(.in) .task i { transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 64px 0 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 18px 16px; }
  .grid-scroll { margin: 0 -16px; padding: 0 16px; }
  .attempts .label { left: -16px; }
  .board-axis { grid-template-columns: 24px minmax(0, 1fr) 52px; }
  .board-axis .a-rank, .board-axis .a-who, .board-axis .a-val { display: none; }
  .row { grid-template-columns: 24px minmax(0, 1fr) 52px; grid-template-areas: "rank who value" ". track track"; row-gap: 10px; gap: 10px 12px; }
  .row .rank { grid-area: rank; } .row .who { grid-area: who; } .row .track { grid-area: track; } .row .value { grid-area: value; }
  .board-axis .ticks { grid-column: 2 / 4; }
  .tabs { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
  .tabs button { white-space: nowrap; }
  .heat td { min-width: 56px; height: 42px; font-size: 14px; }
  .nav a { padding: 6px 10px; }
  .brand span { display: none; }
}
