/* =========================================================
   SlotVTG project page — custom styles
   Modern look on top of Tailwind utility classes.
   ========================================================= */

:root {
  --slot1: #ff6b6b; /* coral - person */
  --slot2: #4ecdc4; /* turquoise - object */
  --slot3: #ffd93d; /* gold - context */
  --slot4: #a78bfa; /* violet - background */
  --ink: #0a0e27;
  --ink2: #11163a;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- NAV ---------------- */
#topnav {
  backdrop-filter: blur(0px);
  background: transparent;
}
#topnav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 1px 0 rgba(10, 14, 39, 0.06);
}
.slot-logo {
  width: 22px;
  height: 22px;
  display: inline-block;
  border-radius: 6px;
  background: conic-gradient(
    from 0deg,
    var(--slot1) 0deg 90deg,
    var(--slot2) 90deg 180deg,
    var(--slot3) 180deg 270deg,
    var(--slot4) 270deg 360deg
  );
  box-shadow: 0 2px 10px rgba(167, 139, 250, 0.4);
}

/* Nav link colors swap based on scroll state for contrast on dark/light bg */
.nav-brand,
.nav-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: #ffd93d;
}
#topnav.scrolled .nav-brand,
#topnav.scrolled .nav-link {
  color: rgba(10, 14, 39, 0.78);
}
#topnav.scrolled .nav-link:hover {
  color: var(--ink);
}

/* ---------------- HERO ---------------- */
.hero-bg-grid {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center top, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center top, black 0%, transparent 75%);
}
.hero-bg-glow {
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(255, 107, 107, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 70% 30%, rgba(78, 205, 196, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 60% at 50% 80%, rgba(167, 139, 250, 0.18), transparent 70%);
  filter: blur(10px);
}

/* Bottom wave: fixed height, sits BELOW content so it never clips text */
.hero-section { padding-bottom: 0; }
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  width: 100%;
  height: 70px;
  display: block;
  pointer-events: none;
  z-index: 1;
}
.hero-tldr {
  position: relative;
  z-index: 20;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.venue-badge-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 217, 61, 0.5);
  transform: translateY(-1px);
}

.hero-grad {
  background: linear-gradient(120deg, #ff6b6b 0%, #ffd93d 40%, #4ecdc4 70%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: grad-shift 6s ease-in-out infinite;
}
@keyframes grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.author-link {
  color: white;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
  transition: border-color 0.2s, color 0.2s;
}
.author-link:hover {
  color: #ffd93d;
  border-bottom-color: #ffd93d;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.36);
  transform: translateY(-2px);
}
.btn-pill[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------- SECTION TITLES ---------------- */
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: rgba(10, 14, 39, 0.5);
  margin-bottom: 8px;
}
section.bg-ink .kicker { color: rgba(255, 255, 255, 0.55); }

.section-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(10, 14, 39, 0.65);
}
section.bg-ink .section-sub { color: rgba(255, 255, 255, 0.7); }

/* ---------------- TEASER SLOT STAGE ---------------- */
.slot-stage {
  position: relative;
  background: radial-gradient(ellipse at top, #fff 0%, #f5f7ff 100%);
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow:
    0 30px 80px -30px rgba(10, 14, 39, 0.18),
    0 0 0 1px rgba(10, 14, 39, 0.02);
  overflow: hidden;
}
#slot-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: linear-gradient(135deg, #fafbff 0%, #f0f2fb 100%);
}

.slot-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
}
/* 5-pill variant used by the hero animation steps */
.slot-steps.slot-steps-5 {
  grid-template-columns: repeat(5, 1fr);
  font-size: 12.5px;
}
.slot-steps.slot-steps-5 .step { padding: 9px 10px; }
.slot-steps .step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 14, 39, 0.04);
  color: rgba(10, 14, 39, 0.55);
  font-weight: 500;
  transition: all 0.4s ease;
  border: 1px solid transparent;
}
.slot-steps .step.active {
  background: white;
  color: var(--ink);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 6px 20px -8px rgba(167, 139, 250, 0.4);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.slot-steps .step.active .step-num {
  background: linear-gradient(135deg, var(--slot1), var(--slot4));
}

.slot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 14px;
  font-size: 13px;
  color: rgba(10, 14, 39, 0.65);
}
.slot-legend em { font-style: normal; color: rgba(10, 14, 39, 0.45); }
.legend-note {
  color: rgba(10, 14, 39, 0.45);
  font-style: italic;
  margin-left: 6px;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-right: -10px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 12px rgba(0, 0, 0, 0.08);
}

