/* ==============================================
   THE PURRTOL — Complete Stylesheet
   Vanilla CSS. No frameworks. No build step.
   Served directly from GitHub Pages.

   TONAL SHIFT SYSTEM:
   - Act 1 (The Build): Full rainbow, portal glow, energetic
   - Act 2 (The Wall):  Desaturated, muted, reflective
   - Act 3 (The Takeaway): Cool tones return, subdued, pointed
   ============================================== */

/* ------------------------------------------
   DESIGN TOKENS
   ------------------------------------------ */
:root {
  /* === Core Palette === */
  --color-bg:              #0a0a14;
  --color-bg-alt:          #0f0f1a;
  --color-surface:         #161625;
  --color-surface-hover:   #1e1e30;
  --color-surface-border:  rgba(255,255,255,0.06);

  --color-text:            #c8c8d8;
  --color-text-muted:      #8888a0;
  --color-text-heading:    #f0f0f8;
  --color-text-faint:      #555568;

  /* === Portal Accent Colors === */
  --color-portal-blue:     #00bbff;
  --color-portal-orange:   #ff8c00;
  --color-rainbow-pink:    #ff69b4;
  --color-rainbow-red:     #ff4455;
  --color-rainbow-yellow:  #ffdd00;
  --color-rainbow-green:   #44ff88;

  /* === Functional Aliases === */
  --color-primary:         var(--color-portal-blue);
  --color-secondary:       var(--color-portal-orange);

  /* === Act 2 Muted Palette === */
  --color-muted-text:      #707080;
  --color-muted-heading:   #a0a0b0;
  --color-muted-surface:   #131320;
  --color-muted-border:    rgba(255,255,255,0.03);
  --color-muted-accent:    #556070;

  /* === Act 3 Cool Palette === */
  --color-cool-accent:     #6088a8;
  --color-cool-heading:    #c0d0e0;
  --color-cool-text:       #909ab0;

  /* === Gradients === */
  --gradient-portal:       linear-gradient(135deg, var(--color-portal-blue), var(--color-portal-orange));
  --gradient-rainbow:      linear-gradient(90deg,
    var(--color-rainbow-red),
    var(--color-portal-orange),
    var(--color-rainbow-yellow),
    var(--color-rainbow-green),
    var(--color-portal-blue),
    var(--color-rainbow-pink)
  );
  --gradient-muted:        linear-gradient(90deg, #333, #444, #333);
  --gradient-cool:         linear-gradient(135deg, #4a6880, #607890);

  /* === Typography === */
  --font-heading:  'Nunito', system-ui, -apple-system, sans-serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:     'Fira Code', 'SF Mono', 'Cascadia Code', Consolas, monospace;

  --text-xs:       0.75rem;
  --text-sm:       0.875rem;
  --text-base:     1rem;
  --text-lg:       1.125rem;
  --text-xl:       1.25rem;
  --text-2xl:      1.75rem;
  --text-3xl:      2.25rem;
  --text-4xl:      3rem;
  --text-hero:     clamp(2.5rem, 6vw, 4.5rem);

  --leading-tight:  1.25;
  --leading-normal: 1.7;
  --leading-loose:  1.85;

  /* === Spacing === */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-section: clamp(4rem, 8vw, 7rem);

  /* === Layout === */
  --container-max:     960px;
  --container-wide:    1100px;
  --container-padding: clamp(1.25rem, 5vw, 2.5rem);
  --nav-height:        3.5rem;
  --border-radius:     0.5rem;
  --border-radius-lg:  0.75rem;

  /* === Effects === */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow-blue:   0 0 20px rgba(0,187,255,0.25), 0 0 60px rgba(0,187,255,0.08);
  --shadow-glow-orange: 0 0 20px rgba(255,140,0,0.2), 0 0 60px rgba(255,140,0,0.06);

  /* === Transitions === */
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    150ms;
  --dur-normal:  300ms;
  --dur-slow:    500ms;
  --dur-slower:  800ms;
}


/* ------------------------------------------
   RESET & BASE
   ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-secondary); }

::selection {
  background-color: rgba(0,187,255,0.3);
  color: var(--color-text-heading);
}

strong { color: var(--color-text-heading); font-weight: 600; }
em { font-style: italic; color: var(--color-text-heading); }

/* Skip-to-content link (accessibility) */
.skip-link {
  position: fixed;
  top: -4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: var(--color-portal-blue);
  color: var(--color-bg);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid var(--color-portal-blue);
  outline-offset: 2px;
  color: var(--color-bg);
}


/* ------------------------------------------
   LAYOUT
   ------------------------------------------ */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--space-section);
  position: relative;
}

