/* ========================================
   TOKENS
   ======================================== */
:root {
  --navy: #1A1A2E;
  --navy-light: #252542;
  --accent: #2E75B6;
  --accent-soft: rgba(46,117,182,0.12);
  --accent-glow: rgba(46,117,182,0.4);
  --paper: #FAFAFA;
  --paper-warm: #F5F5F5;
  --ink-900: #1a1a1a;
  --ink-700: #444;
  --ink-500: #888;
  --ink-400: #aaa;
  --ink-300: #ccc;
  --ink-200: #e0e0e0;
  --white: #fff;
  --white-70: rgba(255,255,255,0.7);
  --white-40: rgba(255,255,255,0.4);
  --white-15: rgba(255,255,255,0.15);
  --white-08: rgba(255,255,255,0.08);

  --font: 'Inter', -apple-system, sans-serif;
  --nav-width: 240px;
  --nav-collapsed: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   RESET
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--ink-900);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
strong { font-weight: 600; }
em { font-style: italic; }

/* ========================================
   NAVIGATION
   ======================================== */
.nav {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--nav-width);
  background: var(--navy);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width 0.4s var(--ease);
  border-right: 1px solid var(--white-15);
}
.nav.collapsed { width: var(--nav-collapsed); }

.nav-toggle {
  background: none;
  border: none;
  color: var(--white-70);
  padding: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.nav-toggle:hover { color: var(--white); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav .icon-close { display: none; }
.nav:not(.collapsed) .icon-close { display: block; }
.nav:not(.collapsed) .icon-menu { display: none; }
.nav.collapsed .icon-close { display: none; }
.nav.collapsed .icon-menu { display: block; }

.nav-items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 24px 0;
  scrollbar-width: none;
}
.nav-items::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--white-40);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s;
  white-space: nowrap;
  border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--white-70); background: var(--white-15); }
.nav-item.active {
  color: var(--white);
  border-left-color: var(--accent);
  background: rgba(46,117,182,0.08);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav.collapsed .nav-item span { opacity: 0; width: 0; overflow: hidden; }
.nav.collapsed .nav-item { padding: 12px 0; justify-content: center; }

/* ========================================
   MAIN / PANELS
   ======================================== */
#main {
  position: fixed;
  left: var(--nav-width);
  top: 0; right: 0; bottom: 0;
  transition: left 0.4s var(--ease);
  overflow: hidden;
  perspective: 1200px;
}
.nav.collapsed ~ #main { left: var(--nav-collapsed); }

.panel {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
  transform: translateY(30px) scale(0.99);
  filter: blur(0px);
  overflow-y: auto;
}
.panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}
.panel.exiting {
  opacity: 0;
  transform: translateY(-15px) scale(0.98);
  filter: blur(4px);
}

.panel.dark { background: var(--navy); color: var(--white); }
.panel.light { background: var(--paper); color: var(--ink-900); }

.panel-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 96px;
  display: flex;
  flex-direction: column;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: var(--nav-width);
  right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease), left 0.4s var(--ease);
  z-index: 99;
}
.nav.collapsed ~ .progress-bar { left: var(--nav-collapsed); }

/* ========================================
   TYPOGRAPHY
   ======================================== */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 24px;
}
.dark .section-label { color: var(--white-40); }

h2 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.lead {
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 800px;
}

.divider {
  width: 64px;
  height: 2px;
  background: var(--ink-900);
  margin-bottom: 40px;
}
.divider.light { background: var(--white-40); }

.accent { color: var(--accent); }
.dim { color: var(--ink-400); font-weight: 400; }
.dark .dim { color: var(--white-40); }
.mono { font-variant-numeric: tabular-nums; }
.highlight { color: var(--accent); font-weight: 600; }
.footnote { font-size: 13px; color: var(--ink-500); margin-top: auto; }
.dark .footnote { color: var(--white-40); }

.insight {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-900);
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--ink-200);
  max-width: 900px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.insight.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   TITLE SLIDE + PARTICLE FIELD
   ======================================== */
.title-layout {
  justify-content: flex-end;
  padding-bottom: 120px;
  position: relative;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.8;
}

.title-content { position: relative; z-index: 1; }
.title-footer { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: lineIn 1s var(--ease) forwards;
  animation-delay: calc(var(--delay) * 0.2s + 0.5s);
}
@keyframes lineIn {
  to { opacity: 1; transform: translateY(0); }
}
.title-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--white-15);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.author { color: var(--white); }

