/* ============================================================
   Attendly AI Harness — Onboarding Tutorial
   Attendly brand — copied 1:1 from attendly-website global.css
   (ink/navy text, hero-blue primary, signature yellow, teal accents,
   Satoshi type). Mobile-first responsive.
   ============================================================ */

/* Satoshi — self-hosted, same files as attendly-website/public/fonts */
@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Regular.woff2') format('woff2'),
       url('fonts/Satoshi-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Medium.woff2') format('woff2'),
       url('fonts/Satoshi-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Bold.woff2') format('woff2'),
       url('fonts/Satoshi-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('fonts/Satoshi-Black.woff2') format('woff2'),
       url('fonts/Satoshi-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- Official Attendly brand tokens (from attendly-website/global.css) ---- */
  --color-ink: #253140;
  --color-mute: #5A6675;
  --color-link: #4680A1;
  --color-attendly-yellow: #FEF272;
  --color-book-blue-light: #BFD9E8;
  --color-book-blue-dark: #4680A1;
  --color-book-hero-blue: #3B7EA1;
  --color-book-hero-bg: #E8F6F6;
  --color-cs-navy: #1B2A4A;
  --color-cs-teal: #0D9488;
  --color-cs-teal-light: #CCFBF1;
  --color-cs-teal-lighter: #F0FDFA;

  /* ---- Semantic aliases used through the deck ---- */
  /* Surfaces */
  --bg: #FFFFFF;
  --bg-soft: var(--color-book-hero-bg);         /* #E8F6F6 — official soft surface */
  --bg-card: #FFFFFF;
  --bg-deep: var(--color-cs-navy);              /* #1B2A4A — navy for code/command blocks */
  --bg-tint-blue: rgba(59, 126, 161, 0.06);     /* hero-blue tint */
  --bg-tint-green: rgba(13, 148, 136, 0.06);    /* teal tint */
  --bg-tint-warm: rgba(254, 242, 114, 0.35);    /* attendly-yellow highlight wash */
  --bg-tint-red: rgba(190, 45, 24, 0.05);
  --bg-tint-purple: rgba(139, 92, 246, 0.06);

  /* Text — Attendly ink + mute */
  --text: var(--color-ink);                     /* #253140 */
  --text-strong: var(--color-cs-navy);          /* #1B2A4A */
  --text-dim: var(--color-mute);                /* #5A6675 */
  --text-faint: #8A96A5;
  --text-on-dark: var(--color-book-hero-bg);    /* #E8F6F6 for inverse contexts */

  /* Accents — mapped to Attendly brand tokens */
  --accent: var(--color-book-hero-blue);        /* #3B7EA1 — primary brand blue */
  --accent-soft: var(--color-link);             /* #4680A1 — link */
  --accent-deep: var(--color-cs-navy);          /* #1B2A4A — navy */
  /* --accent-warm is the legible text/border partner to the pale attendly-yellow.
     The pale #FEF272 remains available via var(--color-attendly-yellow) for
     highlight backgrounds / washes. */
  --accent-warm: #B5850A;                       /* deep amber — legible, yellow-family */
  --accent-warm-ink: #8B6B00;                   /* even deeper for type on yellow fills */
  --accent-green: var(--color-cs-teal);         /* #0D9488 — teal */
  --accent-red: #BE2D18;
  --accent-purple: #8B5CF6;

  /* Lines */
  --border: #E2EBF0;                            /* cool grey */
  --border-strong: var(--color-book-blue-light);/* #BFD9E8 */

  /* Type — Satoshi from Fontshare (the real Attendly font) */
  --font-heading: "Satoshi", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Satoshi", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Menlo", "Monaco", Consolas, monospace;

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(27, 42, 74, 0.05);
  --shadow-md: 0 2px 8px rgba(27, 42, 74, 0.06), 0 1px 2px rgba(27, 42, 74, 0.04);
  --shadow-lg: 0 10px 32px rgba(27, 42, 74, 0.10), 0 2px 6px rgba(27, 42, 74, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;               /* matches attendly-website body size */
  line-height: 1.556;            /* 28 / 18 — matches attendly-website */
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overscroll-behavior: none; }

/* ============================================================
   Top bar — progress + counter + controls
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: rgba(255, 255, 255, 0.92);           /* white, translucent — brand-neutral */
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar .brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand .brand-mark {
  height: 22px;
  width: auto;
  display: block;
}
.topbar .brand .dim {
  color: var(--text-dim);
  font-weight: 500;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 10px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-green));
  transition: width 0.3s ease;
}
.counter {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  min-width: 66px;
  text-align: right;
  font-weight: 500;
}
.topbar button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.topbar button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-tint-blue);
}
.topbar button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ============================================================
   Slides container
   ============================================================ */
