/* AI Roadmap — Cinematic dark experience */
:root {
  --bg: #050608;
  --bg-2: #0a0d12;
  --ink: #e6e9ef;
  --ink-2: #8b94a3;
  --ink-3: #4a5260;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --cyan: #5cf0e2;
  --cyan-dim: #2aa89e;
  --amber: #ffb454;
  --amber-dim: #b87a2a;
  --crimson: #ff4d6d;
  --crimson-dim: #a82a44;
  --violet: #a78bfa;
  --emerald: #4ade80;
  --serif: "Fraunces", "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  --sans: "Inter Tight", "Inter", -apple-system, system-ui, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
}

/* Atmosphere layer — full-screen fixed background that morphs */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: background 1.6s cubic-bezier(.2,.8,.2,1), filter 1.6s;
}

.atmo-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.55) 100%);
}

.atmo-grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Scanlines for cinematic feel */
.atmo-scan {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255,255,255,.012) 2px,
    rgba(255,255,255,.012) 3px
  );
}

/* particles canvas */
#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Tone-specific atmospheres applied via [data-tone] on body */
body[data-tone="neutral"] .atmosphere {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(92,240,226,.08) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(167,139,250,.06) 0%, transparent 45%),
    linear-gradient(180deg, #050608 0%, #0a0d12 100%);
}
body[data-tone="light"] .atmosphere {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(92,240,226,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(255,180,84,.10) 0%, transparent 50%),
    linear-gradient(180deg, #060912 0%, #0c1218 100%);
}
body[data-tone="dark"] .atmosphere,
body[data-tone="twist"] .atmosphere {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,77,109,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 100%, rgba(40,10,15,.5) 0%, transparent 60%),
    linear-gradient(180deg, #060205 0%, #0a0508 100%);
}
body[data-tone="twist"] .atmo-scan {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255,77,109,.025) 2px,
    rgba(255,77,109,.025) 3px
  );
}
body[data-tone="triumph"] .atmosphere {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255,180,84,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(92,240,226,.12) 0%, transparent 50%),
    linear-gradient(180deg, #0a0808 0%, #110a06 100%);
}

/* TOP BAR */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 24px;
  background: linear-gradient(180deg, rgba(5,6,8,.85), rgba(5,6,8,0));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  gap: 14px;
  align-items: center;
}
.topbar .brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
.topbar .controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  padding: 7px 12px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  color: var(--ink);
  border-color: var(--cyan);
  background: rgba(92,240,226,.06);
}
.btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(92,240,226,.08);
}
.btn-pill {
  border-radius: 999px;
}

/* SIDEBAR TIMELINE */
.sidebar {
  position: fixed;
  left: 0; top: 56px; bottom: 0;
  width: 280px;
  z-index: 30;
  border-right: 1px solid var(--line);
  background: rgba(5,6,8,.4);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 24px 0 80px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-3); }

.timeline-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: start;
  padding: 10px 16px 10px 0;
  cursor: pointer;
  position: relative;
  transition: background .25s;
}
.timeline-item:hover {
  background: rgba(255,255,255,.02);
}
.timeline-item .marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.timeline-item .marker::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 1px;
  height: calc(100% + 12px);
  background: var(--line);
  transform: translateX(-50%);
}
.timeline-item:last-child .marker::before { display: none; }