.title-qr {
  position: absolute;
  top: 48px;
  right: 48px;
  z-index: 2;
}
.qr-img {
  width: min(192px, 15vh);
  height: min(192px, 15vh);
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.qr-img:hover { opacity: 1; }

/* ========================================
   CENTER LAYOUT (question, contact)
   ======================================== */
.center-layout {
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Question: typewriter */
.big-question {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 1100px;
}
.big-question .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition: none;
}
.big-question .word.animating {
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.big-question .word.visible {
  opacity: 1;
  transform: translateY(0);
}
.big-question .word.accent-word {
  color: var(--accent);
}

/* Thank you */
/* Trajectory (about slide) */
.trajectory {
  font-family: var(--font);
  font-size: clamp(48px, 5vw, 80px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink-900);
}
.trajectory .arrow {
  color: var(--accent);
  margin: 0 16px;
  font-weight: 400;
}

.thanks {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.contact-info {
  display: grid;
  gap: 8px;
  font-size: 22px;
  font-weight: 400;
  color: var(--white-70);
}
.contact-info a {
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid var(--white-15);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.contact-info a:hover { border-color: var(--accent); }

/* ========================================
   STAT ROW (gap slide)
   ======================================== */
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-top: 64px;
  max-width: 800px;
}
.stat-block {
  border-top: 2px solid var(--ink-900);
  padding-top: 24px;
}
.stat-block.muted { border-top-color: var(--ink-200); }
.stat-number {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: inline;
}
.stat-suffix {
  font-size: 48px;
  font-weight: 500;
  color: var(--ink-400);
  display: inline;
}
.stat-block.muted .stat-number { color: var(--ink-400); }
.stat-label {
  font-size: 16px;
  color: var(--ink-700);
  margin-top: 8px;
}

/* ========================================
   KEY-VALUE GRID (data slide)
   ======================================== */
.kv-grid { display: grid; gap: 0; }
.kv-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink-200);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-10px);
}
.panel.active .kv-row {
  animation: rowIn 0.5s var(--ease) forwards;
}
.panel.active .kv-row:nth-child(1) { animation-delay: 0.1s; }
.panel.active .kv-row:nth-child(2) { animation-delay: 0.15s; }
.panel.active .kv-row:nth-child(3) { animation-delay: 0.2s; }
.panel.active .kv-row:nth-child(4) { animation-delay: 0.25s; }
.panel.active .kv-row:nth-child(5) { animation-delay: 0.3s; }
@keyframes rowIn {
  to { opacity: 1; transform: translateX(0); }
}
.kv-key { font-weight: 600; color: var(--ink-900); }
.kv-val { color: var(--ink-700); }

/* ========================================
   VARIABLES
   ======================================== */
.var-section {}
.var-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 16px;
}
.var-dv {
  padding: 20px 24px;
  border: 1px solid var(--ink-200);
  border-radius: 4px;
  background: var(--paper-warm);
}
.var-dv-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 8px;
}
.var-dv-note {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.5;
  max-width: 900px;
}
.var-grid-clean {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}
.var-group {}
.var-group-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink-200);
  margin-bottom: 16px;
}
.var-list-clean {
  display: grid;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-700);
}
.var-composite {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: 4px;
  font-weight: 600;
  color: var(--ink-900);
}

/* ========================================
   MODEL STACK
   ======================================== */
.model-stack { border-top: 1px solid var(--ink-200); }
.model-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ink-200);
  font-size: 18px;
  align-items: baseline;
}
.model-label { font-weight: 600; }
.model-vars { color: var(--ink-700); }
.model-row.focus {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin-left: -20px;
}
.model-row.focus .model-label { color: var(--accent); }
.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: 8px;
}

/* ========================================
   FIGURE LAYOUT
   ======================================== */
.fig-layout { padding: 48px 64px; }
.fig-header { margin-bottom: 16px; }
.fig-header h2 { font-size: 32px; }
.fig-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.fig-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.fig-caption {
  font-size: 14px;
  color: var(--ink-500);
  margin-top: 16px;
  max-width: 1000px;
}
.fig-caption strong { color: var(--ink-700); }

/* ========================================
   DEPLOYMENT CHART
   ======================================== */
