/* CSS styles for RecGen - Light Mode Premium Theme */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  /* User's palette - applied with restraint */
  --honey-bronze: #e0d0f5;
  --accent-dark: #4a1d8e;
  --hyper-magenta: #9333ea;
  --neon-violet: #a855f7;
  --cool-horizon: #3b82f6;
  --blue-energy: #2563eb;

  /* Light mode backgrounds */
  --bg-deep: #fafafa;
  --bg-surface: #ffffff;
  --bg-elevated: #f5f5f5;
  --bg-card: rgba(255, 255, 255, 0.95);

  /* Text hierarchy */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #7a7a7a;

  /* Refined borders */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);

  /* Elegant gradients */
  --gradient-warm: linear-gradient(135deg, var(--honey-bronze) 0%, var(--neon-violet) 100%);
  --gradient-cool: linear-gradient(135deg, var(--cool-horizon) 0%, var(--hyper-magenta) 100%);
  --gradient-full: linear-gradient(135deg, var(--honey-bronze) 0%, var(--neon-violet) 40%, var(--blue-energy) 100%);

  /* Light mode shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 8px 40px rgba(147, 51, 234, 0.12);
}

/* Dark mode */
[data-theme="dark"] {
  --bg-deep: #0f0f14;
  --bg-surface: #1a1a24;
  --bg-elevated: #22222e;
  --bg-card: rgba(26, 26, 36, 0.95);

  --text-primary: #e8e8ed;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 40px rgba(147, 51, 234, 0.2);
}

[data-theme="dark"] body {
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -20%, rgba(147, 51, 234, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(147, 51, 234, 0.06) 0%, transparent 50%);
}