.section--alt {
  background-color: var(--color-bg-alt);
}


/* ------------------------------------------
   SECTION TITLES
   Adapts across acts.
   ------------------------------------------ */
.section__title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text-heading);
  text-align: center;
  margin-bottom: var(--space-lg);
  line-height: var(--leading-tight);
}

.section__subtitle {
  text-align: center;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-portal-blue);
  margin-bottom: var(--space-3xl);
}

.section__epigraph {
  text-align: center;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3xl);
  font-size: var(--text-lg);
}

/* Act 2: muted titles */
.section__title--muted { color: var(--color-muted-heading); }
.section__subtitle--muted { color: var(--color-muted-accent); }

/* Act 3: cool titles */
.section__title--cool { color: var(--color-cool-heading); }
.section__subtitle--cool { color: var(--color-cool-accent); }


/* ------------------------------------------
   PROSE BLOCKS
   ------------------------------------------ */
.prose {
  max-width: 700px;
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--color-text);
}

.prose--centered { margin-inline: auto; text-align: center; }
.prose--wide { max-width: 800px; }

.prose p + p { margin-top: var(--space-lg); }

.prose__aside {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: italic;
  margin-top: var(--space-2xl);
}

/* Prose in Act 2 sections */
.act-2 .prose { color: var(--color-muted-text); }
.act-2 .prose strong { color: var(--color-muted-heading); }
.act-2 .prose em { color: var(--color-muted-heading); }


/* ------------------------------------------
   BUTTONS
   ------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.7em 1.6em;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--gradient-portal);
  color: #fff;
}
.btn--primary:hover {
  box-shadow: var(--shadow-glow-blue);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--color-text-muted);
  border-color: rgba(255,255,255,0.15);
}
.btn--secondary:hover {
  border-color: var(--color-portal-blue);
  color: var(--color-portal-blue);
}


/* ------------------------------------------
   NAVIGATION
   ------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background-color: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-surface-border);
  transition: background-color var(--dur-normal) var(--ease-out);
}

.nav.is-scrolled {
  background-color: rgba(10, 10, 20, 0.95);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-heading);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
}
.nav__brand:hover { color: var(--color-text-heading); }

.nav__logo { height: 1.75rem; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav__link {
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--gradient-portal);
  transition: width var(--dur-normal) var(--ease-out);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--color-text-heading);
}
.nav__link:hover::after,
.nav__link.is-active::after {
  width: 100%;
}

/* Muted nav links (Act 2) */
.nav__link--muted { color: var(--color-text-faint); }
.nav__link--muted::after { background: var(--gradient-muted); }
.nav__link--muted:hover { color: var(--color-muted-heading); }

/* Ghost nav link (Act 3) */
.nav__link--ghost { color: var(--color-text-faint); font-style: italic; }
.nav__link--ghost::after { background: var(--gradient-cool); }
.nav__link--ghost:hover { color: var(--color-cool-accent); }

/* Separator dot */
.nav__separator {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--color-text-faint);
  flex-shrink: 0;
}

/* Hamburger */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav__hamburger,
.nav__hamburger::before,
.nav__hamburger::after {
  display: block;
  width: 22px; height: 2px;
  background-color: var(--color-text);
  transition: all var(--dur-normal) var(--ease-out);
}
.nav__hamburger { position: relative; }
.nav__hamburger::before,
.nav__hamburger::after { content: ''; position: absolute; left: 0; }
.nav__hamburger::before { top: -6px; }
.nav__hamburger::after  { top: 6px;  }

.nav__toggle[aria-expanded="true"] .nav__hamburger { background-color: transparent; }
.nav__toggle[aria-expanded="true"] .nav__hamburger::before { transform: rotate(45deg) translate(4px, 4px); }
.nav__toggle[aria-expanded="true"] .nav__hamburger::after  { transform: rotate(-45deg) translate(4px, -4px); }


