/* ==========================================================================
   True Core Peptides — Shared Design System (truecorepeptides.com)
   Pure Daylight White ground · Pale Sky Wash explainer boards · Soft Sun Wash
   Display: Bricolage Grotesque · Body: Lexend · Flat 1.5px architectural rules
   ========================================================================== */

:root {
  /* Color Palette */
  --bg: #FFFFFF;
  --sky: #EEF4FC;
  --sky-hover: #E2EEFC;
  --sun: #FEF6DC;
  --sun-rule: #EBD58C;
  --rule: #CFDCEB;
  --ink: #121B2B;
  --ink-2: #3E4A5E;
  --caption: #525E70;
  --accent: #0B52BD;
  --accent-hover: #073C8F;
  --accent-tint: #C7DCFA;
  --marigold: #F2B929;
  --ochre-text: #8F5000;

  /* Typography */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Lexend", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing Scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.75rem;
  --s-8: 3.5rem;
  --s-9: 4.5rem;

  /* Radii & Borders */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --border-w: 1.5px;

  /* Layout Measures (rem-capped for fallback-font safety) */
  --wrap-max: 77.5rem;      /* 1240px */
  --breakout-max: 67.5rem;  /* 1080px */
  --prose-max: 39rem;       /* 624px -> ~56-68 chars in Lexend, <=73 in fallbacks */
  --deck-max: 38rem;        /* 608px */
  --heading-max: 46rem;     /* 736px */
}

/* ==========================================================================
   Base Reset & Accessibility
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  z-index: 1000;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.625rem 1.125rem;
  overflow: visible;
  clip-path: none;
}

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

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Core Layout Containers
   ========================================================================== */

.page-wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-left: clamp(1rem, 3.5vw, 2.5rem);
  padding-right: clamp(1rem, 3.5vw, 2.5rem);
}

.reading-col {
  max-width: var(--prose-max);
  margin-left: auto;
  margin-right: auto;
}

.breakout {
  max-width: var(--breakout-max);
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Shared Header & Pill-Segmented Curriculum Navigation
   ========================================================================== */

.site-header {
  background: var(--bg);
  border-bottom: var(--border-w) solid var(--rule);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.wordmark:hover {
  color: var(--accent);
}

.mark-pill {
  width: 26px;
  height: 15px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 3px solid var(--marigold);
  display: inline-block;
  flex-shrink: 0;
}

.pill-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: var(--sky);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.pill-nav a {
  text-decoration: none;
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-2);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: background-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.pill-nav a:hover {
  color: var(--accent);
  background: var(--bg);
}

.pill-nav a.active,
.pill-nav a[aria-current="page"] {
  background: var(--accent);
  color: #FFFFFF;
}

.nav-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  line-height: 1.25;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--rule);
  background: var(--bg);
  flex-shrink: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-utility:hover {
  background: var(--sky);
  border-color: var(--accent);
}

.nav-utility.active,
.nav-utility[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ==========================================================================
   Shared Interactive Controls & Signature Components
   ========================================================================== */

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  padding: 0.78rem 1.625rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--accent);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.btn-pill:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96875rem;
  line-height: 1.3;
  padding: 0.72rem 1.4rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--accent);
  transition: background-color 140ms ease, color 140ms ease;
}

.btn-outline:hover {
  background: var(--sky);
  color: var(--accent-hover);
}

.inline-link,
.prose a,
.qa-a a,
.primer-note a,
.stage-desc a,
.editorial-copy a,
.diagram-caption a,
.data-table a,
.table-note a,
.safety-note a,
.analogy-box a,
.one-sentence-band a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-tint);
  padding-bottom: 1px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.inline-link:hover,
.prose a:hover,
.qa-a a:hover,
.primer-note a:hover,
.stage-desc a:hover,
.editorial-copy a:hover,
.diagram-caption a:hover,
.data-table a:hover,
.table-note a:hover,
.safety-note a:hover,
.analogy-box a:hover,
.one-sentence-band a:hover {
  background: var(--sky);
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

.stage-highlight .stage-desc a:hover,
.analogy-box a:hover {
  background: #F9EBBA;
}

/* Marigold & Cobalt Step Circles */
.step-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--marigold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem; /* 15px */
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.step-circle.med {
  width: 36px;
  height: 36px;
  font-size: 0.96875rem;
}

.step-circle.large {
  width: 44px;
  height: 44px;
  font-size: 1.125rem;
}

.step-circle.step-blue {
  background: var(--accent);
  color: #FFFFFF;
}

.step-circle.step-soft {
  background: var(--sky);
  color: var(--accent);
  border: var(--border-w) solid var(--accent);
}

.step-circle.step-wide {
  width: auto;
  min-width: 2.5rem;
  padding: 0 0.55rem;
  border-radius: var(--radius-pill);
}

.step-circle.large.step-wide {
  min-width: 3.1rem;
  padding: 0 0.7rem;
}

/* Signature: Numbered Step-Pill & "In One Sentence" Band */
.one-sentence-band {
  display: flex;
  align-items: flex-start;
  gap: 1.125rem;
  background: var(--sky);
  border: var(--border-w) solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.one-sentence-band .band-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--accent);
  line-height: 1.35;
}

