/* ==========================================================================
   TrackWAM Project Page — Scheme A
   CVPR Modern Embodied Robotics Layout × Om AI Lab Visual Identity
   ========================================================================== */

:root {
  /* Om AI Lab Core Brand Tokens */
  --omai-navy: #042464;
  --omai-blue: #0066cc;
  --omai-blue-hover: #1d4ed8;
  --omai-sky: #4a90e2;
  --omai-teal: #0d9488;
  --cvpr-highlight: #eff6ff;
  --cvpr-highlight-border: #bfdbfe;

  /* Light Surfaces & Typography */
  --bg: #f8f9fa;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text-primary: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Hugging Face Pill (matching OmAI Lab) */
  --hf-bg: #fffaf0;
  --hf-border: #ecd284;
  --hf-text: #785f12;

  /* Shadows & Radii */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 24px rgba(4, 36, 100, 0.06);
  --shadow-lg: 0 16px 40px rgba(4, 36, 100, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Layout */
  --max-width: 1120px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --omai-navy: #e2e8f0;
  --omai-blue: #60a5fa;
  --omai-blue-hover: #93c5fd;
  --omai-sky: #38bdf8;
  --omai-teal: #2dd4bf;
  --cvpr-highlight: rgba(59, 130, 246, 0.16);
  --cvpr-highlight-border: rgba(96, 165, 250, 0.35);

  --bg: #0f172a;
  --bg-subtle: #1e293b;
  --surface: #162033;
  --surface-elevated: #1e293b;
  --text-primary: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #2b3a55;
  --border-strong: #3b4f70;

  --hf-bg: #3a321d;
  --hf-border: #7c641f;
  --hf-text: #ffe7a3;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.48);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-body);
  background-color: var(--bg);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  max-width: 100%;
}

.site-nav,
.hero,
.hero-inner,
.main-content,
.section,
.section-card,
.tab-group,
.tab-panel,
.figure-block,
.bibtex-wrap {
  min-width: 0;
  max-width: 100%;
}

.two-col > *,
.hardware-strip > *,
.kpi-strip > *,
.bench-stats > *,
.contrib-grid > *,
.module-grid > * {
  min-width: 0;
}

a {
  color: var(--omai-blue);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

a:hover {
  color: var(--omai-blue-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Sticky Top Navigation Bar
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-nav {
  background: rgba(15, 23, 42, 0.86);
}

.nav-inner {
  max-width: calc(var(--max-width) + 48px);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-omai-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  height: 30px;
  width: auto;
  border-radius: 6px;
}

[data-theme="dark"] .nav-logo {
  background: #ffffff;
  padding: 3px 6px;
  border-radius: 6px;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
}

.nav-project-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--omai-navy);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--text-body);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--omai-blue);
  background: var(--cvpr-highlight);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
  border-color: var(--omai-sky);
  color: var(--omai-blue);
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  padding: 52px 24px 36px;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(0, 102, 204, 0.11), transparent 70%),
    radial-gradient(ellipse 55% 40% at 85% 10%, rgba(13, 148, 136, 0.07), transparent 65%),
    var(--bg);
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(56, 189, 248, 0.14), transparent 70%),
    radial-gradient(ellipse 55% 40% at 85% 10%, rgba(45, 212, 191, 0.08), transparent 65%),
    var(--bg);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--cvpr-highlight-border);
  color: var(--omai-blue);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--omai-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.hero-title {
  margin: 0 auto 20px;
  max-width: 960px;
  font-size: clamp(2.05rem, 4.1vw, 3.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.brand-gradient {
  background: linear-gradient(135deg, #042464 0%, #0066cc 58%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .brand-gradient {
  background: linear-gradient(135deg, #93c5fd 0%, #38bdf8 55%, #2dd4bf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Authors & Affiliations */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  max-width: 680px;
  margin: 0 auto 12px;
  font-size: 1.04rem;
  font-weight: 500;
  color: var(--text-primary);
}

.author-item sup {
  color: var(--omai-blue);
  font-weight: 700;
  font-size: 0.72em;
  margin-left: 2px;
}

.author-item sup.corr-mark {
  margin-left: 2px;
  cursor: help;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  max-width: 880px;
  margin: 0 auto 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.affiliations sup,
.author-note sup {
  color: var(--omai-blue);
  font-weight: 700;
  margin-right: 2px;
}

.author-note {
  display: flex;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Resource Pill Buttons (OmAI Lab pill style + icons) */
.resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.pill-btn:hover {
  transform: translateY(-2px);
  border-color: var(--omai-sky);
  color: var(--omai-blue);
  box-shadow: var(--shadow-md);
}

.pill-btn.primary {
  background: var(--omai-navy);
  border-color: var(--omai-navy);
  color: #ffffff;
}

[data-theme="dark"] .pill-btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.pill-btn.primary:hover {
  background: var(--omai-blue);
  border-color: var(--omai-blue);
  color: #ffffff;
}

.pill-btn.hf-pill {
  background: var(--hf-bg);
  border-color: var(--hf-border);
  color: var(--hf-text);
}

.pill-btn.hf-pill:hover {
  border-color: #d99b26;
  color: var(--hf-text);
}

.pill-btn .pill-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(100, 116, 139, 0.14);
  color: var(--text-muted);
}

.pill-btn.primary .pill-tag {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}

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

/* 4-Column Key Metric Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
  text-align: left;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--omai-navy), var(--omai-blue));
}

.kpi-card.teal::before {
  background: linear-gradient(90deg, var(--omai-blue), var(--omai-teal));
}

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.04rem, 1.32vw, 1.18rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--omai-navy);
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.kpi-sub {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Teaser Card */
.teaser-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.media-toggle-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.mode-pill:hover {
  color: var(--text-primary);
}

.mode-pill.active {
  background: var(--surface);
  color: var(--omai-blue);
  box-shadow: var(--shadow-sm);
}

.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-body);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.sync-btn:hover {
  border-color: var(--omai-blue);
  color: var(--omai-blue);
}

.mode-view {
  display: none;
}

.mode-view.active {
  display: block;
  animation: fadeSlide 0.2s ease;
}

/* Hero 3x3 Real-World Video Showcase */
.hero-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 9px;
}

.hero-row-head:first-of-type {
  margin-top: 4px;
}

.hero-row-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--omai-navy);
  letter-spacing: -0.01em;
}

.hero-row-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}

