/* Palette follows the paper figures (main_neurips.tex). */
:root {
  --ink: #292f33;
  --muted: #5d6f7d;
  --accent: #2b6a9b;
  --accent-dark: #294f6d;
  --tint: #b8d2e6;
  --tint-soft: #eef4f9;
  --cream: #faedbd;
  --gold: #debe59;
  --gold-dark: #8b7429;
  --line: #dde3e8;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --radius: 10px;
  --maxw: 1000px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

section { padding: 32px 0; }
section[aria-labelledby="h-method"] { padding-top: 8px; }
section.alt { background: var(--bg-alt); }

h2 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.lede { color: var(--muted); margin: 0 0 28px; }
p { margin: 0 0 16px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 24px; text-align: center; }
.hero .logo { width: 72px; height: 72px; margin: 0 auto 12px; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}
.hero h1 .name { color: var(--accent); }
.hero .subtitle {
  display: block;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 600;
  margin-top: 8px;
  color: var(--ink);
}
.authors { margin: 24px 0 4px; font-size: 1.08rem; }
.authors span { display: inline-block; margin: 0 10px; white-space: nowrap; }
.affils { color: var(--muted); font-size: 0.98rem; }
.affils span { display: inline-block; margin: 0 10px; }
.corr { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem; font-weight: 600;
  border: 1px solid var(--ink);
}
.btn:hover { text-decoration: none; background: var(--accent-dark); border-color: var(--accent-dark); }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn.soon { background: #fff; color: var(--muted); border-color: var(--line); cursor: default; }
.btn.soon:hover { background: #fff; }
.btn .tag { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold-dark); }

/* ---------- Figures ---------- */
figure { margin: 0 0 8px; }
figure.card, .chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.chart-card {
  display: block;
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}
.result { margin: 0; }
.result figcaption { margin: 0 0 14px; }
.result h3 {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}
.result figcaption p {
  margin: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: 400;
  line-height: 1.6;
}
.teaser { margin-top: 36px; }

.stack { display: grid; gap: 28px; margin-top: 20px; }
.stack:first-child { margin-top: 0; }
figure.narrow img { max-width: 860px; margin: 0 auto; }

.abstract { text-align: justify; hyphens: auto; }

code, .math { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 0.88em; }

/* ---------- BibTeX ---------- */
.bib { position: relative; margin-top: 20px; }
.bib pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: #1f2a33; color: #e6edf3; border-radius: var(--radius);
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 0.85rem; line-height: 1.6;
}
.bib button {
  position: absolute; top: 10px; right: 10px;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; border: 1px solid #4a5a67;
  background: #2c3a45; color: #e6edf3; cursor: pointer;
}
.bib button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

footer { padding: 32px 0 48px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); text-align: center; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  section { padding: 24px 0; }
  section[aria-labelledby="h-method"] { padding-top: 0; }
  .hero { padding-top: 44px; }
  .authors span { margin: 0 6px; }
  figure.card, .chart-card { padding: 10px; }
  .abstract { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Models and code ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.models { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.models th, table.models td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.models th { background: var(--bg-alt); font-weight: 600; color: var(--ink); }
table.models tr:last-child td { border-bottom: 0; }
table.models td:first-child { white-space: nowrap; font-weight: 600; }
table.models td:last-child { white-space: nowrap; }
.snippet-label { margin: 22px 0 8px; color: var(--muted); font-size: 0.95rem; }
pre.snippet {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: #1f2a33; color: #e6edf3; border-radius: var(--radius);
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 0.82rem; line-height: 1.6;
}
@media (max-width: 560px) {
  /* Stack each model row: name, then stage and context. */
  table.models thead { display: none; }
  table.models tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.models tr:last-child { border-bottom: 0; }
  table.models td { display: inline; padding: 0; border: 0; white-space: normal; }
  table.models td:first-child { display: block; margin-bottom: 2px; }
  table.models td:last-child::before { content: " \00b7  "; color: var(--muted); }
}