.slides {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--bg-soft);
}
.slide {
  position: absolute;
  inset: 0;
  padding: 48px 56px 80px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s 0.35s;
  overflow-y: auto;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.slide.prev {
  transform: translateX(-30px);
}

/* Typography */
.slide h1 { font-size: 52px; font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; color: var(--text-strong); }
.slide h2 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.018em;
  color: var(--text-strong);
}
.slide h3 { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: var(--text-strong); letter-spacing: -0.01em; }
.slide h4 { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.slide h5 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.slide .lead { font-size: 19px; color: var(--text-dim); margin-bottom: 32px; font-weight: 400; line-height: 1.5; }
.slide code, .slide .mono { font-family: var(--font-mono); font-size: 14px; }

/* Layout — 60/40 split visual + narration */
.slide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 40px;
  height: 100%;
  align-items: start;
}
@media (max-width: 1024px) {
  .slide-layout { grid-template-columns: 1fr; gap: 28px; height: auto; min-height: 100%; }
  .narration { position: static !important; }
}

.visual { min-height: 0; }

.narration {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
  position: sticky;
  top: 0;
  box-shadow: var(--shadow-md);
}
.narration h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 700;
}
.narration p { margin-bottom: 12px; color: var(--text-dim); font-size: 15.5px; }
.narration p:last-child { margin-bottom: 0; }
.narration p strong { color: var(--text-strong); font-weight: 700; }
.narration p em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}
.narration code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--accent-deep);
}

/* ============================================================
   Reusable components
   ============================================================ */

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card.blue   { border-color: var(--accent);        background: linear-gradient(to bottom, var(--bg-tint-blue),   var(--bg-card)); }
.card.green  { border-color: var(--accent-green);  background: linear-gradient(to bottom, var(--bg-tint-green),  var(--bg-card)); }
.card.warm   { border-color: var(--accent-warm);   background: linear-gradient(to bottom, var(--bg-tint-warm),   var(--bg-card)); }
.card.red    { border-color: var(--accent-red);    background: linear-gradient(to bottom, var(--bg-tint-red),    var(--bg-card)); }
.card.purple { border-color: var(--accent-purple); background: linear-gradient(to bottom, var(--bg-tint-purple), var(--bg-card)); }

.card p { color: var(--text-dim); font-size: 15px; line-height: 1.55; }

.card-stack {
  display: grid;
  gap: 18px;
}
.card-stack.row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.card-stack.cols-2 { grid-template-columns: 1fr 1fr; }
.card-stack.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-stack.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Chips */
.chip {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--accent-warm);
  color: var(--accent-warm);
  border-radius: 22px;
  margin: 5px 6px 0 0;
  background: var(--bg-tint-warm);
}
.chip.blue  { border-color: var(--accent);       color: var(--accent);       background: var(--bg-tint-blue); }
.chip.green { border-color: var(--accent-green); color: var(--accent-green); background: var(--bg-tint-green); }

/* Command block (warm dark on light bg for contrast) */
.cmd-block {
  background: var(--bg-deep);
  border: 1px solid var(--bg-deep);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--color-attendly-yellow);   /* yellow on navy — Attendly signature contrast */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
}
.cmd-block .cmd-text { flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd-block .copy-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #CBD5E1;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cmd-block .copy-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}
.cmd-block .copy-btn.copied {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

/* Numbered step (install slide) */
.numbered-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.numbered-step.blue { border-color: var(--accent); }
.numbered-step.green { border-color: var(--accent-green); }
.numbered-step.warm { border-color: var(--accent-warm); }
.step-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  background: var(--accent);
  color: white;
}
.numbered-step.green .step-badge { background: var(--accent-green); }
.numbered-step.warm .step-badge { background: var(--accent-warm); }
.step-body h4 { margin-bottom: 10px; font-size: 17px; color: var(--text-strong); }
.step-body .step-desc {
  font-size: 14.5px;
  color: var(--text-dim);
  margin-top: 10px;
  font-style: italic;
  line-height: 1.55;
}

/* Validator / subagent cards */
.validator {
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.validator h4 { font-size: 16px; margin-bottom: 14px; color: var(--text-strong); }
.validator ul { list-style: none; font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); text-align: left; padding-left: 8px; }
.validator ul li { padding: 4px 0; }
.validator .score {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-top: 14px;
  font-weight: 600;
}

/* Tree structure (openspec folder) */
.tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 2.1;
  box-shadow: var(--shadow-sm);
}
.tree .tree-root { color: var(--accent); font-weight: 700; }
.tree .tree-folder { color: var(--accent-green); font-weight: 600; }
.tree .tree-file { color: var(--text); }
.tree .tree-desc {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}