.one-sentence-band .band-text {
  margin: 0;
  font-size: 1.0625rem; /* 17px */
  font-weight: 500;
  color: var(--ink);
  line-height: 1.6;
  max-width: var(--prose-max);
}

/* "In Plain English" Analogy Box */
.analogy-box {
  background: var(--sun);
  border: var(--border-w) solid var(--sun-rule);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: var(--s-6) 0;
}

.analogy-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ochre-text);
  line-height: 1.32;
}

.analogy-box p {
  margin: 0 0 0.85rem;
  font-size: 1.03125rem;
  line-height: 1.68;
}

.analogy-box p:last-child {
  margin-bottom: 0;
}

/* Safety Concerns & Unknowns Panel */
.safety-note {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-left: 4px solid var(--ochre-text);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: var(--s-6) 0;
}

.safety-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--ochre-text);
  line-height: 1.32;
}

.safety-note p {
  margin: 0 0 0.9rem;
  font-size: 1.03125rem;
  line-height: 1.68;
}

.safety-note ul {
  margin: 0 0 0.9rem;
  padding-left: 1.35rem;
}

.safety-note li {
  margin-bottom: 0.55rem;
  font-size: 1.03125rem;
  line-height: 1.65;
}

.safety-note p:last-child,
.safety-note ul:last-child,
.safety-note li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Home Hero & Full-Bleed Visual Guide 01 Progression Band
   ========================================================================== */

.hero-center {
  text-align: center;
  padding-top: clamp(1.15rem, 2vw, 1.45rem);
  padding-bottom: clamp(1.1rem, 1.85vw, 1.35rem);
}

.lesson-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--sun);
  border: var(--border-w) solid var(--sun-rule);
  border-radius: var(--radius-pill);
  padding: 4px 16px 4px 6px;
  margin-bottom: 0.7rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.1vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 auto 0.6rem;
  max-width: 48rem;
}

.hero-brand-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.hero-deck {
  margin: 0 auto 1rem;
  max-width: var(--deck-max);
  font-size: 1.0625rem; /* 17px */
  color: var(--ink-2);
  line-height: 1.58;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Full-Bleed Pale Sky Wash Progression Band */
.primer-band {
  background: var(--sky);
  border-top: var(--border-w) solid var(--rule);
  border-bottom: var(--border-w) solid var(--rule);
  padding: 1.05rem 0 1.15rem;
}

.primer-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-bottom: 0.75rem;
}

.primer-label {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.primer-hint {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--ochre-text);
}

.stage-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  user-select: none;
}

.stage-card {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stage-highlight {
  background: var(--sun);
  border: 2.5px solid var(--accent);
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  align-self: flex-start;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  text-align: left;
}

.title-blue {
  color: var(--accent);
}

.stage-svg {
  display: block;
  width: 100%;
  max-width: 146px;
  height: auto;
  margin: 0.1rem 0 0.45rem;
}

.stage-desc {
  margin: 0 0 0.55rem;
  font-size: 0.95rem; /* 15.2px */
  color: var(--ink-2);
  line-height: 1.44;
  flex: 1;
}

.stage-tag {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.tag-ochre {
  color: var(--ochre-text);
}

.tag-blue {
  color: var(--accent);
}

.tag-slate {
  color: var(--caption);
}

.primer-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: var(--border-w) solid var(--rule);
}

.primer-note {
  margin: 0;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.52;
  color: var(--caption);
  max-width: 40rem;
}

.primer-foot-link {
  font-size: 0.9375rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Home: Core Idea Band & 7-Lesson Curriculum Ledger
   ========================================================================== */

.home-section {
  padding: 3rem 0;
}

.home-section-tight {
  padding: 2.35rem 0 3rem;
}

.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem 2rem;
  margin: 2.25rem 0 1.6rem;
}

.section-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--ochre-text);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  max-width: 34rem;
}

