/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #fbfbfa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f2f2f0;
  --text: #16161a;
  --text-muted: #5c5c66;
  --text-faint: #8a8a94;
  --border: #e2e2de;
  --border-strong: #cfcfc9;
  --accent: #1f4ea1;
  --accent-soft: #eaf0fb;
  --accent-ink: #15386f;
  --highlight: #b5531f;

  --max: 56rem;
  --radius: 10px;
  --radius-sm: 6px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

code { font-family: var(--font-mono); font-size: .875em; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: .5rem; top: .5rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* -------------------------------------------------------------------- hero */

.hero {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: clamp(2.5rem, 7vw, 4.5rem) 16px clamp(2rem, 5vw, 3rem);
}

.hero__inner { max-width: var(--max); margin: 0 auto; text-align: center; position: relative; }

/* Venue mark: the NeurIPS logo, not a styled text label. It sits at the top
   right of the content column on wider screens, clear of the centred title;
   below 700px it falls back into the flow, centred above the title. */
.venue {
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
}

@media (min-width: 700px) {
  .hero__inner { padding-top: 3rem; }

  .venue {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
  }
}

.venue__logo { height: 30px; width: auto; }

.venue__year {
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-muted);
}

.hero__title {
  margin: 0 0 .5rem;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 6.5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.hero__subtitle {
  margin: 0 auto 2rem;
  max-width: 42rem;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.45;
  color: var(--text-muted);
}

.authors {
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 500;
}
.author sup { font-size: .7em; color: var(--text-faint); margin-left: 2px; }
/* Author links sit in a row of plain names, so they stay the same colour as
   the rest and reveal themselves on hover rather than standing out in blue. */
.author a { color: inherit; text-decoration: none; }
.author a:hover { color: var(--accent); text-decoration: underline; }

.affiliations {
  list-style: none;
  margin: 0 auto 2rem;
  padding: 0;
  max-width: 44rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .15rem 1rem;
  font-size: .8125rem;
  color: var(--text-faint);
}
.affiliation sup { margin-right: 3px; }

/* Affiliation logos.
   The official marks are dark-on-transparent, so the strip keeps a white band
   in both themes — same treatment as the figures — rather than inverting
   brand colours. */
.logos {
  list-style: none;
  margin: 0 auto 2rem;
  padding: 1rem 1.5rem;
  max-width: fit-content;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 2.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.logo { display: flex; align-items: center; }

/* Logos link to their institution; they lift slightly rather than taking the
   usual link colour, which would tint the brand marks. */
.logo a {
  display: block;
  transition: opacity .15s, transform .15s;
}
.logo a:hover { opacity: .65; transform: translateY(-1px); }

.venue__link {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  transition: opacity .15s;
}
.venue__link:hover { opacity: .65; }

/* Each logo carries its own tuned height as --logo-h, set inline from
   site.json, so the row can be scaled down as one on small screens. */
.logo img { width: auto; max-width: 100%; height: var(--logo-h, 30px); }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .625rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
.pill svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* A real brand glyph: filled paths, no stroke, so the rule above must not
   apply its 2px stroke to it. */
.pill svg.mark {
  stroke: none;
  width: auto;
  height: 18px;
}

/* Brand marks served as images keep their own colours. */
.pill__logo { width: auto; height: 17px; flex: none; }

/* --------------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__inner::-webkit-scrollbar { display: none; }

.nav__link {
  flex: none;
  padding: .85rem .7rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- sections */

.section {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-bottom: 1px solid var(--border);
}
.section:last-child { border-bottom: none; }

.section__head { margin-bottom: 1.75rem; }

.section h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.section__lead {
  margin: .6rem 0 0;
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 44rem;
}

/* ------------------------------------------------------------------- prose */

.prose {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  max-width: 42rem;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.1rem; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .35em;
}
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose blockquote {
  margin: 1.4rem 0;
  padding: .3rem 0 .3rem 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.prose + .figure,
.prose + .figure-grid,
.prose + .table-block,
.prose + .highlights,
.prose + .gallery { margin-top: 2rem; }

/* -------------------------------------------------------------- highlights */

.highlights {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.highlight {
  background: var(--bg-elevated);
  padding: 1.35rem 1.1rem;
  text-align: center;
}

.highlight__value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -.02em;
}

.highlight__label {
  display: block;
  margin-top: .4rem;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------- figures */

.figure { margin: 0 0 1.75rem; }
.figure:last-child { margin-bottom: 0; }

.figure__frame {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: hidden;
  transition: border-color .15s;
}
.figure__frame:hover { border-color: var(--border-strong); }
.figure__frame img { width: 100%; }

.figure figcaption {
  margin-top: .7rem;
  font-size: .8438rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.figure-grid .figure { margin-bottom: 0; }

/* ------------------------------------------------------------------ tables */

.table-block { margin-bottom: 2.25rem; }
.table-block:last-child { margin-bottom: 0; }

.table__title {
  margin: 0 0 .8rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.005em;
}

.table__scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: .8438rem;
  font-variant-numeric: tabular-nums;
}

table.results th,
table.results td {
  padding: .5rem .7rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

table.results thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border-strong);
}
table.results thead th:hover { color: var(--text); }
table.results thead th[aria-sort] { color: var(--accent); }
table.results thead th[aria-sort]::after {
  content: " ▾";
  font-size: .7em;
}
table.results thead th[aria-sort="ascending"]::after { content: " ▴"; }

table.results th.num, table.results td.num { text-align: right; }

table.results tbody tr:last-child td { border-bottom: none; }
table.results tbody tr:hover { background: var(--accent-soft); }

table.results td.rank { color: var(--text-faint); width: 1%; }
table.results td.model { font-weight: 500; }
table.results td.model code {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .4em;
  font-size: .9em;
}

.table__note {
  margin: .7rem 0 0;
  font-size: .8125rem;
  color: var(--text-faint);
}

/* ----------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
}

.gallery__item { margin: 0; }

.gallery__item a {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.gallery__item a:hover { border-color: var(--accent); transform: translateY(-2px); }

.gallery__pdf {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  color: var(--text-faint);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.gallery__item figcaption {
  margin-top: .55rem;
  font-size: .8125rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ bibtex */

.bibtex {
  position: relative;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.bibtex pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .8125rem;
  line-height: 1.65;
}

.bibtex__copy {
  position: absolute;
  top: .6rem;
  right: .6rem;
  padding: .35rem .75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.bibtex__copy:hover { color: var(--accent); border-color: var(--accent); }
.bibtex__copy.is-done { color: #2e7d4f; border-color: #2e7d4f; }

/* ------------------------------------------------------------------ footer */

.footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: .8438rem;
  color: var(--text-muted);
}
.footer p { margin: 0 0 .4rem; }
.footer__meta { color: var(--text-faint); }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 600px) {
  .hero { padding-top: 2rem; }
  .authors { font-size: 1rem; gap: .3rem .9rem; }
  .pill { padding: .5rem .9rem; font-size: .875rem; }
  .prose { font-size: 1rem; }
  table.results th, table.results td { padding: .45rem .55rem; }
  .logos { gap: .9rem 1.5rem; padding: .9rem 1.1rem; }
  .logo img { height: calc(var(--logo-h, 30px) * .78); }
}

@media print {
  .nav, .links, .skip, .bibtex__copy { display: none; }
  body { background: #fff; color: #000; }
  .section { break-inside: avoid; }
}