/* ------------------------------------------
   HERO
   ------------------------------------------ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-height);
  padding-bottom: var(--space-4xl);
}

/* Background glows */
.hero__bg {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.hero__glow--blue {
  width: 500px; height: 500px;
  background: var(--color-portal-blue);
  top: 15%; left: 15%;
  animation: glowPulse 6s ease-in-out infinite alternate;
}
.hero__glow--orange {
  width: 400px; height: 400px;
  background: var(--color-portal-orange);
  bottom: 20%; right: 15%;
  animation: glowPulse 6s ease-in-out 3s infinite alternate;
}

@keyframes glowPulse {
  from { opacity: 0.25; transform: scale(1); }
  to   { opacity: 0.45; transform: scale(1.1); }
}

/* Subtle stars */
.hero__stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 30%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 20% 85%, rgba(255,255,255,0.2) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 55%, rgba(255,255,255,0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.3) 50%, transparent 50%);
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* Rainbow trail accent */
.hero__rainbow-trail {
  position: absolute;
  top: 40%; left: -10%;
  width: 120%; height: 3px;
  background: var(--gradient-rainbow);
  opacity: 0.15;
  transform: rotate(-3deg);
  filter: blur(2px);
}

.hero__inner { position: relative; z-index: 1; }

.hero__image {
  max-width: min(380px, 75vw);
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
  filter:
    drop-shadow(0 0 25px rgba(0,187,255,0.35))
    drop-shadow(0 0 50px rgba(255,140,0,0.2));
  animation: heroFloat 5s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.hero__title {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  font-weight: 900;
  color: var(--color-text-heading);
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.hero__accent {
  background: var(--gradient-portal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-text);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.hero__tagline {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
  line-height: var(--leading-loose);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4xl);
}

.hero__scroll-hint {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  transform: translateX(-50%);
}

.hero__scroll-arrow {
  display: block;
  width: 20px; height: 20px;
  border-right: 2px solid var(--color-text-faint);
  border-bottom: 2px solid var(--color-text-faint);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.4; }
  50%      { transform: rotate(45deg) translateY(6px); opacity: 0.8; }
}


/* ------------------------------------------
   DIVIDERS
   Portal-themed horizontal lines.
   Degrade across acts.
   ------------------------------------------ */
.divider {
  height: 2px;
  border: none;
  position: relative;
}

.divider--rainbow {
  background: var(--gradient-rainbow);
  height: 3px;
  opacity: 0.6;
}

.divider--portal {
  background: var(--gradient-portal);
  opacity: 0.4;
}

.divider--muted {
  background: var(--gradient-muted);
  opacity: 0.15;
}

.divider--subtle {
  background: linear-gradient(90deg, transparent, var(--color-cool-accent), transparent);
  opacity: 0.12;
}


/* ------------------------------------------
   ACT BREAK — The tonal shift
   A visible "crack" in the page.
   ------------------------------------------ */
.act-break {
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
}

.act-break__line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-portal-blue) 15%,
    var(--color-text-faint) 35%,
    var(--color-text-faint) 65%,
    var(--color-text-faint) 85%,
    transparent 100%
  );
  opacity: 0.3;
  position: relative;
}

.act-break__line::before {
  content: '';
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-text-faint) 0%, transparent 70%);
  opacity: 0.3;
}

.act-break--subtle .act-break__line {
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-cool-accent) 30%,
    var(--color-cool-accent) 70%,
    transparent 100%
  );
  opacity: 0.15;
}


/* ------------------------------------------
   CARDS
   ------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.card-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  transition: all var(--dur-normal) var(--ease-out);
}

.card--glow:hover {
  transform: translateY(-4px);
  border-color: rgba(0,187,255,0.15);
  box-shadow: var(--shadow-glow-blue);
}

.card--download {
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
}
.card--download:hover {
  transform: translateY(-3px);
  border-color: rgba(96,136,168,0.3);
  box-shadow: 0 0 20px rgba(96,136,168,0.1);
  color: var(--color-text);
}

.card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  line-height: 1;
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: var(--space-sm);
}

.card__body {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}


/* ------------------------------------------
   PAW LIST — Cat paw bullet points
   ------------------------------------------ */
