/* ==========================================================================
   Art2Sim Project Page — CRISP-inspired Architecture + Modern Lab Craft
   Palette: Deep Cinema Hero (#070B14) + Crisp Light Body (#FFFFFF / #F8FAFC)
   Accent: Art2Sim Teal (#0D9488 on light, #2DD4BF on dark)
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-dark: #070b14;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-bright: #2dd4bf;
  --accent-soft: #f0fdfa;
  --accent-border: rgba(13, 148, 136, 0.32);
  --amber: #d97706;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: var(--font-sans);
  --container-max: 1180px;
  --container-narrow: 920px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Sticky Top Bar (appears cleanly once scrolled past Hero)
   ========================================================================== */
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.sticky-nav.visible {
  transform: translateY(0);
  opacity: 1;
}
.sticky-nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sticky-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sticky-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.sticky-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sticky-links a {
  color: var(--ink-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}
.sticky-links a:hover,
.sticky-links a.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* ==========================================================================
   1. Full-Height Video Hero (CRISP signature layout, refined modern finish)
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 680px;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  color: #f8fafc;
  overflow: hidden;
}

.hero-stage-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-dark);
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: saturate(1.06);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 52% at 50% 48%, rgba(7, 11, 20, 0.48) 0%, rgba(7, 11, 20, 0.16) 72%, rgba(7, 11, 20, 0.34) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.18) 0%, rgba(7, 11, 20, 0.08) 45%, rgba(7, 11, 20, 0.42) 100%);
  pointer-events: none;
}

.hero-top-spacer {
  height: 44px;
  position: relative;
  z-index: 2;
}

.hero-center {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(14, 22, 38, 0.72);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: clamp(3.8rem, min(10vw, 13.5vh), 7.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.94;
  color: #ffffff;
  text-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
  margin-bottom: clamp(28px, 4.2vh, 48px);
}
.hero-title span {
  color: var(--accent-bright);
}

.hero-subtitle {
  font-size: clamp(1.2rem, min(2.4vw, 4.2vh), 2.3rem);
  font-weight: 600;
  line-height: 1.24;
  color: rgba(248, 250, 252, 0.97);
  max-width: 1400px;
  margin: 0 auto;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.65);
}
@media (max-width: 768px) {
  .desktop-br {
    display: none;
  }
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.hero-btn:hover {
  transform: translateY(-1px);
}
.hero-btn-primary {
  background: var(--accent-bright);
  color: #042f2e;
  font-weight: 600;
}
.hero-btn-primary:hover {
  background: #5eead4;
  color: #042f2e;
}
.hero-btn-glass {
  background: rgba(15, 23, 42, 0.58);
  color: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.28);
  backdrop-filter: blur(12px);
}
.hero-btn-glass:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(45, 212, 191, 0.6);
  color: #ffffff;
}

.hero-bottom-stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: var(--bg-dark);
  padding-top: 10px;
}

.hero-stage-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(14, 22, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.stage-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 999px;
  color: rgba(203, 213, 225, 0.78);
  transition: background 0.25s ease, color 0.25s ease;
}
.stage-pill.active {
  background: var(--accent-bright);
  color: #042f2e;
  font-weight: 600;
}

/* Bottom Hero Navigation Bar (CRISP signature) */
.hero-foot {
  position: relative;
  z-index: 2;
  width: 100%;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-foot-nav {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.hero-foot-nav a {
  padding: 18px 14px;
  text-align: center;
  color: rgba(248, 250, 252, 0.92);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.18s ease, color 0.18s ease;
}
.hero-foot-nav a:last-child {
  border-right: none;
}
.hero-foot-nav a:hover {
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent-bright);
}

/* ==========================================================================
   2. Meta Header (Authors, Affiliations, Resource Links, Overview & KPIs)
   ========================================================================== */
.meta-section {
  padding: 88px 0 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.authors-block {
  text-align: center;
  margin-bottom: 34px;
}

.author-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 18px;
}
.author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 36px;
}
.author-row span {
  white-space: nowrap;
}
.author-row a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.author-row a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
}
.author-list sup {
  font-size: 0.65em;
  color: var(--accent);
  margin-left: 2px;
}