.hero-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-vid-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-vid-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0b1120;
  overflow: hidden;
}

.hero-vid-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

.vid-speed-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  pointer-events: none;
}

.hero-vid-meta {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero-vid-title {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-primary);
}

.hero-vid-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* 4-Method Head-to-Head Video Comparison Grid */
.compare-video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.compare-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compare-card.ours {
  border: 2px solid var(--omai-blue);
  box-shadow: 0 4px 18px rgba(0, 102, 204, 0.12);
}

.compare-card-head {
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.compare-card.ours .compare-card-head {
  background: var(--cvpr-highlight);
}

.compare-method {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-primary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.compare-card.ours .compare-method {
  color: var(--omai-navy);
}

.outcome-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.outcome-badge.pass {
  background: rgba(13, 148, 136, 0.14);
  color: #0f766e;
}

[data-theme="dark"] .outcome-badge.pass {
  background: rgba(45, 212, 191, 0.18);
  color: #5eead4;
}

.outcome-badge.warn {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}

[data-theme="dark"] .outcome-badge.warn {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.outcome-badge.fail {
  background: rgba(220, 38, 38, 0.13);
  color: #b91c1c;
}

[data-theme="dark"] .outcome-badge.fail {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

.compare-vid-frame {
  position: relative;
  width: 100%;
  background: #0b1120;
  overflow: hidden;
}

.compare-vid-frame.view-3rd {
  aspect-ratio: 9 / 15;
}

.compare-vid-frame.view-3rd video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  display: block;
}

.compare-vid-frame.view-1st {
  aspect-ratio: 1 / 1;
}

.compare-vid-frame.view-1st video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.compare-card-foot {
  padding: 8px 11px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.42;
  min-height: calc(1.42em * 2 + 16px);
}

.compare-card-foot strong {
  color: var(--text-body);
  font-weight: 600;
}

/* Full-width Replay Video Frame */
.replay-video-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 8px;
}

.replay-video-frame video {
  width: 100%;
  display: block;
  border-radius: 6px;
}

/* ==========================================================================
   Main Container & Sections
   ========================================================================== */
.main-content {
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 12px 24px 64px;
}

.section {
  margin-top: 44px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 36px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  margin-bottom: 24px;
}

.section-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--omai-blue);
  margin-bottom: 6px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--omai-navy);
  line-height: 1.25;
}

