/* ==========================================================================
   SpeakAct Project Page — Clean Researcher Aesthetic (humiact.fayo.ai + fayo.ai)
   No SaaS marketing fluff, no heavy cards; crisp editorial typography,
   authentic booktabs tables, quiet cobalt honeycomb, and playful pixel strips.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --paper-warm: #faf7f4;
  --surface: #f8f9fb;
  --ink: #111827;
  --ink-body: #2c3440;
  --ink-muted: #5b6472;
  --rule: #e6e7eb;
  --rule-strong: #1f2937;

  /* Signature cobalt from fayo.ai + academic pine + warm Frontier gold */
  --cobalt: #0a3bb5;
  --cobalt-soft: #eef3fc;
  --pine: #0f6b5e;
  --pine-soft: #e8f5f2;
  --rose: #b91c3c;
  --rose-soft: #fdf2f4;
  --gold-bg: #fff6dc;
  --gold-ink: #8a5300;
  --gold-border: #edd38b;

  /* Paper Table 2/3/4 subtle pastel rank tints */
  --rank1: #fff3c4;
  --rank2: #ffe5cc;
  --rank3: #e0eefb;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max-w: 1060px;
  --prose-w: 760px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-body);
  background: var(--bg);
  position: relative;
}

/* Whisper-quiet cobalt honeycomb from fayo.ai behind clean white canvas */
#hex-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

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

a {
  color: var(--cobalt);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Inline blinking cobalt terminal caret (signature fayo.ai motif) */
.terminal-caret {
  display: inline-block;
  width: 0.44em;
  height: 0.92em;
  margin-left: 0.2em;
  vertical-align: -0.1em;
  background: var(--cobalt);
  border-radius: 1px;
  animation: caretBlink 1.12s step-end infinite;
}

@keyframes caretBlink {
  0%, 100% { opacity: 1; }
  52% { opacity: 0; }
}

/* ==========================================================================
   Minimal Sticky Top Bar (fayo.ai cobalt emblem + clean nav links)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fayo-home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  text-decoration: none;
}

.fayo-home-link:hover {
  text-decoration: none;
  color: var(--cobalt);
}

.fayo-logo {
  height: 24px;
  width: auto;
}

.fayo-domain {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.crumb-sep {
  color: #cbd5e1;
  font-size: 14px;
}

.crumb-current {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.crumb-current:hover {
  text-decoration: none;
  color: var(--cobalt);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  font-size: 13.4px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--cobalt);
  text-decoration: none;
}

/* ==========================================================================
   Classic Academic Header & Hero Centerpiece Video
   ========================================================================== */
.hero {
  padding: 44px 0 26px;
}

.paper-title {
  margin: 0 auto 20px;
  max-width: 880px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: clamp(27px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.026em;
  color: var(--ink);
}

.title-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--ink-body);
}

.authors {
  text-align: center;
  margin: 0 auto 14px;
  font-size: 16.2px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 22px;
  row-gap: 4px;
}

.authors sup {
  color: var(--cobalt);
  font-size: 0.72em;
  font-weight: 600;
  margin-left: 1.5px;
}

.author-link {
  color: var(--ink);
  border-bottom: 1px solid #94a3b8;
  padding-bottom: 1px;
}

.author-link:hover {
  color: var(--cobalt);
  border-bottom-color: var(--cobalt);
  text-decoration: none;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  max-width: 900px;
  margin: 0 auto 24px;
  font-size: 14px;
  color: var(--ink-muted);
}

.aff-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.aff-item sup {
  color: var(--cobalt);
  font-weight: 600;
  font-size: 11px;
  margin-right: 1px;
}

.aff-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
}

.aff-logo-honor {
  height: 14px;
}

/* Classic Nerfies-style pills */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-bottom: 30px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7.5px 16px;
  border-radius: 999px;
  font-size: 13.8px;
  font-weight: 500;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #d1d5db;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.link-pill:hover {
  text-decoration: none;
  border-color: var(--cobalt);
  color: var(--cobalt);
  background: var(--cobalt-soft);
}

.link-pill-dark {
  background: #1f242d;
  border-color: #1f242d;
  color: #ffffff;
}

