/* =========================================================================
   buildwithmodels.com v2 — Design System
   --------------------------------------------------------------------------
   Generated via ui-ux-pro-max skill. Vendor-neutral. Professional.
   Applied patterns: Bento Grid Showcase (home) + Swiss Modernism 2.0 (lesson)
   Style: Brutalist (sharp corners, mono eyebrows) softened for professional
   audience — but still firm and uncluttered.
   --------------------------------------------------------------------------
   Light mode is the default (works for the target audience of everyday
   professionals). Dark mode is opt-in via [data-theme="dark"] on <html>.
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  font-feature-settings: "ss01", "cv01";
}

@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;
  }
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;        /* prevent any element from causing horizontal scroll */
}

/* Subtle grain overlay — breaks digital flatness, adds warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before { opacity: 0.05; mix-blend-mode: screen; }

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

button, input, select, textarea { font: inherit; color: inherit; }

/* =========================================================================
   TOKENS
   ========================================================================= */
:root {
  /* Type */
  --body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing scale (8px base, mathematical) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* Radii — sharp brutalist, with optional soft variant */
  --r-none: 0;
  --r-sm: 2px;
  --r-md: 4px;
  --r-pill: 999px;

  /* Borders */
  --bw: 1px;
  --bw-strong: 2px;

  /* Type scale */
  --t-xs: 12px;
  --t-sm: 14px;
  --t-base: 16px;
  --t-md: 18px;
  --t-lg: 20px;
  --t-xl: 24px;
  --t-2xl: clamp(28px, 3.6vw, 36px);
  --t-3xl: clamp(36px, 5vw, 48px);
  --t-4xl: clamp(48px, 7vw, 72px);

  /* Z-index scale */
  --z-base: 1;
  --z-raised: 10;
  --z-nav: 30;
  --z-progress: 40;
  --z-modal: 50;
  --z-toast: 60;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0.13, 1);
  --d-fast: 120ms;
  --d-base: 200ms;
  --d-slow: 320ms;
}

/* ---- Light theme (default) ---- */
:root,
:root[data-theme="light"] {
  /* Surfaces */
  --bg: #FAFAF7;
  --bg-elevated: #FFFFFF;
  --surface-1: #F4F2EC;
  --surface-2: #EBE8E0;
  --surface-3: #E1DDD2;

  /* Text */
  --text: #15171A;
  --text-muted: #51545B;
  --text-dim: #76797F;

  /* Lines */
  --rule: #D6D2C5;
  --rule-strong: #B5B0A1;

  /* Brand & semantic */
  --accent: #B04329;            /* terracotta */
  --accent-strong: #8E331E;     /* hover/active */
  --accent-soft: rgba(176, 67, 41, 0.08);
  --accent-ring: rgba(176, 67, 41, 0.35);

  --ok: #4F7A3A;                /* moss */
  --ok-soft: rgba(79, 122, 58, 0.10);
  --warn: #B57A1A;
  --danger: #A8311E;

  /* Focus ring */
  --focus: var(--accent);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
}

/* ---- Dark theme ---- */
:root[data-theme="dark"] {
  --bg: #0F1115;
  --bg-elevated: #15181E;
  --surface-1: #1A1E25;
  --surface-2: #232730;
  --surface-3: #2C323D;

  --text: #F0EFE9;
  --text-muted: #B0ACA1;
  --text-dim: #7C786F;

  --rule: #2E333D;
  --rule-strong: #424853;

  --accent: #E06848;            /* brighter terracotta for dark bg */
  --accent-strong: #F18669;
  --accent-soft: rgba(224, 104, 72, 0.14);
  --accent-ring: rgba(224, 104, 72, 0.4);

  --ok: #93B773;
  --ok-soft: rgba(147, 183, 115, 0.14);
  --warn: #D49A3D;
  --danger: #D26250;
}

/* =========================================================================
   BASE
   ========================================================================= */