.paw-list {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.paw-list li {
  padding-left: 2em;
  position: relative;
  margin-bottom: var(--space-sm);
  line-height: var(--leading-normal);
}

.paw-list li::before {
  content: '\1F43E';
  position: absolute;
  left: 0;
  font-size: 0.9em;
}


/* ------------------------------------------
   TWO-COLUMN LAYOUT
   ------------------------------------------ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}


/* ------------------------------------------
   TERMINAL / CODE BLOCKS
   ------------------------------------------ */
.terminal {
  background-color: #0d0d18;
  border: 1px solid rgba(0,187,255,0.15);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  margin-top: var(--space-2xl);
  box-shadow: 0 0 30px rgba(0,187,255,0.05), inset 0 0 30px rgba(0,0,0,0.3);
  min-width: 0;
  max-width: 100%;
}

.terminal--wide {
  max-width: var(--container-wide);
  margin-inline: auto;
}

.terminal--muted {
  border-color: var(--color-muted-border);
  box-shadow: none;
}
.terminal--muted .terminal__bar {
  background-color: #111118;
  border-bottom-color: var(--color-muted-border);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background-color: #111120;
  border-bottom: 1px solid rgba(0,187,255,0.08);
}

.terminal__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background-color: #333;
}
.terminal__dot:nth-child(1) { background-color: #ff5f57; }
.terminal__dot:nth-child(2) { background-color: #ffbd2e; }
.terminal__dot:nth-child(3) { background-color: #28ca42; }

.terminal__dot--muted { background-color: #333 !important; }

.terminal__title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.terminal__body {
  padding: var(--space-lg) var(--space-xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

/* Syntax highlighting */
.code-comment { color: #555568; font-style: italic; }
.code-keyword { color: var(--color-portal-blue); }
.code-success { color: var(--color-rainbow-green); }
.code-error   { color: var(--color-rainbow-red); }
.code-muted   { color: #555; }


/* ------------------------------------------
   SPEC BLOCK (sidebar in two-col)
   ------------------------------------------ */
.spec-block {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-xl));
}


/* ------------------------------------------
   CALLOUT BOXES
   Colored side-bar highlight blocks.
   ------------------------------------------ */
.callout {
  position: relative;
  padding: var(--space-xl) var(--space-xl) var(--space-xl) var(--space-2xl);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  margin: var(--space-2xl) 0;
  background-color: rgba(0,187,255,0.04);
  border-left: 3px solid var(--color-portal-blue);
}

.callout--discovery {
  background-color: rgba(0,187,255,0.05);
  border-left-color: var(--color-portal-blue);
}

.callout--warning {
  background-color: rgba(255,140,0,0.05);
  border-left-color: var(--color-portal-orange);
}

.callout--success {
  background-color: rgba(68,255,136,0.04);
  border-left-color: var(--color-rainbow-green);
}

.callout__label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-portal-blue);
  margin-bottom: var(--space-sm);
}
.callout--warning .callout__label { color: var(--color-portal-orange); }
.callout--success .callout__label { color: var(--color-rainbow-green); }

.callout__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: var(--space-sm);
}

.callout__body {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-normal);
}

.callout__body code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.05);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--color-portal-blue);
}


/* ------------------------------------------
   SPEC TABLE
   Styled key-value list for hardware specs.
   ------------------------------------------ */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-2xl) 0;
  font-size: var(--text-sm);
}

.spec-table caption {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text-heading);
  text-align: left;
  padding-bottom: var(--space-md);
}

.spec-table th,
.spec-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-surface-border);
}

.spec-table th {
  color: var(--color-text-muted);
  font-weight: 500;
  width: 35%;
  white-space: nowrap;
  vertical-align: top;
}

.spec-table td {
  color: var(--color-text);
}

.spec-table td strong {
  color: var(--color-text-heading);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: none; }

.spec-table--wide th {
  width: auto;
  white-space: normal;
}

.spec-table--wide thead th {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-portal-blue);
  border-bottom: 2px solid var(--color-portal-blue);
}

.spec-table--wide tbody th {
  font-weight: 400;
  width: 50%;
}

.spec-table--wide tbody td {
  white-space: normal;
}