.link-pill-dark:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #ffffff;
}

/* Quiet inline key-facts ribbon (editorial numbers, not SaaS stat boxes) */
.facts-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.72);
}

.fact-cell {
  padding: 11px 14px;
  border-right: 1px solid var(--rule);
  text-align: center;
}

.fact-cell:last-child {
  border-right: none;
}

.fact-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.fact-val.is-cobalt { color: var(--cobalt); }
.fact-val.is-pine { color: var(--pine); }

.fact-lbl {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* Hero Teaser Video & Subtle Reel Switcher */
.teaser-block {
  margin: 0 auto;
}

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

.teaser-frame {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.teaser-frame video {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
}

.teaser-caption-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 11px;
}

.teaser-caption {
  margin: 0;
  font-size: 14.2px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.teaser-caption strong {
  color: var(--ink);
}

.teaser-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.speed-inline {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.rate-btn {
  border: none;
  background: #ffffff;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 8px;
  cursor: pointer;
  border-right: 1px solid var(--rule);
}

.rate-btn:last-child { border-right: none; }

.rate-btn.is-active {
  background: var(--cobalt-soft);
  color: var(--cobalt);
  font-weight: 600;
}

.text-action-btn {
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.text-action-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

/* ==========================================================================
   Clickable Pixel-Art Scene Dividers (humiact.fayo.ai + SpeakAct Robot Arm & Bees)
   ========================================================================== */
.pixel-strip-wrap { width: 100%; }

.pixel-strip {
  --px-s: 0.78;
  --px-y: 0.48;
  --px-hop: -4px;
  position: relative;
  height: 34px;
  margin: 2px 0;
  border-radius: 7px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: 1px solid transparent;
  overflow: hidden;
}

.pixel-strip::before,
.pixel-trail {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  z-index: 1;
  pointer-events: none;
  background: #dce4ee;
  border-radius: 1px;
}

.pixel-strip::before { content: ""; top: 2px; }
.pixel-trail { bottom: 2px; }

.pixel-scene {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.px-item {
  position: absolute;
  left: var(--x, 50%);
  transform: translateX(-50%);
  display: block;
  width: auto;
  height: calc(var(--h, 20px) * var(--px-s));
  overflow: visible;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.px-ground { bottom: 3px; }
.px-air { top: calc(var(--y, 8px) * var(--px-y)); }
.px-mid { bottom: calc(var(--y, 8px) * var(--px-y)); }

@keyframes pxBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.5px; } }
@keyframes pxStride { 0%, 100% { translate: -2px 0; } 50% { translate: 2px -1px; } }
@keyframes pxFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes pxFlutter { 0%, 100% { translate: 0 0; } 50% { translate: 2px -2px; } }
@keyframes pxDrift { 0%, 100% { translate: 0 0; } 50% { translate: -6px 0; } }
@keyframes pxHop { 0% { translate: 0 0; } 40% { translate: 0 var(--px-hop); } 100% { translate: 0 0; } }
@keyframes pxArmWave { 0%, 100% { rotate: 0deg; } 50% { rotate: -14deg; } }
@keyframes pxTentacleSway { 50% { transform: skewX(10deg) scaleY(0.84); } }
@keyframes pxGlow { 50% { opacity: 0.25; } }
@keyframes pxSpark { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.px-bob { animation: pxBob var(--dur, 1.3s) steps(2, end) infinite; animation-delay: var(--del, 0s); }
.px-stride { animation: pxStride var(--dur, 1.1s) steps(2, end) infinite; animation-delay: var(--del, 0s); }
.px-float { animation: pxFloat var(--dur, 2.2s) steps(4, end) infinite; animation-delay: var(--del, 0s); }
.px-flutter { animation: pxFlutter var(--dur, 1.3s) steps(3, end) infinite; animation-delay: var(--del, 0s); }
.px-cloud { animation: pxDrift var(--dur, 10s) steps(6, end) infinite; animation-delay: var(--del, 0s); }
.px-star { animation: pxGlow var(--dur, 2.4s) steps(3, end) infinite; animation-delay: var(--del, 0s); }
.px-arm-wave { animation: pxArmWave 1.2s steps(2, end) infinite; transform-box: fill-box; transform-origin: 20% 90%; }
.px-tentacles { animation: pxTentacleSway 1.2s steps(3, end) infinite; transform-box: fill-box; transform-origin: center top; }
.px-beam { animation: pxGlow 2.2s steps(3, end) infinite; }
.px-spark { animation: pxSpark 1.4s steps(2, end) infinite; }

.pixel-strip.is-hopping .px-char.px-bob { animation: pxHop 0.42s steps(3, end) 1, pxBob var(--dur, 1.3s) steps(2, end) 0.42s infinite; }
.pixel-strip.is-hopping .px-char.px-stride { animation: pxHop 0.42s steps(3, end) 1, pxStride var(--dur, 1.1s) steps(2, end) 0.42s infinite; }
.pixel-strip.is-hopping .px-char.px-float { animation: pxHop 0.42s steps(3, end) 1, pxFloat var(--dur, 2.2s) steps(4, end) 0.42s infinite; }
.pixel-strip.is-hopping .px-char.px-flutter { animation: pxHop 0.42s steps(3, end) 1, pxFlutter var(--dur, 1.3s) steps(3, end) 0.42s infinite; }

/* ==========================================================================
   Content Sections & Academic Typography (with fayo.ai cobalt hex bullet)
   ========================================================================== */
.section {
  padding: 42px 0;
}

.prose-col {
  max-width: var(--prose-w);
  margin: 0 auto;
}

.prose-spaced {
  margin-top: 32px;
}

.section-heading {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Signature cobalt hexagon from fayo.ai */
.section-heading::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 11px;
  height: 13px;
  background: var(--cobalt);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.subsection-heading {
  margin: 0 0 10px;
  font-size: 16.8px;
  font-weight: 600;
  color: var(--ink);
}

.prose-col p,
.tab-prose {
  margin: 0 0 14px;
  font-size: 15.4px;
  line-height: 1.74;
  color: var(--ink-body);
  text-align: justify;
  text-justify: inter-word;
}

.prose-col p:last-child { margin-bottom: 0; }

.prose-col code,
.tab-prose code {
  font-family: var(--font-mono);
  font-size: 12.8px;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}

.section-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 28px;
  margin-bottom: 22px;
}

.section-head-inline > div {
  width: 100%;
}

.section-note {
  margin: 0;
  width: 100%;
  max-width: none;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-muted);
}

.rollout-drawer-bar .section-note {
  width: auto;
  flex: 1 1 360px;
}

/* Minimal Underlined Tabs */
.underline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
}

.u-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 6px 2px 8px;
  font-family: var(--font-sans);
  font-size: 13.6px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.u-tab:hover { color: var(--ink); }

.u-tab.is-active {
  color: var(--cobalt);
  font-weight: 600;
}

.u-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--cobalt);
}

/* ==========================================================================
   Paper Figures (Flat, Crisp, Click-to-Zoom)
   ========================================================================== */
.paper-figure {
  margin: 24px 0 0;
  padding: 0;
}

.paper-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.figure-zoomable img {
  cursor: zoom-in;
  transition: border-color 0.16s ease;
}

.figure-zoomable:hover img {
  border-color: #94a3b8;
}

.paper-figure figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--ink-muted);
}