.section-lead {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: justify;
  text-justify: inter-word;
}

/* Abstract */
.abstract-text {
  font-size: 1.01rem;
  line-height: 1.78;
  color: var(--text-body);
  margin: 0 0 26px;
  text-align: justify;
  text-justify: inter-word;
}

.contrib-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.contrib-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.contrib-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.contrib-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cvpr-highlight);
  color: var(--omai-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.card-corner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 104, 214, 0.08);
  color: var(--omai-blue);
  flex-shrink: 0;
}

.card-corner-icon.teal {
  background: rgba(13, 148, 136, 0.10);
  color: #0d9488;
}

.card-corner-icon.purple {
  background: rgba(124, 58, 237, 0.10);
  color: #7c3aed;
}

[data-theme="dark"] .card-corner-icon {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
}

[data-theme="dark"] .card-corner-icon.teal {
  background: rgba(20, 184, 166, 0.16);
  color: #2dd4bf;
}

[data-theme="dark"] .card-corner-icon.purple {
  background: rgba(167, 139, 250, 0.16);
  color: #a78bfa;
}

.module-head .card-corner-icon {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.contrib-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.contrib-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.contrib-card p strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ==========================================================================
   Figures, Zoomable Frames & Video Slots
   ========================================================================== */
.figure-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  overflow: hidden;
  position: relative;
}

.figure-frame.zoomable {
  cursor: zoom-in;
}

.figure-frame.zoomable::after {
  content: 'Click to zoom';
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.figure-frame.zoomable:hover::after {
  opacity: 1;
}

.figure-frame img {
  margin: 0 auto;
  border-radius: 6px;
}

.figure-block {
  margin: 28px 0 0;
}

.figure-caption {
  margin: 18px 2px 0;
  font-size: 0.89rem;
  color: var(--text-muted);
  line-height: 1.68;
  text-align: justify;
  text-justify: inter-word;
}

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

.video-wrapper {
  display: none;
  background: #0b1120;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrapper.active {
  display: block;
}

.video-wrapper video {
  width: 100%;
  display: block;
  max-height: 540px;
  background: #000;
}

/* Method 3-Module Grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.module-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 7px;
  background: var(--omai-navy);
  color: #ffffff;
  flex-shrink: 0;
}

[data-theme="dark"] .module-index {
  background: #2563eb;
}

.module-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.module-card p {
  margin: 0;
  font-size: 0.89rem;
  color: var(--text-body);
  line-height: 1.6;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.tag-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ==========================================================================
   ForkTrack-Bench Stats & Platform Strip
   ========================================================================== */
.bench-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.bench-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bench-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.02rem, 1.45vw, 1.2rem);
  font-weight: 700;
  color: var(--omai-navy);
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}

.bench-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: auto 0;
  padding-top: 6px;
  line-height: 1.45;
}