[data-theme="dark"] .tab-btn.active {
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cta.dark {
  background: #e8e8ed;
  border-color: #e8e8ed;
  color: #0f0f14;
}

[data-theme="dark"] .cta.dark:hover {
  background: #fff;
  border-color: #fff;
}

[data-theme="dark"] .results-table .highlight-row {
  background: rgba(147, 51, 234, 0.1);
}

[data-theme="dark"] img {
  border-color: var(--border-subtle);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -20%, rgba(147, 51, 234, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(147, 51, 234, 0.03) 0%, transparent 50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  padding: 48px 28px 48px 28px;
  position: relative;
  min-height: 100vh;
  line-height: 1.7;
  font-size: 17px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Clean modern headings */
h1, h2, h3, h4, h5, h6, .section-heading {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hero-text {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Horizontal Navigation Bar */
.horizontal-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transform: translateY(-100%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.horizontal-nav.visible {
  transform: translateY(0);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .horizontal-nav {
  background: rgba(15, 15, 20, 0.85);
}

.horizontal-nav-item {
  padding: 6px 16px;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.horizontal-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.horizontal-nav-item.active {
  color: var(--accent-dark);
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

[data-theme="dark"] .horizontal-nav-item.active {
  background: var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Dropdown menu for Analysis */
.horizontal-nav-dropdown {
  position: relative;
}

.horizontal-nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  min-width: 120px;
}

.horizontal-nav-dropdown:hover .horizontal-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.horizontal-nav-dropdown-item {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.horizontal-nav-dropdown-item:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

[data-theme="dark"] .horizontal-nav-dropdown-menu {
  background: rgba(25, 25, 35, 0.95);
}

@media (max-width: 600px) {
  .horizontal-nav {
    gap: 2px;
    padding: 8px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  .horizontal-nav-item {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* Progress Sidebar */
.progress-sidebar {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: none;
}

@media (min-width: 1400px) {
  .progress-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
}

.progress-track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.progress-line {
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: var(--border-light);
  z-index: 0;
}

.progress-line-fill {
  position: absolute;
  left: 7px;
  top: 22px;
  width: 2px;
  background: var(--honey-bronze);
  z-index: 1;
  transition: height 0.3s ease;
  height: 0;
}

.progress-item {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.progress-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.progress-item.active .progress-dot {
  background: var(--honey-bronze);
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 5px rgba(147, 51, 234, 0.2);
}

.progress-item.passed .progress-dot {
  background: var(--honey-bronze);
  border-color: var(--accent-dark);
}

.progress-label {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 1;
  transition: color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-item.active .progress-label {
  color: var(--accent-dark);
  font-weight: 600;
}

.progress-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

/* Main Content */
.main-content {
  max-width: 1060px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Navigation - Hidden (using progress sidebar instead) */
.top-nav {
  display: none;
}

.nav-brand {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 16px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background: rgba(147, 51, 234, 0.08);
  color: var(--accent-dark);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.nav-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  transition: all 0.25s ease;
}

.nav-btn.primary {
  background: var(--honey-bronze);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
  font-weight: 600;
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.nav-btn.primary:hover {
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.3);
}

/* Hero Section - Elegant */
.hero-flow {
  position: relative;
  overflow: hidden;
  padding: 64px 48px 100px 48px;
  border-radius: 28px;
  margin-bottom: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

/* Soft flowing gradient orbs */
.hero-flow::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  top: -250px;
  left: -150px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.12) 0%, rgba(147, 51, 234, 0) 70%);
  animation: orbFlow1 25s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.hero-flow::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.08) 0%, rgba(147, 51, 234, 0) 70%);
  animation: orbFlow2 30s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.hero-flow > * {
  position: relative;
  z-index: 1;
}

/* Third orb */
.hero-flow .hero-orb {
  position: absolute;
  width: 450px;
  height: 450px;
  top: 40%;
  right: 10%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0) 70%);
  animation: orbFlow3 28s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes orbFlow1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(80px, 40px); }
  50% { transform: translate(120px, -20px); }
  75% { transform: translate(40px, 60px); }
}

@keyframes orbFlow2 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-60px, -50px); }
  50% { transform: translate(-100px, 30px); }
  75% { transform: translate(-30px, -40px); }
}

@keyframes orbFlow3 {
  0%, 100% { transform: translateY(-50%) translate(0, 0); }
  33% { transform: translateY(-50%) translate(-50px, 70px); }
  66% { transform: translateY(-50%) translate(40px, -50px); }
}

.hero-text {
  font-size: 80px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-primary);
}

.sub-hero-text {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 36px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.hero-pill-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-pill {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 100px;
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.25);
  color: var(--accent-dark);
  transition: all 0.25s ease;
  animation: pillPopIn 0.5s ease both;
}

.hero-pill:nth-child(1) { animation-delay: 0.1s; }
.hero-pill:nth-child(2) { animation-delay: 0.2s; }
.hero-pill:nth-child(3) { animation-delay: 0.3s; }

@keyframes pillPopIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hero-pill:hover {
  background: rgba(147, 51, 234, 0.18);
  border-color: rgba(147, 51, 234, 0.4);
  transform: translateY(-2px);
}

.hero-flow .authors {
  text-align: center;
}

/* Authors */
.authors {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 2;
  margin-top: 0;
  margin-bottom: 32px;
  text-align: center;
}

.authors span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.authors .affiliation {
  font-family: 'Inter', -apple-system, sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}

.authors a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.authors a:hover {
  color: var(--accent-dark);
}

.authors sup {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 1px;
}

.authors .author-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 4px;
}

.authors .affiliation sup {
  font-size: 9px;
  margin-right: 2px;
}

.affiliation-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.affiliation-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.affiliation-item span {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

.affiliation-item sup {
  font-size: 9px;
  margin-right: 2px;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
}

.logo-number {
  position: absolute;
  top: -14px;
  left: -12px;
  background: none;
  color: var(--text-muted);
  font-size: 10px;
  font-family: 'Inter', -apple-system, sans-serif;
  z-index: 1;
  transform: scale(0.8);
  transform-origin: center;
}

/* Abstract Summary */
.abstract-summary {
  margin: 8px 160px 48px 160px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.cta {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  background: transparent;
  transition: all 0.25s ease;
}

.cta.primary {
  background: var(--honey-bronze);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
  font-weight: 600;
}

.cta.ghost {
  border-color: rgba(147, 51, 234, 0.3);
  color: var(--accent-dark);
}

.cta.dark {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}

.cta.dark:hover {
  background: #000;
  border-color: #000;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cta.primary:hover {
  box-shadow: 0 12px 32px rgba(147, 51, 234, 0.25);
}

.cta.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Hero Waves */
.hero-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 70px;
  overflow: hidden;
  opacity: 0.7;
}

.waves-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wave-parallax use {
  animation: waveShift 16s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.wave-parallax use:nth-child(1) { animation-delay: -2s; animation-duration: 16s; }
.wave-parallax use:nth-child(2) { animation-delay: -4s; animation-duration: 14s; }
.wave-parallax use:nth-child(3) { animation-delay: -6s; animation-duration: 20s; }
.wave-parallax use:nth-child(4) { animation-delay: -8s; animation-duration: 18s; }

@keyframes waveShift {
  0% { transform: translate3d(-90px, 0, 0); }
  50% { transform: translate3d(20px, 0, 0); }
  100% { transform: translate3d(-90px, 0, 0); }
}

/* Tagline - Section Headers */
.tagline {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  background: transparent;
  color: var(--text-primary);
  display: block;
  padding: 48px 0 0 0;
  margin: 24px 0 20px 0;
  border: none;
  position: relative;
}

.tagline::before {
  display: none;
}

.tagline::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--honey-bronze) 0%, rgba(147, 51, 234, 0.15) 40%, transparent 100%);
  border-radius: 2px;
  margin-bottom: 12px;
  margin-top: 24px;
}

/* Tagline with controls on the right */
.tagline-with-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 48px 0 0 0;
  margin: 24px 0 20px 0;
  position: relative;
}

.tagline-with-controls::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--honey-bronze) 0%, rgba(147, 51, 234, 0.15) 40%, transparent 100%);
  border-radius: 2px;
  position: absolute;
  bottom: -12px;
  left: 0;
}

.tagline-with-controls .tagline-text {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.tagline-with-controls .slideshow-controls {
  flex-shrink: 0;
}

/* Quick Links */
.quick-links {
  text-align: center;
  margin-top: 0;
  margin-bottom: 40px;
}

.quick-links a {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 18px;
  padding: 8px 0;
  transition: color 0.2s ease;
  border-bottom: 1px solid transparent;
}

.quick-links a:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}