.paper-figure figcaption strong { color: var(--ink); }

.fig-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.fig-grid-2 .paper-figure { margin-top: 0; }

/* ==========================================================================
   Rollout Video Grid (Clean, Flat, Unobstructed Frames)
   ========================================================================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 20px;
}

.video-item { display: flex; flex-direction: column; }
.video-item.is-hidden { display: none; }

.video-box {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 7px;
  overflow: hidden;
}

.video-box video {
  width: 100%;
  height: auto;
  display: block;
  background: #0d1117;
}

.video-box.is-light-bg video {
  background: #ffffff;
}

.video-info { padding-top: 9px; }

.video-info-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.video-title {
  margin: 0;
  font-size: 14.6px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.video-right-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.video-tag {
  font-family: var(--font-mono);
  font-size: 11.2px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.video-tag.is-pass { color: var(--pine); font-weight: 600; }
.video-tag.is-cobalt { color: var(--cobalt); font-weight: 600; }

.mini-expand {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 0 2px;
  cursor: pointer;
  line-height: 1;
}

.mini-expand:hover { color: var(--cobalt); }

.video-desc {
  margin: 4px 0 0;
  font-size: 13.3px;
  line-height: 1.52;
  color: var(--ink-muted);
}

/* ==========================================================================
   Table 5: Interactive 53-Model Zero-Shot Leaderboard + Scaling Plot
   ========================================================================== */