body {
  font-family: var(--body);
  font-size: var(--t-base);
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

::selection { background: var(--accent); color: #FFFFFF; }

/* Accessible focus ring (universal) */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
button:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}

/* Skip link — keyboard a11y */
.skip-link {
  position: absolute;
  top: 0; left: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--d-base) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */
h1, h2, h3, h4 {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}
h1 { font-size: var(--t-4xl); text-wrap: balance; }
h2 { font-size: var(--t-3xl); text-wrap: balance; }
h3 { font-size: var(--t-2xl); }
h4 { font-size: var(--t-xl); }

p { color: var(--text-muted); }
strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }
code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-1);
  border: 1px solid var(--rule);
  padding: 1px 6px;
}
pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--surface-1);
  border: var(--bw) solid var(--rule);
  padding: var(--s-4);
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (min-width: 720px) {
  pre { white-space: pre-wrap; word-break: break-word; }
}
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* Monospace eyebrow / metadata */
.eyebrow,
.mono {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

/* =========================================================================
   LAYOUT PRIMITIVES
   ========================================================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 40px);
  padding-right: clamp(20px, 4vw, 40px);
}
.container-narrow {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 40px);
  padding-right: clamp(20px, 4vw, 40px);
}
.stack-1 > * + * { margin-top: var(--s-1); }
.stack-2 > * + * { margin-top: var(--s-2); }
.stack-3 > * + * { margin-top: var(--s-3); }
.stack-4 > * + * { margin-top: var(--s-4); }
.stack-6 > * + * { margin-top: var(--s-6); }
.stack-8 > * + * { margin-top: var(--s-8); }
.stack-12 > * + * { margin-top: var(--s-12); }

/* =========================================================================
   NAVBAR — static header (sits at top of page, scrolls away with content)
   ========================================================================= */
.nav-wrap {
  position: relative;
  z-index: var(--z-nav);
  background: var(--bg-elevated);
  border-bottom: var(--bw) solid var(--rule);
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 64px;
  max-width: var(--container, 1200px);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  background: var(--bg-elevated);
}
[data-theme="dark"] .nav {
  background: var(--bg-elevated);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.nav-brand img {
  display: block;
  height: 22px;
  width: auto;
}
.nav-brand img.nav-brand-dark { display: none; }
[data-theme="dark"] .nav-brand img.nav-brand-light { display: none; }
[data-theme="dark"] .nav-brand img.nav-brand-dark { display: block; }
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;          /* touch target */
  padding: 0 14px;
  font-size: var(--t-sm);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: color var(--d-base) var(--ease), background var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
  cursor: pointer;
}
.nav-link:hover { color: var(--text); background: var(--surface-1); }
.nav-link[aria-current="page"] { color: var(--text); border-color: var(--accent); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--text);
  color: var(--bg);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background var(--d-base) var(--ease), color var(--d-base) var(--ease);
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

.nav-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--d-base) var(--ease), background var(--d-base) var(--ease);
}
.nav-theme:hover { color: var(--text); background: var(--surface-1); }

.nav-mobile-toggle {
  display: none;
}

/* Mobile nav */
@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .nav-theme {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--text);
    border-radius: var(--r-sm);
    cursor: pointer;
  }
  .nav-theme:hover { background: var(--surface-1); }
  .nav-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    margin-left: 8px;
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--text);
    border-radius: var(--r-sm);
    cursor: pointer;
  }
  .nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--rule);
    border-top: 0;
    border-radius: 0 0 var(--r-md) var(--r-md);
    padding: var(--s-3);
  }
  .nav.is-open .nav-link { min-height: 44px; padding: 10px 12px; }
}
/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  font-family: var(--body);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: var(--bw) solid transparent;
  border-radius: var(--r-sm);
  transition: background var(--d-base) var(--ease), color var(--d-base) var(--ease), border-color var(--d-base) var(--ease), transform var(--d-fast) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-secondary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-secondary:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--text); background: var(--surface-1); }

.btn-sm { min-height: 36px; padding: 6px 12px; font-size: var(--t-xs); }

/* =========================================================================
   BENTO GRID (Home page)
   ========================================================================= */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-4);
}
.bento-cell {
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
  padding: clamp(20px, 2.6vw, 28px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bento-cell-feature {
  grid-column: span 8;
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.bento-cell-feature .bento-title,
.bento-cell-feature .bento-sub { color: inherit; }
.bento-cell-feature .bento-sub { opacity: 0.7; }
.bento-cell-feature .bento-eyebrow { color: var(--bg); opacity: 0.6; }
.bento-cell-feature .bento-cta { color: var(--bg); }

.bento-cell-lesson { grid-column: span 4; }
.bento-cell-half { grid-column: span 6; }
.bento-cell-third { grid-column: span 4; }

@media (max-width: 1024px) {
  .bento-cell-feature,
  .bento-cell-lesson,
  .bento-cell-half,
  .bento-cell-third { grid-column: span 12; }
}

.bento-eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bento-title {
  font-size: var(--t-2xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}
.bento-sub {
  font-size: var(--t-base);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 56ch;
}
.bento-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--s-4);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: fit-content;
  transition: gap var(--d-base) var(--ease);
}
.bento-cta:hover { gap: 10px; }
.bento-cta-arrow {
  display: inline-block;
  transition: transform var(--d-base) var(--ease);
}
.bento-cta:hover .bento-cta-arrow { transform: translateX(2px); }

.bento-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  margin-bottom: var(--s-4);
}
.bento-cell.is-planned { opacity: 0.78; background: var(--surface-1); }
.bento-cell.is-planned .bento-eyebrow { color: var(--text-dim); }
.bento-cell.is-planned .bento-num { border-color: var(--text-dim); color: var(--text-dim); }
.bento-cell.is-planned .bento-cta { color: var(--text-dim); pointer-events: none; }

/* Live (featured) feature cell: 2px terracotta top border to mark "current" */
.bento-cell-feature.is-live {
  border-top: 2px solid var(--accent);
}

/* Status badge — small dot + label, two variants */
.bento-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
}
.bento-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.bento-status.is-available {
  border-color: var(--accent);
  color: var(--accent);
}
.bento-status.is-available::before { background: var(--accent); }
.bento-status.is-coming {
  border-color: var(--rule-strong);
  color: var(--text-dim);
}
.bento-status.is-coming::before { background: var(--text-dim); }
/* On the dark feature cell, keep the available badge readable */
.bento-cell-feature .bento-status.is-available {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.bento-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-4);
}
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--r-pill);
}
.bento-cell.is-planned .chip { background: transparent; }

