/* =============================================================
   DESIGN TOKENS
   ============================================================= */

:root {
  /* Color */
  --bg:             #0b0b0a;
  --bg-closing:     #111110;
  --fg:             #ede9e0;
  --fg-muted:       rgba(237, 233, 224, 0.65);
  --fg-subtle:      rgba(237, 233, 224, 0.3);
  --divider:        rgba(237, 233, 224, 0.15);
  --divider-strong: rgba(237, 233, 224, 0.25);
  --focus:          #5b8cf8;

  /* Typography */
  --font: Inter, 'Helvetica Neue', Arial, sans-serif;

  --t-eyebrow: 0.6875rem;   /* 11px */
  --t-body:    1rem;
  --t-sub:     1.25rem;
  --t-h:       clamp(2rem, 5vw, 3.75rem);
  --t-hero:    clamp(2.75rem, 7.5vw, 6.25rem);
  --t-quote:   clamp(1.625rem, 3.5vw, 2.875rem);

  --ls-eyebrow: 0.15em;
  --lh-tight:   1.04;
  --lh-body:    1.65;

  /* Layout */
  --nav-h:   52px;
  --notes-h: 184px;
  --pad-x:   clamp(1.5rem, 8vw, 7rem);
  --pad-y:   clamp(4rem, 10vh, 8rem);
  --max-w:   1200px;
  --gap:     clamp(2.5rem, 6vw, 5rem);
}


/* =============================================================
   RESET
   ============================================================= */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  scroll-snap-type: y mandatory;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}


/* =============================================================
   UTILITY
   ============================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =============================================================
   SKIP LINK
   ============================================================= */

.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: #fff;
  color: #000;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-100%);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
}


/* =============================================================
   TOP NAV
   ============================================================= */

.top-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: rgba(11, 11, 10, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--divider);
}

.section-counter {
  font-family: var(--font);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.notes-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.8rem;
  background: transparent;
  border: 1px solid var(--divider-strong);
  color: var(--fg-muted);
  font-family: var(--font);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.notes-btn:hover,
.notes-btn[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--fg-muted);
}

.notes-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.notes-btn kbd {
  font-family: var(--font);
  font-size: 0.625rem;
  padding: 0.1em 0.35em;
  background: var(--divider);
  border: 1px solid var(--divider-strong);
  border-radius: 2px;
  color: var(--fg-subtle);
}


/* =============================================================
   BOTTOM BAR
   ============================================================= */

.bottom-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: rgba(11, 11, 10, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--divider);
}

.bottom-bar__title {
  font-family: var(--font);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-bar__logo {
  height: 1.25rem;
  width: auto;
  opacity: 0.65;
  flex-shrink: 0;
  margin-inline-start: 1rem;
}


/* =============================================================
   PROGRESS BAR
   ============================================================= */

.progress-bar {
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  z-index: 200;
  height: 1px;
  background: var(--divider);
}

.progress-fill {
  height: 100%;
  background: var(--fg-muted);
  width: 0%;
  transition: width 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}


/* =============================================================
   MAIN + SLIDES
   ============================================================= */

main {
  padding-top: var(--nav-h);
  padding-bottom: var(--nav-h);
}

/* When notes panel is open, keep content above it (notes panel + bottom bar) */
.notes-open main {
  padding-bottom: calc(var(--notes-h) + var(--nav-h));
}

.slide {
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad-y) var(--pad-x);
  border-bottom: 1px solid var(--divider);
  position: relative;
}

.slide__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}


/* =============================================================
   TYPE ATOMS
   ============================================================= */

.eyebrow {
  display: block;
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.headline {
  font-size: var(--t-h);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.04em;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.subhead {
  font-size: var(--t-sub);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--fg-muted);
  max-width: 58ch;
}

.caption {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--divider);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}


/* =============================================================
   IMAGE BLOCK
   ============================================================= */

.image-block {
  width: 100%;
}

.image-block img {
  width: 100%;
  height: auto;
}

.image-block--placeholder {
  aspect-ratio: 16 / 9;
}

.image-block--animated {
  position: relative;
  display: block;
}

.anim-toggle {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(11, 11, 10, 0.80);
  border: 1px solid var(--divider-strong);
  color: var(--fg);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s;
}

.anim-toggle:hover {
  background: rgba(11, 11, 10, 0.95);
  border-color: var(--fg-muted);
}