/* Images */
img {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  margin: 0;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
}

img.logo-img {
  height: 35px !important;
  width: auto !important;
  max-width: 150px !important;
  object-fit: contain !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.main-content > img {
  margin-left: 0;
  margin-right: 0;
}

.teaser-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  margin: 24px 0 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.teaser-image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -5px;
  pointer-events: none;
}

/* Dataset Media */
.dataset-item {
  box-shadow: var(--shadow-sm);
}

.dataset-link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted);
}

.dataset-link:hover {
  border-bottom-style: solid;
}

.dataset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.dataset-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dataset-tag.object {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.dataset-tag.part {
  background: rgba(147, 51, 234, 0.15);
  color: #9333ea;
}

.dataset-tag.sensor {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-secondary);
}

.dataset-media {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dataset-media img {
  border-radius: 0;
  border: none;
}

.dataset-video-grid .dataset-media {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dataset-video-grid .dataset-media video {
  width: 100%;
  height: auto;
  max-height: 100%;
}

/* Figure Links */
a#figure-1-img,
a#figure-2-img,
a#figure-3-img {
  display: block;
  text-decoration: none;
  cursor: default;
}

a#figure-1-img img,
a#figure-2-img img,
a#figure-3-img img {
  display: block;
  width: 100%;
  height: auto;
}

#figure-1-img {
  margin-top: 20px;
  margin-left: 0;
  margin-right: 0;
}

#figure-2-img {
  border-radius: 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: 20px;
}

a#figure-2-img img {
  border: none;
  border-radius: 0;
}

#figure-3-img {
  padding: 24px;
  background: var(--bg-surface);
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

a#figure-3-img img {
  border: none;
  border-radius: 0;
  margin: 0;
}

/* Figure Caption */
.figure-caption {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 20px;
  margin-bottom: 48px;
  padding: 0 32px;
  line-height: 1.7;
}

/* Card Surface - Refined */
.card-surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}

/* Section styles */
.section {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 48px;
  color: var(--text-secondary);
}

.section-heading {
  font-size: 28px;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

.section-lead {
  color: var(--text-muted);
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

/* Abstract Card */
.abstract-card {
  position: relative;
  overflow: hidden;
}

.abstract-card:focus {
  outline: 2px solid var(--honey-bronze);
  outline-offset: 4px;
}

.abstract-card:hover,
.abstract-card:focus-within {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.abstract-teaser {
  transition: opacity 0.3s ease;
  color: var(--text-secondary);
}

.abstract-teaser p {
  margin-bottom: 16px;
}

.abstract-card:hover .abstract-teaser,
.abstract-card:focus-within .abstract-teaser {
  opacity: 0.4;
}

.abstract-full {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
  color: var(--text-secondary);
}

.abstract-card:hover .abstract-full,
.abstract-card:focus-within .abstract-full {
  max-height: 1200px;
  opacity: 1;
  margin-top: 20px;
}

.abstract-full p {
  margin-bottom: 16px;
}

.abstract-hint {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin: 20px 0 12px 0;
  font-style: italic;
}

/* TL;DR Grid */
.tldr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tldr-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tldr-card:hover,
.tldr-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-light);
}

.tldr-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

.tldr-video {
  width: 100%;
  border-radius: 14px;
  margin-top: 18px;
  height: 220px;
  max-height: 220px;
  opacity: 1;
  display: block;
  object-fit: cover;
  transition: max-height 0.4s ease, opacity 0.35s ease;
  box-shadow: var(--shadow-sm);
}

.tldr-label {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Pipeline Grid */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 32px 0 24px 0;
}

.pipeline-card {
  background: var(--bg-elevated);
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.pipeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pipeline-card video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}

.pipeline-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

.pipeline-step {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--accent-dark);
}

/* Slider Section */
.slider-section {
  margin: 40px 0 64px 0;
}

.slider-task-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.slider-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-nav-btn:hover {
  background: var(--honey-bronze);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

.slider-task-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}

.slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
  border: 1px solid var(--border-subtle);
}

.slider-labels {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.slider-label-sim,
.slider-label-real {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.slider-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid var(--honey-bronze);
  box-shadow: 2px 0 20px rgba(147, 51, 234, 0.25);
}

.slider-overlay .slider-video {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  /* Width set by JS to match wrapper width */
  object-fit: cover;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--honey-bronze);
  pointer-events: none;
}

.slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--honey-bronze);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.4);
}

.slider-handle::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 16px;
  font-weight: bold;
}

.slider-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.slider-caption {
  margin-top: 20px;
}

/* Side by Side Cards */
.side-by-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.side-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.side-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.side-card video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.side-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

