:root {
  --text: #1f2937;
  --muted: #5b6472;
  --accent: #0f6e6a;
  --accent-soft: #d7f4f1;
  --line: #e5e7eb;
  --band-alt: #f6f7f9;
  --max: 1120px;
  --nav-h: 60px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --yaw-pos: #b45309;
  --yaw-zero: #0f766e;
  --yaw-neg: #1d4ed8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  font-family: "Source Sans 3", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.65;
}

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

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}
.wrap.narrow { width: min(860px, calc(100% - 2.5rem)); }

/* ---------- top nav ---------- */
.topnav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  color: #fff;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.topnav.solid {
  background: rgba(255, 255, 255, .96);
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(8px);
}
.nav-inner {
  height: 100%;
  padding: 0 clamp(1rem, 2.2vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: inherit;
  flex: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  margin-left: auto;
  min-width: 0;
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links a {
  color: inherit;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.97rem;
  white-space: nowrap;
  opacity: .88;
}
.nav-links a:hover { text-decoration: none; opacity: 1; }
.nav-links a.on { opacity: 1; color: #7dd3c0; }
.topnav.solid .nav-links a:hover { color: var(--accent); }
.topnav.solid .nav-links a.on { color: var(--accent); }

/* ---------- hero (page 1) ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: #0b1220;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(5, 10, 20, .38) 0%, transparent 100%),
    linear-gradient(180deg, rgba(5, 10, 20, .55) 0%, rgba(5, 10, 20, .3) 35%, rgba(5, 10, 20, .4) 65%, rgba(5, 10, 20, .75) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 3rem));
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.hero-name {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 9vw, 6.2rem);
  line-height: 1.12;
  padding: 0 0.04em 0.16em;
  margin-bottom: -0.1em;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #a9e6c3 0%, #b0dcec 38%, #aecff5 62%, #c7a9f2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .45));
}
.hero-title {
  margin: 0.9rem auto 1.5rem;
  max-width: 28em;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.72rem, 3.7vw, 2.95rem);
  font-weight: 600;
  line-height: 1.28;
}
.hero .authors {
  margin: 0.45rem 0 0.35rem;
  font-size: clamp(1.2rem, 2.15vw, 1.75rem);
  line-height: 1.45;
}
.hero .authors a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .45); white-space: nowrap; }
.hero .affiliations, .hero .note {
  margin: 0.28rem 0;
  font-size: clamp(1.02rem, 1.55vw, 1.32rem);
  line-height: 1.45;
  opacity: .85;
}
.hero .affiliations span { white-space: nowrap; margin-right: 0.7em; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.6rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-weight: 700;
  border: 1px solid #fff;
  text-shadow: none;
}
.btn:hover { text-decoration: none; background: #e5e7eb; }
.btn.secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn.secondary:hover { background: rgba(255, 255, 255, .2); }

.scroll-cue {
  position: absolute;
  z-index: 1;
  bottom: 28px;
  left: 50%;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: #fff;
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- content (page 2) ---------- */
.band { padding: 4.2rem 0; }
.band.alt { background: var(--band-alt); }
.band h2 {
  margin: 0 0 1.6rem;
  text-align: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}
.band p { margin: 0 0 0.9rem; text-wrap: pretty; }
.band p.lead { text-align: center; color: var(--muted); max-width: 760px; margin: -0.6rem auto 1.8rem; }
#abstract p { text-align: justify; font-size: 1.06rem; }

.demo-video {
  display: block;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.subblock { margin-top: 3rem; }
.subblock:first-of-type { margin-top: 0; }
.subblock h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.8rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 650;
}
.subblock > .figure { margin-top: 1rem; }
.subblock h3 .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}
.contrib { font-size: 1.06rem; }
.video-caption { margin-top: 1rem; }
.hint { color: var(--accent); font-weight: 700; }

.points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 1.6rem;
}
.point {
  padding: 1.2rem 1.35rem 0.4rem;
  border-radius: 14px;
  background: var(--band-alt);
  border-top: 3px solid var(--accent);
}
.point h4 {
  margin: 0 0 0.75rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--accent);
}
.point p { font-size: 0.98rem; }
.point .step {
  display: inline-block;
  min-width: 1.6rem;
  margin-right: 0.45rem;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #115e59;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: 1px;
}