/* Full-width Interactive 53-Model Scaling Card (clean single panel, zero Table 4 clutter) */
.lb-visual-single {
  margin-bottom: 24px;
}

.scatter-card {
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #ffffff;
  padding: 15px 18px 13px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.scatter-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.scatter-tier-summary {
  font-family: var(--font-mono);
  font-size: 11.4px;
  color: var(--ink-muted);
}

.scatter-tier-summary strong {
  color: var(--ink);
}

.scatter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.scatter-title {
  font-size: 13.8px;
  font-weight: 600;
  color: var(--ink);
}

.scatter-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.scatter-svg-wrap {
  position: relative;
  width: 100%;
  flex: 1;
}

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

.scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 6px;
  font-size: 11.8px;
  color: var(--ink-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
}

.legend-item:hover { background: #f3f4f6; color: var(--ink); }
.legend-item.is-dim { opacity: 0.35; }

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

.scatter-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  min-width: 196px;
  background: rgba(17, 24, 39, 0.95);
  color: #f8fafc;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.8px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  display: none;
}

.scatter-tooltip.is-visible { display: block; }
.scatter-tooltip .tt-name { font-weight: 700; color: #ffffff; font-size: 12.4px; }
.scatter-tooltip .tt-org { color: #cbd5e1; font-size: 11px; margin-bottom: 4px; }
.scatter-tooltip .tt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.lb-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 12px;
}

.lb-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-search {
  width: 220px;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.lb-search:focus {
  outline: none;
  border-color: var(--cobalt);
}

.lb-reset-btn {
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink-muted);
  font-size: 12px;
  padding: 5.5px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.lb-reset-btn:hover {
  border-color: var(--cobalt);
  color: var(--cobalt);
}

/* ==========================================================================
   Authentic Booktabs Academic Tables
   ========================================================================== */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.tab-prose {
  max-width: var(--max-w);
  margin-bottom: 20px;
}

.table-wrap { margin-bottom: 10px; }

.table-caption {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.54;
  color: var(--ink-muted);
}

.table-caption strong { color: var(--ink); }

.table-scroll {
  overflow-x: auto;
  background: #ffffff;
}

.booktabs {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 2px solid var(--rule-strong);
  background: #ffffff;
}

.booktabs th,
.booktabs td {
  padding: 6.5px 8px;
  text-align: center;
  white-space: nowrap;
}

.booktabs thead th {
  font-weight: 600;
  font-size: 12.2px;
  color: var(--ink);
  border-bottom: 1px solid #cbd5e1;
}

.booktabs thead tr.subhead th,
.booktabs thead tr:only-child th {
  border-bottom: 1.2px solid var(--rule-strong);
}

.booktabs th.col-sep,
.booktabs td.col-sep {
  border-left: 1px solid #e2e8f0;
}

.booktabs tbody tr:hover { background: #f8fafc; }

.booktabs .align-left {
  text-align: left;
  padding-left: 8px;
}

.booktabs .align-right {
  text-align: right;
  padding-right: 10px;
}

.booktabs tr.row-ours {
  background: #f3f7fe;
  border-top: 1px solid #d7e2f7;
}

.booktabs tr.row-frontier {
  background: #fffdf5;
}

.booktabs tr.row-frontier:hover {
  background: #fff8e1;
}

.booktabs tr.row-divider td {
  text-align: left;
  padding: 6px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #164478;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid var(--rule);
  background: #f8fafc;
}

.booktabs tr.row-divider .tier-note {
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 6px;
}

.booktabs td.val-ours { color: var(--cobalt); font-weight: 700; }
.booktabs td.val-bold { color: var(--ink); font-weight: 700; }
.booktabs td.val-frontier {
  background: var(--gold-bg);
  color: var(--ink);
  font-weight: 700;
}

.booktabs td.rk1 { background: var(--rank1); font-weight: 700; color: var(--ink); }
.booktabs td.rk2 { background: var(--rank2); font-weight: 600; color: var(--ink); }
.booktabs td.rk3 { background: var(--rank3); font-weight: 500; color: var(--ink); }

.booktabs .val-neg { color: var(--rose); font-weight: 600; }
.booktabs .val-pos { color: var(--pine); font-weight: 700; }
.booktabs .dim { color: var(--ink-muted); font-weight: 400; font-size: 11.6px; }

.chk-yes { color: var(--pine); font-weight: 700; }
.chk-no { color: #c05363; font-weight: 600; }

/* Sortable Table 5 headers */
.booktabs th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.14s ease, background 0.14s ease;
}

.booktabs th.sortable:hover {
  color: var(--cobalt);
  background: #f1f5f9;
}

.booktabs th.sortable.is-sorted {
  color: var(--cobalt);
}

.sort-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  opacity: 0.45;
}

.booktabs th.sortable.is-sorted .sort-arrow {
  opacity: 1;
}

/* Compact fit for 12-column Table 5 so ALL columns show with ZERO right-edge clipping */
#leaderboard .container {
  max-width: 1120px;
}

#table5Leaderboard {
  font-size: 12.2px;
}

#table5Leaderboard th,
#table5Leaderboard td {
  padding: 5.5px 6px;
}