.timeline-item .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--ink-3);
  z-index: 2;
  margin-top: 6px;
  transition: all .3s;
}
.timeline-item.active .dot,
.timeline-item.passed .dot {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.timeline-item.tone-twist.active .dot,
.timeline-item.tone-twist.passed .dot {
  background: var(--crimson);
  border-color: var(--crimson);
  box-shadow: 0 0 10px var(--crimson);
}
.timeline-item.tone-triumph.active .dot,
.timeline-item.tone-triumph.passed .dot {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.timeline-item .num {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: .15em;
  margin-top: 2px;
}
.timeline-item .meta {
  padding-top: 2px;
}
.timeline-item .act {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.timeline-item .ttl {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.3;
  font-weight: 500;
}
.timeline-item.active .ttl {
  color: var(--ink);
}
.timeline-item.active .act {
  color: var(--cyan);
}
.timeline-item.tone-twist.active .act { color: var(--crimson); }
.timeline-item.tone-triumph.active .act { color: var(--amber); }

.sidebar-header {
  padding: 8px 24px 18px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.sidebar-header .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .25em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sidebar-header .progress-bar {
  height: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.sidebar-header .progress-bar .fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .3s;
}
.sidebar-header .progress-text {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  margin-top: 8px;
}

/* MAIN CONTENT */
main {
  margin-left: 280px;
  margin-top: 56px;
  position: relative;
  z-index: 5;
}

.chapter {
  min-height: 100vh;
  padding: 80px 8% 120px 8%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.chapter .chapter-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .3em;
  margin-bottom: 14px;
}
.chapter .chapter-act {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: .25em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.chapter[data-tone="twist"] .chapter-act { color: var(--crimson); }
.chapter[data-tone="triumph"] .chapter-act { color: var(--amber); }

.chapter h1.chapter-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 18px;
  max-width: 18ch;
  text-wrap: balance;
}

.chapter .chapter-intro {
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 24px);
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.45;
  max-width: 50ch;
  margin-bottom: 48px;
  font-weight: 300;
}

.chapter .body {
  max-width: 720px;
  margin-top: 24px;
}
.chapter .body p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 18px;
  font-weight: 400;
}
.chapter .body p strong {
  color: var(--ink);
  font-weight: 600;
}
.chapter .body h3 {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin: 36px 0 14px 0;
  font-weight: 500;
}
.chapter[data-tone="twist"] .body h3 { color: var(--crimson); }
.chapter[data-tone="triumph"] .body h3 { color: var(--amber); }

.chapter .body ul {
  list-style: none;
  margin-bottom: 24px;
}
.chapter .body ul li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: 22px;
  position: relative;
  margin-bottom: 10px;
}
.chapter .body ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}
.chapter .body ul li strong {
  color: var(--ink);
}

/* INTRO/HERO chapter */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 8%;
  position: relative;
}
.hero .hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero .hero-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--cyan);
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(56px, 9vw, 140px);
  line-height: .95;
  font-weight: 300;
  letter-spacing: -.03em;
  margin-bottom: 24px;
  max-width: 14ch;
  text-wrap: balance;
}
.hero h1 .accent {
  font-style: italic;
  color: var(--cyan);
  position: relative;
}
.hero .hero-sub {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 300;
  font-style: italic;
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.35;
  margin-bottom: 56px;
}
.hero .hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .2em;
  text-transform: uppercase;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero .scroll-cue {
  position: absolute;
  bottom: 48px;
  left: 8%;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--ink-3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: enter-opacity .8s ease 2.4s both, bob 2.4s ease-in-out 3.2s infinite;
}
.hero .scroll-cue::before {
  content: "";
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
}

/* CARDS — concept tiles, tool cards, etc */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 24px 0 32px 0;
}
.tile {
  border: 1px solid var(--line-2);
  padding: 18px 16px;
  background: rgba(255,255,255,.015);
  position: relative;
  overflow: hidden;
  transition: all .3s;
  cursor: default;
}
.tile:hover {
  border-color: var(--cyan);
  background: rgba(92,240,226,.04);
}
.tile .tile-key {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: .15em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.tile .tile-val {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.tile .tile-val strong { color: var(--ink); }

/* TOOL CARDS — for harnesses, repos, etc */
.tool-card {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 22px 24px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.015);
  margin-bottom: 12px;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  border-color: var(--cyan);
  background: rgba(92,240,226,.03);
  transform: translateX(4px);
}
.tool-card .glyph {
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.tool-card h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--ink);
}
.tool-card .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}
.tool-card .tag.warn { color: var(--amber); }
.tool-card .tag.danger { color: var(--crimson); }
.tool-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.tool-card .links {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-direction: column;
}

/* VIDEO CARD */
.video-card {
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.02);
  padding: 18px 20px;
  margin: 18px 0 32px 0;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  transition: all .3s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.video-card:hover {
  border-color: var(--cyan);
  background: rgba(92,240,226,.04);
}
.video-card .thumb {
  width: 110px;
  height: 62px;
  background: linear-gradient(135deg, #1a1f28, #0a0d12);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line-2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.video-card .thumb[data-yt]::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--yt-thumb);
  background-size: cover;
  background-position: center;
  opacity: .55;
  filter: saturate(.8);
}
.video-card:hover .thumb[data-yt]::before { opacity: .85; }
.video-card .thumb::after {
  content: "";
  width: 0; height: 0;
  border-left: 14px solid var(--cyan);
  border-top: 8px solid transparent;
  position: relative;
  z-index: 1;
  border-bottom: 8px solid transparent;
  filter: drop-shadow(0 0 8px var(--cyan));
}
.video-card .meta {
  flex: 1;
  min-width: 0;
}
.video-card .label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.video-card .ttl {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}
.video-card .arrow {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 18px;
}

/* QUOTE/PULLQUOTE */
.pullquote {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 32px);
  font-style: italic;
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
  margin: 36px 0;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--cyan);
  max-width: 32ch;
  text-wrap: balance;
}
.chapter[data-tone="twist"] .pullquote { border-color: var(--crimson); }
.chapter[data-tone="triumph"] .pullquote { border-color: var(--amber); }

