/* ---------------------------------------------------------------
   24H-GNN project page
   Light, editorial academic style: thin Helvetica, narrow reading column,
   frosted sticky navigation, outlined action buttons, flat figure cards.
---------------------------------------------------------------- */
:root {
  --ink: #1d1d1f;
  --muted: #6b7280;
  --faint: #9aa1ac;
  --line: #dfe3e8;
  --soft: #f6f7f9;
  --softer: #fafbfc;
  --link: #1f407a;
  --accent: #2f62b0;
  --accent-soft: #e8eff9;
  --gold: #c98a1a;
  --red: #c0504a;
  --col: 960px;
  --wide: 1160px;
  --font: "Helvetica Neue", Helvetica, "Segoe UI", Roboto, Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --nav: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 300 18px/1.62 var(--font); -webkit-font-smoothing: antialiased;
  min-width: 320px; display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 .9em; }
b, strong { font-weight: 500; }
sup, sub { line-height: 0; }

.col { width: min(var(--col), calc(100% - 32px)); margin-inline: auto; }
.wide { width: min(var(--wide), calc(100% - 32px)); margin-inline: auto; }

/* ---------- navigation ---------- */
.topnav {
  position: sticky; top: 0; z-index: 30; height: var(--nav);
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.topnav .inner { width: min(1200px, calc(100% - 32px)); height: 100%; margin-inline: auto; display: flex; align-items: center; gap: 18px; }
.topnav .brand b { font-weight: 500; }
.topnav .brand { display: flex; align-items: center; gap: 9px; color: var(--ink); border: 0; font-weight: 500; letter-spacing: .01em; white-space: nowrap; }
.topnav .brand svg { width: 22px; height: 22px; }
.topnav .brand span { color: var(--accent); }
.topnav ul { display: flex; gap: 2px; margin: 0 0 0 auto; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.topnav ul::-webkit-scrollbar { display: none; }
.topnav li a { display: block; padding: 4px 10px; color: var(--ink); font-size: 16px; text-transform: lowercase; white-space: nowrap; border-bottom: 1px solid transparent; }
.topnav li a:hover { color: var(--link); border-bottom-color: var(--link); }
.topnav li a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 54px 0 6px; }
.hero h1 { margin: 0; font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: .95; letter-spacing: -.035em; }
.hero h1 span { color: var(--accent); }
.hero h2.sub { text-align: center; letter-spacing: 0; margin: 18px auto 0; max-width: 780px; font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.25; font-weight: 300; text-wrap: balance; }
.hero .venue { display: block; margin-top: 14px; font-weight: 400; font-size: 17px; color: var(--muted); letter-spacing: .01em; }
.authors { margin: 24px auto 0; max-width: 900px; font-size: 18px; line-height: 1.7; }
.authors .au { white-space: nowrap; }
.authors .au:not(:last-child)::after { content: ","; margin-right: .35em; }
.authors sup { font-size: .72em; color: var(--muted); margin-left: 1px; }
.affils { display: flex; flex-wrap: wrap; justify-content: center; gap: .35em 22px; margin: 12px auto 0; max-width: 1020px; font-size: 14.5px; line-height: 1.3; color: var(--muted); }
.affils sup { color: var(--ink); margin-right: 3px; font-size: .78em; }
.contact { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.options a, .options .dsbl {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 18px 7px;
  border: 1px solid #b9bfc8; background: #fff; color: var(--ink);
  font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.options a:hover { background: var(--soft); border-color: var(--ink); transform: translateY(-1px); }
.options .dsbl { color: var(--faint); border-style: dashed; cursor: not-allowed; }
.options svg { width: 17px; height: 17px; flex: none; }

/* ---------- figures ---------- */
.fig { margin: 0; }
.fig .frame { border: 1px solid var(--line); background: #fff; padding: 12px; }
.fig .frame img { margin-inline: auto; cursor: zoom-in; }
.cap { margin: 10px auto 0; max-width: 920px; font-size: 16px; line-height: 1.4; font-weight: 300; color: #3a3f47; }
.cap b { font-weight: 500; color: var(--ink); }
.teaser { margin-top: 38px; }
.fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.fig-grid figure { margin: 0; }
.fig-grid .sub { text-align: center; font-size: 14px; color: var(--muted); margin-top: 6px; }
@media (max-width: 640px) { .fig-grid { grid-template-columns: 1fr; } }

/* ---------- key numbers ---------- */
.keys { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin: 30px auto 0; background: var(--softer); }
.key { padding: 18px 18px 16px; border-right: 1px solid var(--line); }
.key:last-child { border-right: 0; }
.key .num { font-size: 2.3rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; color: var(--accent); }
.key .lbl { margin-top: 8px; font-size: 14px; line-height: 1.3; color: var(--muted); }
@media (max-width: 820px) {
  .keys { grid-template-columns: repeat(2, 1fr); }
  .key:nth-child(2) { border-right: 0; }
  .key:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- section scaffolding ---------- */
section { position: relative; padding-top: 12px; }
h2 { margin: 42px 0 14px; font-weight: 400; font-size: 26px; line-height: 1.15; text-align: center; letter-spacing: -.01em; }
h3 { margin: 34px 0 8px; font-weight: 500; font-size: 20px; line-height: 1.2; }
h3 .n { color: var(--accent); margin-right: 8px; font-weight: 400; }
h4 { margin: 0 0 4px; font-weight: 500; font-size: 16px; }
.lead { color: #444a53; }
.abstract { hyphens: auto; }
.kicker { text-align: center; color: var(--muted); max-width: 760px; margin: -4px auto 22px; font-size: 17px; }

/* sticky major headings */
.stkt {
  position: sticky; top: var(--nav); z-index: 20; margin: 0; padding: 22px 16px 10px;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: saturate(130%) blur(12px); backdrop-filter: saturate(130%) blur(12px);
  transition: padding .25s ease, font-size .25s ease, box-shadow .25s ease;
}
.stkt.stuck { padding-top: 9px; padding-bottom: 8px; font-size: 18px; box-shadow: 0 1px 0 rgba(0,0,0,.07); }
section.major { padding-top: 40px; }

/* numbered contributions */
ul.contrib { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: c; }
ul.contrib li { counter-increment: c; position: relative; padding: 4px 0 14px 44px; line-height: 1.5; }
ul.contrib li::before {
  content: counter(c); position: absolute; left: 0; top: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-size: 14px; font-weight: 500;
}

/* glance cards */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 0; }
.glance > div { background: var(--softer); border: 1px solid var(--line); padding: 14px 16px; }
.glance .tag { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.glance p { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: #3a3f47; }
@media (max-width: 900px) { .glance { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .glance { grid-template-columns: 1fr; } }

/* pipeline steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; counter-reset: s; }
.step { position: relative; background: var(--softer); border: 1px solid var(--line); border-top-width: 4px; padding: 12px 14px 12px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 8px; right: 12px; font-size: 1.5rem; font-weight: 300; color: #c8d0dc; }
.step p { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
.step.c1 { border-top-color: #9db9ec; } .step.c2 { border-top-color: #f3cf5f; }
.step.c3 { border-top-color: #8fbf80; } .step.c4 { border-top-color: #e69a9a; }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, 1fr); } }

/* algorithm box */
.algo { margin: 14px 0; border: 1px solid var(--line); background: #fff; }
.algo header { padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--soft); font-weight: 500; font-size: 15px; }
.algo ol { margin: 0; padding: 10px 14px 10px 38px; font-size: 16px; line-height: 1.45; }
.algo li { padding: 3px 0 3px 4px; }
.algo li::marker { color: var(--accent); font-weight: 500; }

.eq { margin: 14px 0 16px; padding: 8px 14px; overflow-x: auto; background: var(--softer); border: 1px solid var(--line); }
.eq .katex-display { margin: .45em 0; }
.eq-tag { float: right; color: var(--faint); font-size: 14px; }

.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 16px; margin: 16px 0; font-size: 16px; line-height: 1.5; }
.note p:last-child { margin: 0; }
.note .lab { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 500; display: block; margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip { padding: 3px 12px; font-size: 14px; border: 1px solid var(--line); background: #fff; }
.chip b { color: var(--accent); font-weight: 500; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); margin: 14px 0 6px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 14px; text-align: right; white-space: nowrap; font-weight: 300; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--soft); font-weight: 500; border-bottom: 1px solid var(--line); }
tbody tr + tr td { border-top: 1px solid #eef0f3; }
tbody tr.ours td { background: var(--accent-soft); }
tbody tr.ours td:first-child { font-weight: 500; color: var(--link); }
tbody tr.sep td { border-top: 2px solid var(--line); }
tbody tr.delta td { font-style: italic; color: var(--muted); border-top: 2px solid var(--line); background: var(--softer); }
td.best { font-weight: 500; color: var(--link); }
td.pos { color: #1c7c4b; } td.neg { color: var(--red); }
td.txt, th.txt { text-align: left; white-space: normal; }
.tcap { margin: 6px 2px 22px; font-size: 14.5px; line-height: 1.4; color: var(--muted); }
.tcap b { color: var(--ink); font-weight: 500; }

/* ---------- demo ---------- */
.demo { border: 1px solid var(--line); background: #fff; padding: 18px; }
.sims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
@media (max-width: 640px) { .sims { grid-template-columns: 1fr; } }
.cell { background: var(--softer); border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; line-height: 1.35; }
.cell .ax { color: var(--muted); font-weight: 500; letter-spacing: .03em; }
.cell b { display: block; font-weight: 500; }
.cell .term { font-family: var(--mono); font-size: 14px; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .ax { stroke: #cdd3db; } .chart text { font-size: 11px; fill: #6b7280; font-family: var(--font); }
.chart .l-loop { stroke: #8fa3bb; fill: none; stroke-width: 2; stroke-dasharray: 5 4; }
.chart .l-taxi { stroke: var(--gold); fill: none; stroke-width: 2; stroke-dasharray: 2 3; }
.chart .l-fused { stroke: var(--accent); fill: none; stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; }
.slider label { display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; margin: 12px 0 4px; }
.slider output { font-family: var(--mono); font-weight: 500; color: var(--link); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.verdict { margin-top: 12px; padding: 10px 14px; font-size: 15.5px; line-height: 1.45; background: var(--accent-soft); border-left: 3px solid var(--accent); }

/* ---------- result charts ---------- */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 14px; }
.tab { padding: 6px 16px 5px; border: 1px solid #b9bfc8; background: #fff; font: inherit; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; color: var(--ink); }
.tab:hover { background: var(--soft); }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.bars { display: grid; gap: 7px; border: 1px solid var(--line); padding: 16px 18px; background: #fff; }
.bar { display: grid; grid-template-columns: 240px 1fr 62px; align-items: center; gap: 12px; font-size: 15.5px; }
.bar .track { height: 16px; background: var(--soft); position: relative; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #aab6c6; transition: width .55s cubic-bezier(.2,.8,.2,1); }
.bar.ours .fill { background: var(--accent); }
.bar.ours .nm { font-weight: 500; color: var(--link); }
.bar .v { text-align: right; font-family: var(--mono); font-size: 14px; }
.bar.top .v { font-weight: 700; }
.bar.top .v::before { content: "★ "; color: var(--gold); font-weight: 400; }
@media (max-width: 560px) { .bar { grid-template-columns: 120px 1fr 44px; font-size: 14px; } }

.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 0; }
.findings > div { border: 1px solid var(--line); background: var(--softer); padding: 14px 16px; }
.findings .big { font-size: 1.9rem; font-weight: 300; color: var(--accent); line-height: 1.1; letter-spacing: -.02em; }
.findings p { font-size: 15px; line-height: 1.42; color: #3a3f47; margin: 6px 0 0; }
@media (max-width: 820px) { .findings { grid-template-columns: 1fr; } }

/* before/after slider */
.compare { position: relative; overflow: hidden; border: 1px solid var(--line); background: #eee; user-select: none; touch-action: pan-y; aspect-ratio: 659 / 490; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .top { clip-path: inset(0 0 0 50%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.compare .handle::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35); display: grid; place-items: center; font-size: 18px; color: var(--ink); }
.compare .tag { position: absolute; top: 10px; padding: 3px 10px; background: rgba(255,255,255,.88); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.compare .tag.l { left: 10px; } .compare .tag.r { right: 10px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre { margin: 0; padding: 16px; overflow-x: auto; background: var(--soft); border: 1px solid var(--line); font: 13px/1.55 var(--mono); }
.bib .copy { position: absolute; top: 8px; right: 8px; padding: 3px 11px; font: 13px var(--font); background: #fff; border: 1px solid #b9bfc8; cursor: pointer; letter-spacing: .05em; text-transform: uppercase; }
.bib .copy:hover { background: var(--soft); }
.ref { font-size: 17px; }

/* ---------- related ---------- */
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.card { display: flex; flex-direction: column; background: var(--softer); text-align: center; color: var(--ink); border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card h5 { margin: 0; padding: 12px 10px 0; font-size: 18px; font-weight: 400; }
.card .cover { margin-top: 8px; aspect-ratio: 8 / 5; overflow: hidden; background: #fff; border-block: 1px solid var(--line); }
.card .cover img { width: 100%; height: 100%; object-fit: contain; }
.card .d { padding: 8px 14px 0; font-size: 15px; line-height: 1.3; font-weight: 400; color: var(--link); }
.card .v { padding: 4px 14px 12px; font-size: 14px; color: var(--muted); }
.related { grid-template-columns: minmax(300px, 420px); justify-content: center; }

/* ---------- footer ---------- */
footer { margin-top: 56px; padding: 18px 0 14px; background: var(--softer); border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; line-height: 1.5; text-align: center; }
footer p { margin: 0 0 3px; }
footer b { color: var(--muted); font-weight: 500; }

/* ---------- lightbox ---------- */
dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog#lightbox::backdrop { background: rgba(10,16,24,.78); }
dialog#lightbox img { max-width: 96vw; max-height: 90vh; background: #fff; padding: 10px; cursor: zoom-out; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .topnav .brand span { display: none; }
  .abstract { text-align: left; }
  .hero { padding-top: 34px; }
  .stkt { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
  .topnav, .options, .bib .copy, .demo .slider, .tabs { display: none; }
  .stkt { position: static; }
  section { break-inside: avoid; }
}