.side-label {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.side-label.muted {
  color: var(--neon-violet);
}

.side-label.accent {
  color: var(--cool-horizon);
}

.insight-block {
  background: var(--bg-surface);
}

/* Co-training Gallery */
.co-gallery {
  margin-top: 32px;
}

.co-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.co-gallery-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.co-gallery-card:hover,
.co-gallery-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.co-gallery-card video {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  box-shadow: var(--shadow-sm);
  background: #000;
}

.co-caption {
  margin-top: 12px;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* Co-training Split Card */
.cotrain-split-card {
  margin-top: 24px;
}

.cotrain-split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
}

.cotrain-left,
.cotrain-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cotrain-section-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.cotrain-section-lead {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cotrain-barplot-container {
  flex: 1;
  display: flex;
  align-items: center;
}

#cotrain-bar {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.cotrain-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cotrain-collage video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .cotrain-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .cotrain-collage {
    grid-template-columns: 1fr;
  }
}

/* Correlation Callout */
.correlation-callout {
  margin-top: 28px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.metric-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-value {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--accent-dark);
}

.metric-label {
  font-family: 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.metric-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.evidence-list {
  margin: 20px 0 0 20px;
  padding: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.evidence-list li {
  margin-bottom: 8px;
}

.evidence-list li::marker {
  color: var(--accent-dark);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 28px 0 52px 0;
}

.stats-grid-inline {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.stats-grid-inline .stat-card {
  flex: 1;
  min-width: 200px;
  padding: 20px;
  margin: 0;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-warm);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.stat-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* Scatter Card */
.scatter-card {
  margin-top: 28px;
}

.correlation-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.correlation-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.correlation-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#comparison-bar {
  width: 100%;
  height: 320px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
}

.comparison-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.comparison-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comparison-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.comparison-legend .legend-dot.polaris {
  background: var(--hyper-magenta);
}

.comparison-legend .legend-dot.libero {
  background: #eab308;
  opacity: 0.6;
}

.correlation-legend-shared {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 800px) {
  .correlation-split {
    grid-template-columns: 1fr;
  }

  .roboarena-section {
    flex-direction: column !important;
  }

  .roboarena-right {
    flex-shrink: 1 !important;
    width: 100%;
  }

  .roboarena-right > div {
    max-width: 100% !important;
  }
}

#corr-scatter {
  width: 100%;
  height: 320px;
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
}

.scatter-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.scatter-status {
  margin-top: 0;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--accent-dark);
}

.scatter-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-shape {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-radius: 0;
}

.legend-shape.square {
  border-radius: 3px;
}

.legend-shape.circle {
  border-radius: 50%;
}

.legend-shape.square.blue {
  background: var(--hyper-magenta);
  border-color: var(--neon-violet);
}

.legend-shape.circle.gray {
  background: var(--text-muted);
  border-color: var(--text-secondary);
}

.legend-shape.triangle {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--honey-bronze);
  border-radius: 0;
  border: none;
}

