:root {
  --bg: #ffffff;
  --bg-band: #f7f8fa;
  --text: #18181b;
  --text-body: #2d333b;
  --muted: #636c76;
  --line: #e5e8ec;
  --line-strong: #cfd5dc;
  --rule-heavy: #1f2328;
  --accent: #1d4f82;
  --accent-hover: #12365c;
  --accent-link: #1a62b5;
  --accent-soft: #eef4fb;
  --pill-dark: #24292f;
  --pill-dark-hover: #0f172a;
  --ok: #167943;
  --ok-bg: #eaf6ef;
  --err: #be2e26;
  --err-bg: #fdf0ef;
  --display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --w-prose: 780px;
  --w-table: 1080px;
  --w-wide: 1160px;

  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 68px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Containers: Dual-Measure Rhythm */
.wrap-prose {
  width: min(var(--w-prose), 100% - 40px);
  margin: 0 auto;
}

.wrap-table {
  width: min(var(--w-table), 100% - 40px);
  margin: 0 auto;
}

.wrap-wide {
  width: min(var(--w-wide), 100% - 40px);
  margin: 0 auto;
}

/* Minimal Translucent Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.topbar-inner {
  width: min(var(--w-wide), 100% - 40px);
  margin: 0 auto;
  min-height: 52px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 0.88rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.back-link {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-slash {
  color: #d0d7de;
  user-select: none;
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-nav::-webkit-scrollbar {
  display: none;
}

.topbar-nav a {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}

.topbar-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero Section (VGGT / Utonia Open White Canvas) */
.hero {
  padding: 54px 0 44px;
  text-align: center;
}

.hero-header {
  width: min(940px, 100% - 40px);
  margin: 0 auto;
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.028em;
  color: var(--text);
}

.hero-title .acronym {
  color: var(--accent);
}

.hero-venue {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.hero-authors {
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  font-size: 1.12rem;
  line-height: 1.6;
}

.author-block {
  white-space: nowrap;
  color: var(--text);
}

.author-block a {
  color: var(--accent-link);
  font-weight: 500;
}

.author-block sup,
.hero-affiliations sup {
  font-size: 0.7em;
  margin-left: 1px;
  color: var(--muted);
}

.hero-affiliations {
  margin: 8px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-notes {
  margin: 6px auto 0;
  font-size: 0.84rem;
  color: #76808c;
}

/* Classic CVPR Dark Pill Action Buttons */
.publication-links {
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--pill-dark);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--pill-dark);
  transition: background-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
  cursor: pointer;
}

.pill-btn:hover {
  background: var(--pill-dark-hover);
  border-color: var(--pill-dark-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.pill-btn.is-outline {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line-strong);
}

.pill-btn.is-outline:hover {
  background: var(--bg-band);
  border-color: #9aa4b0;
  color: var(--text);
  box-shadow: none;
}

.pill-btn.is-soon {
  background: var(--bg-band);
  color: var(--muted);
  border-color: var(--line-strong);
  cursor: default;
}

.pill-btn.is-soon:hover {
  background: var(--bg-band);
  border-color: var(--line-strong);
  color: var(--muted);
  transform: none;
  box-shadow: none;
}

.soon-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e5e9ef;
  color: #57606a;
}

.pill-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Open Borderless Teaser + TL;DR */
.teaser-block {
  margin: 38px auto 0;
  text-align: left;
}

.zoomable-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
}

.tldr-callout {
  width: min(920px, 100%);
  margin: 20px auto 0;
  padding: 14px 20px;
  background: var(--bg-band);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 0.97rem;
  line-height: 1.62;
  color: var(--text-body);
}

.tldr-callout strong {
  color: var(--text);
}

/* Alternating Full-Bleed Sections */
.band {
  padding: 56px 0;
}

.band-tinted {
  background: var(--bg-band);
  border-top: 1px solid rgba(0, 0, 0, 0.045);
  border-bottom: 1px solid rgba(0, 0, 0, 0.045);
}

.sec-head {
  text-align: center;
  margin-bottom: 26px;
}

.sec-head.is-left {
  text-align: left;
  margin-bottom: 18px;
}

.sec-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.022em;
  line-height: 1.25;
  color: var(--text);
}

.sec-desc {
  margin: 8px auto 0;
  max-width: 700px;
  font-size: 0.96rem;
  line-height: 1.58;
  color: var(--muted);
}

/* Narrow Prose Styling */
.prose p {
  margin: 0 0 1.05rem;
  font-size: 1.02rem;
  line-height: 1.76;
  color: var(--text-body);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* Segmented Pill Controls (Apple / Utonia Gallery Selector) */
.gallery-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 22px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef1f5;
}

