/* Project page style. Accent colours are set per page in :root of index.html (--g1, --g2, --g3, --accent). */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7fa;
  --card: #ffffff;
  --ink: #15171c;
  --ink-2: #464b57;
  --ink-3: #737a88;
  --line: #e5e6ec;
  --figure-bg: #ffffff;
  --code-bg: #f4f4f7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, .06), 0 16px 36px rgba(16, 24, 40, .10);
  --maxw: 1120px;
  --grad: linear-gradient(100deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c0e13;
  --bg-soft: #11141b;
  --card: #151922;
  --ink: #eceef3;
  --ink-2: #b7bcc8;
  --ink-3: #8b91a0;
  --line: #252a35;
  --figure-bg: #ffffff;
  --code-bg: #0f1218;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s;
  font-feature-settings: "cv08"; /* Inter: upper-case I with serifs, so ReInit does not read as Relnit */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 650; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ---------- nav */
.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; height: 60px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; }
.nav-links a { color: var(--ink-2); font-size: 15px; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.nav-links a:hover { text-decoration: none; color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer;
}
.theme-btn:hover { color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }

/* ---------- hero */
.hero { position: relative; padding: 64px 0 40px; text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(48% 44% at 50% 38%, var(--accent-soft) 0%, transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--ink-3) 35%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 30%, #000 0%, transparent 75%); mask-image: radial-gradient(60% 60% at 50% 30%, #000 0%, transparent 75%);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.chip:hover { text-decoration: none; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.title { margin: 22px 0 0; line-height: 1.06; letter-spacing: -.025em; }
.title .main {
  display: block; font-size: clamp(3rem, 9vw, 5.6rem); font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title .sub { display: block; margin-top: 10px; font-size: clamp(1.35rem, 3.1vw, 2.15rem); font-weight: 650; color: var(--ink); letter-spacing: -.015em; }
.tagline { max-width: 760px; margin: 22px auto 0; font-size: clamp(1.05rem, 1.9vw, 1.22rem); color: var(--ink-2); line-height: 1.6; }
.tagline b { color: var(--ink); }
.authors { margin: 26px 0 0; font-size: 1.08rem; font-weight: 500; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.authors span { white-space: nowrap; }
.authors sup, .affils sup { color: var(--accent); font-weight: 650; margin-left: 1px; }
.affils { margin: 6px 0 0; color: var(--ink-3); font-size: .98rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
.affils span { white-space: nowrap; }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15.5px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn svg { width: 18px; height: 18px; }
.btn .emoji { font-size: 17px; line-height: 1; }
.btn.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }

/* ---------- sections */
section.sec { padding: 76px 0; }
section.tint { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { display: block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
h2 { margin: 0 0 18px; font-size: clamp(1.7rem, 3.4vw, 2.35rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
h3 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: -.01em; }
.lead { font-size: 1.1rem; color: var(--ink-2); margin: 0 0 18px; }
p { margin: 0 0 16px; }
.center { text-align: center; }
.muted { color: var(--ink-3); }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure-card { margin: 0; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure-card .canvas { background: var(--figure-bg); border-radius: var(--radius-sm); padding: 10px; }
.figure-card img[data-zoom] { cursor: zoom-in; }
figcaption { margin-top: 14px; font-size: .93rem; color: var(--ink-2); line-height: 1.55; }
figcaption b { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 34px; }
.stat { padding: 22px 20px; text-align: left; }
.stat .num { font-size: 1.95rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .num small { font-size: .55em; font-weight: 700; }
.stat .lbl { margin-top: 8px; font-size: .92rem; color: var(--ink-2); line-height: 1.5; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.step { padding: 22px; }
.step .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--grad); margin-bottom: 12px; }
.step p { margin: 0; color: var(--ink-2); font-size: .97rem; }
.step code, .tag { font-family: var(--mono); font-size: .85em; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.split > *, .stats > *, .steps > * { min-width: 0; }
.eq {
  margin: 20px 0; padding: 22px 16px; text-align: center; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); box-shadow: var(--shadow); font-size: 1.35rem; overflow-x: auto;
}
.eq math { font-size: 1.3em; }
.callout { padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }
.callout b { color: var(--accent); }
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
ul.clean li { position: relative; padding-left: 26px; color: var(--ink-2); }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 9px; height: 9px; border-radius: 3px; background: var(--grad); }
ul.clean li b { color: var(--ink); }

/* ---------- comparison slider */
.compare { position: relative; border-radius: var(--radius-sm); overflow: hidden; user-select: none; touch-action: pan-y; --pos: 50%; background: #000; }
.compare img { width: 100%; height: auto; pointer-events: none; }
.compare .top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .top img { height: 100%; object-fit: cover; }
.compare .bar { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.compare .knob {
  position: absolute; top: 50%; left: var(--pos); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #222;
  display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); pointer-events: none; font-size: 15px; font-weight: 700;
}
.compare .tagl, .compare .tagr {
  position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; color: #fff;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); pointer-events: none;
}
.compare .tagl { left: 10px; }
.compare .tagr { right: 10px; background: color-mix(in srgb, var(--accent) 85%, transparent); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-labels { display: grid; gap: 8px; margin-top: 10px; font-size: .86rem; color: var(--ink-2); text-align: center; line-height: 1.35; }
.compare-hint { margin-top: 10px; font-size: .86rem; color: var(--ink-3); text-align: center; }
.compare-scroll { overflow-x: auto; }
.compare-scroll .inner { min-width: 0; }

/* ---------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
table.res { width: 100%; border-collapse: collapse; font-size: .93rem; font-variant-numeric: tabular-nums; }
table.res th, table.res td { padding: 9px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.res th:first-child, table.res td:first-child { text-align: left; }
table.res thead th { font-size: .82rem; font-weight: 650; color: var(--ink-2); background: var(--bg-soft); }
table.res thead tr.grp th { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
table.res tbody tr:last-child td { border-bottom: 0; }
table.res tr.sep td { border-top: 2px solid var(--line); }
table.res tr.blockhead td { font-size: .78rem; font-style: italic; color: var(--ink-3); background: var(--bg-soft); padding-top: 7px; padding-bottom: 7px; }
table.res tr.ours td { background: var(--accent-soft); }
table.res tr.ours td:first-child { font-weight: 700; color: var(--accent); }
table.res tr.ref td { color: var(--ink-3); }
table.res .b { font-weight: 750; color: var(--ink); }
table.res .u { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
table.res .sd { font-size: .78em; color: var(--ink-3); margin-left: 2px; }
table.res .ind1 { padding-left: 26px; }
table.res .ind2 { padding-left: 44px; }
.table-note { margin-top: 12px; font-size: .88rem; color: var(--ink-3); line-height: 1.55; }

/* ---------- tabs and gallery */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tabs button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 15px; font-weight: 600; padding: 8px 18px; border-radius: 999px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: #fff; background: var(--accent); }
.tabpanel[hidden] { display: none; }
.tabpanel { margin-top: 22px; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gal-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; font-size: .85rem; font-weight: 650; color: var(--ink-2); text-align: center; }
.gal-head .o { color: var(--accent); }
.gal-row { margin-bottom: 18px; }
.gallery-wrap { max-width: 820px; margin: 0 auto; }
.gal-row img { width: 100%; border-radius: var(--radius-sm); cursor: zoom-in; }
.gal-row .p { margin-top: 7px; font-size: .9rem; color: var(--ink-2); text-align: center; }

/* ---------- bibtex */
.bib { border-radius: var(--radius); border: 1px solid var(--line); background: var(--code-bg); overflow: hidden; box-shadow: var(--shadow); }
.bib-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); background: var(--card); font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.bib pre {
  margin: 0; padding: 20px 24px; overflow-x: auto; background: transparent; border: 0;
  font-family: var(--mono); font-size: 14px; line-height: 1.65; color: var(--ink);
}
.copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600;
}
.copy:hover { color: var(--ink); }
.copy svg { width: 15px; height: 15px; }

/* ---------- footer, lightbox, reveal */
footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9rem; text-align: center; }
footer a { color: var(--ink-2); }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 32px; background: rgba(8, 10, 14, .86); cursor: zoom-out; }
.lightbox.open { display: grid; animation: fade .2s ease; }
.lightbox img { max-width: min(1600px, 96vw); max-height: 90vh; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- responsive */
.compare-hint.mobile { display: none; }
@media (max-width: 760px) {
  .compare-scroll .inner { min-width: 720px; }
  .compare-hint.mobile { display: block; }
}
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .nav-links { display: none; }
  .nav .wrap { justify-content: space-between; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 40px; }
  section.sec { padding: 56px 0; }
  .stats { grid-template-columns: 1fr; }
  .figure-card { padding: 10px; }
  .btn { padding: 9px 15px; font-size: 14.5px; }
  .title .sub br { display: none; }
}