/* =========================================================================
   HERO (home page)
   ========================================================================= */
.hero {
  padding: clamp(56px, 8vw, 120px) 0 clamp(40px, 6vw, 80px);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  margin-bottom: var(--s-6);
  background: var(--bg-elevated);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--ok);
  border-radius: var(--r-pill);
}
.hero-title {
  font-size: var(--t-4xl);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: var(--s-5);
  max-width: 16ch;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero-lede {
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: var(--s-8);
}
.hero-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  gap: var(--s-8);
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-2xl);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-stat span {
  display: block;
  font-size: var(--t-xs);
  font-family: var(--mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* =========================================================================
   HERO MISSION (inline block, below title, above lede)
   ========================================================================= */
.hero-mission {
  max-width: 64ch;
  margin: 0 0 var(--s-8);
  padding: var(--s-5) var(--s-6);
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
}
.hero-mission-label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.hero-mission-quote {
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-3);
}
.hero-mission-meta {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.55;
}

/* =========================================================================
   SECTIONS
   ========================================================================= */
.section {
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--rule);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--s-8);
  align-items: end;
  margin-bottom: var(--s-10);
}
@media (max-width: 768px) { .section-head { grid-template-columns: 1fr; gap: var(--s-4); } }
.section-head h2 { font-size: var(--t-3xl); margin-bottom: 10px; }
.section-head p { color: var(--text-muted); max-width: 56ch; font-size: var(--t-md); }

.section-foot {
  display: flex;
  justify-content: center;
  margin-top: var(--s-10);
}

/* =========================================================================
   CALLOUT
   ========================================================================= */
.callout {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-6);
  background: var(--accent-soft);
  border: var(--bw) solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--r-sm);
}
.callout-icon {
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.5;
}
.callout-body strong { display: block; color: var(--text); margin-bottom: 4px; }
.callout-body p { color: var(--text-muted); font-size: var(--t-sm); line-height: 1.5; margin: 0; }

/* =========================================================================
   LESSON PAGE
   ========================================================================= */
.lesson-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 40px) clamp(80px, 10vw, 160px);
}
.lesson-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  margin-bottom: var(--s-8);
}
.lesson-breadcrumb a { color: inherit; text-decoration: none; }
.lesson-breadcrumb a:hover { color: var(--text); }
.lesson-breadcrumb .sep { color: var(--text-dim); }

.lesson-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  margin-bottom: var(--s-4);
  letter-spacing: 0.06em;
}
.lesson-meta-bar .sep { color: var(--rule-strong); }
.lesson-meta-bar .progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ok);
  font-weight: 600;
}
.lesson-meta-bar .progress .dot {
  width: 6px; height: 6px;
  background: var(--ok);
  border-radius: var(--r-pill);
}

.lesson-title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-4);
  max-width: 22ch;
}
.lesson-dek {
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: var(--s-10);
}

.lesson-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  margin-bottom: clamp(40px, 5vw, 64px);
}
@media (max-width: 720px) { .lesson-summary { grid-template-columns: 1fr; } }
.summary-card {
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-5);
  min-width: 0;
}
.summary-card-label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.summary-card-value {
  font-size: var(--t-md);
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}

/* Layout: sticky TOC + content */
.lesson-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 960px) {
  .lesson-grid { grid-template-columns: 1fr; }
}

.lesson-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-5);
}
.lesson-toc-title {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s-3);
  display: block;
}
.lesson-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
}
.lesson-toc li { counter-increment: toc; }
.lesson-toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px;
  align-items: center;
  padding: 8px 8px 8px 0;
  font-size: var(--t-sm);
  line-height: 1.35;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
  transition: color var(--d-base) var(--ease), background var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
  cursor: pointer;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.lesson-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.lesson-toc a:hover { color: var(--text); }
