/* ── tokens ─────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* palette */
  --indigo: #474a8e;
  --lavender: #757bc4;
  --wine: #8f204f;
  --rose: #c87181;
  --bronze: #845502;
  --ochre: #aa8c0e;
  /* praised / criticized reviewer signals */
  --green: #2e7d57;
  --red: #b23c3c;

  --bg: #ffffff;
  --bg-alt: #f8f8fc;
  --ink: #1d1d2c;
  --ink-soft: #545468;
  --muted: #8a8a9c;
  --line: #e6e5ef;
  --accent: var(--indigo);

  --f-title: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "Noto Sans Mono", ui-monospace, Menlo, monospace;

  --r: 12px;
  --shadow: 0 1px 3px rgba(40, 40, 90, .06), 0 10px 28px rgba(40, 40, 90, .06);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; border-radius: 6px; }
p { margin: 0; }
code { font-family: var(--f-mono); font-size: .86em; }
h1, h2, h3, h4 { font-family: var(--f-title); margin: 0; text-wrap: balance; }
.inner { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

/* ── nav ────────────────────────────────────────────── */
#topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.brand { font-family: var(--f-title); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--indigo); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-links a:hover { color: var(--indigo); text-decoration: none; }

/* ── hero ───────────────────────────────────────────── */
.hero { text-align: center; padding-block: 64px 48px; }
.hero h1 {
  font-weight: 700;
  font-size: clamp(2.3rem, 5.6vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  max-width: 16ch; margin-inline: auto;
}
.hero h1 span { color: var(--indigo); }
.hero .subtitle {
  display: block; margin-top: 16px;
  font-family: var(--f-title); font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--ink-soft); letter-spacing: -.01em;
}
.authors { margin: 24px 0 26px; color: var(--ink-soft); }
.author-list { font-size: 16.5px; margin-bottom: 6px; }
.author-list a { font-weight: 600; color: var(--indigo); white-space: nowrap; }
sup { font-size: .68em; font-weight: 600; padding-left: 1px; }
/* keep subscripts (D+, D-) from stretching the line they sit on */
sub { line-height: 0; }
.affils { font-size: 14px; }
.affils sup { color: var(--indigo); }

.hero-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  --btn-c: var(--indigo);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover {
  text-decoration: none; transform: translateY(-1px);
  border-color: var(--btn-c); color: var(--btn-c);
  background: color-mix(in srgb, var(--btn-c) 7%, white);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--btn-c) 22%, transparent);
}
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.primary:hover { background: #3a3d78; color: #fff; }
.btn-github { --btn-c: #181717; }
.btn-hf { --btn-c: #d98200; }

/* ── sections ───────────────────────────────────────── */
.section { padding-block: 72px; }
.section.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.section-head h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.05; letter-spacing: -.035em;
}
/* colored bar under each section title; set --hue on .section-head */
.section-head h2::after {
  content: ""; display: block;
  width: 56px; height: 4px; margin: 18px auto 0;
  border-radius: 999px; background: var(--hue, var(--indigo));
}
.section-head .sub { margin: 18px auto 0; max-width: 620px; font-size: 17px; font-weight: 500; color: var(--ink-soft); }

.prose { max-width: 760px; margin-inline: auto; display: grid; gap: 16px; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.lede { font-size: 17.5px; line-height: 1.7; }

/* figure card */
.fig { margin: 0; display: flex; flex-direction: column; align-items: center; }
.fig .card {
  width: 100%;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px; overflow: hidden;
}
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 14px; max-width: 680px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); text-align: center; }
.fig figcaption b { color: var(--ink); font-weight: 600; }
.fig.md { max-width: 660px; margin-inline: auto; }
.fig.lead { margin-bottom: 44px; }
.fig.wide figcaption { max-width: none; padding-inline: 16px; }
/* wide diagrams link to the full-size image, which phones can pinch-zoom */
.fig a.card { display: block; cursor: zoom-in; }
.zoom-hint { display: none; font-style: italic; color: var(--muted); }

/* ── overview ───────────────────────────────────────── */
/* the wide teaser GIF gets its own row, with the text below it; figure, caption and
   text share one column width so their edges line up */
.overview { display: grid; gap: 40px; max-width: 860px; margin-inline: auto; }
.overview .prose { max-width: none; margin: 0; }
/* match the card to the GIF's #fcfcfc background so the animation has no visible edge */
.card.gif-bg { background: #fcfcfc; }
.fig.teaser figcaption { max-width: none; }
.overview .hook { font-family: var(--f-title); font-weight: 600; font-size: 22px; line-height: 1.35; color: var(--ink); letter-spacing: -.015em; }
.overview .hook em { font-style: normal; color: var(--wine); }
.hl { color: var(--wine); font-weight: 600; }

/* ── benchmark ──────────────────────────────────────── */
/* data setups table, with its note beside it */
.data-stats { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 36px; align-items: center; }
.data-stats figcaption {
  margin: 0; max-width: none; text-align: left; font-size: 15px; line-height: 1.6;
  padding-left: 20px; border-left: 3px solid var(--lavender);
  display: grid; gap: 10px;
}
.data-stats figcaption b { white-space: nowrap; }
table.setups { min-width: 500px; }
.setups th, .setups td { text-align: center; vertical-align: middle; }
.setups th[rowspan], .setups td:first-child { text-align: left; }
.setups thead th { padding-block: 10px; }
.setups .col-groups th { border-bottom: 0; padding-bottom: 0; }
.setups .col-groups th[rowspan] { border-bottom: 1px solid var(--line); vertical-align: bottom; padding-bottom: 10px; }
/* underline each column group separately, like booktabs \cmidrule */
.setups .col-groups span { display: block; padding-bottom: 6px; border-bottom: 1.5px solid var(--lavender); color: var(--indigo); }
.setups thead tr + tr th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.setups thead i { font-family: var(--f-title); font-weight: 600; font-style: italic; }
.setups td { font-family: var(--f-title); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; padding-block: 16px; }
.setups td.setup { font-family: var(--f-mono); font-size: 14.5px; font-weight: 500; color: var(--c); white-space: nowrap; }
.setups td.setup::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 10px; border-radius: 50%; background: var(--c); }
/* where D- comes from; hangs off the number so the number stays centered under its header */
.setups .n { position: relative; }
/* symmetric padding wide enough for the tag, so the D- column keeps its number centered */
.setups td:nth-child(3), .setups thead tr + tr th:nth-child(2) { padding-inline: 50px; }
.setups .src {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  margin-left: 6px; padding: 2px 6px; border-radius: 5px; line-height: 1.5;
  font-family: var(--f-body); font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, white);
}
/* the two column groups get a faint divider */
.setups td:nth-child(4), .setups thead tr + tr th:nth-child(3) { border-left: 1px solid var(--line); }