.band-tinted .segmented {
  background: #e6ebf1;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 550;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-active {
  background: #ffffff;
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.ghost-link-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 550;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ghost-link-btn:hover {
  border-color: #9aa4b0;
  color: var(--text);
}

/* De-boxed 6-Column Qualitative Strip (CAT3D / Paper Native Proportions) */
.qual-strip {
  display: grid;
  grid-template-columns: 1.48fr 1.56fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.qual-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qual-col-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.qual-col.is-ours .qual-col-label {
  color: var(--ok);
  font-weight: 750;
}

.qual-thumb {
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);
}

.qual-col .qual-thumb {
  aspect-ratio: 1 / 1;
}

.qual-col.is-wide-input .qual-thumb {
  aspect-ratio: 295 / 194;
}

.qual-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qual-col.is-lidar-input .qual-thumb img {
  object-fit: contain;
}

.qual-meta {
  margin-top: 7px;
  text-align: center;
  font-size: 0.79rem;
  color: var(--muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.err-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 650;
}

.err-chip.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.err-chip.is-err {
  background: var(--err-bg);
  color: var(--err);
}

.err-chip.is-gt {
  background: var(--accent-soft);
  color: var(--accent);
}

.scene-caption {
  margin: 16px auto 0;
  max-width: 860px;
  text-align: center;
  font-size: 0.91rem;
  color: var(--muted);
  line-height: 1.58;
}

/* De-boxed Cross-View Attention Curtain Gallery */
.attn-subbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin: -8px 0 20px;
  font-size: 0.83rem;
  color: var(--muted);
}

.inline-modes {
  display: inline-flex;
  gap: 6px;
}

.mini-pill {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 11px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.14s;
}

.mini-pill:hover {
  color: var(--text);
  border-color: #9aa4b0;
}

.mini-pill.is-active {
  background: var(--pill-dark);
  border-color: var(--pill-dark);
  color: #ffffff;
}

.range-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.range-inline input[type="range"] {
  width: 110px;
  accent-color: var(--accent);
  cursor: pointer;
}

.attn-strip {
  display: grid;
  grid-template-columns: 1.32fr 1.32fr 0.76fr;
  gap: 16px;
  align-items: start;
}

.attn-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.attn-item-head strong {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
}

.attn-item-head span {
  font-size: 0.78rem;
  color: var(--muted);
}

.curtain-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 350;
  border-radius: 7px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
  user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
}

.attn-item.is-square .curtain-viewport {
  aspect-ratio: 1 / 1;
}

.curtain-viewport img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.curtain-heat {
  clip-path: inset(0 0 0 var(--split, 50%));
}

.curtain-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.curtain-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.curtain-tag {
  position: absolute;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.62);
  color: #ffffff;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.curtain-tag.is-left {
  left: 8px;
}

.curtain-tag.is-right {
  right: 8px;
}

/* Method Figure & KaTeX Math Blocks */
.method-figure {
  margin: 0 auto 32px;
}

.fig-caption {
  margin: 12px auto 0;
  max-width: 960px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.fig-caption strong {
  color: var(--text);
}

.math-block {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--bg-band);
  border-radius: 7px;
  overflow-x: auto;
  text-align: center;
}

/* Authentic LaTeX Booktabs Academic Tables */
.table-section {
  margin-top: 34px;
}

.table-section:first-of-type {
  margin-top: 0;
}

.table-header-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.table-caption {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.52;
  color: var(--text-body);
}

.table-caption strong {
  color: var(--text);
}

.booktabs-scroll {
  overflow-x: auto;
}

.booktabs {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--rule-heavy);
  border-bottom: 2px solid var(--rule-heavy);
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
  background: #ffffff;
}

.booktabs th,
.booktabs td {
  padding: 6.5px 11px;
  text-align: left;
  white-space: nowrap;
}

.booktabs thead th {
  font-weight: 650;
  color: var(--text);
  vertical-align: bottom;
}

.booktabs thead tr.tr-subhead th {
  border-bottom: 1.2px solid var(--rule-heavy);
  padding-top: 3px;
}

.booktabs th.cmidrule {
  text-align: center;
  position: relative;
  padding-bottom: 4px;
}

.booktabs th.cmidrule::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: #8c959f;
}

.booktabs th.num,
.booktabs td.num {
  text-align: right;
}

.booktabs th.center,
.booktabs td.center {
  text-align: center;
}

.booktabs tr.midrule-top td {
  border-top: 1px solid #cfd5dc;
}

.booktabs tbody tr:hover {
  background: #f8fafc;
}

.booktabs tr.row-ours {
  background: #eef5fc;
}

.booktabs tr.row-ours:hover {
  background: #e5effa;
}

.booktabs tr.row-ours td {
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid #aebfd2;
}

.booktabs tr.row-subnote td {
  font-style: italic;
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 9px;
  padding-bottom: 4px;
}

.u-second {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dual-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 36px;
  align-items: start;
}

.table-footnote {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* BibTeX */
.bibtex-wrap {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text-body);
  border-radius: 6px;
  padding: 5px 11px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.14s;
}

.copy-btn:hover {
  border-color: #8c959f;
  background: var(--bg-band);
}

.copy-btn.is-copied {
  border-color: #86efac;
  background: var(--ok-bg);
  color: var(--ok);
}

.bibtex-wrap pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text-body);
  overflow-x: auto;
  padding-right: 92px;
}

/* Footer */
.footer {
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.footer p {
  margin: 4px 0;
}

.hidden {
  display: none !important;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 14, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  cursor: zoom-out;
}

.lightbox img {
  max-width: min(1440px, 95vw);
  max-height: 90vh;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--sans);
  font-size: 0.82rem;
  cursor: pointer;
}

/* Responsive Breakpoints */
@media (max-width: 1020px) {
  .qual-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .qual-col.is-wide-input .qual-thumb {
    aspect-ratio: 1 / 1;
  }
  .qual-col.is-wide-input .qual-thumb img {
    object-fit: contain;
  }
  .attn-strip {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
  }
  .attn-item.is-square .curtain-viewport {
    max-width: 380px;
    margin: 0 auto;
  }
  .dual-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 8px 0;
    gap: 4px 12px;
  }
  .topbar-nav {
    width: 100%;
    gap: 14px;
    border-top: 1px solid #f0f2f5;
    padding-top: 5px;
    font-size: 0.83rem;
  }
  .hero {
    padding: 36px 0 28px;
  }
  .band {
    padding: 40px 0;
  }
  .qual-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