.deploy-chart { margin-top: 16px; }
.deploy-legend {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--ink-500);
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.exit { background: var(--accent); }
.dot.no-exit { background: var(--ink-300); }

.deploy-bars { display: grid; gap: 24px; }
.deploy-stage {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  opacity: 0;
  transform: translateX(-10px);
}
.deploy-stage.visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.stage-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  text-align: right;
}
.bar-pair { display: grid; gap: 6px; }
.bar {
  height: 28px;
  border-radius: 3px;
  width: calc(var(--pct) * 1%);
  transition: width 0.8s var(--ease);
  display: flex;
  align-items: center;
  padding-left: 10px;
  min-width: 0;
  overflow: hidden;
}
.bar.exit { background: var(--accent); }
.bar.no-exit { background: var(--ink-300); }
.bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.3s 0.6s;
}
.deploy-stage.visible .bar-val { opacity: 1; }
.bar.no-exit .bar-val { color: var(--ink-700); }

/* ========================================
   FOREST PLOT
   ======================================== */
.forest { margin-top: 16px; position: relative; }
.forest-axis {
  position: relative;
  height: 40px;
  margin-bottom: 8px;
  margin-left: 200px;
  margin-right: 200px;
}
.axis-line {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--ink-200);
}
.axis-ref {
  position: absolute;
  bottom: 0;
  left: var(--pos);
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.axis-ref::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 1px;
  height: 999px;
  background: var(--ink-200);
  z-index: 0;
}
.axis-label-left, .axis-label-right {
  position: absolute;
  bottom: 12px;
  font-size: 10px;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.axis-label-left { left: 0; }
.axis-label-right { right: 0; }

.forest-rows { display: grid; gap: 12px; position: relative; z-index: 1; }
.forest-row {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  gap: 16px;
  align-items: center;
  opacity: 0;
  transform: translateX(-10px);
}
.forest-row.visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.forest-label {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}
.forest-model {
  font-size: 11px;
  color: var(--ink-400);
  margin-left: 4px;
}
.forest-bar {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}
.ci-line {
  position: absolute;
  height: 2px;
  background: var(--ink-400);
  left: 50%;
  width: 0;
  transition: all 0.8s var(--ease-out);
  transform: translateX(-50%);
}
.ci-line.drawn {
  transform: translateX(0);
}
.or-point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-900);
  left: 50%;
  transform: translate(-50%, -20px);
  opacity: 0;
  transition: all 0.5s var(--ease-bounce);
  z-index: 2;
}
.or-point.dropped {
  transform: translate(-50%, 0);
  opacity: 1;
}
.or-point.accent-point {
  background: var(--accent);
  width: 14px;
  height: 14px;
  box-shadow: 0 0 12px var(--accent-glow);
}
.or-point.ns-point { background: var(--ink-300); }
.forest-stat {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.forest-row.visible .forest-stat {
  opacity: 1;
  transform: translateX(0);
}
.p-val { color: var(--ink-500); margin-left: 8px; font-size: 12px; }

/* ========================================
   NULL FINDINGS
   ======================================== */
.null-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 8px;
}
.null-card {
  padding: 32px;
  border: 1px solid var(--ink-200);
  background: var(--paper-warm);
  border-radius: 4px;
}
.null-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 12px;
}
.null-title.struck { text-decoration: line-through; text-decoration-thickness: 1px; }
.null-stat {
  font-size: 14px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.struck-inline {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: var(--ink-400);
}

/* ========================================
   ROBUSTNESS CHART
   ======================================== */
.robust-rows { display: grid; gap: 12px; }
.robust-row {
  display: grid;
  grid-template-columns: 300px 1fr 220px;
  gap: 16px;
  align-items: center;
  opacity: 0;
  transform: translateX(-10px);
}
.robust-row.visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.robust-row.spotlight .robust-label {
  color: var(--accent);
  font-weight: 600;
}
.robust-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  text-align: right;
}
.robust-bar-wrap {
  height: 24px;
  background: var(--paper-warm);
  border-radius: 3px;
  overflow: hidden;
}
.robust-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0;
  transition: width 0.8s var(--ease);
}
.robust-row[data-sig="false"] .robust-bar { background: var(--ink-300); }
.robust-stat {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.robust-row.visible .robust-stat { opacity: 1; }
.p-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}
.p-badge.sig { background: rgba(46,117,182,0.12); color: var(--accent); }
.p-badge.marg { background: rgba(170,170,170,0.15); color: var(--ink-500); }