.anim-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.image-block--placeholder {
  background: var(--divider);
  border: 1px solid var(--divider-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-block__label {
  font-size: var(--t-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: center;
  padding: 1rem;
}


/* =============================================================
   LAYOUT — IMAGE FULL
   ============================================================= */

.slide--image-full {
  padding: 0;
}

.slide--image-full .slide__inner {
  max-width: none;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide--image-full .image-block {
  width: 100%;
  height: 100%;
}

.slide--image-full .image-block img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* =============================================================
   LAYOUT — HERO
   ============================================================= */

.slide--hero .slide__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.slide--hero .eyebrow {
  margin-bottom: 2.5rem;
}

.slide--hero .headline {
  font-size: var(--t-hero);
  max-width: 20ch;
}

.slide--hero .subhead {
  max-width: 50ch;
}


/* =============================================================
   LAYOUT — TEXT-IMAGE & IMAGE-TEXT
   ============================================================= */

.slide--text-image .slide__inner,
.slide--image-text .slide__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--gap);
}

/* image-text: image is first in DOM (stays left at desktop).
   At mobile we reorder so text reads before image. */


/* =============================================================
   LAYOUT — QUOTE
   ============================================================= */

.slide--quote .slide__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
}

.slide--quote .eyebrow {
  margin-bottom: 3rem;
}

.quote-mark {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 7rem;
  line-height: 0.6;
  color: var(--divider-strong);
  margin-bottom: 2.25rem;
}

.slide--quote .headline {
  font-size: var(--t-quote);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.3;
  max-width: 26ch;
  margin-bottom: 2rem;
}

.slide--quote .subhead {
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-style: normal;
  max-width: none;
}


/* =============================================================
   LAYOUT — PIPELINE
   ============================================================= */

.slide--pipeline .slide__inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.slide--pipeline .headline {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 0;
}

.pipeline {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.75rem;
  padding: 0;
}

.pipeline__step {
  display: flex;
  align-items: center;
}

/* Arrow between steps */
.pipeline__arrow {
  height: 1.5rem;
  width: auto;
  margin: 0 0.75rem;
  opacity: 0.5;
  flex-shrink: 0;
}

.pipeline__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9.5rem;
  height: 9.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--fg-muted);
  border: 1px solid var(--divider-strong);
  white-space: nowrap;
  line-height: 1.2;
  transition: color 0.15s, border-color 0.15s;
}

/* Highlighted step — the one being called out on this slide */
.pipeline__step--highlight .pipeline__label {
  color: var(--bg);
  border-color: var(--fg);
  background: var(--fg);
}


/* =============================================================
   LAYOUT — CHECKLIST
   ============================================================= */

.slide--checklist .slide__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4rem;
}

.slide--checklist .headline {
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  text-align: left;
  flex: 2;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.checklist__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--fg-muted);
}

.checklist__box {
  width: 0.9rem;
  height: 0.9rem;
  border: 1.5px solid var(--fg-subtle);
  flex-shrink: 0;
}

.checklist__item--afterthought {
  margin-top: 1.25rem;
  color: var(--fg);
}

.checklist__item--afterthought .checklist__box {
  border-color: var(--fg-muted);
}


/* =============================================================
   LAYOUT — AGENDA
   ============================================================= */

.slide--agenda .slide__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3rem;
}

.slide--agenda .headline {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
}

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.agenda-tile {
  border: 1px solid var(--divider-strong);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.agenda-tile__number {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--fg-subtle);
  line-height: 1;
}

.agenda-tile__label {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  color: var(--fg);
  line-height: 1.3;
}


/* =============================================================
   LAYOUT — COMPARISON
   ============================================================= */

.slide--comparison .slide__inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.slide--comparison .headline {
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}

.comparison-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--divider-strong);
  border: 1px solid var(--divider-strong);
}

.comparison-panel {
  background: var(--bg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comparison-panel__label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-muted);
}


/* =============================================================
   LAYOUT — CARD GRID
   ============================================================= */

.slide--card-grid .slide__inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.slide--card-grid .slide__header .headline {
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--divider-strong);
  border: 1px solid var(--divider-strong);
}

.card {
  background: var(--bg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.card__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.card__body {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: var(--lh-body);
}


/* =============================================================
   LAYOUT — CLOSING
   ============================================================= */

.slide--closing {
  background: var(--bg-closing);
}

.slide--closing .slide__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.slide--closing .eyebrow {
  margin-bottom: 2rem;
}

.slide--closing .headline {
  font-size: var(--t-hero);
  max-width: 20ch;
  margin-bottom: 1.5rem;
}

.slide--closing .subhead {
  max-width: 50ch;
}

.closing-rule {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--fg-muted);
  margin: 2.5rem auto 0;
}


/* =============================================================
   SPEAKER NOTES PANEL
   ============================================================= */

.speaker-notes-panel {
  position: fixed;
  inset: auto 0 var(--nav-h) 0;
  z-index: 200;
  height: var(--notes-h);
  background: rgba(5, 5, 5, 0.97);
  border-top: 1px solid var(--divider-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.speaker-notes-panel[hidden] {
  display: none;
}

.speaker-notes-panel__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem var(--pad-x);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.speaker-notes-panel__label {
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-subtle);
  flex-shrink: 0;
}

.speaker-notes-panel__text {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: var(--lh-body);
  overflow-y: auto;
}


/* =============================================================
   FOCUS STATES
   ============================================================= */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}


/* =============================================================
   LAYOUT — SOURCES
   ============================================================= */

.slide--sources .slide__inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.source-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  max-width: 900px;
}

