:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-dark: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-green: #15803d;
  --accent-red: #b91c1c;
  --border-color: #e2e8f0;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 980px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.86em;
  background: var(--bg-tertiary);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  color: #1e293b;
}

/* Top Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.nav-brand:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

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

/* Hero Section (BundleSDF / Nerfies Style) */
.hero {
  padding: 3rem 1.5rem 2.2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-container {
  max-width: 940px;
  margin: 0 auto;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.hero-title {
  font-size: clamp(1.8rem, 3.3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.hero-description {
  max-width: 65ch;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}

.authors-block {
  margin-bottom: 1.1rem;
}

.authors-list {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-blue);
}

.authors-affiliation {
  font-size: 0.94rem;
  color: var(--text-muted);
}

.cta-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
  margin-bottom: 1.8rem;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-pill:hover {
  text-decoration: none;
}

.btn-dark {
  background: #1e293b;
  color: #ffffff;
}

.btn-dark:hover {
  background: #0f172a;
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-outline:hover {
  border-color: #64748b;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Sections */
.section {
  padding: 2.6rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.section.alt-bg {
  background-color: var(--bg-secondary);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 1.35rem;
  text-align: center;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.section-subtitle {
  font-size: 0.96rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto;
}

/* Value Highlights (3 Clean Cards) */
.value-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.35rem;
}

.value-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  text-align: left;
}

.value-metric {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.25rem;
}

.value-card h3 {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.value-card p {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.52;
}

/* Interactive Comparison Viewer (BundleSDF Style) */
.comp-selector-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.comp-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.comp-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.comp-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.comp-stage {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.comp-stage video {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: block;
}

.comp-verdict-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.verdict-box {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.verdict-ours {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.verdict-baseline {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

/* Media & Video Grids */
.teaser-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}

.teaser-video,
.video-card video,
.teaser-grid-3 img,
.figure-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: block;
}

.teaser-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.teaser-grid-3 img,
.figure-card img {
  cursor: zoom-in;
}

.video-grid-2,
.figures-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.video-card,
.figure-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.video-card h4,
.figure-card h4 {
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.caption {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-align: left;
  margin-top: 0.55rem;
}

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

.abstract-box {
  max-width: 880px;
  margin: 0 auto;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.72;
  text-align: left;
}

.abstract-box p + p {
  margin-top: 0.85rem;
}

.code-snippet {
  max-width: 880px;
  margin: 1.1rem auto 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary);
  overflow-x: auto;
  text-align: left;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin-top: 0.75rem;
}

table.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
  border-top: 1.5px solid var(--text-primary);
  border-bottom: 1.5px solid var(--text-primary);
  background: #ffffff;
}

table.benchmark-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #94a3b8;
  white-space: nowrap;
}

table.benchmark-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

table.benchmark-table tr.highlight-row td,
table.benchmark-table tr.highlight-row-emerald td {
  background: #f0fdf4;
  font-weight: 600;
  color: var(--text-primary);
}

/* Collapsible details for supplementary tables */
details.supp-details {
  margin-top: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
}

details.supp-details summary {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* BibTeX */
.bibtex-wrapper {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.58;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.28rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.claim-callout {
  background: var(--bg-secondary);
  border-left: 3px solid #64748b;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-modal img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 6px;
  background: #ffffff;
  padding: 0.4rem;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.75rem;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
}

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 1.8rem 1.5rem;
  font-size: 0.85rem;
  text-align: center;
}

/* ==========================================================================
   Interactive Split-Screen 4-Camera + Rotatable 3D Scene Reconstruction Viewer
   ========================================================================== */
.scene3d-split-shell {
  margin-top: 1.25rem;
  background: #0b1017;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  text-align: left;
}

.scene3d-stage {
  display: grid;
  grid-template-columns: 28% 72%;
  height: 620px;
}

.scene3d-cameras-pane {
  background: #080c12;
  border-right: 1px solid #1e293b;
  padding: 4px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  min-height: 0;
}

.scene3d-cam-tile {
  position: relative;
  width: 100%;
  height: 100%;
  background: #05080c;
  border: 1px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
}

.scene3d-cam-tile canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-overlay-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(7, 11, 16, 0.74);
  border: 1px solid rgba(56, 189, 248, 0.34);
  backdrop-filter: blur(4px);
  font-size: 10.5px;
  line-height: 1.2;
  pointer-events: none;
}

.cam-overlay-pill strong {
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cam-overlay-pill span {
  font-family: 'JetBrains Mono', monospace;
  color: #34d399;
  font-size: 10px;
}

.cam-overlay-ctx {
  border-color: rgba(148, 163, 184, 0.28);
}

.scene3d-viewport-pane {
  position: relative;
  background: #0c1015;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
}

.scene3d-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.scene3d-canvas:active {
  cursor: grabbing;
}

.scene3d-assist-hud {
  position: absolute;
  bottom: 50px;
  left: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 13, 18, 0.76);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 8px;
  padding: 5px 10px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.scene3d-reticle-svg {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.scene3d-assist-body {
  font-size: 11px;
  line-height: 1.35;
  color: #cbd5e1;
}

.scene3d-assist-title {
  font-weight: 700;
  font-size: 11.5px;
  color: #34d399;
  margin-bottom: 1px;
}

.scene3d-assist-title[data-state="approaching"] {
  color: #fbbf24;
}

.scene3d-assist-title[data-state="transport"] {
  color: #38bdf8;
}

.scene3d-assist-title[data-state="standby"] {
  color: #cbd5e1;
}

.viewport-top-right {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.floating-dock {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(9, 13, 18, 0.76);
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-sep {
  width: 1px;
  height: 15px;
  background: #334155;
  margin: 0 2px;
}

.scene3d-chip {
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
}

.scene3d-chip:hover {
  background: #334155;
  color: #ffffff;
}

.scene3d-chip.is-active,
.scene3d-chip[aria-pressed="true"] {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

.scene3d-orient-svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  pointer-events: none;
  background: rgba(9, 13, 18, 0.76);
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}

.scene3d-orient-svg text {
  font-size: 10px;
  font-weight: 700;
}

.viewport-bottom-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(9, 13, 18, 0.78);
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  font-size: 11.5px;
}

.scene3d-play-btn {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.scene3d-play-btn:hover {
  background: #0369a1;
}

.scene3d-scrubber {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
  height: 4px;
}

.dock-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
}

.dock-muted {
  color: #94a3b8;
}

.dock-accent {
  color: #34d399;
}

@media (max-width: 960px) {
  .scene3d-stage {
    grid-template-columns: 1fr;
    height: auto;
  }
  .scene3d-cameras-pane {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border-right: none;
    border-bottom: 1px solid #1e293b;
  }
  .scene3d-viewport-pane {
    height: 520px;
  }
}

@media (max-width: 768px) {
  .value-grid-3,
  .comp-verdict-bar,
  .teaser-grid-3,
  .video-grid-2,
  .figures-grid-2,
  .scene3d-inventory-list {
    grid-template-columns: 1fr;
  }
}

/* Inline mathematical notation (zero-CDN, instant paint) */
.math {
  font-variant-numeric: lining-nums tabular-nums;
}

.math i {
  font-family: 'STIX Two Text', 'Cambria Math', 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-size: 1.04em;
}

.math b {
  font-family: 'STIX Two Text', 'Cambria Math', 'Times New Roman', Georgia, serif;
  font-weight: 700;
}

.math .math-cal {
  font-family: 'STIX Two Math', 'Cambria Math', 'Apple Chancery', 'URW Chancery L', Georgia, serif;
  font-style: italic;
}

.math sub,
.math sup {
  font-size: 0.74em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.math sup {
  top: -0.42em;
}

.math sub {
  bottom: -0.22em;
}

.object-example { margin: 2rem 0; padding: 1.2rem; border: 1px solid #cbdad3; border-radius: 12px; background: #f5f8f5; color: #18312b; scroll-margin-top: 5rem; }
.object-example h3 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.object-example > p { margin-top: .5rem; }
.object-panels { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 1rem; margin: 1.2rem 0; align-items: start; }
.object-panels > * { min-width: 0; }
.object-panels img { display: block; width: 100%; height: auto; border-radius: 5px; margin: .45rem 0; }
.object-panels figcaption, .object-source { font-size: .87rem; color: #41574e; }
.object-agent dl { margin: .4rem 0; }
.object-agent dt { font-size: .78rem; color: #496259; }
.object-agent dd { margin-bottom: .35rem; }
.object-agent a { font-size: .88rem; }
.object-example code { overflow-wrap: anywhere; }
.target-check { min-width: 0; border: 0; padding: 0; margin: 1.1rem 0; }
.target-check legend { font-weight: 700; }
.target-check > p { margin: .2rem 0 .6rem; }
.target-check label { display: inline-block; padding: .35rem .55rem .35rem .15rem; cursor: pointer; }
.target-check input { accent-color: #28644c; }
.target-check .body-result, .target-check .offset-result { display: none; margin-top: .45rem; padding: .7rem 1rem; background: white; border-left: 3px solid #44816b; }
.target-check .offset-result { border-color: #a5702c; }
#target-body:checked ~ .body-result, #target-offset:checked ~ .offset-result { display: block; }
@media print { .target-check .body-result, .target-check .offset-result { display: block; } }

@media (max-width: 760px) {
  .object-panels { grid-template-columns: 1fr 1fr; }
  .object-agent { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .object-example { padding: .85rem; }
  .object-panels { gap: .65rem; }
}