/* ========================================
   OBSERVATIONS
   ======================================== */
.obs-list { display: grid; gap: 40px; margin-top: 8px; }
.obs {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 24px;
  align-items: baseline;
}
.obs-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.obs-text { font-size: 20px; line-height: 1.5; }
.obs-note {
  display: block;
  font-size: 14px;
  color: var(--ink-500);
  margin-top: 4px;
}

/* ========================================
   LIMITATIONS (with grain)
   ======================================== */
.panel.dark.grain {
  position: relative;
}
.panel.dark.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.limit-list {
  display: grid;
  gap: 20px;
  max-width: 1000px;
  position: relative;
  z-index: 1;
  align-content: start;
}
.limit-list li {
  font-size: 18px;
  line-height: 1.6;
  color: var(--white-70);
  padding-left: 20px;
  position: relative;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.limit-list li.visible {
  opacity: 1;
  transform: translateX(0);
}
.limit-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--white-40);
}

/* ========================================
   FORWARD
   ======================================== */
.forward-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.forward-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.forward-text {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-900);
  margin-bottom: 12px;
}
.forward-note {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.5;
}
.forward-direction {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--ink-900);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-900);
  max-width: 900px;
}

/* ========================================
   BIVARIATE GRID
   ======================================== */
.bivar-grid { display: grid; gap: 8px; }
.bivar-item {
  display: grid;
  grid-template-columns: 280px 1fr 140px;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 4px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.bivar-item.visible { opacity: 1; transform: translateX(0); }
.bivar-item.sig { background: rgba(46,117,182,0.06); }
.bivar-item.ns { background: var(--paper-warm); }
.bivar-item.neutral { background: var(--paper-warm); }
.bivar-name { font-size: 16px; font-weight: 600; color: var(--ink-900); }
.bivar-item.ns .bivar-name { color: var(--ink-500); }
.bivar-result { font-size: 14px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.bivar-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  text-align: center;
}
.bivar-badge.sig { background: rgba(46,117,182,0.15); color: var(--accent); }
.bivar-badge.ns { background: rgba(170,170,170,0.15); color: var(--ink-500); }
.bivar-badge.neutral { background: rgba(170,170,170,0.1); color: var(--ink-400); }

/* ========================================
   MODEL COMPARISON TABLE
   ======================================== */
.model-table { overflow-x: auto; }
.model-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.model-table th, .model-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--ink-200);
}
.model-table th.var-col-th { width: 180px; }
.model-table th.model-col {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: 0.02em;
}
.model-table th.model-col[data-step="2"] { color: var(--accent); }
.th-sub { font-weight: 400; color: var(--ink-400); font-size: 11px; display: block; margin-top: 2px; }
.model-table td.var-name { text-align: left; font-weight: 500; color: var(--ink-700); }
.model-table td.var-name.accent { color: var(--accent); font-weight: 600; }
.model-table td[data-step] {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.model-table td[data-step].visible { opacity: 1; }
.or-sig { font-weight: 600; color: var(--ink-900); }
.or-sig.accent { color: var(--accent); }
.or-marg { color: var(--ink-500); }
.or-ns { color: var(--ink-400); }
.key-row { background: rgba(46,117,182,0.04); }
.fit-row td { font-size: 13px; color: var(--ink-500); border-bottom: none; }
.improve-row td { padding-top: 4px; }
.improve-sig { color: var(--accent); font-weight: 600; }
.improve-ns { color: var(--ink-400); }
.sig-legend {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

/* ========================================
   INDIVIDUAL STAGE TESTS
   ======================================== */
.stage-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.stage-test {
  padding: 20px 16px;
  border: 1px solid var(--ink-200);
  border-radius: 4px;
  background: var(--paper-warm);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.stage-test.visible { opacity: 1; transform: translateY(0); }
.stage-name { font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 8px; }
.stage-or { font-size: 20px; font-weight: 700; color: var(--ink-400); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.stage-p { font-size: 12px; font-variant-numeric: tabular-nums; }
.stage-p.ns { color: var(--ink-400); }
.stage-p.sig { color: var(--accent); font-weight: 600; }
.stage-or.accent { color: var(--accent); }

.stage-vs {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--accent);
  display: flex;
  justify-content: center;
}
.stage-test.composite {
  background: var(--accent-soft);
  border-color: var(--accent);
  padding: 20px 40px;
}
.stage-test.composite .stage-name { color: var(--accent); }

/* ========================================
   NULL FINDINGS (dark variant)
   ======================================== */
.null-card.dark-card {
  background: var(--white-08);
  border-color: var(--white-15);
}
.null-card.dark-card .null-title { color: var(--white-40); }
.null-card.dark-card .null-stat { color: var(--white-40); font-variant-numeric: tabular-nums; }
.null-note { font-size: 13px; color: var(--white-40); margin-top: 8px; line-height: 1.4; }
.light-insight {
  color: var(--white-70) !important;
  border-top-color: var(--white-15) !important;
}
.light-insight strong { color: var(--white); }

/* ========================================
   COMPARE ROW (age gap, breadth)
   ======================================== */
.compare-row {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 64px;
}
.compare-block {
  flex: 1;
  padding-top: 24px;
  position: relative;
}
.compare-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  transition: width 1.2s var(--ease);
}
.compare-block.growing::before { width: 100%; }
.compare-block.muted::before { background: var(--ink-200); }
.compare-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.compare-number {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.compare-number.visible {
  opacity: 1;
  transform: translateY(0);
}
.compare-block.muted .compare-number { color: var(--ink-400); }
.compare-unit {
  font-size: 16px;
  color: var(--ink-700);
  margin-top: 4px;
}
.compare-sub {
  font-size: 13px;
  color: var(--ink-400);
  margin-top: 4px;
}
.compare-vs {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-300);
  flex-shrink: 0;
  margin-top: 40px;
}

/* ========================================
   PREDICTED PROBABILITY CHART
   ======================================== */
.prob-chart {
  flex: 1;
  position: relative;
  min-height: 300px;
}
#probCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.prob-legend {
  display: flex;
  gap: 32px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-500);
}
.prob-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prob-legend-item::before {
  content: '';
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--lc);
}