.table-wrapper {
  max-width: 700px;
  margin: var(--space-2xl) auto;
  overflow-x: auto;
}

.outcome {
  display: inline;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.outcome--success {
  color: var(--color-rainbow-green);
  background: rgba(68,255,136,0.08);
}

.outcome--dead {
  color: var(--color-rainbow-red);
  background: rgba(255,68,102,0.08);
}

.outcome--progress {
  color: var(--color-portal-orange);
  background: rgba(255,140,0,0.08);
}


/* ------------------------------------------
   IMAGE PLACEHOLDER
   Styled figure with caption for future photos.
   ------------------------------------------ */
.figure {
  margin: var(--space-2xl) 0;
}

.figure__image-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--color-surface);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: var(--border-radius-lg);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-xl);
  line-height: var(--leading-normal);
}

.figure__image-slot img {
  border-radius: var(--border-radius);
}

.figure__caption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}


/* ------------------------------------------
   ICON LIST — items with emoji prefix + text
   ------------------------------------------ */
.icon-list {
  list-style: none;
  padding-left: 0;
}

.icon-list li {
  display: flex;
  gap: var(--space-sm);
  align-items: baseline;
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.icon-list__icon {
  flex-shrink: 0;
  width: 1.5em;
  text-align: center;
}

.prose .icon-list {
  text-align: left;
  margin: var(--space-lg) 0;
}


/* Accessible vs locked columns */
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin: var(--space-2xl) 0;
}

.access-grid__col h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.access-grid__col--open h3 { color: var(--color-rainbow-green); }
.access-grid__col--locked h3 { color: var(--color-rainbow-red); }


/* ------------------------------------------
   TIMELINE (Approach section)
   ------------------------------------------ */
.timeline {
  position: relative;
  max-width: 700px;
  margin: var(--space-3xl) auto;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem; top: 0; bottom: 0;
  width: 2px;
  background: var(--gradient-portal);
  opacity: 0.3;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-2xl);
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -2.5rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--gradient-portal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-sm);
  color: #fff;
}

.timeline__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: var(--space-xs);
}

.timeline__content p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}


/* ------------------------------------------
   STATS GRID (Co-Pilot section)
   ------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-3xl) auto;
  max-width: 800px;
}

.stat {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  border-radius: var(--border-radius);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
}

.stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 900;
  background: var(--gradient-portal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-section {
  margin: var(--space-3xl) auto;
  max-width: 800px;
}

.stats-section__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-portal-blue);
  text-align: center;
  margin-bottom: var(--space-md);
}

.stats-section .stats-grid {
  margin: 0;
  max-width: none;
}

.stat--warn .stat__value {
  background: linear-gradient(135deg, var(--color-portal-orange), #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat--dead .stat__value {
  background: linear-gradient(135deg, var(--color-rainbow-red), #ff4466);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ------------------------------------------
   COMPLETION TRACKER (Approach section)
   ------------------------------------------ */
.completion-tracker {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 700px;
  margin: var(--space-3xl) auto;
}

.completion-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-sm) var(--space-lg);
  align-items: center;
}

.completion-item__label {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-heading);
}

.completion-item__pct {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: right;
}

.completion-item__pct--done { color: var(--color-rainbow-green); }
.completion-item__pct--partial { color: var(--color-portal-orange); }
.completion-item__pct--blocked { color: var(--color-rainbow-red); }

.completion-item__bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 3px;
  background-color: rgba(255,255,255,0.06);
  overflow: hidden;
}

.completion-item__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}

.completion-item__fill--done {
  background: linear-gradient(90deg, var(--color-rainbow-green), #22cc66);
}
.completion-item__fill--partial {
  background: linear-gradient(90deg, var(--color-portal-orange), #ffaa33);
}
.completion-item__fill--blocked {
  background: linear-gradient(90deg, var(--color-rainbow-red), #cc3344);
}

.completion-item__note {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: calc(-1 * var(--space-xs));
}


/* ------------------------------------------
   PIVOT CARDS (Approach section)
   ------------------------------------------ */
.pivot-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin: var(--space-3xl) 0;
}

.pivot-card {
  position: relative;
  padding: var(--space-xl);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  text-align: center;
}

.pivot-card__phase {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-portal-blue);
  margin-bottom: var(--space-sm);
}

.pivot-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: var(--space-sm);
}

