:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --border: #e3e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #2a78d6;
  --accent-ink: #1d5fae;
  --accent-soft: #e7f0fb;
  --series-ours: #2a78d6;
  --series-other: #8a8984;
  --grid: #ebe9e4;
  --axis: #b9b7b0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #2f2f2c;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #96958c;
    --accent: #3987e5;
    --accent-ink: #7fb2f0;
    --accent-soft: #1b2a3d;
    --series-ours: #3987e5;
    --series-other: #8f8e87;
    --grid: #2a2a27;
    --axis: #55544f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1a1a19;
  --surface-2: #232321;
  --border: #2f2f2c;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #96958c;
  --accent: #3987e5;
  --accent-ink: #7fb2f0;
  --accent-soft: #1b2a3d;
  --series-ours: #3987e5;
  --series-other: #8f8e87;
  --grid: #2a2a27;
  --axis: #55544f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 28px; text-align: center; }
.hero h1 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.hero .name {
  display: block; font-size: clamp(40px, 8vw, 64px); line-height: 1.05;
  letter-spacing: 0.04em; color: var(--text);
}
.hero .subtitle {
  display: block; margin: 14px auto 0; max-width: 760px;
  font-size: clamp(19px, 3vw, 26px); font-weight: 500; line-height: 1.3; color: var(--text-2);
}
.authors {
  list-style: none; padding: 0; margin: 26px 0 4px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font-size: 18px;
}
.authors a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.authors a:hover { border-color: var(--accent); }
.affil { margin: 0; color: var(--text-2); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.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-weight: 600; font-size: 15px;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--accent); color: #fff; }
.btn.disabled { background: var(--surface-2); color: var(--text-3); cursor: default; }

/* ---------- sections ---------- */
section { margin: 56px 0; }
h2 { font-size: 28px; margin: 0 0 14px; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 32px 0 12px; color: var(--text-2); }
p { margin: 0 0 14px; }
.small { font-size: 15px; color: var(--text-2); }

.teaser figure { margin: 0; padding: 14px; background: #ffffff; border: 1px solid var(--border); border-radius: 14px; }
.tldr { margin-top: 18px; font-size: 19px; line-height: 1.55; color: var(--text); }

figure.wide { margin: 28px 0 0; }
figure.wide img { border-radius: 10px; border: 1px solid var(--border); background: #fff; }
figcaption { margin-top: 10px; font-size: 15px; color: var(--text-2); }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gallery img { border-radius: 8px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
@media (max-width: 720px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---------- tables ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.table-wrap.narrow { max-width: 640px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; padding: 12px 14px 6px; font-size: 14px; color: var(--text-2); }
th, td { padding: 7px 14px; text-align: right; white-space: nowrap; }
th[scope="row"], thead th:first-child { text-align: left; font-weight: 500; }
thead th { font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); }
thead th[scope="colgroup"] { text-align: center; }
tbody tr + tr th, tbody tr + tr td { border-top: 1px solid var(--grid); }
tr.muted { color: var(--text-3); }
tr.ours { background: var(--accent-soft); }
tr.ours th { font-weight: 700; }

/* ---------- chart ---------- */
.viz-root { position: relative; margin-top: 20px; padding: 18px 18px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.viz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; }
.viz-title { margin: 0; font-weight: 600; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.key-ours { background: var(--series-ours); }
.key-other { background: var(--series-other); }
.key-ref { border: 2px solid var(--series-other); background: transparent; }
.viz-scroll { overflow-x: auto; margin: 8px -6px 0; padding: 0 6px; }
.viz-svg { width: 100%; min-width: 560px; height: auto; display: block; overflow: visible; }
.viz-svg .grid line { stroke: var(--grid); stroke-width: 1; }
.viz-svg .axis line, .viz-svg .axis path { stroke: var(--axis); stroke-width: 1; }
.viz-svg text { fill: var(--text-2); font-size: 13px; font-family: inherit; }
.viz-svg .axis-title { fill: var(--text-2); font-size: 13px; font-weight: 600; }
.viz-svg .ref-line { stroke: var(--text-3); stroke-dasharray: 4 4; stroke-width: 1; }
.viz-svg .ref-label { fill: var(--text-3); font-size: 12px; }
.viz-svg .pt { stroke: var(--surface); stroke-width: 2; }
.viz-svg .pt.ours { fill: var(--series-ours); }
.viz-svg .pt.other { fill: var(--series-other); }
.viz-svg .pt.ref { fill: var(--surface); stroke: var(--series-other); stroke-width: 2; }
.viz-svg .lbl { fill: var(--text-2); font-size: 13px; }
.viz-svg .lbl.ours { fill: var(--text); font-weight: 700; }
.viz-svg .hit { fill: transparent; cursor: pointer; }
.viz-svg .better { fill: var(--text-3); font-size: 12px; }
.viz-svg g.active .pt { stroke: var(--text); }
.viz-note { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 2; min-width: 180px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.tooltip b { display: block; margin-bottom: 2px; font-size: 14px; }
.tooltip .row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.tooltip .row span:last-child { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
pre { margin: 0; padding: 18px; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; font-size: 14px; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.copy {
  position: absolute; top: 10px; right: 10px; padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 600 13px system-ui, sans-serif; cursor: pointer;
}
.copy:hover { color: var(--text); border-color: var(--accent); }

.foot { padding: 24px 16px 48px; color: var(--text-3); font-size: 14px; border-top: 1px solid var(--border); }