.source-item {
  border-top: 1px solid var(--divider);
  padding: 1.25rem 0;
}

.source-item:last-child {
  border-bottom: 1px solid var(--divider);
}

.source-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em;
  font-size: var(--t-sub);
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s;
}

a.source-link:hover {
  color: var(--fg-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.source-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.source-by {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  font-weight: 400;
}


/* =============================================================
   LAYOUT — HEADLINE + IMAGE (stacked)
   ============================================================= */

.slide--headline-image .slide__inner {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.slide--headline-image .slide__header .headline {
  font-size: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: 0.75rem;
}

.slide--headline-image .slide__media {
  width: 100%;
}


/* =============================================================
   LAYOUT — SECTION DIVIDER
   ============================================================= */

.slide--section-divider .slide__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.section-divider__number {
  display: block;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.slide--section-divider .headline {
  font-size: var(--t-hero);
  max-width: 22ch;
}

.slide--section-divider .subhead {
  max-width: 50ch;
  margin-top: 1.5rem;
}


/* =============================================================
   LAYOUT — DEFINITION
   ============================================================= */

.slide--definition .slide__inner {
  max-width: 760px;
}

.slide--definition .headline {
  font-size: clamp(3rem, 7vw, 6rem);
  margin-bottom: 0.5rem;
}

.definition__phonetic {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  font-style: normal;
}

.definition__pos {
  font-size: var(--t-sub);
  font-style: italic;
  color: var(--fg-muted);
  margin-bottom: 0;
}

.definition__rule {
  border: none;
  border-top: 1px solid var(--divider-strong);
  margin: 1.5rem 0;
  max-width: 420px;
}

.definition__text {
  font-size: var(--t-sub);
  color: var(--fg-muted);
  line-height: var(--lh-body);
  max-width: 52ch;
}

.definition__num {
  color: var(--fg-muted);
  margin-right: 0.5rem;
}


/* =============================================================
   RESPONSIVE — tablet & mobile
   ============================================================= */

@media (max-width: 760px) {
  /* Stack two-column layouts */
  .slide--text-image .slide__inner,
  .slide--image-text .slide__inner {
    grid-template-columns: 1fr;
  }

  /* image-text: text reads before image on mobile */
  .slide--image-text .slide__text  { order: -1; }
  .slide--image-text .slide__media { order: 0;  }

  /* Stack comparison panels */
  .comparison-panels {
    grid-template-columns: 1fr;
  }

  /* Stack checklist: heading above list */
  .slide--checklist .slide__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .slide--checklist .headline {
    flex: none;
  }

  /* Pipeline: vertical stack with down arrows */
  .pipeline {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline__step {
    flex-direction: column;
    align-items: center;
  }

  .pipeline__label {
    width: 100%;
    height: auto;
    padding: 0.75rem 1rem;
    white-space: normal;
  }

  .pipeline__arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  /* Nav padding */
  .top-nav {
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --pad-x: 1.25rem;
  }

  /* Hide keyboard hint on very small screens */
  .notes-btn kbd {
    display: none;
  }
}

/* Portrait touch devices (phones held upright):
   - Disable snap scrolling so tall slides don't trap content below the fold
   - Let slides be content-height instead of forcing 100dvh
   - Align content to the top instead of centering (avoids gap at top) */
@media (pointer: coarse) and (orientation: portrait) {
  html {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  .slide {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    min-height: 100svh;
    justify-content: flex-start;
    --pad-y: clamp(2rem, 6vh, 4rem);
  }
}

/* =============================================================
   PER-SLIDE OVERRIDES — targeted by slide id, never bleeds
   ============================================================= */

#title .headline,
#nobody-reads .headline {
  font-size: clamp(3.5rem, 10vw, 8rem);
}

#ai-pivot {
  justify-content: center;
}

#ai-pivot .slide__inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-pivot .image-block {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-pivot .image-block img {
  max-height: 65vh;
  max-width: 80%;
  width: auto;
  height: auto;
}


/* =============================================================
   200% ZOOM — browser zoom doubles computed px, clamp handles it
   No fixed-width containers; all layouts use max-width + padding.
   ============================================================= */