.lesson-toc a.is-active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
.lesson-toc a.is-active::before { color: var(--accent); }

/* Mobile TOC: collapsible details */
@media (max-width: 960px) {
  .lesson-toc {
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
  }
  .lesson-toc details {
    background: var(--bg-elevated);
    border: var(--bw) solid var(--rule);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
  }
  .lesson-toc summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .lesson-toc summary::-webkit-details-marker { display: none; }
  .lesson-toc summary::after { content: "+"; color: var(--accent); font-size: var(--t-lg); }
  .lesson-toc details[open] summary::after { content: "−"; }
  .lesson-toc ol { margin-top: var(--s-3); }
}

/* Lesson content */
.lesson-content {
  max-width: 70ch;
  font-size: var(--t-md);
  line-height: 1.7;
}
.lesson-content > section + section { margin-top: clamp(48px, 6vw, 72px); }
.lesson-content h2 {
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-4);
  scroll-margin-top: 100px;
}
.lesson-content h3 { font-size: var(--t-xl); margin: var(--s-8) 0 var(--s-3); }
.lesson-content p + p { margin-top: var(--s-4); }
.lesson-content ul, .lesson-content ol { margin: var(--s-4) 0; padding-left: 1.5rem; }
.lesson-content li { margin: 6px 0; color: var(--text-muted); }
.lesson-content li::marker { color: var(--text-dim); }

/* Question grid (improved from current) */
.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  margin: var(--s-6) 0;
}
@media (max-width: 600px) { .question-grid { grid-template-columns: 1fr; } }
.question-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  color: var(--text);
  line-height: 1.4;
}
.question-pill::before {
  content: "?";
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  border-radius: var(--r-pill);
}

/* Pyramid (improved) */
.pyramid {
  display: grid;
  gap: 6px;
  margin: var(--s-8) 0;
  padding: var(--s-6);
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
}
.pyramid-head {
  text-align: center;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s-4);
}
.pyramid-head .eyebrow { display: block; margin-bottom: 4px; }
.pyramid-head strong { display: block; font-size: var(--t-md); color: var(--text); }
.pyramid-stack { display: grid; gap: 4px; justify-items: center; }
.pyramid-layer {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-sm);
}
.pyramid-layer strong { display: block; color: var(--text); font-size: var(--t-sm); }
.pyramid-layer > span { display: block; font-size: var(--t-xs); color: var(--text-muted); }
.pyramid-num {
  width: 28px; height: 28px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF !important;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.pyramid-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: var(--s-4);
  padding: 12px 16px;
  background: var(--ok-soft);
  border: 1px solid var(--ok);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--t-sm);
  font-weight: 500;
}

/* Context details / accordions */
.accordion {
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-sm);
  margin: var(--s-3) 0;
  overflow: hidden;
}
.accordion summary {
  cursor: pointer;
  list-style: none;
  padding: var(--s-4) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-weight: 600;
  color: var(--text);
  font-size: var(--t-sm);
  transition: background var(--d-base) var(--ease);
}
.accordion summary:hover { background: var(--surface-1); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--t-lg);
  color: var(--accent);
  line-height: 1;
}
.accordion[open] summary::after { content: "−"; }
.accordion-body { padding: 0 var(--s-5) var(--s-5); }
.accordion-body p { color: var(--text-muted); font-size: var(--t-sm); line-height: 1.6; margin-bottom: var(--s-3); }
.accordion-body pre { margin: var(--s-3) 0; }
.accordion-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  border-radius: var(--r-pill);
}

/* Progress check (checklist) */
.progress-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-3);
  padding: 10px 12px;
  background: var(--surface-1);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  cursor: pointer;
  user-select: none;
}
.progress-check input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--d-base) var(--ease);
}
.progress-check input[type="checkbox"]:checked {
  background: var(--ok);
  border-color: var(--ok);
}
.progress-check input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}
.progress-check input[type="checkbox"]:checked + span {
  color: var(--text-dim);
  text-decoration: line-through;
}

/* Verification checklist */
.checklist {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-6) 0;
}
.checklist-item {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-4) var(--s-5);
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color var(--d-base) var(--ease);
}
.checklist-item:hover { border-color: var(--rule-strong); }
.checklist-item input { margin-top: 2px; }
.checklist-item-body { flex: 1; }
.checklist-item-body strong { display: block; color: var(--text); margin-bottom: 2px; font-size: var(--t-sm); }
.checklist-item-body span { color: var(--text-muted); font-size: var(--t-xs); }

