/* ==========================================================================
   SNAP Academic Project Page Stylesheet
   Clean, prestigious, light-themed academic conference design
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Outfit', 'Google Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Crisp Light Academic Palette */
  --bg-page: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border-light: #e2e8f0;
  --border-dark: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Academic Accent Colors */
  --accent-primary: #1d4ed8;       /* Royal Academic Blue */
  --accent-primary-light: #eff6ff;
  --accent-primary-hover: #1e40af;
  --accent-snap: #2563eb;
  --accent-teal: #0d9488;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-slate: #475569;

  /* Shadows & Borders */
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --max-width: 1180px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-page);
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover {
  color: var(--accent-primary);
  background: var(--bg-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition);
  line-height: 1;
}

.nav-btn-paper {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.nav-btn-paper:hover {
  background: var(--border-light);
  border-color: var(--border-dark);
}

.nav-btn-code {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
}

.nav-btn-code:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}

/* Mobile Navigation Hamburger Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.nav-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Drawer Dropdown */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.5rem 1.25rem;
  z-index: 99;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.mobile-nav-drawer.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.mobile-nav-link:hover, .mobile-nav-link:active {
  background: var(--bg-hover);
  color: var(--accent-primary);
}

.mobile-nav-link i {
  width: 18px;
  color: var(--text-muted);
}

.mobile-nav-link:hover i {
  color: var(--accent-primary);
}

.mobile-nav-github {
  margin-top: 0.5rem;
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 600;
}

.mobile-nav-github i {
  color: #ffffff !important;
}

.mobile-nav-github:hover {
  background: #1e293b !important;
}

/* Header & Hero */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--accent-primary-light);
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  max-width: 1000px;
  margin: 0 auto 1.25rem;
}

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

.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 860px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-authors {
  margin-bottom: 2rem;
}

.authors-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.affiliations {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.venue-tag {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  transform: translateY(-1px);
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Academic Key Insights Box */
.takeaway-box {
  background: var(--accent-primary-light);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-top: 2.5rem;
  text-align: left;
}

.takeaway-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.takeaway-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.takeaway-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   TEASER FIGURE SECTION
   ========================================================================== */

.teaser-wrapper {
  margin: 2rem auto 0;
  max-width: 1080px;
}

.teaser-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  text-align: center;
}

.teaser-card:hover {
  box-shadow: var(--shadow-hover);
}

.teaser-image {
  width: 100%;
  max-width: 1020px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.teaser-caption {
  margin-top: 1.25rem;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.65;
  text-align: left;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.teaser-caption strong {
  color: var(--text-primary);
  font-weight: 700;
}

.teaser-caption em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-primary);
}

/* Sections */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-light);
}

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

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2.75rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 0.4rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Academic Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .card {
    padding: 1.25rem 1rem;
  }
}

/* TL;DR 3 Pillars */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}

.pillar-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.pillar-card:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.pillar-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-primary);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.pillar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.pillar-desc {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   NOVEL VIEW PCAS: THUMBNAIL BUTTONS & RECTANGULAR CONTEXT FRAMES
   ========================================================================== */

/* Visual Sequence Selector Grid with Centered Compact RGB Thumbnails */
.sequence-thumbnails-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 auto 1.25rem;
  padding-bottom: 0.25rem;
}

.seq-thumb-btn {
  flex: 0 0 96px;
  width: 96px;
  background: #090d16;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  aspect-ratio: 16 / 10;
}

.seq-thumb-btn:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.seq-thumb-btn.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.38);
}

.seq-thumb-img-wrap {
  width: 100%;
  height: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #000000;
}

.seq-thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.seq-thumb-btn:hover .seq-thumb-img-wrap img {
  transform: scale(1.06);
}

/* Stage Container */
.interactive-stage {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Context Rectangles Grid */
.context-rectangles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.context-frame-rect {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
  cursor: pointer;
}

.context-frame-rect:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.context-rect-img-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  max-height: 58px;
  overflow: hidden;
  background: #000;
}

.context-rect-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.context-rect-label {
  padding: 0.15rem 0.35rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border-light);
}

.context-rect-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.context-rect-badge {
  display: none;
}

/* Two-Column Display: Left = Synthesized PCA Video, Right = Trajectory Canvas */
.stage-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .stage-main-grid {
    grid-template-columns: 1fr;
  }
}

.video-column-card, .trajectory-column-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-subtle);
}

.column-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

.column-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid rgba(29, 78, 216, 0.2);
}

/* Video Player */
.video-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

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