/* ========================================
   SCREENING GRID (16 tests)
   ======================================== */
.screen-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.screen-card {
  padding: 16px 14px;
  border-radius: 4px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.screen-card.visible { opacity: 1; transform: translateY(0); }
.screen-card.ns {
  background: var(--paper-warm);
  border: 1px solid var(--ink-200);
}
.screen-card.hit {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(46,117,182,0.15);
}
.screen-card.hit .screen-name { color: var(--accent); font-weight: 700; }
.screen-card.hit .screen-p { color: var(--accent); font-weight: 600; }
.screen-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  margin-bottom: 6px;
}
.screen-or {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.screen-p {
  font-size: 12px;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

/* ========================================
   DOMAIN TESTS
   ======================================== */
.domain-stack { display: grid; gap: 12px; }
.domain-row {
  display: grid;
  grid-template-columns: 280px 1fr 120px 140px;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-radius: 4px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.domain-row.visible { opacity: 1; transform: translateX(0); }
.domain-row.ns {
  background: var(--white-08);
  border: 1px solid var(--white-15);
}
.domain-row.hit {
  background: rgba(46,117,182,0.12);
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px rgba(46,117,182,0.15);
}
.domain-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--white-40);
}
.domain-row.hit .domain-name { color: var(--white); }
.domain-vars {
  font-size: 13px;
  color: var(--white-40);
}
.domain-row.hit .domain-vars { color: var(--white-70); }
.domain-result {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--white-40);
  text-align: right;
}
.domain-row.hit .domain-result { color: var(--white); font-weight: 600; }
.domain-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 3px;
  text-align: center;
}
.domain-badge.ns { background: var(--white-08); color: var(--white-40); }
.domain-badge.hit { background: rgba(46,117,182,0.25); color: var(--accent); }

/* ========================================
   AGE PROBLEM DETAIL
   ======================================== */
.age-problem-detail {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  max-width: 900px;
}
.age-point {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-700);
  padding-left: 16px;
  border-left: 2px solid var(--ink-200);
}

/* ========================================
   OUTCOME SLIDE
   ======================================== */
.outcome-rationale { display: grid; gap: 16px; max-width: 900px; margin-bottom: 32px; }
.outcome-point {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-700);
}
.outcome-icon { color: var(--accent); font-size: 8px; padding-top: 10px; }
.outcome-stat {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-900);
  padding-top: 24px;
  border-top: 2px solid var(--ink-200);
  max-width: 900px;
}