/* ---------------- OBSERVATION (paper Fig. 2) ---------------- */
.observation-wrap {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  max-width: 1100px;
  background: #ffffff;
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 40px -22px rgba(10, 14, 39, 0.20);
}
.observation-figure {
  width: 100%;
  height: auto;
  display: block;
  /* Reveal from left to right when scrolled into view — mimics
     each of the four diagnostic panels appearing in sequence. */
  clip-path: inset(0 100% 0 0);
  transition: clip-path 2.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.observation-wrap.in-view .observation-figure {
  clip-path: inset(0 0 0 0);
}

.observation-captions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 38px auto 0;
  max-width: 1100px;
}
@media (max-width: 900px) {
  .observation-captions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .observation-captions { grid-template-columns: 1fr; }
}
.obs-cap {
  background: #f8faff;
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 12px;
  padding: 16px 16px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(10, 14, 39, 0.78);
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.observation-captions.in-view .obs-cap { opacity: 1; transform: none; }
.observation-captions.in-view .obs-cap:nth-child(1) { transition-delay: 0.7s; }
.observation-captions.in-view .obs-cap:nth-child(2) { transition-delay: 1.1s; }
.observation-captions.in-view .obs-cap:nth-child(3) { transition-delay: 1.5s; }
.observation-captions.in-view .obs-cap:nth-child(4) { transition-delay: 1.9s; }
.obs-cap::before {
  content: attr(data-letter);
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--ink);
  color: white;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  font-family: 'Instrument Serif', serif;
  letter-spacing: 0.04em;
}
.obs-cap strong { color: var(--ink); }

/* ---------------- MAINFIGURE (paper Fig. 3) ---------------- */
.mainfigure-wrap {
  margin: 56px auto 0;
  max-width: 1100px;
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 48px -24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.10);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.mainfigure-wrap.in-view {
  opacity: 1;
  transform: none;
}
.mainfigure-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.mainfigure-cap {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(10, 14, 39, 0.62);
  text-align: center;
}
.mainfigure-cap strong { color: var(--ink); }