/* Subagent row */
.subagent-row {
  display: grid;
  grid-template-columns: 230px 110px 1fr;
  gap: 20px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
}
.subagent-row.purple { border-color: var(--accent-purple); }
.subagent-row.warm { border-color: var(--accent-warm); }
.subagent-row .name { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.subagent-row.purple .name { color: var(--accent-purple); }
.subagent-row.warm .name { color: var(--accent-warm); }
.subagent-row .phase {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.subagent-row .axes { font-size: 14px; color: var(--text-dim); }

/* Flow diagram (horizontal chain of cards) */
.flow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 16px 0 22px;
}
.flow .flow-node {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  min-width: 105px;
  text-align: center;
  color: var(--text);
  position: relative;
  box-shadow: var(--shadow-sm);
}
.flow .flow-node.green { border-color: var(--accent-green); }
.flow .flow-node.warm { border-color: var(--accent-warm); }
.flow .flow-node.purple { border-color: var(--accent-purple); color: var(--accent-purple); font-weight: 600; }

/* Human-intervention markers */
.flow .flow-node.human {
  background: linear-gradient(to bottom, var(--bg-tint-blue), var(--bg-card));
  border-width: 2.5px;
}
.flow .flow-node.human::before {
  content: '👤';
  position: absolute;
  top: -10px;
  right: -8px;
  background: var(--accent);
  color: white;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.flow .arrow {
  align-self: center;
  font-size: 16px;
  color: var(--text-faint);
  font-weight: 600;
}

.flow-legend {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-dim);
}
.flow-legend .leg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flow-legend .leg .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.flow-legend .leg .dot.human { background: var(--accent); color: white; }
.flow-legend .leg .dot.auto { background: var(--bg-soft); border: 1.5px solid var(--border-strong); }

/* PR lifecycle vertical timeline */
.timeline { position: relative; padding-left: 48px; }
.timeline::before {
  content: ''; position: absolute; left: 19px; top: 26px; bottom: 26px;
  width: 2.5px; background: var(--accent-green);
}
.timeline .step {
  position: relative;
  margin-bottom: 18px;
}
.timeline .step::before {
  content: attr(data-num);
  position: absolute;
  left: -48px; top: 0;
  width: 40px; height: 40px;
  background: var(--accent-green);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.timeline .step h4 { font-size: 17px; margin-bottom: 6px; color: var(--text-strong); }
.timeline .step p { font-size: 15px; color: var(--text-dim); }

/* Callout box */
.callout {
  background: var(--bg-card);
  border: 2px solid var(--accent-warm);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.callout.red { border-color: var(--accent-red); }
.callout.green { border-color: var(--accent-green); }
.callout.blue { border-color: var(--accent); }
.callout h4 { margin-bottom: 10px; color: var(--accent-warm); font-size: 16px; font-weight: 700; }
.callout.red h4 { color: var(--accent-red); }
.callout.green h4 { color: var(--accent-green); }
.callout.blue h4 { color: var(--accent); }
.callout p, .callout li { font-size: 15px; color: var(--text); line-height: 1.55; }
.callout ul { padding-left: 22px; margin-top: 8px; }
.callout ul li { margin-bottom: 6px; }
.callout p + p { margin-top: 10px; }

/* Lists in visuals */
.bullet-list { list-style: none; }
.bullet-list li {
  padding: 5px 0;
  color: var(--text-dim);
  font-size: 15px;
  display: flex;
  gap: 10px;
  line-height: 1.55;
}
.bullet-list li::before {
  content: '·';
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

/* Ralph loop */
.ralph {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin: 26px 0;
}
.ralph-cycle {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ralph-step {
  padding: 16px 20px;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-green);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.ralph-step h5 { font-size: 16px; margin-bottom: 4px; color: var(--text-strong); }
.ralph-step p { font-size: 14px; color: var(--text-dim); }

/* Checklist */
.checklist li {
  padding: 7px 0;
  font-size: 15px;
  color: var(--text);
}
.checklist li::before {
  content: '☐ ';
  color: var(--text-faint);
  margin-right: 8px;
  font-weight: 600;
}

/* Cheat sheet */
.cheat-group {
  margin-bottom: 22px;
}
.cheat-group h5 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 700;
}
.cheat-group h5.green { color: var(--accent-green); }
.cheat-group h5.warm { color: var(--accent-warm); }
.cheat-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 8px 0;
  font-size: 15.5px;
  border-bottom: 1px dashed transparent;
}
.cheat-row code {
  color: var(--text-strong);
  font-size: 15px;
  font-family: var(--font-mono);
  font-weight: 700;
}
.cheat-row .desc { color: var(--text-dim); }
.cheat-row .phase-tag {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  margin-left: 8px;
}
.cheat-row .phase-tag.manual { color: var(--text-faint); }

/* ============================================================
   Slide nav arrows
   ============================================================ */
.nav {
  position: fixed;
  bottom: 24px;
  right: 28px;
  display: flex;
  gap: 10px;
  z-index: 100;
}
.nav button {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-md);
}
.nav button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tint-blue);
}
.nav button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================
   TOC overlay
   ============================================================ */