/* CALLOUT */
.callout {
  border: 1px solid var(--crimson);
  background: rgba(255,77,109,.05);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  position: relative;
}
.callout .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--crimson);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.callout.warn { border-color: var(--amber); background: rgba(255,180,84,.04); }
.callout.warn .label { color: var(--amber); }
.callout.info { border-color: var(--cyan); background: rgba(92,240,226,.04); }
.callout.info .label { color: var(--cyan); }

/* COMPARISON TABLE — Plans */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}
.plan {
  border: 1px solid var(--line-2);
  padding: 22px 20px;
  background: rgba(255,255,255,.015);
  transition: all .35s;
  cursor: pointer;
  position: relative;
}
.plan.active {
  border-color: var(--cyan);
  background: rgba(92,240,226,.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(92,240,226,.08);
}
.plan h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.plan.active h4 { color: var(--cyan); }
.plan.economy.active h4 { color: var(--emerald); }
.plan.balanced.active h4 { color: var(--cyan); }
.plan.quality.active h4 { color: var(--amber); }
.plan .price {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 16px;
}
.plan .roles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan .orchestrator {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(92,240,226,.25);
  background: rgba(92,240,226,.04);
  border-radius: 4px;
}
.plan .orchestrator .orch-icon {
  width: 22px; height: 22px;
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 4px var(--cyan));
}
.plan .orchestrator .orch-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 2px;
  display: block;
}
.plan .orchestrator .orch-model {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  text-align: right;
}
.plan .orchestrator .orch-text {
  display: flex; flex-direction: column;
}
.plan .role {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-family: var(--mono);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.plan .role:last-child { border: none; }
.plan .role .role-name {
  color: var(--ink-3);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .15em;
}
.plan .role .role-model {
  color: var(--ink-2);
}
.plan.active .role .role-model { color: var(--ink); }

/* STACK EVOLUTION DIAGRAM */
.stack-diagram {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.01);
  position: relative;
  overflow-x: auto;
}
.stack-flow {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}
.stack-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.02);
  min-width: 130px;
  position: relative;
  transition: all .3s;
}
.stack-node:hover {
  border-color: var(--cyan);
  background: rgba(92,240,226,.05);
}
.stack-node.problem {
  border-color: var(--crimson);
  background: rgba(255,77,109,.04);
}
.stack-node .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stack-node .name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.stack-node.problem .label { color: var(--crimson); }
.stack-arrow {
  width: 30px;
  height: 1px;
  background: var(--line-2);
  position: relative;
  flex-shrink: 0;
}
.stack-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px; height: 6px;
  border-right: 1px solid var(--ink-3);
  border-top: 1px solid var(--ink-3);
  transform: translateY(-50%) rotate(45deg);
}

/* Pillars (3 pillars of communication) */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 36px 0;
}
.pillar {
  border: 1px solid var(--line-2);
  padding: 28px 22px;
  background: rgba(255,255,255,.015);
  position: relative;
}
.pillar .num {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1;
  color: var(--cyan);
  font-style: italic;
  font-weight: 300;
  margin-bottom: 14px;
}
.pillar h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.pillar p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* PROMPT COMPARISON */
.prompt-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.prompt-box {
  border: 1px solid var(--line-2);
  padding: 18px;
  background: rgba(255,255,255,.015);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  position: relative;
}
.prompt-box.bad { border-color: var(--crimson); background: rgba(255,77,109,.03); }
.prompt-box.good { border-color: var(--emerald); background: rgba(74,222,128,.03); }
.prompt-box .verdict {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.prompt-box.bad .verdict { color: var(--crimson); }
.prompt-box.good .verdict { color: var(--emerald); }

/* SUPERWHISPER PROMPT BLOCK */
.prompt-block {
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.015);
  padding: 20px 22px;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prompt-block .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prompt-block .head h5 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--cyan);
  text-transform: uppercase;
  font-weight: 500;
}
.prompt-block .preview {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
}