/* Media figures */
.media-figure {
  margin: var(--s-6) 0;
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elevated);
}
.media-figure-img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface-1);
  cursor: zoom-in;
  border: 0;
}
.media-figure-caption {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--rule);
  font-size: var(--t-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.media-figure-caption strong { color: var(--text); }

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: var(--z-progress);
  transition: width 100ms linear;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
  border-top: 1px solid var(--rule);
  padding: var(--s-10) 0 var(--s-12);
  background: var(--surface-1);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-8);
  margin-bottom: var(--s-10);
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-family: var(--mono); font-weight: 700; font-size: var(--t-sm); margin-bottom: var(--s-3); }
.footer-brand span { color: var(--accent); }
.footer-tagline { font-size: var(--t-sm); color: var(--text-muted); max-width: 32ch; }
.footer-col h4 {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-size: var(--t-sm); color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  font-size: var(--t-xs);
  color: var(--text-dim);
  font-family: var(--mono);
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* =========================================================================
   SVG icons (inline, no emoji)
   ========================================================================= */
.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }

/* =========================================================================
   UTILITIES
   ========================================================================= */
.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;
}
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.divider {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: var(--s-8) 0;
}

/* =========================================================================
   PRINT (improved)
   ========================================================================= */
@media print {
  :root, :root[data-theme] {
    --bg: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --surface-1: #FFFFFF;
    --surface-2: #FFFFFF;
    --text: #000000;
    --text-muted: #1F1F1F;
    --text-dim: #4A4A4A;
    --rule: #BBBBBB;
    --rule-strong: #888888;
    --accent: #000000;
    --ok: #006622;
  }
  body { background: #FFFFFF; color: #000; font-size: 11pt; line-height: 1.5; }
  .nav-wrap, .reading-progress, .skip-link, .nav-theme, .nav-mobile-toggle { display: none !important; }
  .bento-cell { background: #FFFFFF !important; color: #000 !important; border: 1px solid #888 !important; page-break-inside: avoid; }
  .bento-cell-feature { background: #FFFFFF !important; color: #000 !important; }
  .lesson-toc { position: static; border: 1px solid #888; padding: 12px; page-break-after: avoid; }
  .lesson-summary, .pyramid, .accordion, .checklist-item, .media-figure { page-break-inside: avoid; }
  a { color: #000 !important; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .accordion[open] .accordion-body { display: block !important; }
  .accordion summary::after { display: none; }
  @page { margin: 18mm 14mm; }
  .footer { background: #FFFFFF; border-top: 1px solid #888; }
  .progress-check input[type="checkbox"] { display: none; }
  .progress-check::before { content: "☐"; font-size: 14pt; margin-right: 6px; }
  .progress-check input:checked + span::after { content: " ✓"; color: #006622; font-weight: bold; }
}

/* =========================================================================
   SLIDE-DECK LESSON LAYOUT
   Each slide is a card that owns the viewport vertically. Navigation
   controls + mark-complete button at the top, content in the middle,
   back/next at the bottom.
   ========================================================================= */
.deck {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 40px) clamp(60px, 8vw, 120px);
  min-height: calc(100dvh - 92px);
  display: flex;
  flex-direction: column;
}
.deck-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.deck-slide-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.deck-slide-num strong { color: var(--accent); font-weight: 700; }
.deck-progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
}
.deck-progress-chip strong { color: var(--text); font-weight: 700; }
.deck-progress-chip .bar {
  width: 60px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.deck-progress-chip .bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 300ms var(--ease);
}

.deck-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: var(--s-3);
  color: var(--text);
  scroll-margin-top: 96px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 14px;
}
.deck-title:focus { outline: none; }
.deck-title:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }
.deck-kicker {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--s-2);
  display: block;
}
.deck-dek {
  font-size: var(--t-md);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--s-8);
  max-width: 60ch;
}

.deck-body {
  flex: 1;
  font-size: var(--t-md);
  line-height: 1.7;
  color: var(--text);
}
.deck-body p { color: var(--text-muted); margin-bottom: var(--s-4); }
.deck-body p:last-child { margin-bottom: 0; }
.deck-body strong { color: var(--text); }
.deck-body ul, .deck-body ol { margin: var(--s-4) 0; padding-left: 1.5rem; }
.deck-body li { margin: 6px 0; color: var(--text-muted); }
.deck-body li::marker { color: var(--text-dim); }
.deck-body pre { margin: var(--s-3) 0; }
.deck-body code { font-size: 0.92em; }

/* "mark complete" button + back/next footer */
.deck-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: auto;
  padding-top: var(--s-8);
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.deck-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--d-base) var(--ease);
}
.deck-mark:hover { border-color: var(--ok); color: var(--ok); }
.deck-mark.is-complete {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}
.deck-mark.is-complete::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: var(--ok);
  color: #FFFFFF;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}