.affiliations {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}
.affiliation-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 30px;
}
.affiliations sup {
  color: var(--accent);
  margin-right: 2px;
}
.author-notes {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Resource Links Row */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 36px;
}

.res-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.res-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.res-btn:hover {
  background: #1e293b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.res-btn-outline {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.res-btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.res-btn-disabled {
  background: var(--bg-subtle);
  color: var(--ink-muted);
  border: 1px dashed var(--border-strong);
  cursor: default;
  pointer-events: none;
}
.res-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

/* Overview + KPI Strip */
.overview-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.overview-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.overview-card p {
  font-size: 1.03rem;
  color: var(--ink-secondary);
  line-height: 1.7;
}
.overview-card strong {
  color: var(--ink);
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}
.kpi-card.kpi-highlight {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}
.kpi-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 4px;
}
.kpi-highlight .kpi-value {
  color: var(--accent-hover);
}
.kpi-delta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent-hover);
  background: rgba(13, 148, 136, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.kpi-label {
  font-size: 0.84rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Shared Section Layout
   ========================================================================== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}
.section-subtle {
  background: var(--bg-subtle);
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 36px;
}
.section-title {
  font-size: clamp(1.75rem, 3.1vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 14px;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* Tabs & Selector Controls */
.control-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.control-bar-inline {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.tab-btn {
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.tab-btn:hover {
  color: var(--ink);
}
.tab-btn.active {
  background: #ffffff;
  color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  font-weight: 600;
}

.comparison-controls {
  gap: 8px 16px;
  margin-bottom: 20px;
}
.comparison-controls .tab-group {
  flex-wrap: nowrap;
  gap: 2px;
  padding: 3px;
}
.comparison-controls .tab-btn {
  padding: 6px 12px;
  white-space: nowrap;
}
.case-select {
  width: 10rem;
  max-width: 100%;
  min-height: 38px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background-color: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.case-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.case-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  transition: all 0.16s ease;
}
.case-chip:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.case-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 600;
}

/* Playback Toolbar */
.playback-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.16s ease;
}
.tool-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.tool-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.closeup-toggle {
  min-height: 38px;
  border-color: var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}
.closeup-toggle svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.closeup-toggle:hover,
.closeup-toggle[aria-pressed="true"] {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: #ffffff;
}
.closeup-toggle[hidden] {
  display: none;
}
.tool-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* ==========================================================================
   3. Interactive 3D Demos (3-Panel Synced Stage + Flanking <> Arrows + Viser)
   ========================================================================== */
.carousel-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.carousel-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
  padding-bottom: 3px;
}
.carousel-arrow:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  transform: scale(1.06);
}

.interactive-stage-3 {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stage-pane {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}
.stage-pane-ours {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.13);
}

.stage-pane-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}
.stage-pane-ours .stage-pane-head {
  background: var(--accent-soft);
  border-bottom-color: rgba(13, 148, 136, 0.18);
}

.pane-badge {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.pane-dataset-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-muted);
}

.viser-hint strong {
  color: var(--accent-hover);
  font-weight: 700;
}

.viser-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-hover);
  background: var(--accent-hover);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.viser-mode-btn[aria-pressed="false"]::before {
  content: "↻" / "";
  font-size: 1rem;
  line-height: 1;
}
.viser-mode-btn:hover,
.viser-mode-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.viser-mode-btn:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.stage-media-box {
  position: relative;
  background: #ffffff;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage-media-dark {
  background: #ffffff;
}
.stage-media-box video {
  width: 100%;
  height: auto;
  display: block;
}
#interactive-demos[data-dataset="D3D-HOI"] .stage-media-box video {
  width: 80%;
}
.stage-media-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  visibility: hidden;
}
.stage-media-box.viser-open iframe {
  visibility: visible;
}
.stage-media-box.viser-open video {
  visibility: hidden;
}
.viser-toast {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stage-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 62px;
  gap: 14px;
  flex-wrap: wrap;
}
.stage-footer-centered {
  justify-content: center;
  padding: 0;
}
.stage-caption {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  flex: 1;
  min-width: 260px;
}
.stage-caption strong {
  color: var(--ink);
}
.stage-sync-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   4 & 5. Synchronized Comparison Grids (Physics 4-col & Recon 5-col)
   ========================================================================== */