.section-lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 32rem;
}

.arc-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: var(--border-w) solid var(--rule);
}

.arc-group {
  display: grid;
  grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr);
  gap: 1.25rem 2.75rem;
  padding: 1.6rem 0;
  border-bottom: var(--border-w) solid var(--rule);
  align-items: start;
}

.arc-meta {
  padding-top: 0.35rem;
}

.arc-tag {
  display: inline-block;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--accent);
  background: var(--sky);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.75rem;
  margin-bottom: 0.65rem;
}

.arc-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.45rem;
}

.arc-desc {
  margin: 0;
  font-size: 0.96875rem;
  line-height: 1.58;
  color: var(--ink-2);
  max-width: 22rem;
}

.lesson-list,
.prose .lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.error-list {
  margin-top: var(--s-5);
}

.lesson-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem 1.1rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.lesson-row:hover {
  background: var(--sky);
  border-color: var(--accent);
}

.lesson-row-body {
  min-width: 0;
}

.lesson-row-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.lesson-row:hover .lesson-row-title {
  color: var(--accent);
}

.lesson-row-summary {
  display: block;
  font-size: 0.96875rem;
  line-height: 1.56;
  color: var(--ink-2);
  max-width: 39rem;
}

.lesson-row-arrow {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 140ms ease;
}

.lesson-row:hover .lesson-row-arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   Home: "Three Questions Beginners Ask First" (Full-Bleed Pale Sky Wash)
   ========================================================================== */

.qa-band {
  background: var(--sky);
  border-top: var(--border-w) solid var(--rule);
  border-bottom: var(--border-w) solid var(--rule);
  padding: 3rem 0;
}

.qa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem 2rem;
  margin-bottom: 1.65rem;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.qa-item {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  align-items: start;
}

.qa-q-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.qa-q-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.qa-question {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}

.qa-short {
  margin: 0;
  background: var(--sun);
  border: var(--border-w) solid var(--sun-rule);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  line-height: 1.48;
  color: var(--ink);
}

.qa-a p {
  margin: 0 0 0.85rem;
  font-size: 1.03125rem; /* 16.5px */
  line-height: 1.68;
  color: var(--ink);
  max-width: var(--prose-max);
}

.qa-a-foot {
  margin: 0;
  font-size: 0.96875rem;
}

/* ==========================================================================
   Home: Editorial Transparency & Sources Band
   ========================================================================== */

.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
}

.editorial-copy p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  max-width: var(--prose-max);
}

.editorial-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.promise-box {
  background: var(--sun);
  border: var(--border-w) solid var(--sun-rule);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.6rem;
}

.promise-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ochre-text);
}

.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.promise-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.96875rem;
  line-height: 1.56;
  color: var(--ink);
}

.promise-list strong {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   Content Chapter Pages (Lessons 01-07, Glossary, References, About, Contact)
   Unified single left edge inside .page-wrap + 2-column handbook spread
   ========================================================================== */

.chapter-banner {
  background: var(--sky);
  border-bottom: var(--border-w) solid var(--rule);
  padding: 1.5rem 0 2.25rem;
}

.chapter-banner-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--prose-max)) minmax(0, 1fr);
  gap: 1.5rem 2.75rem;
  align-items: end;
}

.chapter-head-wrap {
  max-width: var(--prose-max);
  margin-left: 0;
  margin-right: 0;
}

.banner-aside {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.toc-heading {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.toc-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.toc-list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.toc-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ochre-text);
  flex-shrink: 0;
}

.terms-divider {
  margin: 0.95rem 0 0.7rem;
  border: 0;
  border-top: var(--border-w) solid var(--rule);
}

.terms-label {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--caption);
  line-height: 1.3;
}

.terms-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--rule);
  background: var(--sky);
  color: var(--ink);
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.term-chip:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.chapter-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.rail-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--caption);
  margin-right: 0.35rem;
}

.rail-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--rule);
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.rail-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rail-pill.active,
.rail-pill[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  color: var(--caption);
  margin: 0 0 0.85rem;
  list-style: none;
  padding: 0;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent-tint);
}

.breadcrumb a:hover {
  border-bottom-color: var(--accent);
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.024em;
  color: var(--ink);
  margin: 0 0 0.85rem;
  max-width: 42rem;
}