/* MODAL (video modal + others) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2,3,5,.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn .3s;
}
.modal {
  width: 100%;
  max-width: 960px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  position: relative;
  animation: slideUp .4s cubic-bezier(.2,.8,.2,1);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h4 {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.modal-close {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  width: 28px; height: 28px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--crimson);
  border-color: var(--crimson);
}
.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-yt-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  transition: color .2s, border-color .2s, background .2s;
}
.modal-yt-link:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(92,240,226,.05);
}
.modal-body {
  padding: 0;
}
.modal-body iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  display: block;
}

/* Easter egg: hidden console in topbar */
.console-line {
  position: fixed;
  bottom: 12px;
  right: 16px;
  z-index: 40;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .15em;
  pointer-events: none;
  opacity: .5;
}
.console-line .blink {
  animation: blink 1.2s steps(2) infinite;
  color: var(--cyan);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(-1px, -1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(1px, -1px); }
}
.glitch {
  animation: glitch .3s steps(1) infinite;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(.2,.8,.2,1), transform 1s cubic-bezier(.2,.8,.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* MINIMAP */
.minimap {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.minimap-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  cursor: pointer;
  transition: all .3s;
  border: none;
  padding: 0;
  position: relative;
}
.minimap-dot:hover {
  background: var(--ink-2);
  transform: scale(1.4);
}
.minimap-dot.active {
  background: var(--cyan);
  width: 16px;
  height: 6px;
  border-radius: 3px;
  box-shadow: 0 0 8px var(--cyan);
}
.minimap-dot.tone-twist.active { background: var(--crimson); box-shadow: 0 0 8px var(--crimson); }
.minimap-dot.tone-triumph.active { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.minimap-tooltip {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.minimap-dot:hover .minimap-tooltip {
  opacity: 1;
}

/* Repo/link inline */
.lnk {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 0.95em;
  padding: 1px 2px;
  transition: all .2s;
}
.lnk:hover {
  color: var(--ink);
  background: rgba(92,240,226,.1);
  border-color: var(--cyan);
}

/* End/CTA card grid */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 32px 0;
}
.cta-card {
  border: 1px solid var(--line-2);
  padding: 20px 18px;
  background: rgba(255,255,255,.015);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.cta-card:hover {
  border-color: var(--cyan);
  background: rgba(92,240,226,.04);
  transform: translateY(-2px);
}
.cta-card .label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.cta-card .name {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
}
.cta-card .desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: 4px;
}
.cta-card .arrow {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 14px;
  margin-top: auto;
  align-self: flex-end;
}

/* Toast for clipboard copy */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-2);
  border: 1px solid var(--cyan);
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cyan);
  z-index: 200;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 8px 32px rgba(92,240,226,.15);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Audio button special icon */
.audio-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.audio-icon .bar {
  width: 2px;
  background: currentColor;
  animation: audiobar 1.2s ease-in-out infinite;
}
.audio-icon .bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.audio-icon .bar:nth-child(2) { height: 10px; animation-delay: .2s; }
.audio-icon .bar:nth-child(3) { height: 7px; animation-delay: .4s; }
.btn:not(.active) .audio-icon .bar { animation: none; height: 6px; }

@keyframes audiobar {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

/* Responsive — for narrower viewports */
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  main { margin-left: 220px; }
  .plans { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .prompt-compare { grid-template-columns: 1fr; }
  .minimap { display: none; }
}

/* === MOBILE === */
@media (max-width: 720px) {
  /* Layout: sidebar collapses, main fills viewport */
  .sidebar { display: none; }
  main { margin-left: 0; }
  .chapter {
    padding: 80px 20px 60px 20px;
    min-height: auto;
  }

  /* Top bar — tighter, with proper safe-area for notched devices */
  .topbar { padding: 10px 14px; }
  .topbar .brand { font-size: 10px; gap: 8px; }
  .topbar .brand .meta-line { display: none; }
  .topbar .brand .brand-tag { display: none; }
  .topbar .controls { gap: 6px; }
  .topbar .controls button,
  .topbar .controls .lang-toggle button { padding: 6px 10px; font-size: 10px; }

  /* HERO — biggest source of overflow. Cap font, allow break, center on mobile. */
  .hero { padding-top: 20px; }
  .hero h1 {
    font-size: clamp(38px, 11vw, 64px);
    line-height: 1.0;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  .hero .hero-sub { font-size: clamp(15px, 4vw, 20px); }
  .hero-eyebrow { font-size: 10px; letter-spacing: .15em; }

  /* Chapter titles — same overflow problem */
  .chapter h1.chapter-title {
    font-size: clamp(32px, 9vw, 56px);
    line-height: 1.05;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  .chapter .chapter-intro { font-size: clamp(15px, 4vw, 20px); }
  .chapter h2 { font-size: clamp(20px, 5.5vw, 28px); }
  .chapter h3 { font-size: clamp(16px, 4.5vw, 22px); }
  .chapter p, .chapter li { font-size: 15px; line-height: 1.55; }
  .pullquote { font-size: clamp(18px, 5vw, 24px); }

  /* Tiles → single column on mobile */
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 12px; }

  /* Tool cards — already stacked, refine */
  .tool-card { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .tool-card .glyph { width: 60px; height: 60px; }

  /* Plans (3 cards) → stacked */
  .plans { grid-template-columns: 1fr; gap: 14px; }
  .plan { padding: 18px; }
  .plan .roles { font-size: 12px; }

  /* Pillars / prompt-compare — already stacked at 1100px, refine */
  .pillars, .prompt-compare { gap: 12px; }

  /* Video cards — stack thumb + meta vertically on very narrow */
  .video-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .video-card .thumb { width: 100%; height: 160px; }
  .video-card .arrow { display: none; }

  /* CTA grid → single column */
  .cta-grid { grid-template-columns: 1fr; }

  /* Modals — full-bleed on mobile */
  .modal { width: 96vw; max-width: 96vw; }
  .modal-head { flex-wrap: wrap; gap: 8px; }
  .modal-head h4 { font-size: 11px; flex: 1 1 100%; order: -1; }
  .modal-yt-link { font-size: 9px; padding: 5px 8px; }

  /* Console line easter egg — hide on mobile (overlaps content) */
  .console-line { display: none; }
}

/* Extra-small phones (≤ 380px) */
@media (max-width: 380px) {
  .chapter { padding: 76px 16px 48px 16px; }
  .hero h1 { font-size: clamp(32px, 10.5vw, 48px); }
  .chapter h1.chapter-title { font-size: clamp(28px, 8.5vw, 44px); }
  .topbar .brand .dot { display: none; }
}

/* ============================================
   ENTRANCE CINEMATIC SEQUENCE
   ============================================ */

/* --- Boot overlay: cyan line sweep + radial flash --- */
.boot-sequence {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.boot-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan) 30%, var(--cyan) 70%, transparent 100%);
  box-shadow: 0 0 20px var(--cyan), 0 0 60px rgba(92,240,226,.4);
  transform-origin: left;
  animation: boot-sweep 1.2s cubic-bezier(.4,0,.2,1) .1s both;
}

@keyframes boot-sweep {
  0%   { transform: scaleX(0); opacity: 0; }
  15%  { opacity: 1; }
  55%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

.boot-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(92,240,226,.14) 0%, transparent 55%);
  animation: boot-glow 1.8s ease .4s both;
}

@keyframes boot-glow {
  0%   { opacity: 0; transform: scale(.7); }
  35%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}

/* --- Topbar: drops from above --- */
.topbar {
  animation: enter-from-top .9s cubic-bezier(.2,.8,.2,1) .6s both;
}

@keyframes enter-from-top {
  from {
    opacity: 0;
    transform: translateY(-100%);
    filter: blur(6px);
  }
}

/* --- Sidebar: slides from left --- */
.sidebar {
  animation: enter-from-left 1s cubic-bezier(.2,.8,.2,1) 1s both;
}

@keyframes enter-from-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
    filter: blur(6px);
  }
}