#table5Leaderboard thead th {
  font-size: 11.6px;
}

#table5Leaderboard .align-left {
  padding-left: 6px;
}

#table5Leaderboard .align-right {
  padding-right: 7px;
}

/* Subtle inline bar inside Score S cell */
.score-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 64px;
}

.score-bar-track {
  width: 24px;
  height: 5px;
  border-radius: 3px;
  background: #edf0f5;
  overflow: hidden;
  display: inline-block;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--cobalt);
}

.row-frontier .score-bar-fill { background: #c27803; }
.row-open .score-bar-fill { background: var(--pine); }
.row-text .score-bar-fill { background: #94a3b8; }

.table-footnote {
  margin-top: 8px;
  font-size: 12.2px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ==========================================================================
   Dedicated Swarm Wave & Heartbeat Interactive Orchestration Stage (#swarm)
   ========================================================================== */
.swarm-stage-card {
  border: 1px solid #1e293b;
  border-radius: 9px;
  overflow: hidden;
  background: #060d1b;
  color: #e2e8f0;
  margin-bottom: 24px;
}

.swarm-hud-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 13px 18px;
  background: #091326;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.swarm-wave-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.swarm-wave-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.swarm-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.swarm-wave-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f8fafc;
}

.swarm-wave-detail {
  font-family: var(--font-mono);
  font-size: 11.4px;
  color: #94a3b8;
}

.swarm-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sw-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0e1d36;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 12.2px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sw-btn:hover {
  border-color: #7dd3fc;
  color: #ffffff;
  background: #14284a;
}

.sw-btn-warn {
  border-color: rgba(251, 146, 60, 0.42);
  color: #fdba74;
}

.sw-btn-warn:hover {
  border-color: #fb923c;
  background: rgba(251, 146, 60, 0.15);
  color: #ffedd5;
}

.sw-speed-inline {
  display: inline-flex;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 6px;
  overflow: hidden;
}

.sw-speed-btn {
  border: none;
  background: #0b162b;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 7px;
  cursor: pointer;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.sw-speed-btn:last-child { border-right: none; }

.sw-speed-btn.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  font-weight: 600;
}

.swarm-canvas-wrap {
  position: relative;
  width: 100%;
  height: 440px;
  background: #060d1b;
}

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

.swarm-ecg-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(9, 19, 38, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.32);
  pointer-events: none;
}

.swarm-ecg-label {
  font-family: var(--font-mono);
  font-size: 10.8px;
  font-weight: 600;
  color: #6ee7b7;
  white-space: nowrap;
}

#swarmEcgCanvas {
  width: 82px;
  height: 22px;
  display: block;
}

.swarm-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: #081223;
}