.deck-mark.is-complete::after {
  content: "Re-review";
  margin-left: -4px;
}
.deck-nav-spacer { flex: 1; }
.deck-back, .deck-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  color: var(--text);
  transition: all var(--d-base) var(--ease);
}
.deck-back:hover, .deck-next:hover { border-color: var(--text); }
.deck-back[aria-disabled="true"],
.deck-next[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}
.deck-next {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.deck-next:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.deck-back svg, .deck-next svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* Slide dots (slide indicator in the footer) */
.deck-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.deck-dot {
  width: 8px; height: 8px;
  background: var(--rule);
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  padding: 0;
  transition: all var(--d-base) var(--ease);
}
.deck-dot:hover { background: var(--rule-strong); }
.deck-dot.is-current { background: var(--accent); width: 24px; }
.deck-dot.is-complete { background: var(--ok); }

/* Quiz slide */
.quiz-question {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-6);
  margin-bottom: var(--s-4);
}
.quiz-question-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  border-radius: var(--r-pill);
  margin-bottom: var(--s-3);
}
.quiz-question-prompt {
  font-size: var(--t-md);
  color: var(--text);
  line-height: 1.5;
  font-weight: 500;
  margin-bottom: var(--s-4);
}
.quiz-options {
  display: grid;
  gap: var(--s-2);
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--d-base) var(--ease);
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--text);
}
.quiz-option:hover { border-color: var(--rule-strong); background: var(--surface-1); }
.quiz-option input[type="radio"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--d-base) var(--ease);
}
.quiz-option input[type="radio"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.quiz-option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  background: #FFFFFF;
  border-radius: var(--r-pill);
}
.quiz-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.quiz-status {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-sm);
  color: var(--text-muted);
  margin-right: auto;
}
.quiz-status .bar {
  width: 80px; height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.quiz-status .bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width 200ms var(--ease); }
.quiz-status strong { color: var(--text); font-weight: 700; }

