:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --text: #1c1b19;
  --muted: #5f5c55;
  --border: #e3e0d8;
  --accent: #b4461f;
  --accent-soft: #f6e3da;
  --ours: #fbeee7;
  --shadow: 0 1px 2px rgba(20, 18, 14, .05), 0 8px 24px rgba(20, 18, 14, .06);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412;
    --surface: #1d1c19;
    --surface-2: #26241f;
    --text: #ece9e2;
    --muted: #a6a197;
    --border: #34312b;
    --accent: #ef8a5f;
    --accent-soft: #3a261d;
    --ours: #2c211b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151412;
  --surface: #1d1c19;
  --surface-2: #26241f;
  --text: #ece9e2;
  --muted: #a6a197;
  --border: #34312b;
  --accent: #ef8a5f;
  --accent-soft: #3a261d;
  --ours: #2c211b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 12px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; width: 34px; height: 34px; cursor: pointer; flex: none; font-size: 15px;
}
@media (max-width: 720px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 16px 28px; text-align: center; }
.venue {
  display: inline-block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 20px;
}
h1 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08; margin: 0 0 12px; letter-spacing: -0.01em;
}
.subtitle { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 25px); color: var(--muted); margin: 0 auto 26px; max-width: 760px; line-height: 1.35; }
.authors { font-size: 17px; margin: 0 0 4px; }
.affil { color: var(--muted); font-size: 15px; margin: 0 0 26px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--text); color: var(--bg); text-decoration: none; font-size: 15px; font-weight: 500;
}
.btn svg { width: 17px; height: 17px; }
.btn.disabled { background: var(--surface-2); color: var(--muted); cursor: default; border: 1px solid var(--border); }
.btn .soon { font-size: 12px; opacity: .8; }

/* ---------- Sections ---------- */
section, section.wrap { padding-top: 48px; padding-bottom: 48px; }
section + section { border-top: 1px solid var(--border); }
h2 { font-family: var(--serif); font-size: 32px; margin: 0 0 18px; line-height: 1.2; }
h3 { font-family: var(--serif); font-size: 22px; margin: 34px 0 12px; }
p { margin: 0 0 16px; }
.lead { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.figure { margin: 26px 0; }
.figure img { border-radius: 10px; }
.figure.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.figure.card.white { background: #fff; }
figcaption { color: var(--muted); font-size: 14.5px; margin-top: 10px; line-height: 1.5; }
figcaption b { color: var(--text); }

/* Teaser */
.teaser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
.teaser .op { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); }
.teaser .op img { border-radius: 8px; }
.teaser .op-title { font-family: var(--serif); font-weight: 700; font-size: 17px; margin: 2px 4px 8px; text-align: left; }
.teaser .op-caption { font-size: 13px; color: var(--muted); margin: 8px 4px 2px; text-align: left; line-height: 1.4; }
@media (max-width: 820px) { .teaser { grid-template-columns: 1fr; } }

/* Highlights */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 30px 0 6px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat .v { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
@media (max-width: 820px) { .highlights { grid-template-columns: repeat(2, 1fr); } }

/* Key ideas */
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.idea { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.idea h4 { margin: 0 0 6px; font-size: 16px; }
.idea p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.55; }
.idea .n { color: var(--accent); font-family: var(--serif); font-weight: 700; font-size: 20px; }
@media (max-width: 820px) { .ideas { grid-template-columns: 1fr; } }

.eq {
  font-family: var(--serif); text-align: center; font-size: 19px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 18px 0; overflow-x: auto;
}

/* Galleries */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-4 img, .grid-2 img { border-radius: 8px; }
@media (max-width: 720px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }

.panel-labels { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.strip { margin-bottom: 16px; }
.strip img { border-radius: 8px; width: 100%; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 18px; }
.tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font: 500 14.5px var(--sans);
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabpanel[hidden] { display: none; }
.tab-intro { color: var(--muted); font-size: 15px; margin-bottom: 16px; }

.compare-head { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.compare-head span:last-child { color: var(--accent); font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 18px 0 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
td { font-variant-numeric: tabular-nums; }
td:first-child { font-variant-numeric: normal; }
#discovery td:nth-child(3) { font-variant-numeric: normal; }
th, td { padding: 8px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--surface-2); }
td:first-child, th:first-child { text-align: left; }
tr:last-child td { border-bottom: none; }
tr.group td { background: var(--surface-2); font-weight: 600; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); text-align: left; }
tr.ours td { background: var(--ours); }
tr.ours td:first-child { font-weight: 700; }
td b { color: var(--accent); }
td u { text-decoration-thickness: 1px; }
.table-note { font-size: 13.5px; color: var(--muted); }

details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details .table-wrap { margin-bottom: 0; }

/* BibTeX */
.bib { position: relative; }
.bib pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  overflow-x: auto; font: 13.5px/1.6 var(--mono); margin: 0;
}
.copy { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 4px 10px; font: 13px var(--sans); cursor: pointer; }

footer { padding: 36px 0 60px; color: var(--muted); font-size: 13.5px; text-align: center; border-top: 1px solid var(--border); }

/* Let grid children shrink below their content width (wide tables scroll inside .table-wrap). */
.grid-2 > *, .grid-4 > *, .teaser > *, .ideas > *, .highlights > * { min-width: 0; }