.rank-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.rank-lists ol {
  padding-left: 20px;
  margin: 10px 0 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.rank-title {
  font-family: 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.scatter-tooltip {
  position: absolute;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2147483647;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

/* Chart Animations */
@keyframes scatterPointIn {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes barGrowUp {
  0% {
    transform: scaleY(0);
  }
  100% {
    transform: scaleY(1);
  }
}

.scatter-point-animated {
  transform-origin: center;
  transform-box: fill-box;
  opacity: 0;
}

.scatter-point-animated.animate {
  animation: scatterPointIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bar-animated {
  transform-origin: bottom center;
  transform-box: fill-box;
  transform: scaleY(0);
}

.bar-animated.animate {
  animation: barGrowUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes labelFadeIn {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.bar-label-animated {
  opacity: 0;
}

.bar-label-animated.animate {
  animation: labelFadeIn 0.4s ease-out forwards;
}

/* Bar Card */
.bar-card {
  margin-top: 28px;
}

#bar-plot {
  width: 100%;
}

.bar-plot-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Policy Card */
.policy-card {
  margin-top: 28px;
}

.policy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.policy-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.policy-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.policy-title {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.policy-table th,
.policy-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.policy-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}

.policy-table td {
  color: var(--text-secondary);
}

.policy-table td.value-sim {
  color: var(--hyper-magenta);
  font-weight: 600;
}

.policy-table td.value-real {
  color: var(--accent-dark);
  font-weight: 600;
}

/* Video Card */
.video-card {
  margin-top: 28px;
}

.policy-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.policy-video-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.policy-video-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.policy-video-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.policy-video-wrap video {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: var(--shadow-sm);
}

.policy-video-label {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.policy-video-task {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
}

.policy-video-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 20px auto 0;
  width: 100%;
}

.policy-video-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Slide animations */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right { animation: slideInRight 250ms ease; }
.slide-in-left { animation: slideInLeft 250ms ease; }

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 28px 0 20px 0;
}

.gallery-grid video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  display: block;
  transition: all 0.3s ease;
  border: 1px solid var(--border-subtle);
}

.gallery-grid video:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-grid-labeled {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-item video {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

.gallery-label {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

/* Mesh Viewer */
.mesh-viewer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mesh-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.mesh-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.mesh-selector select {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.mesh-selector select:hover:not(:disabled) {
  border-color: var(--border-light);
}

.mesh-selector select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-primary);
}

.mesh-selector-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mesh-active-label {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: var(--accent-dark);
}

.mesh-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.mesh-col {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.mesh-col-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.input-dataset-desc,
.mesh-note {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.mesh-note {
  font-style: italic;
}

.mesh-viewer-frame {
  width: 100%;
  height: auto;
  min-height: 300px;
  border-radius: 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.mesh-media {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mesh-video {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}


/* Reconstruction Split Section (50/50 layout) */
.reconstruction-split-section {
  margin-top: 28px;
}

.reconstruction-split-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.reconstruction-split-container.full-width {
  grid-template-columns: 1fr;
}

.reconstruction-half {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.reconstruction-half-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reconstruction-half-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.reconstruction-media-frame {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-sizing: border-box;
}

.reconstruction-media-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Aligned reconstruction layout - viewer matches input image size */
.reconstruction-aligned {
  align-items: start;
}

.reconstruction-aligned .reconstruction-half {
  display: flex;
  flex-direction: column;
}

.reconstruction-aligned .reconstruction-media-frame {
  width: 100%;
}

.reconstruction-aligned #meshDesktopViewer {
  aspect-ratio: 1; /* default, overridden by JS to match input image */
}

.reconstruction-mobile-fallback {
  display: none;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mobile-viewer-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

.reconstruction-mobile-fallback video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

/* Gaussian Splat Viewer */
.gsplat-half {
  min-height: 500px;
}

.gsplat-active-label {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: var(--accent-dark);
  margin-bottom: 14px;
}

.gsplat-viewer-container {
  position: absolute;
  inset: 0;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.gsplat-viewer-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 12px;
}

.gsplat-viewer-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  display: block;
}

.gsplat-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.gsplat-hint {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  backdrop-filter: blur(4px);
}

.gsplat-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 16px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.gsplat-loading.hidden {
  display: none;
}

.gsplat-loading-text {
  margin-bottom: 10px;
}

.gsplat-progress-bar {
  width: 200px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}

.gsplat-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--honey-bronze);
  border-radius: 3px;
  transition: width 0.2s ease-out;
}

/* Viewer mode toggle (GS Splats / Mesh) */
.viewer-mode-toggle {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: var(--bg-elevated);
}

.viewer-mode-btn {
  padding: 7px 14px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.viewer-mode-btn.active {
  background: var(--honey-bronze);
  color: #fff;
  font-weight: 600;
}

.viewer-mode-btn:hover:not(.active) {
  background: var(--bg-primary);
}

#meshCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}

/* Mesh Half - Vertical stacking */
.mesh-half {
  min-height: 500px;
  overflow: hidden;
}

.mesh-columns-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

.mesh-columns-vertical .mesh-col {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mesh-columns-vertical .mesh-video {
  height: auto;
  max-height: 300px;
}

.mesh-columns-vertical .mesh-viewer-frame {
  min-height: 180px;
  max-height: 220px;
  height: 100%;
}

/* Responsive for split layout */
@media (max-width: 1000px) {
  .reconstruction-split-container {
    grid-template-columns: 1fr;
  }

  .reconstruction-half {
    min-height: 450px;
  }
}

/* Video Gallery Section */
.video-gallery-section {
  margin-bottom: 56px;
  width: 100vw;
  position: relative;
  margin-left: calc((100% - 100vw) / 2);
  box-sizing: border-box;
}

.video-gallery-container {
  box-sizing: border-box;
  max-width: 1150px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.video-gallery-container::-webkit-scrollbar {
  display: none;
}

.video-gallery {
  display: flex;
  gap: 20px;
  padding: 0 32px;
  padding-bottom: 16px;
  box-sizing: border-box;
  width: max-content;
  margin: 0 auto;
}

.gallery-video {
  flex: 0 0 auto;
  height: 220px;
  width: auto;
  border-radius: 18px;
  box-sizing: border-box;
  background-color: var(--bg-deep);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.gallery-video:hover {
  transform: scale(1.02) translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.gallery-nav {
  background: var(--honey-bronze);
  color: var(--accent-dark);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  margin: 0 8px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.3);
}

.gallery-nav:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.4);
}

.gallery-nav-controls {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.gallery-caption-container {
  max-width: 960px;
  margin: 20px auto 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.figure-caption.gallery-caption {
  margin-bottom: 0;
  margin-top: 0;
  text-align: left;
  flex-grow: 1;
}

/* Real-to-Sim Layout */
.r2s-vertical-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.r2s-video-row {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.r2s-video-row > .r2s-video-item,
.r2s-video-row > .stacked-ego-videos {
  flex-grow: 1;
  flex-basis: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
  background-color: var(--bg-deep);
  border-radius: 14px;
}

.r2s-top-row > .r2s-video-item,
.r2s-top-row > .stacked-ego-videos {
  max-height: 266px;
}

.r2s-bottom-row > .r2s-video-item,
.r2s-bottom-row > .stacked-ego-videos {
  max-height: 247px;
}

video.r2s-video-item {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background-color: var(--bg-deep);
  border: none;
  border-radius: 12px;
}

.r2s-video-smpl,
.r2s-video-g1 {
  transform: scale(1.001);
}

.stacked-ego-videos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: auto;
  height: 100%;
  max-width: 100%;
  border: none;
  background-color: transparent;
}

.stacked-ego-videos > video.r2s-video-item {
  aspect-ratio: 1 / 1;
  width: auto;
  height: calc(50% - 4px);
  min-height: 0;
}

.r2s-caption-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: -8px;
}

.r2s-caption-item {
  flex-grow: 1;
  flex-basis: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* Additional Video Row */
.additional-video-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

.additional-video-item {
  height: 220px;
  width: auto;
  border-radius: 18px;
  background-color: #000;
  box-shadow: var(--shadow-md);
}

#input-video-cropped { width: 350px; object-fit: cover; }
#input-video-cropped2 { width: 250px; object-fit: cover; }
#input-video-cropped3 { width: 300px; object-fit: cover; }
#input-video-cropped4 { width: 250px; object-fit: cover; }

.video-gallery .gallery-video {
  height: 224px;
  margin-right: 0;
  flex-shrink: 0;
}

#reconstructionGallerySection .gallery-video {
  height: 220px;
}

/* Fidelity Section */
.fidelity-section {
  margin: 36px auto 0;
  max-width: 1100px;
}

.fidelity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.fidelity-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s ease;
}

.fidelity-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.fidelity-item video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #000;
}

.fidelity-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Resources Section */
.resources-card {
  margin-top: 24px;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.resource-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.resource-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.resource-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.resource-item.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.resource-link.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.resource-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(147, 51, 234, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent-dark);
}

.resource-item h3 {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.resource-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
  line-height: 1.6;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.resource-link:hover {
  gap: 10px;
}

.resource-link svg {
  transition: transform 0.2s ease;
}

.resource-link:hover svg {
  transform: translate(2px, -2px);
}

.resource-coming-soon {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* BibTeX */
.bibtex-code {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 32px;
  border-radius: 20px;
  margin: 88px auto -44px;
  max-width: 1000px;
  box-sizing: border-box;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.bibtex-copy-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.bibtex-copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-dark);
  box-shadow: var(--shadow-sm);
}

.bibtex-copy-btn.copied {
  color: #16a34a;
  border-color: #16a34a;
}

.bibtex-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.bibtex-code pre {
  white-space: pre;
  overflow-x: auto;
  margin: 0;
}

.bibtex-code code {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.7;
}

/* Footer */
.footer {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 120px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 40px;
  text-align: center;
}

.footer a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer a:hover {
  opacity: 0.8;
}

/* Pull Quote */
.pull-quote {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 24px;
  font-style: normal;
  font-weight: 500;
  margin: 64px 0 28px 0;
  color: var(--text-secondary);
  border-left: 3px solid var(--honey-bronze);
  padding-left: 28px;
}

/* Section Subtitle */
.section-subtitle {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: inline-block;
  padding: 12px 20px;
  margin: 36px 0;
  border-radius: 12px;
}

/* TOC Subsection */
.toc-subsection {
  margin-left: 20px;
  font-size: 0.9em;
}

/* Wide Section */
.wide-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 32px;
}

/* Recharts styles */
.recharts-card {
  margin-top: 28px;
}

.recharts-wrap {
  width: 100%;
}

.recharts-fallback {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
}

.recharts-stat {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--honey-bronze);
  color: var(--accent-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.recharts-stat.muted {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.recharts-tooltip {
  background: var(--bg-deep);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
}

/* Scatter styles */
.scatter-flex {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.scatter-visual {
  flex: 1 1 520px;
}

.scatter-notes {
  flex: 1 1 300px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.notes-title {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.scatter-notes ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.scatter-legend .dot::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.scatter-legend .dot.sim::before {
  background: var(--cool-horizon);
}

.scatter-legend .dot.base::before {
  background: var(--neon-violet);
}

/* Tab label visibility - defaults (desktop) */
.tab-full {
  display: inline;
}
.tab-short {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 24px 18px;
    font-size: 14px;
  }
  
  .hero-text {
    font-size: 48px;
  }
  
  .sub-hero-text {
    font-size: 20px;
  }
  
  .hero-flow {
    padding: 40px 28px 90px 28px;
    border-radius: 24px;
  }

  .top-nav {
    padding: 12px 18px;
    gap: 10px;
  }
  
  .nav-links {
    display: none;
  }
  
  .tagline {
    font-size: 24px;
  }
  
  .card-surface {
    padding: 24px;
    border-radius: 20px;
  }
  
  .section-heading {
    font-size: 24px;
  }

  /* Hero action buttons - wrap on mobile */
  .hero-actions {
    flex-wrap: wrap;
    gap: 10px;
  }
  .hero-actions .cta {
    padding: 12px 18px;
    font-size: 13px;
  }

  /* Evaluation datasets - 2 columns on tablet */
  .eval-dataset-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Qualitative results labels - smaller font, allow wrapping */
  .showcase-video-labels {
    gap: 2px;
  }
  .showcase-label {
    font-size: 9px;
    padding: 4px 2px;
    min-width: 0;
  }

  /* Symmetry viewer - smaller labels and grid on mobile */
  .symmetry-row-labels {
    padding-right: 6px;
  }
  .symmetry-row-label {
    font-size: 10px;
    padding: 4px 4px;
    min-width: 22px;
  }
  .symmetry-grid {
    gap: 3px !important;
  }
  .symmetry-cell {
    border-radius: 4px;
  }
  .symmetry-cell img {
    border-radius: 4px;
  }

  /* Tab buttons - shorter text on mobile */
  .tab-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  .tab-full {
    display: none;
  }
  .tab-short {
    display: inline;
  }

  /* Interactive 3D viewer - hide entire section on mobile */
  .reconstruction-split-section {
    display: none !important;
  }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .cta {
    text-align: center;
    width: 100%;
  }

  /* Evaluation datasets - single column on small phones */
  .eval-dataset-grid {
    grid-template-columns: 1fr !important;
  }

  /* Qualitative results labels - 2 rows */
  .showcase-video-labels {
    flex-wrap: wrap;
  }
  .showcase-label {
    flex: 1 1 30%;
    font-size: 10px;
    padding: 5px 3px;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: rgba(147, 51, 234, 0.25);
  color: var(--text-primary);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--honey-bronze);
  outline-offset: 3px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== RecGen New Styles ===== */

/* Comparison Grid */
.comparison-full-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.comparison-full-image:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.comparison-card {
  overflow: hidden;
}

/* Hierarchical Scene Selector (dataset → scene number) */
.scene-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.scene-dataset-btns, .scene-number-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.scene-dataset-btn, .scene-number-btn {
  padding: 7px 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.scene-dataset-btn:hover, .scene-number-btn:hover {
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.scene-dataset-btn:active, .scene-number-btn:active {
  transform: scale(0.97);
}
.scene-dataset-btn.active {
  background: var(--honey-bronze);
  color: var(--accent-dark);
  font-weight: 600;
  border-color: var(--neon-violet);
  box-shadow: 0 4px 12px rgba(168,85,247,0.4);
}
.scene-number-btn.active {
  background: var(--neon-violet);
  color: #fff;
  border-color: var(--neon-violet);
  box-shadow: 0 2px 8px rgba(168,85,247,0.3);
}
.scene-number-btn {
  min-width: 36px;
  text-align: center;
}

/* Thumbnail-based scene selector */
.scene-thumbnails {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.scene-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.scene-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scene-thumb.active {
  border-color: var(--neon-violet);
  box-shadow: 0 4px 12px rgba(168,85,247,0.4);
}

.scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
}

.scene-thumb-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

/* Comparison Scene & Method Selectors */
.comparison-scene-selector,
#sliderSceneSelector {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.comp-scene-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: var(--bg-elevated);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.comp-scene-btn:hover {
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.comp-scene-btn.active {
  background: var(--neon-violet);
  color: #fff;
  box-shadow: 0 2px 8px rgba(168,85,247,0.3);
}
.comparison-method-selectors {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}
.method-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.method-select-group label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.method-select {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: auto;
}
.method-select:hover {
  border-color: var(--neon-violet);
}
.method-select:focus {
  outline: none;
  border-color: var(--neon-violet);
  box-shadow: 0 0 0 2px rgba(168,85,247,0.15);
}
.comparison-method-selectors .vs-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Image Comparison Slider */
.image-slider-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  user-select: none;
}
.image-slider-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  border: none;
}
.slider-img-left {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.slider-img-right-clip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 0 0 50%);
}
.slider-img-right {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.slider-handle-bar {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: white;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}
.slider-handle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--neon-violet);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.image-slider-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 3;
  margin: 0;
}
.slider-labels {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1;
  pointer-events: none;
}
.slider-label-left,
.slider-label-right {
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
}


.figure-caption {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 10px;
}

.section-subheading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  flex-wrap: wrap;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.tab-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ===== Symmetry Comparison Viewer ===== */
.symmetry-viewer {
  margin: 24px 0 8px;
}
.symmetry-grid-wrap {
  display: flex;
  gap: 0;
  align-items: stretch;
}
.symmetry-row-labels {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 4px;
  flex-shrink: 0;
  padding-right: 10px;
}
.symmetry-row-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 6px;
  border-radius: 8px;
  color: #fff;
  min-width: 28px;
}
.symmetry-label-input  { background: #505050; }
.symmetry-label-recgen { background: #745CB4; }
.symmetry-label-sam3d  { background: #3D8DC9; }
.symmetry-label-sam3d a {
  color: #fff;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: rgba(255,255,255,0.7);
  text-underline-offset: 1px;
}
.symmetry-label-sam3d a:hover {
  text-decoration-style: solid;
  text-decoration-color: #fff;
}
/* Stage holds grids and enables crossfade */
.symmetry-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.symmetry-grid {
  display: grid;
  gap: 4px;
}
.symmetry-cell {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-elevated);
  aspect-ratio: 1;
}
.symmetry-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
/* Verdict borders (correct/wrong) — revealed after delay */
.symmetry-cell[data-verdict]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.symmetry-cell[data-verdict="correct"]::after {
  border: 3px solid #22c55e;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.15);
}
.symmetry-cell[data-verdict="wrong"]::after {
  border: 3px solid #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}
.show-verdicts .symmetry-cell[data-verdict]::after {
  opacity: 1;
}
/* Pager dots */
.symmetry-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.symmetry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.symmetry-dot.active {
  background: #745CB4;
  transform: scale(1.3);
}
.symmetry-dot:hover:not(.active) {
  background: var(--text-muted);
}

/* Results Figures */
.results-figure {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: zoom-in;
}
.results-figure:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Chart containers */
.chart-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.chart-container {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 16px 8px 8px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-elevated);
  overflow: hidden;
}
.chart-half {
  flex: 1;
  min-width: 320px;
}
.chart-full {
  width: 100%;
}
.chart-tall {
  height: 700px;
}
.chart-medium {
  height: 400px;
}
.chart-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 8px 0;
}
.hb-objects-figure {
  margin: 8px 0 24px 0;
  padding: 16px;
  background: var(--bg-surface-2, var(--bg-surface));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-align: center;
}
.hb-objects-figure img {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
[data-theme="dark"] .hb-objects-figure img {
  background: #ffffff;
  padding: 8px;
}
.hb-objects-figure figcaption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .chart-half { min-width: 100%; }
  .chart-tall { height: 500px; }
  .chart-medium { height: 300px; }
}

/* View toggle (avg / per-dataset) */
.view-toggle {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
}
.toggle-label input[type="checkbox"] {
  accent-color: var(--hyper-magenta);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
/* Inset toggle inside a media frame */
.overlay-toggle-inset {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 4px 10px;
}
[data-theme="dark"] .overlay-toggle-inset {
  background: rgba(30, 30, 30, 0.85);
}

/* Standalone toggle wrapper */
.overlay-toggle-wrap {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.view-detail { display: none; }
.show-detail .view-detail { display: block; }
.show-detail .view-avg { display: none; }

/* Section divider within card */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 32px 0;
}

/* Ablation table */
.ablation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.ablation-table thead {
  background: var(--bg-elevated);
}
.ablation-table th {
  padding: 10px 14px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}
.ablation-table th:first-child {
  text-align: left;
}
.ablation-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ablation-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}
.ablation-table tbody tr:last-child td {
  border-bottom: none;
}
.ablation-table tbody tr:hover {
  background: var(--bg-elevated);
}
.ablation-table .highlight-row {
  background: rgba(116, 92, 180, 0.06);
}
.ablation-table .highlight-row td:first-child {
  color: #745CB4;
  font-weight: 600;
}
.delta-worse { color: #c0392b; font-size: 11px; margin-left: 4px; }
.delta-better { color: #27ae60; font-size: 11px; margin-left: 4px; }
.delta-same { color: var(--text-muted); font-size: 11px; margin-left: 4px; }
[data-theme="dark"] .ablation-table .highlight-row {
  background: rgba(116, 92, 180, 0.12);
}

/* Results Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.results-table thead {
  background: var(--bg-elevated);
}
.results-table th {
  padding: 10px 14px;
  text-align: left;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-subtle);
  white-space: nowrap;
}
.results-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
.results-table tbody tr:last-child td {
  border-bottom: none;
}
.results-table .highlight-row {
  background: rgba(147, 51, 234, 0.06);
}
.results-table .highlight-row td {
  color: var(--text-primary);
  font-weight: 500;
}
.results-table .highlight-row td:first-child {
  color: var(--accent-dark);
  font-weight: 600;
}
.results-table tbody tr:hover {
  background: var(--bg-elevated);
}

/* Video Grid for Reconstructions */
.video-grid-recon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .video-grid-recon {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .video-grid-recon {
    grid-template-columns: 1fr;
  }
}

.video-card-recon {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-elevated);
}
.video-card-recon:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.video-thumb {
  width: 100%;
  display: block;
  transition: opacity 0.3s ease;
}
.video-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 36px);
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.video-card-label {
  padding: 8px 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  background: var(--bg-surface);
}

/* Showcase Video */
.showcase-video-wrapper {
  position: relative;
}
.showcase-video-labels {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.showcase-label {
  flex: 1;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 6px 4px;
  background: #505050;
  border-radius: 6px;
}
.showcase-label--baseline {
  background: #3D8DC9;
}
.showcase-label--ours {
  background: #745CB4;
}
.showcase-label--baseline a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.7);
}
.showcase-label--baseline a:hover {
  border-bottom-style: solid;
  border-bottom-color: #fff;
}
.showcase-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* Multi-view video */
.multiview-video-wrapper {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.multiview-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* Method Slideshow */
.method-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 980;
  overflow: hidden;
  border-radius: 12px;
}

.method-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.method-slide.active {
  opacity: 1;
}

.method-caption-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 16px;
}

.slideshow-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.slideshow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.slideshow-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.slideshow-counter {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 6px;
}

/* Scroll Reveal Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}
.lightbox.active {
  opacity: 1;
  pointer-events: all;
}
.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  font-size: 36px;
  color: white;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.lightbox-close:hover {
  opacity: 1;
}

/* Multi-Dataset Video Transition */
.multi-dataset-video-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.multi-dataset-video-row:last-child {
  margin-bottom: 0;
}
.multi-dataset-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  min-width: 120px;
  text-align: right;
}
.multi-dataset-videos-inner {
  display: flex;
  gap: 12px;
  flex: 1;
}
.multi-dataset-videos-inner video {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