.sw-step {
  padding: 10px 12px;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  transition: background 0.18s ease;
}

.sw-step:last-child { border-right: none; }

.sw-step-kicker {
  font-family: var(--font-mono);
  font-size: 10.8px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

.sw-step-desc {
  margin-top: 2px;
  font-size: 11.8px;
  color: #94a3b8;
  line-height: 1.35;
}

.sw-step.is-active {
  background: rgba(56, 189, 248, 0.11);
  box-shadow: inset 0 2px 0 #38bdf8;
}

.sw-step.is-active[data-sw-step="heartbeat"] {
  background: rgba(52, 211, 153, 0.11);
  box-shadow: inset 0 2px 0 #34d399;
}

.sw-step.is-active[data-sw-step="ret"] {
  background: rgba(45, 212, 191, 0.12);
  box-shadow: inset 0 2px 0 #2dd4bf;
}

.sw-step.is-active[data-sw-step="aggregate"] {
  background: rgba(250, 204, 21, 0.11);
  box-shadow: inset 0 2px 0 #facc15;
}

.sw-step.is-active .sw-step-kicker { color: #f8fafc; }
.sw-step.is-active .sw-step-desc { color: #cbd5e1; }

.swarm-telemetry-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 9px 16px;
  background: #050b17;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-family: var(--font-mono);
  font-size: 11.4px;
  color: #94a3b8;
}

.swarm-telemetry-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.swarm-telemetry-stats strong { color: #e2e8f0; font-weight: 600; }
.swarm-status-line { color: #7dd3fc; }

/* Enlarged breakout showcase container for the two Swarm videos (larger than standard sections for crisp legibility) */
#swarm .container {
  max-width: min(1440px, 96vw);
}

.swarm-video-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 22px;
}

.swarm-video-pair .video-box {
  border-color: #1e293b;
  background: #060d1b;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.swarm-video-pair .video-box video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #060d1b;
}

@media (max-width: 1080px) {
  .swarm-video-pair {
    grid-template-columns: 1fr;
  }
}

/* Clean Collapsible Rollout Drawer (folded by default at page bottom) */
.rollout-drawer {
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.rollout-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  background: var(--surface);
  transition: background 0.15s ease;
}

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

.rollout-drawer summary:hover {
  background: #f1f5f9;
}

.rollout-summary-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.rollout-summary-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cobalt);
  font-weight: 500;
}

.rollout-drawer[open] .rollout-summary-hint::before {
  content: "Collapse ▲";
}

.rollout-drawer:not([open]) .rollout-summary-hint::before {
  content: "Expand 8 clips ▼";
}

.rollout-drawer-body {
  padding: 18px 18px 22px;
  border-top: 1px solid var(--rule);
}

.rollout-drawer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 18px;
}

/* Clean TL;DR callout card */
.tldr-box {
  padding: 16px 20px;
  border-left: 3px solid var(--cobalt);
  background: var(--surface);
  border-radius: 0 7px 7px 0;
  font-size: 15.6px;
  line-height: 1.7;
  color: var(--ink-body);
}

.tldr-box strong {
  color: var(--ink);
}

/* ==========================================================================
   Interactive Action Callout Verbatim Explorer
   ========================================================================== */