.video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.5rem;
}

.playback-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.playback-btn:hover {
  background: var(--border-light);
}

.speed-select {
  background: var(--bg-hover);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Interactive Trajectory Canvas with Camera Frustum */
.trajectory-canvas-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

#trajectoryCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Continuous Trajectory Scrubber Bar */
.continuous-scrubber-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.scrubber-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.scrubber-status {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.continuous-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-dark);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition);
}

.continuous-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.4);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}

.continuous-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.continuous-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.4);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}

.continuous-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* ==========================================================================
   DAVIS DENSE PCAS: MULTI-ENCODER GENERALITY (DINO HIGHLIGHTED, MAE, SAM)
   ========================================================================== */

.encoder-clarification-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-subtle);
}

.ecb-left {
  flex: 1 1 280px;
  min-width: 0;
}

.ecb-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  background: var(--accent-primary-light);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.6rem;
}

.ecb-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.ecb-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 280px;
  min-width: 0;
}

.ecb-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.ecb-pill small {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.ecb-pill.is-featured {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.1);
}

.ecb-pill.is-featured small {
  color: #2563eb;
  font-weight: 500;
}

.ecb-star {
  color: #2563eb;
  font-size: 1.15rem;
  line-height: 1;
}

/* DAVIS Multi-Teacher Generality Dock (2 Rows of 5 Large Video Thumbnails) */
.davis-selector-dock {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.davis-dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.davis-dock-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.davis-dock-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.02em;
}

.davis-dock-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.davis-dock-badge {
  font-size: 0.70rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.davis-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

@media (max-width: 960px) {
  .davis-selector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 580px) {
  .davis-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.davis-chip {
  background: #090d16;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-subtle);
  aspect-ratio: 16 / 10;
  width: 100%;
}

.davis-chip:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.davis-chip.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4), 0 4px 14px rgba(37, 99, 235, 0.25);
}

.davis-chip-thumb-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.davis-chip-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.28s ease;
}

.davis-chip:hover .davis-chip-thumb {
  transform: scale(1.05);
}

.davis-chip-active-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.62rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.davis-chip.active .davis-chip-active-badge {
  display: flex;
}

.davis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

@media (max-width: 992px) {
  .davis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .davis-grid {
    grid-template-columns: 1fr;
  }
}

.davis-video-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.davis-video-card:hover {
  box-shadow: var(--shadow-card);
}

/* Symmetrical Top Categorization Strips */
.davis-top-strip {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 0.35rem 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strip-neutral {
  background: #f1f5f9;
  color: #475569;
  border-bottom: 1px solid var(--border-light);
}

.strip-featured {
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

.strip-latent {
  background: #f8fafc;
  color: #334155;
  border-bottom: 1px solid var(--border-light);
}

/* Highlight SNAP DINOv3 as Default / Recommended */
.davis-video-card.is-featured {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 6px 20px -2px rgba(29, 78, 216, 0.22);
  transform: translateY(-2px);
}

.davis-video-card.is-featured:hover {
  box-shadow: 0 10px 26px -2px rgba(29, 78, 216, 0.28);
}

.davis-card-header {
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.davis-video-card.is-featured .davis-card-header {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
}

.davis-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.davis-video-card.is-featured .davis-card-title {
  color: #1d4ed8;
  font-size: 0.92rem;
}

.davis-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-featured {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.3);
}

.badge-neutral {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge-rgb {
  background: #0f172a;
  color: #f8fafc;
}

.badge-latent {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.davis-video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

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

.davis-card-footer {
  flex-grow: 1;
  padding: 0.7rem 0.9rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  line-height: 1.45;
}

.davis-video-card.is-featured .davis-card-footer {
  background: #fafcff;
}

/* ==========================================================================
   ROBOTICS RESULTS: INTERACTIVE BAR CHARTS
   ========================================================================== */

.chart-stage {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
  max-width: 860px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .chart-stage {
    padding: 1.25rem 0.85rem;
  }
}

.chart-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

@media (max-width: 640px) {
  .chart-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
}

.chart-task-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .chart-task-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }
}

.chart-task-btn {
  background: #ffffff;
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .chart-task-btn {
    width: 100%;
    text-align: center;
    padding: 0.45rem 0.4rem;
    font-size: 0.78rem;
  }
}

.chart-task-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chart-task-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Bar Chart Legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  padding: 0.55rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .chart-legend {
    gap: 0.5rem 0.75rem;
    font-size: 0.76rem;
    padding: 0.5rem 0.75rem;
  }
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-legend-color {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
}

/* 3 Out-of-Distribution Shift Plots Container */
.robotics-plots-container,
.chart-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  align-items: stretch;
}

@media (max-width: 768px) {
  .robotics-plots-container,
  .chart-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Individual Subplot Card */
.robotics-plot-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.85rem 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.robotics-plot-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.robotics-plot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-light);
}