/* reviewer signals */
.block-title { text-align: center; margin-bottom: 20px; font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 600; letter-spacing: -.02em; }
.signals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sig-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; display: grid; gap: 16px; align-content: start; }
.tag {
  justify-self: start;
  font-family: var(--f-title); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, white);
}
.sig { display: grid; gap: 4px; }
.sig + .sig { padding-top: 16px; border-top: 1px dashed var(--line); }
.sig q { font-size: 15.5px; line-height: 1.55; color: var(--ink); quotes: "\201C" "\201D"; }
.sig q b { font-weight: 600; color: var(--c); }
.sig cite { font-style: italic; font-size: 13.5px; color: var(--muted); }

/* ── study table ────────────────────────────────────── */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 660px; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; padding: 10px 18px; vertical-align: top; }
thead th { font-family: var(--f-title); font-weight: 600; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-block: 14px; }
tbody tr + tr td { border-top: 1px solid var(--line); }
tr.grp td { background: var(--bg-alt); font-family: var(--f-title); font-weight: 600; font-size: 14px; color: var(--indigo); }
tr.grp .note { font-family: var(--f-body); font-weight: 400; font-style: italic; color: var(--muted); margin-left: 8px; }
td.name { white-space: nowrap; font-weight: 500; }
td.name .p { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--indigo); margin-right: 6px; }
td.proto { white-space: nowrap; color: var(--ink-soft); font-size: 14px; }
.judges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; }
.judges .lbl { font-size: 14px; color: var(--ink-soft); margin-right: 4px; }
.chip { font-family: var(--f-mono); font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }

/* ── results ────────────────────────────────────────── */
.result { display: grid; gap: 22px; align-content: start; }