.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 40px;
}
.toc-overlay.visible { display: flex; }
.toc-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.toc-content h2 {
  margin-bottom: 24px;
  color: var(--accent);
  font-size: 28px;
}
.toc-content ol {
  list-style: none;
  counter-reset: toc-counter;
}
.toc-content ol li {
  counter-increment: toc-counter;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 15.5px;
}
.toc-content ol li:hover {
  background: var(--bg-tint-blue);
  color: var(--accent);
}
.toc-content ol li.current {
  background: var(--bg-tint-blue);
  color: var(--accent);
  font-weight: 600;
}
.toc-content ol li::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 600;
}
.toc-phase {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 500;
}

/* ============================================================
   Title slide
   ============================================================ */
.slide-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding-left: 96px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.slide-title .eyebrow {
  color: var(--accent);
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.slide-title .title-wordmark {
  height: 56px;
  width: auto;
  margin-bottom: 20px;
  display: block;
}
.slide-title h1 {
  font-size: 108px;
  font-weight: 900;
  line-height: 0.95;
  margin-bottom: 24px;
  letter-spacing: -0.035em;
  color: var(--text-strong);
}
.slide-title .sub {
  color: var(--text-dim);
  font-size: 22px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.slide-title .accent-bar {
  width: 96px;
  height: 4px;
  background: var(--accent);
  margin-top: 34px;
  border-radius: 3px;
}

/* ============================================================
   Outro / brand slide
   ============================================================ */
.slide-outro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  height: 100%;
  text-align: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.brand-logo-img {
  max-width: 560px;
  width: 60%;
  height: auto;
  margin-bottom: 40px;
}
.slide-outro .welcome {
  color: var(--text-dim);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================================
   Responsive — Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .slide { padding: 36px 40px 96px; }
  .slide h1 { font-size: 44px; }
  .slide h2 { font-size: 30px; }
  .slide h3 { font-size: 20px; }
  .slide .lead { font-size: 18px; margin-bottom: 24px; }

  .card-stack.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .card-stack.cols-4 { grid-template-columns: repeat(2, 1fr); }

  .slide-title { padding-left: 48px; }
  .slide-title h1 { font-size: 84px; }
  .slide-title .eyebrow { font-size: 24px; }
  .slide-title .sub { font-size: 20px; }

  .cheat-row { grid-template-columns: 240px 1fr; gap: 16px; }
  .subagent-row { grid-template-columns: 200px 100px 1fr; gap: 14px; }
}

/* ============================================================
   Responsive — Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  html, body { font-size: 16px; }

  /* Topbar — compact */
  .topbar { height: 48px; padding: 0 12px; gap: 8px; }
  .topbar .brand { font-size: 14px; }
  .topbar .brand .dim { display: none; }
  .progress-bar { margin: 0 4px; }
  .counter { font-size: 11px; min-width: 52px; }
  .topbar button {
    padding: 0;
    font-size: 15px;
    width: 36px;
    height: 32px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .topbar button .btn-label { display: none; }

  /* Slide content */
  .slides { top: 48px; }
  .slide {
    padding: 24px 18px calc(96px + env(safe-area-inset-bottom));
    scroll-behavior: smooth;
  }
  .slide h1 { font-size: 32px; }
  .slide h2 { font-size: 24px; }
  .slide h3 { font-size: 18px; }
  .slide h4 { font-size: 16px; }
  .slide .lead { font-size: 16px; margin-bottom: 20px; line-height: 1.45; }

  /* Stack every multi-column grid */
  .card-stack.cols-2,
  .card-stack.cols-3,
  .card-stack.cols-4 {
    grid-template-columns: 1fr;
  }
  .card-stack { gap: 14px; }
  .card { padding: 18px 18px; }

  /* Narration inline, not sticky */
  .narration {
    padding: 18px 18px;
    font-size: 15px;
    box-shadow: var(--shadow-sm);
  }
  .narration h4 { font-size: 11px; margin-bottom: 10px; }
  .narration p { font-size: 15px; }

  /* Title slide — drastically reduced hero */
  .slide-title {
    padding: 32px 22px;
    height: auto;
    min-height: 100%;
    justify-content: center;
  }
  .slide-title .eyebrow { font-size: 18px; }
  .slide-title .title-wordmark { height: 38px; margin-bottom: 14px; }
  .slide-title h1 { font-size: 56px; letter-spacing: -0.03em; margin-bottom: 16px; }
  .slide-title .sub { font-size: 16px; }
  .slide-title .accent-bar { margin-top: 22px; width: 72px; height: 3px; }
  /* Topbar: hide the "AI Harness Onboarding" label next to the logo */
  .topbar .brand .brand-mark { height: 20px; }

  /* Outro */
  .slide-outro { padding: 32px 22px; }
  .brand-logo-img { max-width: 320px; width: 80%; margin-bottom: 28px; }
  .slide-outro .welcome { font-size: 20px; }

  /* Flow — stack vertical, arrows rotate */
  .flow {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .flow .flow-node { min-width: 0; width: 100%; }
  .flow .arrow {
    transform: rotate(90deg);
    align-self: center;
    font-size: 18px;
    height: 18px;
  }
  .flow-legend { flex-wrap: wrap; gap: 14px; font-size: 13px; }

  /* Subagent + cheat rows — stack into blocks */
  .subagent-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 16px;
  }
  .cheat-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
    font-size: 14.5px;
  }
  .cheat-row code { font-size: 14px; word-break: break-word; }

  /* Numbered step — tighten icon */
  .numbered-step {
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 16px 16px;
  }
  .step-badge { width: 40px; height: 40px; font-size: 19px; }

  /* Timeline — tighter */
  .timeline { padding-left: 40px; }
  .timeline::before { left: 15px; }
  .timeline .step::before {
    left: -40px; width: 32px; height: 32px; font-size: 13px;
  }

  /* Ralph loop — stack */
  .ralph { grid-template-columns: 1fr; gap: 16px; }

  /* Callouts */
  .callout { padding: 16px 18px; }

  /* Command block — allow wrap */
  .cmd-block {
    font-size: 13.5px;
    padding: 10px 12px;
    flex-wrap: wrap;
  }
  .cmd-block .cmd-text { white-space: pre-wrap; word-break: break-all; }

  /* TOC overlay — full-screen sheet */
  .toc-overlay { padding: 0; align-items: stretch; }
  .toc-content {
    padding: 24px 20px 40px;
    max-width: none;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .toc-content h2 { font-size: 22px; margin-bottom: 16px; }
  .toc-content ol li { grid-template-columns: 32px 1fr; font-size: 14.5px; padding: 10px 10px; }
  .toc-content ol li .toc-phase { display: none; }

  /* Nav buttons — bottom-center, larger touch targets */
  .nav {
    right: 50%;
    transform: translateX(50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  .nav button {
    width: 52px; height: 52px;
    font-size: 20px;
    box-shadow: var(--shadow-lg);
  }

  /* Chips — tighter spacing */
  .chip { padding: 5px 10px; font-size: 12px; }

  /* Card stacks in Why This Exists & similar can keep a little breathing space */
  .card-stack.row { grid-auto-flow: row; grid-auto-columns: 1fr; }
}

/* ============================================================
   Responsive — Small mobile (≤ 420px)
   ============================================================ */
@media (max-width: 420px) {
  .topbar { height: 46px; padding: 0 10px; gap: 6px; }
  .topbar .brand { font-size: 13px; }
  .slides { top: 46px; }
  .slide { padding: 20px 14px 92px; }

  .slide h1 { font-size: 26px; }
  .slide h2 { font-size: 22px; }
  .slide h3 { font-size: 17px; }
  .slide .lead { font-size: 15px; }

  .slide-title h1 { font-size: 44px; }
  .slide-title .eyebrow { font-size: 16px; }

  .brand-logo-img { max-width: 260px; }
  .slide-outro .welcome { font-size: 18px; }

  .nav button { width: 48px; height: 48px; font-size: 18px; }
}

/* ============================================================
   Accessibility — respect reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .slide { transition: none !important; }
  .progress-fill { transition: none !important; }
}