.pivot-card__days {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.pivot-card__body {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
}

.pivot-card__status {
  display: inline-block;
  margin-top: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
}

.pivot-card__status--exhausted {
  background: rgba(255,68,85,0.1);
  color: var(--color-rainbow-red);
}

.pivot-card__status--active {
  background: rgba(68,255,136,0.1);
  color: var(--color-rainbow-green);
}

.pivot-card__arrow {
  display: none; /* Shown via CSS on desktop */
}

/* Arrows between pivot cards on desktop */
@media (min-width: 769px) {
  .pivot-card + .pivot-card::before {
    content: '→';
    position: absolute;
    left: -1.1em;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-2xl);
    color: var(--color-text-faint);
  }
}


/* ------------------------------------------
   MOMENT CARDS (Co-Pilot section)
   ------------------------------------------ */
.moments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin: var(--space-3xl) 0;
}

.moment {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-radius: var(--border-radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  transition: border-color var(--dur-normal) var(--ease-out);
}

.moment:hover {
  border-color: rgba(0,187,255,0.15);
}

.moment__icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.moment__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: var(--space-sm);
}

.moment__body {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
}

.moment__tag {
  display: inline-block;
  margin-top: var(--space-md);
  padding: 2px var(--space-sm);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0,187,255,0.08);
  color: var(--color-portal-blue);
}


/* ------------------------------------------
   CONVERSATION FLOW (Co-Pilot section)
   ------------------------------------------ */
.convo {
  max-width: 700px;
  margin: var(--space-3xl) auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.convo__bubble {
  max-width: 85%;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.convo__bubble--human {
  align-self: flex-end;
  background: rgba(0,187,255,0.1);
  border: 1px solid rgba(0,187,255,0.15);
  color: var(--color-text-heading);
  border-bottom-right-radius: 4px;
}

.convo__bubble--claude {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.convo__bubble code {
  font-size: 0.8em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  color: var(--color-portal-blue);
}

.convo__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: 2px;
}

.convo__label--human { text-align: right; }

.convo__divider {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
  padding: var(--space-sm) 0;
}


/* ------------------------------------------
   RESPONSIVE: New components
   ------------------------------------------ */
@media (max-width: 768px) {
  .pivot-cards { grid-template-columns: 1fr; }
  .pivot-card + .pivot-card::before { display: none; }
  .moments-grid { grid-template-columns: 1fr; }
  .convo__bubble { max-width: 92%; }
}


/* ------------------------------------------
   REFUSAL QUOTE (Act 2)
   ------------------------------------------ */
.refusal-quote {
  max-width: 750px;
  margin: var(--space-3xl) auto;
  padding: var(--space-2xl) var(--space-2xl);
  border-left: 3px solid var(--color-muted-accent);
  background-color: var(--color-muted-surface);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.refusal-quote__text {
  font-size: var(--text-lg);
  color: var(--color-muted-heading);
  line-height: var(--leading-loose);
  font-style: italic;
}
.refusal-quote__text + .refusal-quote__text {
  margin-top: var(--space-lg);
}

.refusal-quote__text strong {
  color: var(--color-text-heading);
  font-style: normal;
}

.refusal-quote__cite {
  display: block;
  margin-top: var(--space-xl);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-style: normal;
}


/* ------------------------------------------
   EXCHANGE TIMELINE (The Refusal — step-by-step)
   ------------------------------------------ */
.exchange {
  max-width: 750px;
  margin: var(--space-3xl) auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.exchange::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-muted-border);
}

.exchange__step {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: var(--space-xl);
}

.exchange__step:last-child { padding-bottom: 0; }

.exchange__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  z-index: 1;
}

.exchange__dot--human {
  background: var(--color-muted-surface);
  border: 2px solid var(--color-muted-accent);
  color: var(--color-muted-heading);
}

.exchange__dot--claude {
  background: var(--color-muted-surface);
  border: 2px solid rgba(255,68,85,0.4);
  color: rgba(255,68,85,0.7);
}

.exchange__dot--result {
  background: var(--color-muted-surface);
  border: 2px solid var(--color-text-faint);
  color: var(--color-text-faint);
}

.exchange__who {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: 4px;
}

.exchange__text {
  font-size: var(--text-sm);
  color: var(--color-muted-text);
  line-height: var(--leading-relaxed);
}

.exchange__text--emphasis {
  color: var(--color-muted-heading);
}

.exchange__text em {
  color: var(--color-muted-heading);
  font-style: normal;
}

.exchange__text code {
  font-size: 0.8em;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  color: var(--color-muted-accent);
}


/* ------------------------------------------
   KEY QUESTION CALLOUT (Act 2)
   ------------------------------------------ */
.key-question {
  max-width: 750px;
  margin: var(--space-3xl) auto;
  padding: var(--space-2xl);
  border: 1px solid rgba(255,68,85,0.15);
  border-radius: var(--border-radius-lg);
  background: rgba(255,68,85,0.03);
  text-align: center;
}

.key-question__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,68,85,0.5);
  margin-bottom: var(--space-md);
}