/* ---------------- METHOD STAGE — 3-col variant ---------------- */
.method-stage.method-stage-3col {
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

/* ---------------- MOTIVATION DIAG CARDS ---------------- */
.diag-card {
  position: relative;
  background: white;
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 6px 24px -12px rgba(10, 14, 39, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.diag-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -16px rgba(10, 14, 39, 0.18);
}
.diag-tag {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  font-weight: 600;
}
.diag-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.diag-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(10, 14, 39, 0.7);
  margin-bottom: 16px;
}
.diag-bar {
  background: rgba(10, 14, 39, 0.06);
  border-radius: 6px;
  height: 26px;
  margin-bottom: 8px;
  overflow: hidden;
}
.diag-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.similarity-track {
  position: relative;
  height: 36px;
  margin: 14px 4px 4px;
}
.track-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #34d399 0%, #f59e0b 50%, #f43f5e 100%);
  transform: translateY(-50%);
}
.dot-similar, .dot-dissimilar {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: white;
  border: 3px solid #34d399;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.4);
}
.dot-similar { left: 8%; }
.dot-dissimilar { left: 92%; border-color: #f43f5e; box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4); }

.perturb-cell {
  background: rgba(10, 14, 39, 0.03);
  border-radius: 12px;
  padding: 14px 16px;
}

.mmd-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mmd-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(10, 14, 39, 0.7);
}
.mmd-bar {
  background: rgba(10, 14, 39, 0.06);
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
}
.mmd-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: white;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}
.mmd-fill-bad { background: linear-gradient(90deg, #fb7185, #ef4444); }
.mmd-fill-good { background: linear-gradient(90deg, #34d399, #10b981); }

/* ---------------- METHOD STAGE ---------------- */
.method-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 28px 20px;
}
@media (max-width: 900px) {
  .method-stage {
    grid-template-columns: 1fr;
  }
  .method-arrow { transform: rotate(90deg); margin: -4px 0; }
}
.method-col {
  text-align: center;
}
.method-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 12px;
  font-weight: 600;
}
.method-caption {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 10px;
}
.method-arrow {
  font-size: 28px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  width: 130px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.token-grid > div {
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
}

.bottleneck {
  width: 50px;
  height: 130px;
  margin: 0 auto;
  background: linear-gradient(
    180deg,
    rgba(255, 107, 107, 0.5) 0%,
    rgba(78, 205, 196, 0.5) 33%,
    rgba(255, 217, 61, 0.5) 66%,
    rgba(167, 139, 250, 0.5) 100%
  );
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.bottleneck::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.slot-orbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 130px;
  margin: 0 auto;
}
.orb {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), var(--c) 60%);
  box-shadow: 0 0 20px var(--c), inset -4px -4px 12px rgba(0, 0, 0, 0.2);
  animation: orb-pulse 2.4s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes orb-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.08); filter: brightness(1.2); }
}

.method-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 28px;
}
.method-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.method-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}
.method-body {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 14px;
}
.method-eq {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--slot2);
  padding: 12px 16px;
  border-radius: 4px;
  color: white;
  font-size: 0.92rem;
  margin-bottom: 14px;
  overflow-x: auto;
}

/* ---------------- TASK PIPELINE STRIP ---------------- */
.task-pipeline-wrap {
  margin-top: 72px;     /* clear breathing room from the method-stage diagram above */
  position: relative;
}
.task-pipeline-wrap::before {
  /* faint divider line above the heading so it's clearly its own section */
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 22px;
}
.task-pipeline-heading {
  text-align: center;
  margin-bottom: 22px;
}
.task-pipeline-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}
.task-pipeline-h {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.01em;
}
.task-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 22px 18px;
}
/* Default: show horizontal arrow, hide vertical */
.task-pipe-arrow .arrow-v { display: none; }
.task-pipe-arrow .arrow-h { display: inline; }
@media (max-width: 900px) {
  .task-pipeline {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 14px;
  }
  /* Use a real down-arrow glyph instead of rotating the right-arrow.
     Rotation can shift the glyph optically inside its grid cell and
     make the arrow appear to "stick" to the next item, which is the
     bug the user was seeing. */
  .task-pipe-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    font-size: 20px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    padding: 0;
  }
  .task-pipe-arrow .arrow-h { display: none; }
  .task-pipe-arrow .arrow-v { display: inline; }
}
.task-pipe-item {
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.task-pipe-item.task-pipe-ours {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.16), rgba(167, 139, 250, 0.16));
  border-color: rgba(78, 205, 196, 0.4);
  box-shadow: 0 0 24px -8px rgba(78, 205, 196, 0.4);
}
.task-pipe-icon {
  font-size: 22px;
  margin-bottom: 8px;
}
.task-pipe-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.task-pipe-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  line-height: 1.4;
}
.task-pipe-arrow {
  color: rgba(255, 255, 255, 0.35);
  font-size: 18px;
}

