:root {
  color-scheme: light;
  --bg: #fcfcfb; --wash: #f3f2ee; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --line: rgba(11, 11, 11, .10);
  --accent: #7c3aed; --accent-on-ink: #c4b5fd; --brand: #5b21b6; --on-ink: #fcfcfb;  /* TROPT violet */
  --fam-gradient-based: #2a78d6; --fam-continuous-relaxation: #eb6834; --fam-gradient-free: #1baf7a;
  --kind-loss: #2a78d6; --kind-target: #e34948; --kind-init: #1baf7a; --kind-template: #eda100;
  --kind-combination: #c44fb0; --kind-base: #b5b3ac;  /* magenta: passes the palette check with the four above and the accent */
  --plot-background: var(--bg);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--axis); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
section { padding: 56px 0 8px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin-bottom: 6px; }
h3 { font-size: 16px; }
.sub { color: var(--ink-2); margin: 4px 0 20px; }
.muted { color: var(--muted); }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* header */
nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
nav .brand { font-weight: 650; letter-spacing: .02em; color: var(--brand); }
nav .brand a { color: inherit; text-decoration: none; }
nav .brand a:hover { text-decoration: underline; }
nav .brand span { color: var(--muted); font-weight: 400; }
nav .brand .mark { height: 24px; width: auto; margin-right: 8px; vertical-align: -6px; }
nav .links { display: flex; gap: 18px; color: var(--ink-2); }
nav .links a { text-decoration: none; }
nav .links a:hover { color: var(--ink); }
.hero { padding: 56px 0 8px; }
.eyebrow { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.eyebrow b { color: var(--brand); font-size: 20px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px; }
.eyebrow > span { padding-left: 15px; }  /* under the badge's text: its 14px padding + 1px border */
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.12; text-wrap: balance; }
.hero .sub { font-size: 18px; margin-top: 14px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 14px; }
.reset { font: inherit; font-size: 13px; color: var(--accent); background: none; border: 0; padding: 4px 2px; cursor: pointer; }
.reset:hover { text-decoration: underline; text-underline-offset: 3px; }
.reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
/* the class/family legend, above the table, doubles as a filter */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 14px; font-size: 13px; color: var(--muted); }
.chips > span { margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); font: inherit; color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--wash); border-color: var(--axis); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip .dot { background: var(--c); }
.chip[aria-pressed="false"] { color: var(--muted); border-style: dashed; }
.chip[aria-pressed="false"] .lbl { text-decoration: line-through; text-decoration-color: var(--axis); }
.chip[aria-pressed="false"] .dot { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.chip[aria-disabled="true"] { cursor: default; }  /* the last one on: looks the same, just stays on */
.chip[aria-disabled="true"]:hover { background: var(--bg); border-color: var(--line); }
/* dropdowns */
.dd { position: relative; }
.dd-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 150px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 5px 10px 5px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.dd-btn:hover { background: var(--wash); }
.dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.dd-btn svg { width: 12px; height: 12px; color: var(--muted); flex: none; transition: transform .15s; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
.dd-val, .dd-opt { display: inline-flex; align-items: center; gap: 8px; }
.dd-menu { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; min-width: 100%; margin: 0; padding: 4px;
  list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .04); }
.dd-opt { display: flex; width: 100%; padding: 7px 12px 7px 30px; border-radius: 7px; font-size: 14px; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; position: relative; }
.dd-opt:hover, .dd-opt:focus { background: var(--wash); color: var(--ink); outline: none; }
.dd-opt[aria-selected="true"] { color: var(--brand); font-weight: 550; }
.dd-opt[aria-selected="true"]::before { content: "\2713"; position: absolute; left: 11px; color: var(--accent); }
.dd-opt[aria-disabled="true"] { opacity: .4; cursor: not-allowed; background: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.fam-gradient-based { background: var(--fam-gradient-based); }
.fam-continuous-relaxation { background: var(--fam-continuous-relaxation); }
.fam-gradient-free { background: var(--fam-gradient-free); }
.kind-loss { background: var(--kind-loss); }
.kind-target { background: var(--kind-target); }
.kind-init { background: var(--kind-init); }
.kind-template { background: var(--kind-template); }
.kind-combination { background: var(--kind-combination); }
.kind-base { background: var(--kind-base); }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th { font-weight: 600; font-size: 14px; color: var(--ink); text-align: right; padding: 10px 10px 8px; white-space: nowrap; }
thead tr:last-child th { border-bottom: 1px solid var(--line); vertical-align: bottom; }  /* titles sit by their tooltips */
th[data-tip] { position: relative; cursor: help; }
th[data-tip] .lbl { text-decoration: underline dotted var(--axis); text-underline-offset: 3px; }
th[data-tip]:hover::after, th[data-tip]:focus-visible::after, th[data-tip]:has(.sort:focus-visible)::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 4px); right: 0; z-index: 5; width: 240px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08); color: var(--ink-2); font-size: 12px; font-weight: 400;
  line-height: 1.45; text-align: left; white-space: normal; text-decoration: none;
}
th.l[data-tip]:hover::after, th.l[data-tip]:focus-visible::after { left: 0; right: auto; }
/* sortable measure headers: click to rank by that column */
th .sort { font: inherit; color: inherit; background: none; border: 0; padding: 3px 6px; margin: -3px -6px;
  border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
th .sort:hover { color: var(--ink); background: var(--wash); }
th .sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
th .sort .arrow { font-size: 12px; color: var(--axis); }
th .sort:hover .arrow { color: var(--ink-2); }
th[aria-sort] .sort .arrow { color: var(--accent); }
.table-wrap { min-height: 220px; }  /* room for a header tooltip */
th.primary, td.primary { color: var(--ink); }
th.primary { font-weight: 600; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--wash); }
th.l, td.l { text-align: left; }
td.pos { color: var(--muted); width: 1%; }
td.opt .name { color: var(--ink); font-weight: 550; }
td.opt { white-space: normal; min-width: 240px; }  /* long descriptions wrap */
td.opt .cite { display: block; font-size: 12px; color: var(--muted); }
td.opt .cite a { color: inherit; font-weight: 400; text-decoration: underline; text-decoration-color: var(--axis); }
/* a row's code: a small chevron pill after its citation */
td.opt .cite a.code { display: inline-flex; vertical-align: -3px; margin-left: 6px; padding: 2px 6px; border-radius: 6px;
  background: var(--wash); color: var(--muted); }