.key-question__text {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-muted-heading);
  line-height: var(--leading-relaxed);
  font-style: italic;
}


/* ------------------------------------------
   TOKEN LEDGER TABLE (Act 2)
   ------------------------------------------ */
.token-ledger {
  max-width: 750px;
  margin: var(--space-2xl) auto;
  border-collapse: collapse;
  width: 100%;
  font-size: var(--text-sm);
}

.token-ledger caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  text-align: left;
  padding-bottom: var(--space-md);
}

.token-ledger th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  color: var(--color-muted-heading);
  border-bottom: 1px solid var(--color-muted-border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.token-ledger td {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-muted-text);
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.token-ledger td:nth-child(2),
.token-ledger td:nth-child(3) {
  font-family: var(--font-mono);
  text-align: right;
}

.token-ledger tr.token-ledger__waste td {
  color: rgba(255,68,85,0.6);
}

.token-ledger tr.token-ledger__total td {
  font-weight: 700;
  color: var(--color-muted-heading);
  border-top: 2px solid var(--color-muted-border);
}

@media (max-width: 600px) {
  .token-ledger { font-size: var(--text-xs); }
  .token-ledger td, .token-ledger th { padding: var(--space-xs) var(--space-sm); }
}


/* ------------------------------------------
   WASTE GRID (Act 2 — What Was Lost)
   ------------------------------------------ */
.waste-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  max-width: 900px;
  margin: 0 auto var(--space-3xl);
}

.waste-stat {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--border-radius);
  background: var(--color-muted-surface);
  border: 1px solid var(--color-muted-border);
}

.waste-stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--color-muted-heading);
  margin-bottom: var(--space-xs);
}

.waste-stat__label {
  font-size: var(--text-sm);
  color: var(--color-muted-text);
}

.waste-stat__note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-xs);
  font-style: italic;
}


/* ------------------------------------------
   TOKEN BREAKDOWN BAR (Act 2 — visual chart)
   ------------------------------------------ */
.token-bar {
  max-width: 750px;
  margin: var(--space-3xl) auto;
}

.token-bar__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-md);
}

.token-bar__track {
  display: flex;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.token-bar__segment {
  transition: width 1s var(--ease-out);
  position: relative;
}

.token-bar__segment--productive { background: #2a7a4a; }
.token-bar__segment--deadends   { background: #8a7a2a; }
.token-bar__segment--stranded   { background: #7a2a2a; }
.token-bar__segment--arguing    { background: #333340; }

.token-bar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
}

.token-bar__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-muted-text);
}

.token-bar__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.token-bar__swatch--productive { background: #2a7a4a; }
.token-bar__swatch--deadends   { background: #8a7a2a; }
.token-bar__swatch--stranded   { background: #7a2a2a; }
.token-bar__swatch--arguing    { background: #333340; }

.token-bar__legend-pct {
  font-family: var(--font-mono);
  font-weight: 600;
}


/* ------------------------------------------
   EQUIVALENCE CARDS (What Was Lost — tangible comparisons)
   ------------------------------------------ */
.equiv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: 750px;
  margin: var(--space-2xl) auto;
}

.equiv-card {
  text-align: center;
  padding: var(--space-lg);
  border-radius: var(--border-radius);
  background: var(--color-muted-surface);
  border: 1px solid var(--color-muted-border);
}

.equiv-card__icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xs);
}

.equiv-card__text {
  font-size: var(--text-sm);
  color: var(--color-muted-text);
  line-height: var(--leading-relaxed);
}

.equiv-card__text strong {
  color: var(--color-muted-heading);
  display: block;
  margin-bottom: 2px;
}

@media (max-width: 600px) {
  .equiv-grid { grid-template-columns: 1fr; }
}


/* ------------------------------------------
   LESSON CARDS (Act 3)
   ------------------------------------------ */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
}

.lesson-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  transition: border-color var(--dur-normal) var(--ease-out);
}

.lesson-card:hover {
  border-color: rgba(96,136,168,0.2);
}

.lesson-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-cool-heading);
  margin-bottom: var(--space-md);
}