.compare-grid-4 {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.compare-grid-5 {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.video-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-card.card-ours {
  border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.14);
}

.video-card-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}
.compare-grid-4 .video-card-head,
.compare-grid-5 .video-card-head {
  justify-content: center;
  text-align: center;
}
.card-ours .video-card-head {
  background: var(--accent-soft);
  border-bottom-color: rgba(13, 148, 136, 0.16);
}

.method-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-secondary);
}
.card-ours .method-name {
  color: var(--accent-hover);
  font-weight: 700;
}

.method-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-muted);
}
.card-ours .method-tag {
  background: var(--accent);
  color: #ffffff;
}

.video-card-media {
  background: #ffffff;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.compare-grid-5 .video-card-media {
  aspect-ratio: 4 / 3;
}
.video-card-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#recon-comparisons[data-dataset="d3dhoi"] .video-card-media {
  aspect-ratio: auto;
}
#recon-comparisons[data-dataset="d3dhoi"] .video-card-media video {
  width: 80%;
  height: auto;
  aspect-ratio: auto 9 / 16;
}

/* Quantitative bars below the comparison grids */
.metrics-strip {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.recon-metrics {
  margin-top: 28px;
}
.metrics-caption {
  margin-bottom: 8px;
  color: var(--ink-secondary);
  font-size: 0.82rem;
}
.recon-metrics .metrics-strip {
  margin-top: 0;
}
.recon-metrics .metric-box {
  display: flex;
  flex-direction: column;
}
.recon-metrics .metric-box-title {
  flex: 1;
}
.recon-metrics .bar-row {
  grid-template-columns: 110px minmax(0, 1fr) 40px;
}
.recon-metrics .bar-label {
  white-space: nowrap;
}
@media (max-width: 400px) {
  .recon-metrics .metric-box {
    padding-inline: 12px;
  }
  .recon-metrics .metric-box-title {
    column-gap: 6px;
    font-size: 0.81rem;
  }
  .recon-metrics .metric-box-sub {
    font-size: 0.67rem;
  }
}
.metric-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.metric-box-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: baseline;
}
.metric-box-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}
.metric-box-count {
  font-weight: 400;
}
.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 56px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.86rem;
}
.bar-row:last-child {
  margin-bottom: 0;
}
.bar-label {
  color: var(--ink-muted);
  font-weight: 500;
}
.bar-row.bar-ours .bar-label {
  color: var(--accent-hover);
  font-weight: 700;
}
.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #94a3b8;
}
.bar-row.bar-ours .bar-fill {
  background: linear-gradient(90deg, #0d9488 0%, #2dd4bf 100%);
}
.bar-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: right;
  color: var(--ink-secondary);
}
.bar-row.bar-ours .bar-val {
  color: var(--accent-hover);
  font-weight: 600;
}

/* ==========================================================================
   6. Method
   ========================================================================== */
#method .section-header {
  max-width: none;
  margin-bottom: 40px;
}
#method .section-title {
  margin-bottom: 26px;
}
.method-stages {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding-inline-start: 1.6em;
  text-align: left;
  text-wrap: balance;
  font-size: 1.05rem;
  color: var(--ink-secondary);
}
.method-stages li + li {
  margin-top: 8px;
}
.method-stages li::marker {
  content: "(" counter(list-item) ") ";
}
.method-stages strong {
  color: var(--ink);
}
.method-stages strong::after {
  content: ":";
}
@media (max-width: 1023px) {
  .method-stage-break {
    display: none;
  }
}
.method-video {
  display: block;
  width: 100%;
  max-width: 1040px;
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  background: #070b14;
}