.train-stack { margin-top: 1.6rem; }
.train-stack .split-copy p { margin-bottom: 0.85rem; }
.train-stack .abl { max-width: 980px; margin: 1.4rem auto 0; }
.dilemma {
  padding: 0.7rem 1rem;
  border-left: 4px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  background: #fffbeb;
  font-size: 1.05rem !important;
}
.dilemma b { color: #b45309; }
.payoff {
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #f0fdfa;
}
.payoff b { color: var(--accent); }

.abl {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.abl-head, .abl-row {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 2rem;
  align-items: center;
}
.abl-head {
  padding: 0 0.8rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.abl-rows { flex: 1 1 auto; display: flex; flex-direction: column; }
.abl-row {
  flex: 1 1 0;
  padding: 0.62rem 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.abl-row.muted .abl-name { color: var(--muted); }
.abl-row.ours { background: #e6f4f1; border-radius: 10px; border-bottom: 0; }
.abl-row.ours .abl-name { color: var(--accent); font-weight: 700; }
.abl-name { font-weight: 600; }
.abl-cell { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.abl-cell i {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: #b4bfc6;
  min-width: 3px;
  max-width: calc(100% - 3.3rem);
  flex: none;
}
.abl-row.ours .abl-cell i { background: var(--accent); }
.abl-cell b { font-family: var(--mono); font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.abl-row.ours .abl-cell b { color: var(--accent); font-weight: 800; }
.abl-note { margin: 0.6rem 0 0 !important; font-size: 0.8rem; color: var(--muted); text-align: right; }

.split.split-cost { align-items: stretch; gap: 1rem 2.2rem; }
.cost-left { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.split-cost .split-copy { justify-content: space-between; gap: 0.8rem; }
.split-cost .split-copy p { margin: 0; font-size: 1.08rem; line-height: 1.8; }
.caption.cost-cap { margin: 0.7rem 0 0; text-align: left !important; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.stats div { min-width: 0; padding: 0.6rem 0.7rem; border-radius: 12px; background: #f0fdfa; border: 1px solid #ccfbf1; }
.stats b { display: block; font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; color: var(--accent); line-height: 1.2; white-space: nowrap; }
.stats span { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.35; }

.roll-svg svg { display: block; width: 100%; height: auto; }
.roll-svg .roll-marker { opacity: 0; transition: opacity .18s ease; }
.roll-svg .roll-marker.on { opacity: 1; }
.roll-cursor { stroke: #94a3b8; stroke-width: 0.8; stroke-dasharray: 3 3; }


.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.1rem 1.5rem;
  align-items: center;
}
.split-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.split-fig .figure {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}
.split-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.split-copy p { margin-bottom: 0.65rem; }
.split-copy p:last-child { margin-bottom: 0; }

.table-wrap {
  overflow-x: auto;
  margin: 0.4rem 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.paper-tbl {
  border-collapse: collapse;
  width: 100%;
  min-width: 980px;
  font-size: 11px;
  font-family: var(--mono);
}
.paper-tbl th, .paper-tbl td {
  padding: 5px 6px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.paper-tbl th:first-child, .paper-tbl td:first-child {
  text-align: left;
  font-family: "Source Sans 3", sans-serif;
  position: sticky;
  left: 0;
  background: #fff;
}
.paper-tbl thead th {
  background: #f8fafc;
  font-weight: 650;
  text-align: center;
}
.paper-tbl td.best { background: #DEF3E6; font-weight: 700; }
.paper-tbl td.second { background: #ECF8F1; text-decoration: underline; font-weight: 400; }
.paper-tbl tr.persist td { color: #9ca3af; }
.paper-tbl tbody tr:last-child td { border-bottom: 0; }

.fig-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.4rem 0 0.2rem;
}
.fig-row figure { margin: 0; }

.figure {
  display: block;
  width: 100%;
  height: auto;
}

.caption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}


.bibtex {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: #0b1220;
  color: #e5e7eb;
  font-size: 0.86rem;
  line-height: 1.5;
}


.fgroup { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.flabel {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.chip:hover { border-color: #cbd5e1; color: var(--text); }
.chip.sel {
  background: var(--accent-soft);
  border-color: #5eead4;
  color: #115e59;
}


.clip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gallery-card:nth-child(21) { grid-column: 2; grid-row: 6; }
.gallery-card:nth-child(22) { grid-column: 3; grid-row: 6; }
.gallery-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: #f8fafc;
}
.card-hd { display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px; min-width: 0; }
.card-hd .idx { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.card-hd h3 { margin: 0; font-size: 15.5px; font-weight: 640; white-space: nowrap; font-family: inherit; }
.card-hd .rid {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clips { display: grid; grid-template-columns: 1fr; gap: 11px; }
.clip { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.clip video {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  cursor: pointer;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.clip figcaption { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}
.tag.yaw-pos { color: var(--yaw-pos); border-color: #fcd34d; background: #fffbeb; }
.tag.yaw-zero { color: var(--yaw-zero); border-color: #99f6e4; background: var(--accent-soft); }
.tag.yaw-neg { color: var(--yaw-neg); border-color: #bfdbfe; background: #eff6ff; }


/* ---------- qualitative comparison ---------- */
.cmp-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin: 1.1rem 0 14px;
}
.cmp-frame { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.cmp-board {
  --shot-ar: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  cursor: pointer;
}
.cmp-pane {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.cmp-pane.ref { grid-column: span 2; grid-row: span 2; border-color: #fcd34d; }
.cmp-pane.ref .cmp-shot { flex: 1 1 auto; aspect-ratio: auto; }
.cmp-pane.ours { border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45, 212, 191, .25); }
.cmp-shot {
  aspect-ratio: var(--shot-ar);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c232d;
}
.cmp-shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cmp-pane figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 650;
}
.cmp-pane.ours figcaption { color: #0f766e; background: #f0fdfa; }
.cmp-pane .badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.cmp-pane.ref .badge { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.cmp-scales { display: contents; }
.cmp-scale {
  min-width: 0;
  padding: 0;
  background: transparent;
}
.cmp-scale.field { grid-column: 1 / span 2; grid-row: 3; }
.cmp-scale.error { grid-column: 3 / span 3; grid-row: 3; }
.cmp-scale img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: fill;
}
.cmp-scale .t { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 2px 0 6px; }
.cmp-scale .t b { display: block; margin-bottom: 2px; font-size: 13px; color: var(--text); }

.footer {
  padding: 2rem 0 2.6rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .cmp-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-pane.ref { grid-column: 1 / -1; grid-row: 1; }
  .cmp-pane.ref .cmp-shot { aspect-ratio: var(--shot-ar); }
  .cmp-scale.field { grid-column: 1 / -1; grid-row: 2; }
  .cmp-pane:nth-child(2) { grid-column: 1; grid-row: 3; }
  .cmp-pane:nth-child(3) { grid-column: 2; grid-row: 3; }
  .cmp-pane:nth-child(4) { grid-column: 1; grid-row: 4; }
  .cmp-pane:nth-child(5) { grid-column: 2; grid-row: 4; }
  .cmp-pane:nth-child(6) { grid-column: 1; grid-row: 5; }
  .cmp-pane:nth-child(7) { grid-column: 2; grid-row: 5; }
  .cmp-scale.error { grid-column: 1 / -1; grid-row: 6; }
}
@media (max-width: 960px) {
  .split.split-cost { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .clip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-card:nth-child(21),
  .gallery-card:nth-child(22) { grid-column: auto; grid-row: auto; }
  .clips { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .clip-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-inner { gap: 0.6rem; }
  #abstract p { text-align: left; }
  .nav-brand { font-size: 1rem; }
  .nav-links a { padding: 0.35rem 0.45rem; font-size: 0.86rem; }
  .band { padding: 3rem 0; }
  .hero .affiliations, .hero .note { font-size: clamp(0.92rem, 3.4vw, 1.05rem); }
  .fig-row, .split, .split.split-cost, .points { grid-template-columns: 1fr; }
  .abl-head, .abl-row { grid-template-columns: 8.5rem 1fr 1fr; gap: 0 0.8rem; }
  .cmp-frame { margin-left: 0; }
}