.bench-task-list {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 7px;
  row-gap: 2px;
  margin: auto 0;
  padding-top: 6px;
  text-align: left;
  font-size: 0.76rem;
  line-height: 1.42;
  color: var(--text-muted);
}

.bench-task-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--omai-blue);
  white-space: nowrap;
}

.bench-task-name {
  white-space: nowrap;
}

.embodiment-grid {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: space-between;
  align-items: end;
  gap: 6px;
  width: 100%;
  margin: auto 0;
  padding-top: 8px;
}

.embodiment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.embodiment-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.2;
}

.embodiment-icon {
  height: 20px;
  width: auto;
  object-fit: contain;
}

[data-theme="dark"] .embodiment-icon {
  filter: invert(0.92);
}

/* ==========================================================================
   Interactive Tabs
   ========================================================================== */
.tab-group {
  margin-top: 24px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1 1 auto;
  min-width: 130px;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 102, 204, 0.06);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--omai-blue);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  animation: fadeSlide 0.22s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.two-col {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  align-items: start;
}

.two-col.equal {
  grid-template-columns: 1fr 1fr;
}

.insight-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--omai-blue);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-body);
}

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

/* ==========================================================================
   Academic Tables
   ========================================================================== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.academic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.academic-table th,
.academic-table td {
  padding: 9px 11px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.academic-table thead tr:first-child th:first-child,
.academic-table td:first-child {
  text-align: left;
  padding-left: 16px;
}

.academic-table thead th {
  background: var(--bg);
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-strong);
}

.academic-table .group-row td {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-style: italic;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 16px;
  text-align: left;
}

.academic-table tbody tr:hover td {
  background: rgba(0, 102, 204, 0.03);
}

.academic-table tbody tr.ours-row td {
  background: var(--cvpr-highlight);
  color: var(--text-primary);
  font-weight: 400;
  border-top: 1.5px solid var(--cvpr-highlight-border);
  border-bottom: 1.5px solid var(--cvpr-highlight-border);
}

.academic-table tbody td.best,
.academic-table tbody tr.ours-row td.best {
  font-weight: 800;
  color: var(--omai-navy);
}

[data-theme="dark"] .academic-table tbody td.best,
[data-theme="dark"] .academic-table tbody tr.ours-row td.best {
  color: #93c5fd;
}

.table-note {
  margin: 10px 2px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.check-yes {
  color: var(--omai-teal);
  font-weight: 700;
}

.check-no {
  color: var(--text-muted);
  opacity: 0.55;
}

/* ==========================================================================
   Real-World Deployment Hardware Strip & Diagnostics
   ========================================================================== */
.hardware-strip {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.hardware-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.spec-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.spec-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.spec-val {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text-primary);
  margin-top: 2px;
}

.diag-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.diag-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.84rem;
}

.diag-step strong {
  display: block;
  color: var(--omai-navy);
  margin-bottom: 4px;
}

/* Real-World Quantitative Evaluation Block */
.real-quant-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.real-quant-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 14px;
}

.real-quant-head h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--omai-navy);
}

.real-quant-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Collapsible Failure Analysis */
.failure-details {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.failure-details summary {
  padding: 15px 20px;
  font-weight: 650;
  font-size: 0.94rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.failure-details summary::-webkit-details-marker {
  display: none;
}

.failure-details summary::after {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  color: var(--omai-blue);
  transition: transform 0.2s ease;
}

.failure-details[open] summary::after {
  content: '−';
}

.failure-details-body {
  padding: 0 20px 20px;
}

/* ==========================================================================
   BibTeX Block
   ========================================================================== */
.bibtex-wrap {
  position: relative;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  overflow: hidden;
}

.bibtex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #94a3b8;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.copy-btn:hover {
  border-color: #60a5fa;
  color: #ffffff;
}

.copy-btn.copied {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
}

.bibtex-wrap pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
}