.ablation-takeaways,
.ablation-grid {
  max-width: 960px;
  margin-inline: auto;
}
.ablation-takeaways {
  margin-bottom: 28px;
  padding-inline-start: 1.5em;
  font-size: 0.94rem;
  color: var(--ink-secondary);
}
.ablation-takeaways li + li {
  margin-top: 8px;
}
.ablation-takeaways strong {
  color: var(--ink);
}
.ablation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.ablation-metric,
.ablation-ticks {
  color: var(--ink-muted);
  font-size: 0.74rem;
}
.ablation-chart {
  --plot-height: 208px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  margin-top: 10px;
}
.ablation-ticks {
  display: flex;
  height: calc(var(--plot-height) + 1em);
  margin-top: -0.5em;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  line-height: 1;
}
.ablation-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  text-align: center;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  line-height: 1.3;
}
.ablation-bars::before {
  position: absolute;
  inset: 0 0 auto;
  height: var(--plot-height);
  border-block: 1px solid var(--border);
  background: linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat;
  content: "";
}
.ablation-bar {
  --bar-height: calc(var(--sr) / var(--sr-max) * 100%);
  position: relative;
  height: var(--plot-height);
  margin-bottom: 8px;
}
.ablation-bar::before {
  position: absolute;
  inset: auto 0 0;
  width: min(72%, 56px);
  height: var(--bar-height);
  margin-inline: auto;
  border-radius: 4px 4px 0 0;
  background: #94a3b8;
  content: "";
}
.ablation-bar span {
  position: absolute;
  inset: auto 0 calc(var(--bar-height) + 5px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ablation-bars li:last-child .ablation-bar::before {
  background: var(--accent);
}
.ablation-bars li:last-child .ablation-bar span {
  color: var(--accent-hover);
}
@media (max-width: 860px) {
  .ablation-takeaways,
  .ablation-grid {
    max-width: 500px;
  }
  .ablation-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
@media (max-width: 480px) {
  .ablation-card {
    padding-inline: 12px;
  }
  .ablation-bars {
    gap: 4px;
    font-size: 0.7rem;
  }
  .ablation-bars li > span {
    overflow-wrap: anywhere;
  }
}

/* ==========================================================================
   7. Downstream Applications (Student Distillation & Unitree G1)
   ========================================================================== */
.downstream-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-xs);
}
.downstream-block + .downstream-block {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.downstream-head {
  text-align: center;
  margin-bottom: 20px;
}
.downstream-head .tab-group {
  margin-top: 14px;
}
.downstream-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.downstream-sub {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  text-wrap: balance;
}

.downstream-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 88%;
  max-width: 596px;
  margin-inline: auto;
}
.downstream-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 902px;
}
#g1-grid {
  column-gap: 24px;
  max-width: 604px;
}

/* ==========================================================================
   8. BibTeX & Footer
   ========================================================================== */
.bibtex-card {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #1e293b;
}
.bibtex-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.bibtex-title {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #94a3b8;
}
.bibtex-actions {
  display: flex;
  gap: 8px;
}
.bibtex-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.16s ease;
}
.bibtex-btn:hover {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}
.bibtex-pre {
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: #e2e8f0;
}

.site-footer {
  padding: 36px 0 48px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--ink-muted);
  background: var(--bg-subtle);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .interactive-stage-3 {
    grid-template-columns: 1fr;
  }
  .stage-footer-bar {
    padding: 0;
  }
  .compare-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .compare-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .metrics-strip {
    grid-template-columns: 1fr;
  }
  .sticky-nav-inner {
    padding-inline: 12px;
    gap: 8px;
  }
  .sticky-links {
    gap: 2px;
  }
  .sticky-links a {
    padding-inline: 4px;
    font-size: 0.8rem;
  }
}

@media (max-width: 680px) {
  #interactive-demos .carousel-shell {
    gap: 8px;
  }
  #interactive-demos .carousel-arrow {
    width: 36px;
  }
  .stage-pane-head {
    flex-wrap: wrap;
    padding-inline: 10px;
  }
  .comparison-controls .tab-btn {
    padding-inline: 8px;
    font-size: 0.8rem;
  }
  .hero-foot-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-foot-nav a:last-child {
    grid-column: span 2;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .kpi-grid,
  .compare-grid-4,
  .compare-grid-5 {
    grid-template-columns: 1fr;
  }
  .downstream-grid,
  #g1-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 320px;
  }
  .overview-card,
  .downstream-panel {
    padding: 20px;
  }
  .downstream-block + .downstream-block {
    margin-top: 24px;
    padding-top: 24px;
  }
  .sticky-links {
    display: none;
  }
}