/* results carousel: a scroll-snap track, so touch swiping works without JS */
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.carousel-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); cursor: pointer;
  transition: color .18s ease, border-color .18s ease, opacity .18s ease;
}
.carousel-btn svg { width: 18px; height: 18px; }
.carousel-btn:hover:not(:disabled) { color: var(--wine); border-color: var(--rose); }
.carousel-btn:disabled { opacity: .35; cursor: default; }
.carousel-dots { display: flex; }
/* 24px hit area around a small pill */
.carousel-dot { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; transition: width .25s ease; }
.carousel-dot::before { content: ""; width: 9px; height: 9px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 45%, transparent); transition: width .25s ease, background .25s ease; }
.carousel-dot:hover::before { background: var(--rose); }
.carousel-dot[aria-current="true"] { width: 38px; }
.carousel-dot[aria-current="true"]::before { width: 26px; background: var(--wine); }
.carousel-track {
  /* the gap keeps neighbouring slides' card shadows out of view */
  display: flex; gap: 48px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  /* room below for the figure-card shadow, which the scroll container would otherwise clip */
  padding-bottom: 28px; margin-bottom: -28px;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--lavender); outline-offset: 6px; border-radius: var(--r); }
.carousel-track > .result { flex: 0 0 100%; scroll-snap-align: start; }
.result-head { max-width: 760px; margin-inline: auto; text-align: center; display: grid; gap: 10px; }
.result-head h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 600; letter-spacing: -.02em; }
.result-head p { color: var(--ink-soft); }
/* model names like claude-sonnet-4-5 should not break at their hyphens */
.result-head code { white-space: nowrap; }

/* ── bibtex ─────────────────────────────────────────── */
.bibtex-wrap { position: relative; max-width: 820px; margin-inline: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.bibtex-wrap pre { margin: 0; overflow-x: auto; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.65; color: var(--ink); }
#copy-bib {
  position: absolute; top: 12px; right: 12px;
  font: 600 12.5px var(--f-body); padding: 6px 12px; border-radius: 8px;
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); cursor: pointer;
}
#copy-bib:hover { color: var(--indigo); border-color: var(--lavender); }

footer { padding-block: 28px 40px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 820px) {
  .overview { gap: 32px; }
  .signals, .data-stats { grid-template-columns: 1fr; }
  .data-stats { gap: 20px; }
  .section { padding-block: 56px; }
}
/* the study table stacks into one block per change instead of scrolling sideways:
   name and protocol on the first line, description below */
@media (max-width: 720px) {
  .zoom-hint { display: inline; }
  table.study { min-width: 0; }
  table.study thead { display: none; }
  table.study tbody, table.study tr, table.study td { display: block; }
  table.study td { padding: 0; }
  table.study tbody tr + tr td { border-top: 0; }
  table.study tbody tr + tr { border-top: 1px solid var(--line); }
  table.study tr.grp td { padding: 10px 16px; }
  table.study tr.grp .note { display: block; margin: 2px 0 0; }
  table.study tr:not(.grp) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  table.study td.name { white-space: normal; }
  table.study td:nth-child(2) { grid-column: 1 / -1; color: var(--ink-soft); font-size: 14.5px; }
  table.study td.proto {
    grid-column: 2; grid-row: 1; align-self: start;
    font-size: 12px; padding: 1px 8px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--bg-alt);
  }
}
@media (max-width: 560px) {
  .inner { padding-inline: 16px; }
  .nav-links { display: none; }
  .hero { padding-block: 44px 36px; }
  .fig .card { padding: 10px; }
  /* phones get the static vertical teaser (see index.html), which is on white */
  .card.gif-bg { background: #fff; }
  /* the data statistics table fits a phone: tighter cells, and the ICLR/LLM tag
     moves under its number instead of hanging beside it */
  table.setups { min-width: 0; }
  .setups th, .setups td { padding-inline: 6px; }
  .setups td:nth-child(3), .setups thead tr + tr th:nth-child(2) { padding-inline: 6px; }
  .setups thead tr + tr th { font-size: 13px; }
  .setups td { font-size: 17px; }
  .setups td.setup { font-size: 13px; white-space: normal; }
  .setups td.setup::before { margin-right: 6px; }
  .setups .n { display: inline-flex; flex-direction: column; align-items: center; }
  .setups .src { position: static; transform: none; margin: 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  .carousel-track { scroll-behavior: auto; }
  .carousel-dot, .carousel-dot::before { transition: none; }
}