/* ==========================================================================
   Footer & Lightbox Modal
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-weight: 500;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  max-width: min(94vw, 1400px);
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.lightbox-content img {
  max-height: 78vh;
  width: auto;
  object-fit: contain;
}

.lightbox-caption {
  font-size: 0.86rem;
  color: #334155;
  text-align: center;
  max-width: 900px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #0f172a;
  color: #ffffff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 960px) {
  .kpi-strip,
  .bench-stats,
  .diag-steps,
  .compare-video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-video-grid {
    grid-template-columns: 1fr;
  }
  .contrib-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }
  .two-col,
  .two-col.equal,
  .hardware-strip {
    grid-template-columns: 1fr;
  }
}

/* Mobile-only collapsible text controls (hidden on desktop) */
.mobile-readmore-btn {
  display: none;
}

.mobile-swipe-hint {
  display: none;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .hero {
    padding: 26px 14px 20px;
  }
  .hero-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    margin-bottom: 12px;
  }
  .hero-title {
    font-size: 1.55rem;
    line-height: 1.24;
    margin-bottom: 12px;
  }
  .authors {
    font-size: 0.86rem;
    gap: 4px 10px;
  }
  .affiliations {
    font-size: 0.76rem;
    gap: 2px 10px;
  }
  .resource-links {
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 18px;
  }
  .pill-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  .teaser-card {
    padding: 14px 12px;
  }
  .main-content {
    padding: 6px 12px 44px;
  }
  .section {
    margin-bottom: 18px;
  }
  .section-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  .section-title {
    font-size: 1.28rem;
    line-height: 1.28;
  }
  .section-lead {
    font-size: 0.88rem;
    line-height: 1.58;
  }
  .abstract-text {
    font-size: 0.9rem;
    line-height: 1.64;
  }

  /* Collapsible long text on mobile: tap to expand full copy */
  .mobile-collapsible.is-collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--mobile-clamp-lines, 3);
    overflow: hidden;
    position: relative;
  }
  .mobile-readmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    margin-bottom: 4px;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--omai-blue);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-readmore-btn:active {
    opacity: 0.78;
  }

  /* Horizontal snap carousels for hero & 4-method video grids on mobile */
  .hero-row-head {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  .hero-row-tag {
    font-size: 0.7rem;
  }
  .hero-video-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .hero-video-grid::-webkit-scrollbar {
    display: none;
  }
  .hero-video-grid .hero-vid-card {
    flex: 0 0 74%;
    scroll-snap-align: start;
  }

  .compare-video-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .compare-video-grid::-webkit-scrollbar {
    display: none;
  }
  .compare-video-grid .compare-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .mobile-swipe-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
    margin: -2px 0 6px;
  }

  /* Compact grids & single-row scrollable tab bars */
  .bench-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .bench-stat {
    padding: 12px 10px;
  }
  .bench-stat-num {
    font-size: 1.05rem;
  }
  .kpi-strip,
  .hardware-specs,
  .diag-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .contrib-card,
  .module-card {
    padding: 15px 14px;
  }
  .tab-bar {
    display: flex;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }
  .tab-bar::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex: 0 0 auto;
    min-width: auto;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 7px 12px;
  }
  .media-toggle-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
  }
  .mode-pills {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mode-pills::-webkit-scrollbar {
    display: none;
  }
  .mode-pill {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.76rem;
    padding: 6px 10px;
  }
  .sync-btn {
    align-self: flex-start;
    font-size: 0.76rem;
    padding: 5px 10px;
  }

  /* Tables & BibTeX mobile readability */
  .academic-table {
    font-size: 0.76rem;
  }
  .academic-table th,
  .academic-table td {
    padding: 6px 7px;
  }
  .bibtex-wrap pre {
    font-size: 0.75rem;
    padding: 12px;
  }

  /* Safe lightbox close button on narrow screens */
  .lightbox {
    padding: 14px;
  }
  .lightbox-content {
    padding: 10px;
  }
  .lightbox-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }
}