.chapter-deck {
  margin: 0;
  font-size: 1.125rem; /* 18px */
  line-height: 1.62;
  color: var(--ink-2);
  max-width: var(--deck-max);
}

.chapter-body {
  padding: var(--s-7) 0 var(--s-8);
}

.chapter-body .reading-col {
  margin-left: 0;
  margin-right: 0;
}

.chapter-body .one-sentence-band {
  max-width: none;
  margin: 0 0 var(--s-6);
}

.chapter-body .one-sentence-band.band-full {
  margin-bottom: var(--s-7);
}

/* Two-Column Handbook Spread (aligned to .page-wrap left edge) */
.lesson-spread {
  display: grid;
  grid-template-columns: minmax(0, var(--prose-max)) minmax(0, 1fr);
  gap: 2rem 2.75rem;
  align-items: start;
}

.lesson-spread + .lesson-spread {
  margin-top: var(--s-7);
}

.spread-main {
  min-width: 0;
}

.spread-aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spread-aside .diagram-board {
  max-width: none;
  margin: 0;
  padding: 1.15rem 1.2rem;
}

.spread-aside .diagram-plate {
  padding: 0.9rem;
}

.spread-aside .diagram-plate img {
  max-width: 100%;
}

.spread-aside .analogy-box,
.spread-aside .safety-note,
.spread-aside .status-card {
  margin: 0;
}

/* Full-width Split Safety Panel (aligned flush-left below tables) */
.safety-note.safety-split {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 1.25rem 2.75rem;
  align-items: start;
  margin: var(--s-7) 0 0;
  padding: 1.5rem 1.75rem;
}

.safety-split-head {
  min-width: 0;
}

.safety-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--caption);
  line-height: 1.35;
}

.safety-split-body {
  min-width: 0;
  max-width: var(--prose-max);
}

.safety-split-body p:first-child {
  margin-top: 0;
}

.safety-split-body ul {
  margin: 0.5rem 0 0;
  padding-left: 1.35rem;
}

.safety-split-body li {
  margin-bottom: 0.65rem;
  font-size: 1.03125rem;
  line-height: 1.66;
}

.safety-split-body li:last-child {
  margin-bottom: 0;
}

.safety-split-body p {
  margin: 0 0 0.95rem;
  font-size: 1.03125rem;
  line-height: 1.68;
}

.safety-split-body p:last-child {
  margin-bottom: 0;
}

/* Prose Typography */
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: var(--s-7) 0 var(--s-4);
  scroll-margin-top: 1.5rem;
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: var(--s-6) 0 var(--s-3);
  scroll-margin-top: 1.5rem;
}

.prose .analogy-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ochre-text);
  line-height: 1.32;
}

.prose .safety-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--ochre-text);
  line-height: 1.32;
}

.prose p {
  margin: 0 0 1.25rem;
  font-size: 1.0625rem; /* 17px */
  line-height: 1.72;
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.55rem;
  font-size: 1.0625rem;
  line-height: 1.68;
}

/* Diagram Boards */
.diagram-board {
  background: var(--sky);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin: var(--s-7) 0;
  max-width: none;
}

.diagram-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.85rem;
  margin-bottom: 1rem;
}

.diagram-id {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ochre-text);
  font-variant-numeric: tabular-nums;
}

.diagram-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink);
  margin: 0;
}

.diagram-plate {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: 10px;
  padding: 1rem;
}

.diagram-plate img {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  margin: 0 auto;
}

.diagram-caption {
  margin: 0.9rem 0 0;
  font-size: 0.96875rem; /* 15.5px */
  line-height: 1.6;
  color: var(--caption);
  max-width: 44rem;
}

/* Tables (full width, flush left inside .page-wrap) */
.table-wrap {
  max-width: none;
  margin: var(--s-7) 0;
}