/* Results slide */
.results-hero {
  text-align: center;
  padding: var(--s-10) var(--s-6);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  margin-bottom: var(--s-8);
  background: var(--bg-elevated);
}
.results-hero[data-score-tier="perfect"] {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.results-hero[data-score-tier="good"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.results-hero[data-score-tier="poor"] {
  background: var(--surface-1);
  border-color: var(--text-dim);
}
.results-score {
  font-family: var(--mono);
  font-size: clamp(56px, 10vw, 96px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: var(--s-3);
}
.results-hero[data-score-tier="perfect"] .results-score { color: var(--ok); }
.results-hero[data-score-tier="good"] .results-score { color: var(--accent); }
.results-label {
  font-family: var(--mono);
  font-size: var(--t-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--s-3);
}
.results-message {
  font-size: var(--t-md);
  color: var(--text);
  line-height: 1.5;
  max-width: 50ch;
  margin: 0 auto;
}

.results-review {
  display: grid;
  gap: var(--s-3);
}
.results-item {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-strong);
  border-radius: var(--r-md);
  padding: var(--s-5) var(--s-6);
}
.results-item.is-correct {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}
.results-item.is-incorrect {
  border-left-color: var(--danger);
  background: rgba(168, 49, 30, 0.06);
}
.results-item-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.results-icon {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}
.results-item.is-correct .results-icon { background: var(--ok); }
.results-item.is-incorrect .results-icon { background: var(--danger); }
.results-question {
  font-size: var(--t-sm);
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}
.results-answers {
  display: grid;
  gap: 6px;
  margin: var(--s-3) 0;
  font-size: var(--t-sm);
  line-height: 1.5;
}
.results-answer-line {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--s-3);
  align-items: start;
}
.results-answer-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding-top: 2px;
}
.results-answer-value { color: var(--text-muted); }
.results-item.is-correct .results-answer-value.is-correct-value { color: var(--ok); font-weight: 500; }
.results-item.is-incorrect .results-answer-value.is-your-value { color: var(--danger); }
.results-explain {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
}
.results-explain strong { color: var(--text); }
.results-rereview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  transition: all var(--d-base) var(--ease);
  cursor: pointer;
}
.results-rereview:hover { background: var(--accent); color: #FFFFFF; }
.results-rereview svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* Hide non-active slides; only one slide visible at a time */
.slide { display: none; }
.slide.is-active { display: flex; flex-direction: column; flex: 1; }

/* Intro slide TOC list */
.intro-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  counter-reset: intro-toc;
}
.intro-toc li { counter-increment: intro-toc; }
.intro-toc a {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  font-size: var(--t-sm);
  line-height: 1.4;
  transition: all var(--d-base) var(--ease);
  cursor: pointer;
}
.intro-toc a:hover {
  border-color: var(--rule-strong);
  background: var(--surface-1);
  transform: translateX(2px);
}
.intro-toc a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.intro-toc a::before {
  content: counter(intro-toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-dim);
  font-weight: 600;
  text-align: center;
}
.intro-toc a:hover::before { color: var(--accent); }
.intro-toc .toc-arrow {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: var(--t-base);
  transition: color var(--d-base) var(--ease), transform var(--d-base) var(--ease);
}
.intro-toc a:hover .toc-arrow { color: var(--accent); transform: translateX(2px); }
.intro-toc-secondary {
  list-style: none;
  padding: var(--s-3) 0 0;
  margin: var(--s-3) 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 4px;
}
.intro-toc-secondary li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: 10px 16px;
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.4;
}
.intro-toc-secondary .toc-arrow-secondary {
  font-family: var(--mono);
  color: var(--text-dim);
  text-align: center;
  font-size: var(--t-base);
}
.intro-toc-secondary .toc-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  color: var(--text-dim);
  font-weight: 600;
}
.intro-meta-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}
.intro-meta-row .eyebrow { display: inline-block; }
.intro-meta-row .meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
}
.intro-meta-row .meta-pill strong { color: var(--text); font-weight: 600; }
.intro-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
@media (max-width: 720px) { .intro-summary-cards { grid-template-columns: 1fr; } }
.intro-summary-card {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  min-width: 0;
}
.intro-summary-card-label {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.intro-summary-card-value {
  font-size: var(--t-sm);
  color: var(--text);
  line-height: 1.4;
  font-weight: 500;
}

/* Hide back button on slide 1 */
.deck-back[hidden] { display: none; }

/* When a slide is the active one, force its display: flex (override .slide's display:none) */
.slide[aria-current="step"] { display: flex; flex-direction: column; flex: 1; }

/* Quiz: hide back/next while taking it; only "Submit" shown */
.deck.is-quiz .deck-back,
.deck.is-quiz .deck-next,
.deck.is-quiz .deck-mark { display: none; }
.deck.is-quiz .deck-dots { display: none; }
.deck.is-quiz .deck-nav-spacer { display: none; }

/* Results: hide back button (no going back to a quiz already submitted) */
.deck.is-results .deck-back { display: none; }

/* Mark complete states: visible "completed" badge next to slide title */
.deck-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ok);
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--ok);
  border-radius: var(--r-pill);
  background: var(--ok-soft);
  align-self: center;
  flex-shrink: 0;
}
.deck-complete-badge::before { content: "✓"; font-weight: 700; font-size: 12px; }
.deck-complete-badge[hidden] { display: none; }

/* Lab download card (sample meeting notes for the lab) */
.lab-download {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  border: 1px dashed var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.lab-download-text { flex: 1 1 280px; min-width: 0; }
.lab-download-text strong {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}
.lab-download-text p {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: 1.5;
}
.lab-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--d-base) var(--ease);
  flex-shrink: 0;
}
.lab-download-btn:hover {
  background: #FFFFFF;
  color: var(--accent);
}
.lab-download-btn:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

/* Lab step list (used on standalone labs page) */
.lab-steps { display: flex; flex-direction: column; gap: var(--s-5); }
.lab-step { display: grid; grid-template-columns: 48px 1fr; gap: var(--s-4); padding: var(--s-3) 0; }
.lab-step + .lab-step { border-top: 1px solid var(--rule); padding-top: var(--s-5); margin-top: var(--s-2); }
.lab-step-num {
  font-family: var(--mono);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1;
  padding-top: 4px;
}
.lab-step-body h3 {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-2);
  color: var(--text);
}
.lab-step-body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: var(--t-md);
}
.lab-step-body p em { font-style: italic; color: var(--text); background: var(--surface-1); padding: 1px 4px; border-radius: 3px; font-size: 0.95em; }