/* --- Hero: staggered dramatic reveal --- */
.hero .hero-eyebrow {
  animation: enter-up .9s cubic-bezier(.2,.8,.2,1) .8s both;
}

.hero h1 {
  animation: enter-title 1.8s cubic-bezier(.16,1,.3,1) 1s both;
}

@keyframes enter-title {
  from {
    opacity: 0;
    transform: translateY(60px) scale(.94);
    filter: blur(16px);
  }
  50% {
    filter: blur(3px);
  }
}

.hero h1 .accent {
  animation: accent-glow 2.5s ease 2.2s both;
}

@keyframes accent-glow {
  0%   { text-shadow: none; }
  40%  { text-shadow: 0 0 40px rgba(92,240,226,.7), 0 0 80px rgba(92,240,226,.3); }
  100% { text-shadow: none; }
}

.hero .hero-sub {
  animation: enter-up 1s cubic-bezier(.2,.8,.2,1) 1.5s both;
}

.hero .hero-meta {
  animation: enter-up .8s cubic-bezier(.2,.8,.2,1) 1.9s both;
}

/* --- Minimap: slides from right (preserving translateY -50%) --- */
.minimap {
  animation: enter-minimap 1s cubic-bezier(.2,.8,.2,1) 1.5s both;
}

@keyframes enter-minimap {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(24px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    filter: blur(0);
  }
}

/* --- Console line: fades in last --- */
.console-line {
  animation: enter-console 1s ease 2.8s both;
}

@keyframes enter-console {
  from { opacity: 0; }
  to   { opacity: .5; }
}

/* --- Shared entrance keyframes --- */
@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(32px);
    filter: blur(10px);
  }
}

@keyframes enter-opacity {
  from { opacity: 0; }
}