.param-callout {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(167, 139, 250, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 28px 36px;
  text-align: center;
}
.param-divider {
  width: 1px;
  height: 60px;
  background: rgba(255, 255, 255, 0.18);
}
@media (max-width: 800px) {
  .param-callout { grid-template-columns: 1fr; }
  .param-divider { width: 60px; height: 1px; margin: 0 auto; }
}

/* ---------------- SLOT VISUALIZATION (paper Fig. 4) ---------------- */
.slotviz-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .slotviz-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
.slotviz-fig {
  margin: 0;
  background: white;
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 14px 40px -20px rgba(10, 14, 39, 0.22);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.slotviz-fig.in-view { opacity: 1; transform: none; }
.slotviz-fig img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.slotviz-fig figcaption {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(10, 14, 39, 0.55);
  text-align: center;
}
@media (max-width: 900px) {
  .slotviz-fig {
    max-width: 460px;
    margin: 0 auto;
  }
}

.slotviz-text {
  min-width: 0;
}
.slotviz-h {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 16px;
}
.slotviz-h em {
  font-style: italic;
  color: #4ecdc4;
}
.slotviz-p {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(10, 14, 39, 0.75);
  margin-bottom: 14px;
}
.slotviz-bullets {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.slotviz-bullets li {
  position: relative;
  padding-left: 26px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(10, 14, 39, 0.78);
  margin-bottom: 9px;
}
.bullet-dot {
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 10px rgba(0, 0, 0, 0.06);
}

/* ---------------- SLOT VISUALIZATION GRID (deprecated procedural) ---------------- */
.slot-vis-grid {
  display: grid;
  grid-template-columns: 90px repeat(5, 1fr);
  gap: 10px;
  background: white;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(10, 14, 39, 0.08);
  box-shadow: 0 12px 40px -20px rgba(10, 14, 39, 0.18);
}
.vis-row {
  display: contents;
}
.vis-cell {
  aspect-ratio: 16/9;
  border-radius: 10px;
  background: rgba(10, 14, 39, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: rgba(10, 14, 39, 0.75);
  position: relative;
  overflow: hidden;
}
.vis-cell.vis-label {
  background: transparent;
  color: rgba(10, 14, 39, 0.7);
  font-size: 13px;
}
.vis-row.vis-header .vis-cell {
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(10, 14, 39, 0.55);
}

/* ---------------- RESULTS ---------------- */
.result-card {
  background: linear-gradient(135deg, white 0%, #f8faff 100%);
  border: 1px solid rgba(10, 14, 39, 0.08);
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  box-shadow: 0 8px 30px -16px rgba(10, 14, 39, 0.14);
  transition: transform 0.2s ease;
}
.result-card:hover { transform: translateY(-3px); }
.result-source {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(10, 14, 39, 0.55);
  font-weight: 600;
}
.result-delta {
  font-size: 3.4rem;
  font-weight: 800;
  background: linear-gradient(120deg, #10b981, #4ecdc4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 8px 0;
  letter-spacing: -0.02em;
}
.result-delta-neutral {
  background: linear-gradient(120deg, #6b7280, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-meta {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(10, 14, 39, 0.55);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px -16px rgba(10, 14, 39, 0.14);
}
.results-table th,
.results-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(10, 14, 39, 0.06);
}
.results-table th {
  background: var(--ink);
  color: white;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.results-table tbody tr:nth-child(even) {
  background: rgba(10, 14, 39, 0.025);
}
.results-table tbody tr.row-ours {
  background: linear-gradient(90deg, rgba(78, 205, 196, 0.08), rgba(167, 139, 250, 0.08));
}
.results-table tbody tr.row-ours td {
  font-weight: 600;
}

/* Full results table (paper Table 1) — 15 cols, denser styling */
.results-table-full {
  font-size: 12.5px;
  min-width: 1100px;
}
.results-table-full th,
.results-table-full td {
  padding: 7px 8px;
}
.results-table-full th {
  font-size: 10.5px;
  white-space: nowrap;
}
.results-table-full th.target-group {
  background: linear-gradient(90deg, #1c2150, #11163a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.18em;
  font-size: 11px;
}
.results-table-full td.src-cell {
  font-weight: 700;
  background: rgba(10, 14, 39, 0.04);
  border-right: 1px solid rgba(10, 14, 39, 0.08);
  vertical-align: middle;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.results-table-full tr.group-head td {
  border-top: 2px solid rgba(10, 14, 39, 0.12);
}
.results-table-full td.na {
  color: rgba(10, 14, 39, 0.30);
}
/* Vertical dividers between dataset groups (every 4 cols inside metrics) */
.results-table-full thead th:nth-of-type(2),
.results-table-full thead th:nth-of-type(3),
.results-table-full thead th:nth-of-type(4),
.results-table-full tbody tr td:nth-last-of-type(8),
.results-table-full tbody tr td:nth-last-of-type(4) {
  border-left: 1px solid rgba(10, 14, 39, 0.12);
}

/* ---------------- BIBTEX ---------------- */
.bibtex-card {
  position: relative;
  background: var(--ink);
  color: #e6e9f5;
  border-radius: 14px;
  padding: 26px 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  box-shadow: 0 16px 40px -16px rgba(10, 14, 39, 0.4);
  overflow-x: auto;
}
.bibtex-card pre {
  white-space: pre;
  margin: 0;
}
.bibtex-copy {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease;
  font-family: 'Inter', sans-serif;
}
.bibtex-copy:hover { background: rgba(255, 255, 255, 0.16); }
.bibtex-copy.copied {
  background: rgba(52, 211, 153, 0.3);
  border-color: rgba(52, 211, 153, 0.6);
}

/* ---------------- HELPERS ---------------- */
.text-slot1 { color: var(--slot1); }
.text-slot2 { color: var(--slot2); }
.text-slot3 { color: var(--slot3); }
.text-slot4 { color: var(--slot4); }

/* ---------------- LIGHTBOX (click-to-zoom for figures) ---------------- */
.zoomable {
  cursor: zoom-in;
  transition: filter 0.18s ease, transform 0.18s ease;
}
.zoomable:hover {
  filter: brightness(0.97);
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
  animation: lightbox-fade-in 0.25s ease-out;
}
@keyframes lightbox-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 64px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  cursor: default;
  /* allow native pinch-zoom on touchscreens */
  touch-action: pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
  font-family: 'Inter', sans-serif;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}
@media (max-width: 600px) {
  .lightbox { padding: 12px; }
  .lightbox-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 22px; }
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.footer-link:hover {
  color: #ffd93d;
  text-decoration-color: #ffd93d;
}

/* =========================================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================================= */
@media (max-width: 767px) {
  /* Less padding around the canvas so the animation gets more pixels */
  .slot-stage {
    padding: 12px;
    border-radius: 16px;
  }

  /* Step pills: 5 columns is too cramped — stack into 2 cols, last spans both */
  .slot-steps,
  .slot-steps.slot-steps-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 12px;
  }
  .slot-steps .step {
    padding: 8px 10px;
  }
  .slot-steps.slot-steps-5 .step:last-child {
    grid-column: 1 / -1; /* the LLM → [t_s, t_e] pill spans the full row */
  }
  .step-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  /* Legend wraps on narrow viewports */
  .slot-legend {
    gap: 12px;
    font-size: 12px;
  }
  .legend-note {
    flex-basis: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 4px;
  }

  /* Vis grid: 6-column grid is way too narrow on phones.
     Switch to 1-column rows: each row shows the frame + slots in a horizontal sub-grid. */
  .slot-vis-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 8px;
  }
  .vis-row {
    display: grid;
    grid-template-columns: 70px repeat(5, 1fr);
    gap: 6px;
  }
  .vis-row.vis-header {
    display: none; /* hide the column-header row on mobile to save space */
  }
  .vis-cell {
    font-size: 11px;
  }

  /* Result cards: stack vertically */
  .result-delta {
    font-size: 2.8rem;
  }

  /* Param callout: stacked already via existing @media; tighten spacing */
  .param-callout {
    padding: 22px 18px;
    gap: 16px;
  }

  /* BibTeX card: smaller font + horizontal scroll already enabled */
  .bibtex-card {
    font-size: 0.78rem;
    padding: 18px;
  }

  /* Hero title size */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  /* Make the diagnostic card hover lift not jumpy on touch */
  .diag-card:hover {
    transform: none;
  }
}