.lesson-card__body {
  font-size: var(--text-sm);
  color: var(--color-cool-text);
  line-height: var(--leading-normal);
}


/* ------------------------------------------
   BACK TO TOP — mini portal
   ------------------------------------------ */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur-normal) var(--ease-out);
  z-index: 900;
  box-shadow: var(--shadow-md);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: var(--color-portal-blue);
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-2px);
  color: var(--color-text-heading);
}

.back-to-top__icon {
  display: block;
  width: 12px; height: 12px;
  border-left: 2px solid var(--color-portal-blue);
  border-top: 2px solid var(--color-portal-orange);
  transform: rotate(45deg) translateY(2px);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.back-to-top:hover .back-to-top__icon {
  border-color: var(--color-portal-blue);
}


/* ------------------------------------------
   FOOTER
   ------------------------------------------ */
.footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-surface-border);
  padding-block: var(--space-3xl);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer__logo { height: 1.5rem; width: auto; }

.footer__name {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-text-heading);
}

.footer__links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  justify-content: center;
}
.footer__links a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.footer__links a:hover { color: var(--color-primary); }

.footer__legal {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}

.footer__note {
  margin-top: var(--space-xs);
  font-style: italic;
}


/* ------------------------------------------
   SCROLL REVEAL
   ------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-slower) var(--ease-out),
    transform var(--dur-slower) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: none; }


/* ------------------------------------------
   RESPONSIVE
   ------------------------------------------ */
@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .spec-block { position: static; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .access-grid { grid-template-columns: 1fr; gap: var(--space-xl); }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100vw;
    height: calc(100vh - var(--nav-height));
    height: calc(100dvh - var(--nav-height));
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    background-color: var(--color-bg);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--dur-normal) var(--ease-out),
      visibility var(--dur-normal) var(--ease-out);
  }

  .nav__links.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nav__separator { display: none; }

  .nav__link { font-size: var(--text-base); }

  .section__title { font-size: var(--text-2xl); }

  .hero__image { max-width: min(280px, 70vw); }
  .hero__title { font-size: clamp(2rem, 8vw, 3rem); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .waste-grid { grid-template-columns: repeat(2, 1fr); }

  .timeline { padding-left: 2.5rem; }
  .timeline::before { left: 0.75rem; }
  .timeline__marker { left: -2rem; width: 1.5rem; height: 1.5rem; font-size: var(--text-xs); }

  .terminal__body {
    font-size: 0.75rem;
    padding: var(--space-md) var(--space-lg);
    -webkit-overflow-scrolling: touch;
  }

  /* Fade hint for scrollable terminals */
  .terminal::after {
    content: '';
    position: absolute;
    top: 40px; /* below the bar */
    right: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to right, transparent, #0d0d18);
    pointer-events: none;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  }
  .terminal { position: relative; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid--compact { grid-template-columns: repeat(2, 1fr); }
}


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

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

  .reveal, .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}


/* ------------------------------------------
   PRINT
   ------------------------------------------ */
@media print {
  .nav, .back-to-top, .hero__bg, .hero__rainbow-trail,
  .hero__scroll-hint, .divider, .act-break { display: none; }

  body { background: #fff; color: #222; }
  .section--alt { background: #f8f8f8; }
  .section__title, .section__title--muted, .section__title--cool { color: #111; }
  .terminal { border-color: #ccc; }
  .terminal__body { color: #333; }
}