.robotics-shift-badge {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.robotics-shift-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Plot Body with Grid & Axes */
.robotics-plot-body {
  position: relative;
  height: 200px;
  width: 100%;
}

.robotics-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.robotics-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  border-bottom: 1px dashed rgba(203, 213, 225, 0.7);
}

.robotics-grid-zero {
  border-bottom: 2px solid #94a3b8; /* Solid crisp 0% baseline */
  z-index: 3;
}

.robotics-axis-val {
  position: absolute;
  left: 3px;
  bottom: 2px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1;
}

.robotics-bars-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end; /* All bars grow upwards strictly from the bottom (0% baseline) */
  justify-content: center;
  gap: 8px;
  height: 200px;
  width: 100%;
  padding: 0 6px 0 28px; /* Leave space on left for axis values */
  border-bottom: 2px solid #94a3b8; /* Physically identical to bottom: 0px */
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .robotics-bars-row {
    gap: 12px;
    padding: 0 12px 0 32px;
  }
  .chart-bar-wrap {
    max-width: 44px;
  }
}

.chart-bar-wrap {
  flex: 1;
  max-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.chart-bar-val {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chart-bar-val.is-ours {
  color: var(--text-primary);
  font-weight: 800;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 0px;
  position: relative;
}

.chart-bar.is-ours {
  box-shadow: 0 2px 8px rgba(107, 163, 232, 0.35);
  border: 1.5px solid #4a88db;
  border-bottom: none;
}

.chart-bar:hover {
  opacity: 0.85;
}

/* Callout Box under Chart */
.robotics-insight-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   METHOD ARCHITECTURE & FORMULAS
   ========================================================================== */

.arch-figure {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-subtle);
  text-align: center;
}

.arch-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.math-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  margin: 1rem 0;
  overflow-x: auto;
}

/* ==========================================================================
   BENCHMARK TABLES (PUBLICATION QUALITY)
   ========================================================================== */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
  display: block;
}

.academic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.88rem;
}

.academic-table th, .academic-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.academic-table th:first-child,
.academic-table td:first-child {
  text-align: left;
  padding-left: 0.85rem;
  white-space: nowrap;
}

.academic-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border-dark);
  white-space: nowrap;
  vertical-align: middle;
}

/* Symmetrical and properly sized layout for Table 1 (11 columns) */
.table-point-correspondence {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  table-layout: fixed;
  min-width: 860px;
}

.table-point-correspondence th,
.table-point-correspondence td {
  padding: 0.6rem 0.45rem;
  font-size: 0.88rem;
  text-align: center;
}

.table-point-correspondence th {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.table-point-correspondence th.dataset-header {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-hover);
}

.table-point-correspondence th:first-child,
.table-point-correspondence td:first-child {
  padding-left: 0.85rem;
}

.academic-table tr:hover td {
  background: var(--bg-hover);
}

.academic-table tr.highlight-row td {
  background: var(--accent-primary-light);
  font-weight: 700;
  color: var(--text-primary);
}

.academic-table tr.highlight-row td:first-child {
  border-left: 3px solid var(--accent-primary);
}

.best-metric {
  font-weight: 800;
  color: var(--accent-primary);
}