td.opt .cite a.code:first-child { margin-left: 0; }  /* an entry without a citation, e.g. Base */
td.opt .cite a.code svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
td.opt .cite a.code:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
td.opt .row { display: flex; align-items: center; gap: 8px; }
td.score { color: var(--ink); font-weight: 600; }
/* rank cell: a 1..k rank axis, a violet mean tick; per-model lanes when several models are ranked */
td.score .ax { position: relative; display: inline-block; width: 88px; height: 12px; margin-left: 10px; vertical-align: middle; }
td.score .ax::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--grid); }
td.score .ax.lanes::before { top: 0; bottom: 0; border-top: 0; border-left: 1px solid var(--grid); border-right: 1px solid var(--grid); }
td.score .mk { position: absolute; }
td.score .mk::after { content: ""; position: absolute; inset: -4px; }  /* a hover target bigger than the mark */
td.score .mean { top: -2px; bottom: -2px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--accent); }
td.score .spread { top: 50%; border-top: 1.5px solid color-mix(in oklab, var(--accent) 30%, transparent); }
td.score .spread::after { display: none; }
td.score .lane { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 35%, var(--muted)); box-shadow: 0 0 0 1px var(--bg); }
/* the main measure's header: larger, centered over its whole column (number and axis) */
th.rank { text-align: center; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3; }
th.rank .lbl { text-decoration: none; }  /* no dotted cue on the big title; its tooltip still shows on hover */
th.rank .metric, .sub .metric { color: var(--accent); }  /* the part that follows the ranking measure */
/* the rank axis's ends above the cells: a bracket with its end ticks, the ranks under them */
th .scale { display: flex; justify-content: space-between; width: 88px; margin: 6px 0 0 auto; font-size: 10px; font-weight: 400; color: var(--muted); }
th .scale .better { color: var(--axis); }
td .se { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }  /* ± SEM, under the value */
th.on, td.on { color: var(--ink); }
th.on .lbl { color: var(--accent); text-decoration: underline solid var(--accent); text-underline-offset: 4px; }  /* the ranking measure */
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* figures */
.chart [aria-label="x-axis label"], .chart [aria-label="y-axis label"] { font-size: 13.5px; font-weight: 500; fill: var(--ink-2); }
.chart [aria-label$="axis label"] .metric { fill: var(--accent); font-weight: 600; }  /* follows the ranking measure */
.sub b { font-weight: 600; color: var(--ink); }  /* a choice made with the controls */
.key { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 6px; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key .dot { background: var(--c); }
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 32px; }
figure { margin: 0; min-width: 0; }
figure.wide { grid-column: 1 / -1; }
/* one legend for all the section's figures, at the top right of the card: on the heading's line when it fits,
   under it (still right-aligned) when it doesn't, as the leaderboard's filters */