/* Context checklist page (standalone, print-friendly) */
.resource-page .hero { padding-bottom: var(--s-8); }
.checklist-section {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: var(--bw) solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-8);
}
.checklist-section-head { margin-bottom: var(--s-6); }
.checklist-section-head .eyebrow { margin-bottom: var(--s-3); }
.checklist-section-head h2 {
  font-size: var(--t-3xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 var(--s-3);
  color: var(--text);
}
.checklist-section-dek {
  color: var(--text-muted);
  font-size: var(--t-md);
  line-height: 1.6;
  margin: 0;
  max-width: 60ch;
}
.checklist-list { list-style: none; padding: 0; margin: 0; counter-reset: vc; display: flex; flex-direction: column; }
.checklist-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--s-4);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: vc;
}
.checklist-item:first-child { padding-top: 0; }
.checklist-item:last-child { padding-bottom: 0; border-bottom: 0; }
.checklist-num {
  font-family: var(--mono);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1;
  padding-top: 4px;
}
.checklist-body h3 {
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-2);
  color: var(--text);
}
.checklist-q {
  color: var(--text);
  margin: 0 0 var(--s-2);
  font-size: var(--t-md);
  line-height: 1.5;
  font-weight: 500;
}
.checklist-why {
  color: var(--text-muted);
  font-size: var(--t-sm);
  line-height: 1.55;
  margin: 0;
}
.checklist-example {
  margin: var(--s-3) 0 0;
  font-size: 12px;
  line-height: 1.55;
  background: var(--surface-1);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.print-only { display: none; }
.no-print {}

/* Quiz submit button */
.quiz-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--d-base) var(--ease);
}
.quiz-submit:hover:not([aria-disabled="true"]) { background: var(--accent-strong); border-color: var(--accent-strong); }
.quiz-submit[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }

/* Print: each slide prints as its own page */
@media print {
  .deck { min-height: auto; page-break-after: always; }
  .slide { display: flex !important; flex-direction: column !important; page-break-after: always; }
  .slide:not(:last-of-type) { page-break-after: always; }
  .deck-actions, .deck-progress-chip, .deck-dots { display: none !important; }
  .results-rereview::after { content: " (" attr(href) ")"; }

  /* Resource page: strip chrome, show only the checklist content */
  body.resource-page { background: #fff; }
  body.resource-page .nav-wrap,
  body.resource-page .footer,
  body.resource-page .no-print,
  body.resource-page .skip-link { display: none !important; }
  body.resource-page .hero { padding: 0 0 var(--s-6); }
  body.resource-page .hero-eyebrow { color: #000; border-color: #000; }
  body.resource-page .hero-title,
  body.resource-page .checklist-section-head h2,
  body.resource-page .checklist-body h3 { color: #000 !important; }
  body.resource-page .hero-mission,
  body.resource-page .checklist-section,
  body.resource-page .checklist-example { background: #fff !important; border-color: #555 !important; box-shadow: none !important; }
  body.resource-page .checklist-num { color: #000 !important; }
  body.resource-page .checklist-q,
  body.resource-page .checklist-why,
  body.resource-page .checklist-section-dek { color: #000 !important; }
  body.resource-page .checklist-section { page-break-inside: avoid; }
  body.resource-page .checklist-item { page-break-inside: avoid; }
  body.resource-page .print-only { display: block; }
  body.resource-page a { color: #000 !important; text-decoration: none !important; }
  body.resource-page a::after { content: ""; }
}

/* ---- Mobile refinements (≤640px) ----
   On phones, the deck-actions row is dense: Mark complete + 8 dots
   + Back + Next. We stack them into clean rows so nothing overlaps. */
@media (max-width: 640px) {
  .deck-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-3);
  }
  .deck-mark {
    width: 100%;
    justify-content: center;
  }
  .deck-nav-spacer { display: none; }
  .deck-dots {
    order: 3;
    justify-content: center;
    padding: var(--s-2) 0;
  }
  .deck-back, .deck-next {
    min-height: 44px;
  }
  /* Make Back/Next sit on the same row at full width each */
  .deck-back, .deck-next { flex: 1 1 0; justify-content: center; }
  .deck-back { order: 2; }
  .deck-next { order: 1; }
  /* Deck header: stack slide-num above progress chip on tiny screens */
  .deck-header { gap: var(--s-2); }
  .deck-progress-chip { margin-left: 0; font-size: var(--t-xxs, 11px); }
  /* Quiz header: stack answered count above progress bar on tiny screens */
  .quiz-status { flex-direction: column; align-items: flex-start; gap: 4px; }
  .quiz-status .bar { width: 100%; }
  /* Pyramid layers: tighten spacing on mobile */
  .pyramid { padding: var(--s-4) var(--s-3); }
  .pyramid-num { width: 28px; height: 28px; font-size: 13px; }
  .pyramid-layer > span { font-size: 12px; }
  /* Lab steps: tighten margins on mobile */
  .lab-step { padding: var(--s-3); }
  .lab-step h4 { font-size: var(--t-md); }
  /* Results hero: tighten on mobile */
  .results-hero { padding: var(--s-5) var(--s-4); }
  .results-score { font-size: var(--t-2xl, 2rem); }
  /* Intro slide: smaller TOC list on mobile */
  .intro-toc { font-size: var(--t-sm); }
}