.supervision-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.supervision-badge.nvs {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.supervision-badge.geom {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.supervision-badge.ours {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

.supervision-badge.mim {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   BIBTEX CITATION
   ========================================================================== */

.bibtex-container {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
}

.bibtex-card {
  position: relative;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.bibtex-code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.bibtex-code code {
  font-family: inherit;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Footer */
.site-footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-subtle);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* ==========================================================================
   TEACHER IMPROVEMENT: INTERACTIVE BAR CHART (SNAP VS TEACHER)
   ========================================================================== */

.teacher-chart-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.teacher-chart-header {
  margin-bottom: 1.5rem;
}

.teacher-chart-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.teacher-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.teacher-btn-group {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.t-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.t-btn:hover {
  color: var(--accent-primary);
}

.t-btn.active {
  background: #ffffff;
  color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.teacher-sub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.teacher-filters-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.t-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.t-pill-btn {
  background: #ffffff;
  border: 1px solid var(--border-dark);
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.t-pill-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.t-pill-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

/* Legend */
.teacher-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.t-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.t-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

/* ── Teacher Chart Stage ─────────────────────────────────────────────── */
.teacher-chart-stage {
  padding: 0.9rem 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

/* 3-Column Card Grid */
.teacher-groups-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  align-items: stretch; /* ensures cards have equal height and aligned baselines */
}

@media (max-width: 960px) {
  .teacher-groups-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Group Card (Standard for SAM & MAE) */
.teacher-group-card {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem 0.65rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.teacher-group-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

/* Featured Group Card (DINOv3 Primary Backbone) */
.teacher-group-card.is-featured-card {
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  border: 1.5px solid #3b82f6;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.09);
}

.teacher-group-card.is-featured-card:hover {
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.16);
}

/* Card Header at the TOP of each card */
.teacher-card-header {
  margin-bottom: 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-light);
}

.teacher-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.teacher-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.01em;
}

.teacher-card-star {
  color: #2563eb;
  font-size: 1rem;
}

.teacher-badge-primary {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
  white-space: nowrap;
}

.teacher-badge-secondary {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

.teacher-badge-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.teacher-badge-threshold {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.teacher-card-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Chart Area inside Card */
.teacher-chart-area {
  position: relative;
  height: 176px;
  width: 100%;
}

/* Background Reference Grid Lines (Restores 0%, 25%, 50%, 75%, 100% vertical scale) */
.teacher-grid-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.teacher-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(203, 213, 225, 0.65);
}

.t-scale-mark {
  position: absolute;
  left: 4px;
  top: -8px;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  font-weight: 600;
  line-height: 1;
  background: rgba(255, 255, 255, 0.8);
  padding: 1px 3px;
  border-radius: 2px;
}

.teacher-group-card.is-featured-card .t-scale-mark {
  background: rgba(240, 247, 255, 0.9);
}

/* Bars Row */
.teacher-bars-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;   /* bars grow upward from baseline */
  justify-content: center;
  gap: 14px;
  height: 176px;
  width: 100%;
  border-bottom: 2px solid #cbd5e1; /* Crisp solid baseline anchored at 0% */
}

.teacher-bar-wrap {
  flex: 0 0 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

.teacher-stacked-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.teacher-stacked-bar:hover {
  filter: brightness(1.06);
}

.teacher-stacked-bar.is-featured {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  border: 1.5px solid #1d4ed8;
  border-bottom: none;
}

.bar-segment-gain {
  width: 100%;
  transition: height 0.4s ease;
  position: relative;
}

.bar-segment-base {
  width: 100%;
  background: #94a3b8;
  border-top: 2px solid #ffffff;
  transition: height 0.4s ease;
}

/* Fixed-Height Gain Badges Row Pinned Across Top */
.teacher-gain-badges-row {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 3;
}

.teacher-gain-col {
  flex: 0 0 58px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Labels above bar */
.teacher-bar-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3px;
}

/* Floating Delta Tag with generous padding and clean contrast */
.teacher-delta-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.42rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  letter-spacing: 0.01em;
  line-height: 1.15;
  border: 1px solid transparent;
}

.teacher-bar-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  text-align: center;
  line-height: 1.1;
}

/* Sublabels row below baseline */
.teacher-sublabels-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: 5px;
  margin-bottom: 0.2rem;
}

.teacher-bar-sublabel {
  flex: 0 0 58px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  font-family: var(--font-mono);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.teacher-bar-sublabel.is-featured {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

/* Card Footer */
.teacher-card-footer {
  display: none;
}

/* Insight Box */
.teacher-insight-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: #eff6ff;
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.86rem;
  color: #1e3a8a;
  line-height: 1.5;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 992px) {
  .nav-menu {
    gap: 0.6rem;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 0.25rem 0.45rem;
  }
}

@media (max-width: 868px) {
  .nav-menu {
    display: none !important;
  }
  .nav-btn {
    padding: 0.45rem 0.6rem;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
  }
  .nav-btn-text {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .hero {
    padding: 3rem 0 2rem;
  }
  .hero-title {
    font-size: 2.1rem;
    line-height: 1.2;
  }
  .hero-subtitle {
    font-size: 1.02rem;
  }
  .action-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }
  .action-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  .table-container {
    margin: 1rem -0.5rem;
    border-radius: var(--radius-sm);
  }
  .academic-table {
    font-size: 0.8rem;
  }
  .academic-table th, .academic-table td {
    padding: 0.45rem 0.35rem;
  }
}