.callout-explorer {
  margin-top: 24px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.callout-top {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.callout-top-title {
  font-size: 13.8px;
  font-weight: 600;
  color: var(--ink);
}

.callout-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}

.c-pill {
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 12.2px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.c-pill:hover {
  border-color: var(--cobalt);
  color: var(--ink);
}

.c-pill.is-active {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #ffffff;
}

.callout-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 0;
}

.callout-col {
  padding: 16px 18px;
}

.callout-col + .callout-col {
  border-left: 1px solid var(--rule);
  background: #fcfdff;
}

.callout-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.callout-prompt-box {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  padding: 10px 12px;
  border-left: 3px solid var(--cobalt);
  background: var(--surface);
  border-radius: 0 5px 5px 0;
  margin-bottom: 14px;
}

.callout-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.outcome-chip {
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.outcome-chip.is-pass { border-color: #b7dfd7; background: var(--pine-soft); }
.outcome-chip.is-freeze { border-color: #c5d7f7; background: var(--cobalt-soft); }
.outcome-chip.is-fail { border-color: #f3cbd3; background: var(--rose-soft); }

.outcome-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 2px;
}

.outcome-val {
  font-family: var(--font-mono);
  font-size: 12.2px;
  font-weight: 600;
  color: var(--ink);
}

.callout-terminal {
  font-family: var(--font-mono);
  font-size: 12.3px;
  line-height: 1.62;
  background: #f8fafc;
  border: 1px solid #dbe2ec;
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--ink);
  overflow-x: auto;
}

.term-intent-line {
  display: block;
  padding: 4px 8px;
  margin: -2px -4px 8px;
  border-radius: 4px;
  background: var(--cobalt-soft);
  color: var(--cobalt);
  font-weight: 600;
}

.term-intent-line.is-abstain {
  background: #e0ecff;
  color: #082e94;
}

.term-action-lines {
  color: #475569;
  font-size: 11.6px;
  white-space: pre;
}

.callout-note {
  margin: 10px 0 0;
  font-size: 12.8px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ==========================================================================
   BibTeX & Quiet Footer
   ========================================================================== */
.bib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bib-head .section-heading { margin: 0; }

.bibtex-box {
  margin: 0;
  padding: 16px 18px;
  background: #f8f9fb;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12.6px;
  line-height: 1.65;
  color: var(--ink);
  overflow-x: auto;
}

.footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0;
  font-size: 13.2px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}

.footer-brand:hover { text-decoration: none; color: var(--cobalt); }
.fayo-logo-footer { height: 22px; width: auto; }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.footer-meta a { color: var(--ink-muted); }
.footer-meta a:hover { color: var(--cobalt); }

/* ==========================================================================
   Clean Lightbox Modal (Theater View for Videos & Zoomable Figures)
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.is-open { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.36);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #fafafa;
}

.lightbox-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.lightbox-tag { color: var(--cobalt); font-weight: 600; }
.lightbox-counter { color: var(--ink-muted); }

.lightbox-bar-actions { display: flex; gap: 6px; }

.lb-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.lb-btn:hover { border-color: var(--cobalt); color: var(--cobalt); }
.lb-btn.is-hidden { display: none; }

.lightbox-stage {
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 70vh;
}

.lightbox-stage.is-image {
  background: #ffffff;
  padding: 14px;
}

.lightbox-stage video {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 67vh;
  object-fit: contain;
}

.lightbox-caption-bar {
  padding: 12px 18px 14px;
  border-top: 1px solid var(--rule);
  background: #ffffff;
}

.lightbox-caption-bar h4 {
  margin: 0 0 3px;
  font-size: 14.8px;
  font-weight: 600;
  color: var(--ink);
}

.lightbox-caption-bar p {
  margin: 0;
  font-size: 13.4px;
  line-height: 1.54;
  color: var(--ink-muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .lb-visual-grid,
  .fig-grid-2,
  .callout-body,
  .swarm-video-pair {
    grid-template-columns: 1fr;
  }
  .swarm-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swarm-canvas-wrap {
    height: 360px;
  }
  .callout-col + .callout-col {
    border-left: none;
    border-top: 1px solid var(--rule);
  }
  .facts-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fact-cell:nth-child(2) { border-right: none; }
  .fact-cell:nth-child(1),
  .fact-cell:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .teaser-caption-row {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero { padding: 28px 0 20px; }
  .section { padding: 34px 0; }
  .video-grid { grid-template-columns: 1fr; }
  .prose-col p, .tab-prose { text-align: left; }
  .lb-search { width: 100%; }
}

@media (max-width: 640px) {
  .pixel-strip {
    --px-s: 0.62;
    --px-y: 0.48;
    --px-hop: -3px;
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-strip *, .pixel-strip *::before, .pixel-strip *::after, .terminal-caret {
    animation: none !important;
  }
}

@media print {
  .pixel-strip-wrap, #hex-field, .terminal-caret { display: none !important; }
}