.table-scroll {
  overflow-x: auto;
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.table-note {
  margin: 0.65rem 0 0;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.55;
  color: var(--caption);
  max-width: 44rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96875rem; /* 15.5px */
  line-height: 1.52;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: var(--border-w) solid var(--rule);
  vertical-align: top;
}

.data-table thead th {
  background: var(--sky);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Lesson 06 Inline Toolkit Grid (stacks cleanly inside right companion rail) */
.diagram-board-wide {
  max-width: none;
}

.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spread-aside .toolkit-grid {
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.toolkit-card {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: 10px;
  padding: 0.95rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
}

.spread-aside .toolkit-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-areas:
    "svg head"
    "svg desc"
    "svg tag";
  align-items: center;
  text-align: left;
  gap: 0.25rem 0.9rem;
  padding: 0.8rem 0.95rem;
}

.spread-aside .toolkit-card-head {
  grid-area: head;
}

.spread-aside .toolkit-svg {
  grid-area: svg;
  max-width: 88px;
  margin: 0;
}

.spread-aside .toolkit-desc {
  grid-area: desc;
}

.spread-aside .toolkit-tag {
  grid-area: tag;
}

.toolkit-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.03125rem;
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
}

.toolkit-svg {
  display: block;
  width: 100%;
  max-width: 132px;
  height: auto;
  margin: 0.15rem 0 0.25rem;
}

.toolkit-desc {
  margin: 0;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.46;
  color: var(--ink-2);
  flex: 1;
}

.toolkit-tag {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--ochre-text);
  line-height: 1.3;
}

.toolkit-desc a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-tint);
  padding-bottom: 1px;
}

.toolkit-desc a:hover {
  background: var(--sky);
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

/* Bottom Lesson Stepper (full width, flush left inside .page-wrap) */
.lesson-stepper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: none;
  margin: var(--s-8) 0 0;
  padding-top: var(--s-6);
  border-top: var(--border-w) solid var(--rule);
}

.stepper-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.stepper-card:hover {
  background: var(--sky);
  border-color: var(--accent);
}

.stepper-card.next {
  text-align: right;
  align-items: flex-end;
}

.stepper-dir {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ochre-text);
}

.stepper-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.stepper-card:hover .stepper-title {
  color: var(--accent);
}

/* Glossary, References, About & Contact Modules */
.glossary-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0;
  margin-bottom: var(--s-6);
}

.jump-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--rule);
  background: var(--sky);
  color: var(--ink);
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.jump-pill:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.glossary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.75rem;
  margin: 0 0 var(--s-6);
  padding: 0;
  border-top: var(--border-w) solid var(--rule);
}

.glossary-entry {
  padding: 1.15rem 0;
  border-bottom: var(--border-w) solid var(--rule);
}

.glossary-entry dt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
  line-height: 1.28;
}

.glossary-entry dd {
  margin: 0;
  font-size: 1.03125rem;
  line-height: 1.66;
  color: var(--ink);
  max-width: 34rem;
}

.glossary-entry dd + dd {
  margin-top: 0.45rem;
}

.glossary-meta {
  font-size: 0.9375rem; /* 15px */
  color: var(--caption);
}

.wide-section {
  max-width: none;
}

.wide-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: var(--s-7) 0 var(--s-4);
  scroll-margin-top: 1.5rem;
}

.wide-section > h2:first-child {
  margin-top: 0;
}

.glossary-entry a,
.ref-item a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-tint);
  padding-bottom: 1px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.glossary-entry a:hover,
.ref-item a:hover {
  background: var(--sky);
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

.ref-group {
  margin-bottom: var(--s-7);
}

.ref-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: var(--s-7) 0 var(--s-3);
}

.ref-group:first-of-type .ref-group-head {
  margin-top: 0;
}

.ref-group-head h2 {
  margin: 0;
}

.ref-count {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--ochre-text);
  font-variant-numeric: tabular-nums;
}

.ref-list,
.prose .ref-list,
.wide-section .ref-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: var(--border-w) solid var(--rule);
}

.ref-item {
  padding: 1rem 0;
  margin: 0;
  border-bottom: var(--border-w) solid var(--rule);
  font-size: 0.96875rem;
  line-height: 1.58;
}

.error-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: var(--s-5);
}

.ref-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.32;
}

.ref-meta {
  color: var(--ink-2);
  display: block;
  margin-bottom: 0.35rem;
}

.ref-url {
  font-size: 0.9375rem; /* 15px */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.status-card {
  background: var(--sky);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: var(--s-5) 0 var(--s-6);
}

.prose > .status-card:first-child {
  margin-top: 0;
}

.prose .status-card-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.status-card p:last-child,
.status-card ul:last-child {
  margin-bottom: 0;
}

.checklist-box {
  background: var(--sky);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin: var(--s-6) 0;
}

.prose .checklist-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.checklist-items,
.prose .checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checklist-items li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.03125rem;
  line-height: 1.62;
}

.checklist-items .step-circle {
  margin-top: 0.15rem;
}

.compare-section {
  margin: var(--s-7) 0 var(--s-6);
}