#analysis { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
#analysis > .key { min-height: 18px; margin: 0 0 0 auto; justify-content: flex-end; }
#analysis > .figs { flex-basis: 100%; min-width: 0; margin-top: 18px; }
/* each figure's title, caption and plot sit on rows shared with the figure beside it */
@supports (grid-template-rows: subgrid) { .figs figure { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; } }
figure .sub { font-size: 14px; margin: 2px 0 12px; }
.chart { color: var(--ink-2); min-height: 120px; }
.chart svg { display: block; overflow: visible; }
.chart figure > div > span { font-size: 12px; } /* Plot's symbol legend */
@media (max-width: 760px) { .figs { grid-template-columns: 1fr; } }

/* setup */
.illus { overflow-x: auto; margin: 8px 0 28px; }
.illus svg { min-width: 640px; width: 100%; height: auto; display: block; }
.illus .box { fill: var(--wash); stroke: var(--line); }
.illus .llm { fill: var(--ink); }
.illus .tok { fill: var(--accent); }
.illus .wire { stroke: var(--axis); stroke-width: 1.5; fill: none; }
.illus .opt { fill: var(--accent); }
.illus text { fill: var(--ink-2); font: 13px system-ui, -apple-system, "Segoe UI", sans-serif; }
.illus text.t { fill: var(--ink); font-weight: 600; font-size: 14px; }
.illus text.s { fill: var(--muted); font-size: 12px; }
.illus text.on-ink { fill: var(--on-ink); }
.illus #arrow path { fill: var(--axis); }
.illus .frame { fill: none; stroke: var(--axis); }
.illus .fixed { fill: var(--ink-2); }
.illus .mark circle { fill: var(--accent); }
.illus .mark.kind-loss circle { fill: var(--kind-loss); }
.illus .mark.kind-target circle { fill: var(--kind-target); }
.illus .mark.kind-init circle { fill: var(--kind-init); }
.illus .mark.kind-template circle { fill: var(--kind-template); }
.illus .mark text { fill: #fff; font-weight: 700; font-size: 12px; }
.illus .mark.kind-template text { fill: #0b0b0b; }
dl.protocol { display: grid; grid-template-columns: 180px 1fr; gap: 12px 24px; margin: 0; font-size: 15px; }
dl.protocol dt { color: var(--muted); }
dl.protocol dd { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { dl.protocol { grid-template-columns: 1fr; gap: 2px; } dl.protocol dd { margin-bottom: 12px; } }

/* citation */
#submit { padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
#submit .sub { margin-bottom: 0; }
.cite-box { position: relative; background: var(--wash); border-radius: 12px; padding: 18px 20px; }
.cite-box pre { margin: 0; overflow-x: auto; color: var(--ink-2); line-height: 1.6; }
.cite-box button {
  position: absolute; top: 12px; right: 12px; font: inherit; font-size: 12px; cursor: pointer;
  color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px;
}
.cite-box button:hover { color: var(--ink); }
footer { margin: 64px 0 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* benchmark tabs */
nav { flex-wrap: wrap; gap: 10px 24px; }
nav .tabs { display: flex; gap: 4px; margin-right: auto; }
nav .tabs a { padding: 4px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; }
nav .tabs a:hover { color: var(--ink); background: var(--wash); }
nav .tabs a[aria-current="page"] { color: var(--brand); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 550; }

/* reference rows: evaluated, but not entries (unranked) */
tr.ref td { color: var(--muted); font-style: italic; }
tr.ref td.opt .name { color: var(--muted); font-weight: 400; }

/* toggles */
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.switch input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

/* inline mark glyphs in figure captions */
.sub .glyph { width: 0.85em; height: 0.85em; vertical-align: -0.08em; color: var(--ink-2); }

/* ==== Quiet cards =================================================================================
   Each section is one white sheet on a stone page; the hero and nav sit on the page itself.
   Benchmark tabs become a segmented control, the table runs edge to edge inside its sheet.
   Same system font: the change is in surfaces and spacing only. */
:root {
  --page: #efeee9;                 /* the ground the sheets sit on */
  --bg: #ffffff;                   /* sheet surface: chips, menus and the charts' dot rings follow it */
  --wash: #f5f4f0;
  --pad: 32px;                     /* a sheet's inner gutter */
}
body { background: var(--page); }

/* nav: no rule, the tabs as a segmented control */
nav { border-bottom: 0; padding: 22px 0 6px; }
nav .tabs { gap: 2px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, var(--page)); }
nav .tabs a { padding: 4px 12px; }
nav .tabs a:hover { background: color-mix(in srgb, var(--bg) 55%, transparent); }
nav .tabs a[aria-current="page"] { background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(11, 11, 11, .06); }

/* hero, on the page */
.hero { padding: 52px 0 40px; }
.eyebrow b { background: var(--bg); }

/* sections: sheets */
main { display: grid; gap: 20px; }
main > section { min-width: 0; padding: 30px var(--pad) 32px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
h2 { font-size: 21px; }
/* the leaderboard's filters keep to the right: beside its title when they fit, under it when they don't */
.lb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 14px; }
.lb-head h2, .lb-head .controls { margin: 0; }
.lb-head .controls { margin-left: auto; justify-content: flex-end; }
.lb-head + .chips { justify-content: flex-end; }

/* the table spans its sheet; its first and last columns keep the sheet's gutter */
#leaderboard .table-wrap { margin: 0 calc(-1 * var(--pad)); border: 0; border-radius: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#board th:first-child, #board td:first-child { padding-left: var(--pad); }
#board th:last-child, #board td:last-child { padding-right: var(--pad); }
.note { margin-top: 14px; }

/* figures: the wide one set apart from the pair below it */
.figs { gap: 36px 40px; }
figure.wide { padding-bottom: 32px; border-bottom: 1px solid var(--line); }

.cite-box { border-radius: 12px; }
footer { margin: 36px 0 40px; border-top: 0; padding-top: 0; }

@media (max-width: 640px) {  /* phones: sheets run to the screen edges, keeping the page's 16px gutter */
  :root { --pad: 16px; }
  main { gap: 12px; }
  main > section { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; padding-top: 24px; padding-bottom: 24px; }
}

/* Loading: quiet placeholders where the data will land (about their final size), then a short fade-in */
[data-state="loading"] :is(.table-wrap, .chart) { background: var(--wash); border-radius: 12px; animation: breathe 1.6s ease-in-out infinite; }
[data-state="loading"] .table-wrap { min-height: 560px; }
[data-state="loading"] .chart { min-height: 340px; }
[data-state="loading"] .dd { display: inline-block; width: 150px; height: 34px; border-radius: 8px; background: var(--wash); vertical-align: middle; }
[data-state="entering"] :is(.table-wrap, .chart, .dd, .chips, [data-version], [data-generated]) { animation: appear .35s ease-out both; }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { [data-state] * { animation: none !important; } }

/* EmbOptBench: one concept large, the others as thumbnails beside it (wide) or in a strip under it (narrow) */
.focus { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
.focus-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 16px 4px 104px; padding-bottom: 3px;
  border-bottom: 1.5px solid var(--accent); font-size: 13px; color: var(--muted); }
.focus-title b { font-size: 15px; color: var(--ink); font-weight: 600; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 24px; }
.thumb { display: block; min-width: 0; font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 5px; }
.thumb:hover { background: var(--wash); border-color: var(--axis); }
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* the concept shown large: an accent frame and title, like the large panel's title rule */
.thumb[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg)); cursor: default; }
.thumb[aria-pressed="true"] .tt b { color: var(--accent); }
.thumb .tt { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12px; white-space: nowrap; }
.thumb .tt b { font-weight: 600; }
.thumb .tt span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.thumb svg { display: block; pointer-events: none; }
.focus.narrow { grid-template-columns: minmax(0, 1fr); }
.focus.narrow .thumbs { display: flex; overflow-x: auto; padding: 2px 2px 6px; }
.focus.narrow .thumb { flex: none; width: 140px; }

/* Table-first header: the headline, one sentence, then version and date; the nav's tab names the benchmark */
.hero.compact { padding: 30px 0 22px; }
.hero.compact h1 { font-size: clamp(24px, 3.2vw, 30px); }
.hero.compact .sub { font-size: 15px; margin: 6px 0 0; }
.hero.compact .when { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
[data-state="loading"] .hero.compact .sub { visibility: hidden; }  /* its counts arrive with the data */