/* ========================================
   CONTROL CHOICE SLIDE
   ======================================== */
.control-comparison { display: grid; gap: 20px; margin-top: 24px; max-width: 800px; }
.control-test {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 20px;
  background: var(--navy-card);
  border-radius: 6px;
}
.control-test-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-grey);
  padding-top: 2px;
}
.control-test-detail {
  display: grid;
  gap: 6px;
}
.control-candidate {
  font-size: 15px;
  color: var(--mid-grey);
  line-height: 1.4;
}
.control-candidate.winner {
  color: var(--dark-text);
}
.control-candidate.winner strong {
  color: var(--accent);
}

/* ========================================
   APPROACH SLIDE
   ======================================== */
.approach-content { max-width: 900px; }
.approach-steps { display: grid; gap: 24px; margin-top: 32px; }
.approach-step {
  padding: 20px 24px;
  background: var(--white-08);
  border-left: 3px solid var(--white-15);
  border-radius: 0 4px 4px 0;
}
.approach-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.approach-detail {
  font-size: 16px;
  line-height: 1.6;
  color: var(--white-70);
}

/* ========================================
   FORWARD SELECTION SLIDE
   ======================================== */
.fwd-result { margin-top: 16px; max-width: 900px; }
.fwd-answer {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 32px;
}
.fwd-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.fwd-nearest, .fwd-observation {
  padding: 24px;
  border-radius: 4px;
}
.fwd-nearest {
  background: var(--paper-warm);
  border: 1px solid var(--ink-200);
}
.fwd-observation {
  background: var(--accent-soft);
  border: 1px solid rgba(46,117,182,0.2);
}
.fwd-nearest-label, .fwd-obs-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 12px;
}
.fwd-obs-label { color: var(--accent); }
.fwd-nearest-var {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 4px;
}
.fwd-nearest-stat {
  font-size: 14px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.fwd-obs-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
}

/* ========================================
   FRAMEWORK GRID
   ======================================== */
.framework-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 24px !important; }
.framework-domain {
  padding: 16px;
  border: 1px solid var(--ink-200);
  border-radius: 4px;
  background: var(--paper-warm);
}
.framework-highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.framework-highlight .var-group-header { color: var(--accent); }

/* ========================================
   FORWARD + THANK YOU MERGED
   ======================================== */
.thanks-footer {
  margin-top: auto;
  padding-top: 32px;
  border-top: 2px solid var(--ink-200);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.thanks-inline {
  font-size: 32px !important;
  font-weight: 700;
  margin-bottom: 0 !important;
}
.contact-inline {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--ink-500);
}
.contact-inline a {
  color: var(--ink-700);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-200);
}

/* ========================================
   BIVARIATE MARGINAL STYLE
   ======================================== */
.bivar-item.marg { background: rgba(170,170,170,0.08); }
.bivar-item.marg .bivar-name { color: var(--ink-500); }
.bivar-badge.marg { background: rgba(170,170,170,0.15); color: var(--ink-500); }

/* ========================================
   NULL GRID TRIPLE
   ======================================== */
.null-grid.triple { grid-template-columns: 1fr 1fr 1fr; }

/* ========================================
   RESPONSIVE
   ======================================== */

/* Mobile hamburger (hidden on desktop) */
.mobile-hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  background: rgba(26,26,46,0.85);
  border: 1px solid var(--white-15);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
.mobile-hamburger svg { width: 20px; height: 20px; color: var(--white-70); }

/* Mobile next-slide hint */
.mobile-next-hint {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,26,46,0.9);
  color: var(--white-70);
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
  pointer-events: none;
}
.mobile-next-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* reserved for mobile */

@media (max-width: 1024px) {
  .nav { width: var(--nav-collapsed); }
  .nav .nav-item span { opacity: 0; width: 0; overflow: hidden; }
  .nav .nav-item { padding: 12px 0; justify-content: center; }
  #main { left: var(--nav-collapsed); }
  .progress-bar { left: var(--nav-collapsed); }
  .panel-inner { padding: 48px 40px; }
  .var-grid { grid-template-columns: 1fr; gap: 32px; }
  .qr-img { width: 80px; height: 80px; }
  .title-qr { top: 24px; right: 24px; }
}

/* Mobile: not yet optimised. Desktop/projector presentation only. */