.compare-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--s-3);
  scroll-margin-top: 1.5rem;
}

.compare-section > p {
  margin: 0 0 var(--s-5);
  max-width: var(--prose-max);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
}

.compare-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.compare-card {
  background: var(--bg);
  border: var(--border-w) solid var(--rule);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  font-size: 1.03125rem;
  line-height: 1.68;
  color: var(--ink);
}

.compare-card a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-tint);
  padding-bottom: 1px;
}

.compare-card a:hover {
  background: var(--sky);
  border-bottom-color: var(--accent);
  color: var(--accent-hover);
}

/* ==========================================================================
   Shared Site Footer (Pale Sky Wash)
   ========================================================================== */

.site-footer {
  background: var(--sky);
  border-top: var(--border-w) solid var(--rule);
  padding: var(--s-7) 0 var(--s-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: 2rem 2.25rem;
  padding-bottom: var(--s-6);
}

.footer-brand-note {
  margin: 0.75rem 0 0;
  font-size: 0.96875rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 22rem;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-links a {
  font-size: 0.9375rem; /* 15px */
  line-height: 1.45;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.footer-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: var(--border-w) solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.footer-disclaimer {
  margin: 0;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.58;
  color: var(--caption);
  max-width: 36rem;
}

.footer-domain {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--caption);
}

/* ==========================================================================
   Responsive Layout: Compact Desktop (<= 1040px), Tablet (<= 980px), Phone (<= 560px)
   ========================================================================== */

@media (max-width: 1040px) {
  .chapter-banner-grid,
  .lesson-spread,
  .safety-note.safety-split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .spread-aside .toolkit-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .top-bar {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  .wordmark {
    order: 1;
  }

  .nav-utility {
    order: 2;
  }

  .pill-nav {
    order: 3;
    flex-basis: 100%;
    border-radius: var(--radius-lg);
    justify-content: center;
  }

  .stage-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .flow-arrow {
    display: none;
  }

  .arc-group {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .qa-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .editorial-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .glossary-list,
  .ref-list,
  .prose .ref-list,
  .wide-section .ref-list,
  .error-list,
  .compare-pair {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 560px) {
  .top-bar {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    gap: 0.65rem;
  }

  .wordmark {
    font-size: 1.1875rem;
    gap: 0.5rem;
  }

  .mark-pill {
    width: 22px;
    height: 13px;
  }

  .nav-utility {
    padding: 0.45rem 0.9rem;
    min-height: 40px;
  }

  .pill-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-lg);
  }

  .pill-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.4rem 0.35rem;
    text-align: center;
    font-size: 0.9375rem; /* 15px */
    border-radius: 10px;
  }

  .hero-center {
    text-align: left;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .hero-title {
    margin-left: 0;
  }

  .hero-deck {
    margin-left: 0;
  }

  .hero-cta-row {
    justify-content: flex-start;
    gap: 1rem;
  }

  .stage-flow {
    grid-template-columns: 1fr;
  }

  .one-sentence-band {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.125rem 1.125rem;
  }

  .lesson-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 0.95rem 1rem;
  }

  .lesson-row .step-circle {
    margin-top: 0.1rem;
  }

  .lesson-row-arrow {
    display: none;
  }

  .qa-item {
    padding: 1.2rem 1.1rem;
  }

  .diagram-board,
  .spread-aside .diagram-board {
    padding: 0.85rem 0.4rem;
  }

  .diagram-plate,
  .spread-aside .diagram-plate {
    padding: 0.3rem 0.2rem;
  }

  .spread-aside .toolkit-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.9rem 0.85rem;
  }

  .spread-aside .toolkit-svg {
    max-width: 112px;
  }

  .safety-note.safety-split {
    padding: 1.2rem 1.15rem;
  }

  .chapter-rail {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .rail-label {
    grid-column: 1 / -1;
    margin-right: 0;
    margin-bottom: 0.1rem;
  }

  .rail-pill {
    min-width: 0;
    padding: 0.35rem 0.2rem;
    min-height: 38px;
  }

  .table-scroll {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    background: var(--bg);
    border: var(--border-w) solid var(--rule);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
  }

  .data-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .data-table td {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--sky);
  }

  .data-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ochre-text);
    margin-bottom: 0.15rem;
  }

  .toolkit-grid,
  .lesson-stepper,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .stepper-card.next {
    text-align: left;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Reduced Motion Preference
   ========================================================================== */

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

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