/* ═══════════════════════════════════════════════════════════════
   Frameworks Library — shared stylesheet
   Design language inherited from LBS Dashboard
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Paper + Ink */
  --bg:           #f5f2ec;
  --bg-elevated:  #fffdf8;
  --bg-sunken:    #edeae4;
  --text:         #1a1714;
  --muted:        #4a4640;
  --faint:        #c8c3b8;
  --hair:         #d8d3c8;

  /* Accents (from dashboard) */
  --accent:       #b05a3a;          /* terracotta */
  --accent-soft:  rgba(176, 90, 58, 0.10);
  --accent-softer: rgba(176, 90, 58, 0.05);
  --moss:         #5a6b3f;
  --slate:        #6e7f8d;
  --olive:        #8a8465;

  /* Course accents (match dashboard) */
  --c-lp: #2e8a7a;   /* Leading People */
  --c-fa: #4a7abf;   /* Financial Accounting */
  --c-da: #b8862e;   /* Data Analytics */
  --c-me: #6a5acd;   /* Marketplace Env */
  --c-el: #888480;   /* Executive Leadership */
  --c-sm: #b05a3a;   /* Strategic Mgmt */
  --c-ms: #7a9d4e;   /* Marketing Strat */

  /* Typography */
  --serif-display: 'DM Serif Display', 'Cormorant Garamond', Georgia, serif;
  --serif:         'Cormorant Garamond', Georgia, serif;
  --sans:          'Inter', system-ui, -apple-system, sans-serif;
  --mono:          'IBM Plex Mono', 'Courier New', monospace;

  /* Scale */
  --container: 960px;
  --container-wide: 1160px;
  --radius: 2px;
  --hair-w: 1px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #141210;
    --bg-elevated: #1e1c18;
    --bg-sunken:   #0e0d0b;
    --text:        #ede8df;
    --muted:       #9a948a;
    --faint:       #3d3a34;
    --hair:        #2b2823;
    --accent:      #d4614e;
    --accent-soft: rgba(212, 97, 78, 0.12);
    --accent-softer: rgba(212, 97, 78, 0.05);
  }
}

/* ── Reset & base ─────────────────────────────────────────── */

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(176,90,58,0.04), transparent 60%),
    radial-gradient(900px 500px at 110% 20%, rgba(46,138,122,0.03), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: var(--accent-soft); color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

hr {
  border: 0;
  border-top: var(--hair-w) solid var(--hair);
  margin: 2rem 0;
}

hr.accent {
  border-top-color: var(--accent);
  opacity: 0.6;
}

/* ── Layout wrappers ──────────────────────────────────────── */

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Masthead / global header ─────────────────────────────── */

.masthead {
  padding: 48px 0 24px;
  border-bottom: var(--hair-w) solid var(--hair);
}

.masthead .brand {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead .brand .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 10px;
  vertical-align: middle;
}

.masthead h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 14px 0 6px;
}

.masthead .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
  margin: 0;
}

.masthead nav {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--muted);
  margin-right: 24px;
}

.masthead nav a:hover,
.masthead nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* ── Breadcrumb ────────────────────────────────────────── */

.crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 10px;
}

.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); text-decoration: none; }
.crumb .sep { margin: 0 10px; opacity: 0.5; }

/* ── Section chrome ─────────────────────────────────────── */

.section-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 8px;
}

h2.display {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin: 0 0 12px;
}

h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 8px;
  font-style: italic;
}

p { margin: 0 0 14px; }

p.lede, .lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--text);
  max-width: 42ch;
}

p.lede .attr {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

/* ── Course grid (home) ───────────────────────────────────── */

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.course-card {
  display: block;
  padding: 28px 26px 24px;
  background: var(--bg-elevated);
  border: var(--hair-w) solid var(--hair);
  border-top: 3px solid var(--course, var(--accent));
  transition: transform 120ms ease, border-color 120ms ease;
  color: var(--text);
}

.course-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--course, var(--accent));
}

.course-card .code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--course, var(--accent));
  margin: 0 0 8px;
}

.course-card .name {
  font-family: var(--serif-display);
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 12px;
}

.course-card .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.course-card.coming-soon {
  opacity: 0.55;
  pointer-events: none;
}

/* ── Module index (course page) ──────────────────────────── */

.module-list {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  border-top: var(--hair-w) solid var(--hair);
}

.module-list li {
  border-bottom: var(--hair-w) solid var(--hair);
}

.module-list a {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 22px 0;
  color: var(--text);
}

.module-list a:hover {
  text-decoration: none;
  color: var(--accent);
}

.module-list a:hover .mod-num {
  color: var(--accent);
}

.module-list .mod-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.module-list .mod-title {
  font-family: var(--serif-display);
  font-size: 22px;
  line-height: 1.2;
}

.module-list .mod-hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.module-list .mod-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--faint);
}

.module-list li.coming-soon a {
  pointer-events: none;
  color: var(--muted);
  opacity: 0.6;
}

.module-list li.coming-soon .mod-arrow::before {
  content: 'soon';
  font-size: 10px;
  letter-spacing: 0.14em;
}

/* ── Module deep-dive sections ───────────────────────────── */

article.module {
  padding: 0 0 64px;
}

article.module > section {
  padding: 40px 0;
  border-bottom: var(--hair-w) solid var(--hair);
}

article.module > section:last-of-type {
  border-bottom: 0;
}

/* Two-column layout (side-by-side on wide screens) */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 860px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

/* Hero diagram container (center-stage) */
.hero-diagram {
  display: grid;
  place-items: center;
  padding: 20px 0 24px;
  /* max-height removed: new diagram types (five-forces, platform, loop) include
     a legend below the SVG — clamping the container clips the legend into the
     next section. Individual SVGs are still capped via .hero-diagram svg below. */
}

.hero-diagram svg {
  max-width: 100%;
  max-height: 440px;
  height: auto;
  width: auto;
}

@media (max-width: 640px) {
  .hero-diagram { padding: 12px 0 16px; }
  .hero-diagram svg { max-height: 340px; }
}

/* ── ELI5 aside inside Core Idea ─────────────────────────── */
.idea-eli5 {
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--bg-elevated);
  border-left: 2px solid var(--accent);
  border-radius: 2px;
  max-width: 62ch;
}
.idea-eli5 .eli5-tag {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.idea-eli5 .eli5-body p {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 10px;
  font-style: italic;
}
.idea-eli5 .eli5-body p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .idea-eli5 { padding: 14px 16px; margin-top: 20px; }
  .idea-eli5 .eli5-body p { font-size: 15.5px; }
}

/* ── Sticky sub-nav (section jump links) ─────────────────── */
.sub-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 10px 0;
  margin: 18px 0 8px;
  border-top: 1px solid rgba(26,23,20,0.08);
  border-bottom: 1px solid rgba(26,23,20,0.08);
  background: rgba(245,242,236,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* Anchor targets must sit below the sticky sub-nav when jumped to */
section[id] { scroll-margin-top: 64px; }

/* Linear flow: horizontal on desktop, vertical on mobile */
.linear { display: block; width: 100%; max-width: 100%; }
.linear .linear-h { display: block; width: 100%; }
.linear .linear-v { display: none; }
.linear .linear-v .lin-step {
  font-family: var(--serif-display, 'DM Serif Display', serif);
  font-size: 22px;
  text-align: center;
  padding: 12px 0;
  color: var(--text);
}
.linear .linear-v .lin-arrow {
  text-align: center;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}
@media (max-width: 640px) {
  .linear .linear-h { display: none; }
  .linear .linear-v { display: block; }
}
.sub-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 2px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid transparent;
  transition: color 150ms, border-color 150ms;
}
.sub-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (max-width: 640px) {
  .sub-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0 20px;
    padding: 6px 24px;
    margin: 12px -24px 4px;
    border-bottom: 0;
    scrollbar-width: none;
  }
  .sub-nav::-webkit-scrollbar { display: none; }
  .sub-nav a { padding: 10px 2px; min-height: 44px; white-space: nowrap; }
}
@media (prefers-color-scheme: dark) {
  .sub-nav {
    background: rgba(20,18,16,0.88);
    border-color: rgba(237,232,223,0.10);
  }
}

/* ── Key Reading (demoted to quiet footnote block) ───────── */
.key-reading {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(26,23,20,0.10);
  max-width: 62ch;
}
.key-reading .kr-cite {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.key-reading .kr-title {
  font-family: var(--serif-display, 'DM Serif Display', serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}
.key-reading .kr-prose {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 10px;
}
.key-reading .kr-pairs {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.key-reading .kr-pairs li {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 11.5px;
  color: var(--muted);
}
.key-reading .kr-pairs .arrow { color: var(--accent); }
.key-reading .kr-kicker {
  font-family: var(--serif, 'Cormorant Garamond', serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  margin: 8px 0 0;
}
@media (max-width: 640px) {
  .key-reading { margin-top: 36px; }
  .key-reading .kr-title { font-size: 18px; }
  .key-reading .kr-prose { font-size: 15.5px; }
}

/* ── Steps flow ──────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 16px 0 0;
}

.step {
  position: relative;
  padding: 20px 20px 20px 22px;
  border-left: 2px solid var(--accent);
  background: var(--accent-softer);
}

.step .step-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.step h4 {
  font-family: var(--serif-display);
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 400;
}

.step p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* ── Diagnostics table ───────────────────────────────────── */

.diagnostics {
  border-top: var(--hair-w) solid var(--hair);
  margin: 16px 0 0;
}

.diagnostic {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: var(--hair-w) solid var(--hair);
  align-items: baseline;
}

.diagnostic .code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.diagnostic .q {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.5;
}

.diagnostic .fix {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.diagnostic .fix::before {
  content: '→';
  color: var(--accent);
  margin-right: 8px;
  font-family: var(--mono);
}

@media (max-width: 640px) {
  .diagnostic {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }
  .diagnostic .code { margin-bottom: 4px; }

  /* Mobile readability floor — iOS anti-zoom at 16px */
  body { font-size: 16px; }
  .prose, .prose p, .prose li { font-size: 16.5px; line-height: 1.65; }
  .muted { font-size: 14px; }
  .meta, .crumb, .code { font-size: 11.5px; letter-spacing: 0.10em; }
  .section-tag { font-size: 9.5px; letter-spacing: 0.08em; }
  .diagram-caption, .diagram-intro { font-size: 15px; line-height: 1.6; }
  .apply .rest, .framework .components { font-size: 16px; line-height: 1.6; }
  .idea-eli5 .eli5-body p { font-size: 16px; font-style: normal; }
  .colophon { font-size: 12px; }

  /* Hero hierarchy: restore 1.5× ratio between H1 and section H2 on mobile */
  .module-hero { padding-bottom: 4px; margin-bottom: 10px; }
  .module-hero h1 { font-size: 40px; line-height: 1.04; }
  h2.display { font-size: 26px; line-height: 1.12; }

  /* Module-list rows: generous tap area, hide tag row, clamp hint */
  .module-list a {
    padding: 22px 12px;
    min-height: 56px;
    grid-template-columns: 56px 1fr 24px;
    gap: 14px;
  }
  .module-list .mod-tags { display: none; }
  .module-list .mod-hint {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: normal;
  }

  /* Course-card shelf: tighter gap, lighter padding, elevate the first */
  .shelf { gap: 14px; }
  .course-card { padding: 22px 20px 20px; }
  .course-card .name { font-size: 22px; margin-bottom: 8px; }
  .shelf .course-card:first-child { padding: 32px 22px 26px; }
  .shelf .course-card:first-child .name { font-size: 28px; }
  .course-card.coming-soon {
    opacity: 1;
    border-top-style: dashed;
    border-top-width: 2px;
    background: transparent;
  }

  /* Framework list hierarchy: breathing room + weighted beats */
  .fw-row { padding: 22px 0; gap: 10px; }
  .fw-row .fw-name { font-size: 18px; }
  .fw-row .fw-comps { color: var(--accent); opacity: 0.72; }

  /* Hero diagram: drop the max-height straitjacket, let ratio drive */
  .hero-diagram { max-height: none; padding: 10px 0 14px; margin: 0 -8px; }
  .hero-diagram svg { max-height: none; width: 100%; }

  /* Safe-area for landscape + bottom gesture bar */
  .wrap {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }

  /* Framework heading becomes a quiet tag on mobile — retire the shouty display */
  #frameworks h2.display { display: none; }
  #frameworks .section-tag { font-size: 10.5px; letter-spacing: 0.12em; margin-bottom: 6px; }
}

/* ── How-to-apply (numbered) ─────────────────────────────── */

ol.apply {
  list-style: none;
  counter-reset: apply;
  padding: 0;
  margin: 16px 0 0;
}

ol.apply li {
  counter-increment: apply;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: var(--hair-w) solid var(--hair);
  align-items: baseline;
}

ol.apply li::before {
  content: counter(apply, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

ol.apply li .txt {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
}

/* ── Callout / sidebar reading ───────────────────────────── */

.callout {
  background: var(--bg-elevated);
  border: var(--hair-w) solid var(--hair);
  border-left: 3px solid var(--accent);
  padding: 24px 26px;
}

.callout .cite {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

.callout h3 {
  font-family: var(--serif-display);
  font-style: normal;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 14px;
}

.callout ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 16.5px;
}

.callout ul li {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: var(--hair-w) dotted var(--hair);
}

.callout ul li:last-child { border-bottom: 0; }

.callout ul li .arrow {
  color: var(--accent);
  font-family: var(--mono);
}

.callout .kicker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  margin-top: 14px;
  font-size: 15px;
}

/* ── Colophon / footer ───────────────────────────────────── */

.colophon {
  margin: 72px 0 48px;
  padding-top: 24px;
  border-top: var(--hair-w) solid var(--hair);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.colophon a {
  display: inline-block;
  min-height: 44px;
  padding: 14px 0;
  line-height: 1.4;
}

.colophon .dots {
  color: var(--accent);
  letter-spacing: 0.3em;
}

/* ── Prose base (for body copy inside sections) ──────────── */

.prose p {
  font-size: 16.5px;
  line-height: 1.7;
  max-width: 62ch;
}

.prose strong { font-weight: 600; color: var(--text); }
.prose em { font-family: var(--serif); font-style: italic; }

/* ── Utility ──────────────────────────────────────────────── */

.muted { color: var(--muted); }
.accent { color: var(--accent); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-style: italic; }
.caps {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: var(--mono);
  font-size: 11px;
}

/* ── Responsive hero title ───────────────────────────────── */

.module-hero {
  padding: 32px 0 8px;
}

.module-hero .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.module-hero h1 {
  font-family: var(--serif-display);
  font-size: clamp(36px, 5.5vw, 56px);
  line-height: 1.05;
  margin: 0 0 10px;
  font-weight: 400;
}

.module-hero .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
}

/* ── Equation display ─────────────────────────────────────── */

.equation {
  font-family: var(--serif-display);
  font-size: clamp(20px, 3.6vw, 36px);
  text-align: center;
  padding: 32px 20px;
  letter-spacing: 0.01em;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 0.6em;
  row-gap: 0.2em;
}

.equation .eq {
  color: var(--accent);
  font-weight: 400;
}

.equation .lhs,
.equation .rhs {
  color: var(--text);
}

.equation .lhs,
.equation .eq,
.equation .rhs {
  white-space: nowrap;
}

/* ── Framework list ───────────────────────────────────────── */

.fw-list {
  border-top: var(--hair-w) solid var(--hair);
  margin: 16px 0 0;
}

.fw-row {
  padding: 18px 0;
  border-bottom: var(--hair-w) solid var(--hair);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.fw-row .fw-name {
  font-family: var(--serif-display);
  font-size: 20px;
  line-height: 1.3;
}

.fw-row .fw-name em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.fw-row .fw-comps {
  font-size: 12px;
  letter-spacing: 0.05em;
}

.fw-row .fw-rule {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--text);
}

/* ── Matrix, hexagon, curve, network — share scroll-reveal class ── */

.matrix line,
.matrix rect {
  opacity: 0;
  transition: opacity 600ms ease;
}
.matrix.in line,
.matrix.in rect { opacity: 1; }

.hexagon polygon {
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
}
.hexagon.in polygon {
  animation: draw-line 1200ms ease-out forwards;
}

.hexagon circle {
  opacity: 0;
  animation: pop-dot 300ms ease-out forwards;
}
.hexagon.in circle:nth-child(1) { animation-delay: 200ms; }
.hexagon.in circle:nth-child(2) { animation-delay: 280ms; }
.hexagon.in circle:nth-child(3) { animation-delay: 360ms; }
.hexagon.in circle:nth-child(4) { animation-delay: 440ms; }
.hexagon.in circle:nth-child(5) { animation-delay: 520ms; }
.hexagon.in circle:nth-child(6) { animation-delay: 600ms; }

.curve path {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
}
.curve.in path {
  animation: draw-line 1200ms ease-out forwards;
}
.curve circle {
  opacity: 0;
  animation: pop-dot 300ms ease-out forwards 1000ms;
}
.curve.in circle { opacity: 1; }

.network line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
}
.network.in line {
  animation: draw-line 900ms ease-out forwards;
}
.network circle {
  opacity: 0;
  animation: pop-dot 260ms ease-out forwards;
}
.network.in circle { opacity: 1; }

/* ── Scroll-reveal (subtle) ──────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal.stagger > * {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.reveal.stagger.in > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal.stagger.in > *:nth-child(1)  { transition-delay:  20ms; }
.reveal.stagger.in > *:nth-child(2)  { transition-delay:  80ms; }
.reveal.stagger.in > *:nth-child(3)  { transition-delay: 140ms; }
.reveal.stagger.in > *:nth-child(4)  { transition-delay: 200ms; }
.reveal.stagger.in > *:nth-child(5)  { transition-delay: 260ms; }
.reveal.stagger.in > *:nth-child(6)  { transition-delay: 320ms; }
.reveal.stagger.in > *:nth-child(7)  { transition-delay: 380ms; }
.reveal.stagger.in > *:nth-child(8)  { transition-delay: 440ms; }
.reveal.stagger.in > *:nth-child(9)  { transition-delay: 500ms; }
.reveal.stagger.in > *:nth-child(10) { transition-delay: 560ms; }
.reveal.stagger.in > *:nth-child(11) { transition-delay: 620ms; }

/* ── Pentagon draw-in ────────────────────────────────────── */

.pentagon line {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
}

.pentagon.in line {
  animation: draw-line 900ms ease-out forwards;
}

.pentagon.in line:nth-child(1)  { animation-delay:  50ms; }
.pentagon.in line:nth-child(2)  { animation-delay: 100ms; }
.pentagon.in line:nth-child(3)  { animation-delay: 150ms; }
.pentagon.in line:nth-child(4)  { animation-delay: 200ms; }
.pentagon.in line:nth-child(5)  { animation-delay: 250ms; }
.pentagon.in line:nth-child(6)  { animation-delay: 400ms; }
.pentagon.in line:nth-child(7)  { animation-delay: 470ms; }
.pentagon.in line:nth-child(8)  { animation-delay: 540ms; }
.pentagon.in line:nth-child(9)  { animation-delay: 610ms; }
.pentagon.in line:nth-child(10) { animation-delay: 680ms; }

.pentagon circle {
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: pop-dot 300ms ease-out forwards;
}

.pentagon.in circle:nth-child(1) { animation-delay:  60ms; }
.pentagon.in circle:nth-child(2) { animation-delay: 120ms; }
.pentagon.in circle:nth-child(3) { animation-delay: 180ms; }
.pentagon.in circle:nth-child(4) { animation-delay: 240ms; }
.pentagon.in circle:nth-child(5) { animation-delay: 300ms; }

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes pop-dot {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .reveal, .reveal.stagger > * { opacity: 1; transform: none; }
  .pentagon line { stroke-dashoffset: 0; }
  .pentagon circle { opacity: 1; }
}

/* ── flow (numbered stations) ───────────────────────────── */
.flow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.flow .flow-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--ink-faint, #d8d2c4);
  border-radius: 6px;
  background: var(--bg-elevated, #fffdf8);
}
.flow .flow-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent, #b05a3a);
  color: var(--bg-elevated, #fffdf8);
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow .flow-step-label {
  font-family: 'DM Serif Display', serif;
  font-size: 19px;
  color: var(--text, #1a1714);
  margin-bottom: 4px;
}
.flow .flow-step-desc {
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--muted, #4a4640);
  line-height: 1.55;
}

/* ── decision-tree (nested questions + branches) ────────── */
.decision-tree {
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text, #1a1714);
}
.decision-tree .dt-node {
  margin: 8px 0;
}
.decision-tree .dt-question {
  display: inline-block;
  padding: 10px 14px;
  background: var(--bg-elevated, #fffdf8);
  border: 1px solid var(--ink-faint, #d8d2c4);
  border-radius: 4px;
  font-family: 'DM Serif Display', serif;
  font-size: 17px;
  max-width: 60ch;
}
.decision-tree .dt-branches {
  list-style: none;
  padding-left: 28px;
  margin: 8px 0 0 14px;
  border-left: 2px solid var(--ink-faint, #d8d2c4);
}
.decision-tree .dt-branch {
  margin: 12px 0;
  position: relative;
}
.decision-tree .dt-edge-label {
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-style: italic;
  color: var(--accent, #b05a3a);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.decision-tree .dt-leaf {
  display: inline-block;
  padding: 8px 12px;
  background: var(--accent, #b05a3a);
  color: var(--bg-elevated, #fffdf8);
  border-radius: 4px;
  max-width: 60ch;
  line-height: 1.5;
}

/* ── two-axis SVG sizing ────────────────────────────────── */
.two-axis { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }

/* ── two-axis legend (HTML rows below SVG) ────────────── */
.two-axis-wrap { display: block; margin: 0 auto; max-width: 720px; }
.ta-legend {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text, #1a1714);
}
.ta-legend-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--hair, #d8d2c4);
}
.ta-legend-label {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--text, #1a1714);
}
.ta-legend-end {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--muted, #4a4640);
  line-height: 1.5;
}
.ta-legend-tag {
  font-family: Inter, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text, #1a1714);
  font-weight: 600;
  padding-top: 2px;
}

/* ── trajectory (custom Christensen-style two-curve chart) ─ */
.trajectory { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }

/* ── safety: keep new diagrams from sliding into the colophon ── */
.flow, .decision-tree, .two-axis-wrap, .trajectory { margin-bottom: 24px; }

/* ── Accessibility floor ──────────────────────────────────────────── */

/* Skip-to-content link: visually hidden until focused. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--text);
  color: var(--bg, #f5f2ec);
  padding: 8px 14px;
  font-family: Inter, sans-serif;
  font-size: 14px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: top 0.15s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Visible focus outline for keyboard users (was: zero global rule). */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}
@media (prefers-color-scheme: dark) {
  a:focus-visible,
  button:focus-visible,
  [tabindex]:focus-visible {
    outline-color: var(--accent);
  }
}

/* Body links: underlined by default (was color-only signaling).
   Excludes nav/crumb/colophon/sub-nav/module-list/course-card/skip-link
   which are already affordance-clear from layout. */
.lede a, .prose a, .module-hero a,
section[id] p a, section[id] li a,
.attr a, .ta-legend a, .flow-step-desc a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.lede a:hover, .prose a:hover, .module-hero a:hover,
section[id] p a:hover, section[id] li a:hover {
  text-decoration-thickness: 2px;
}

/* Decision-tree branch label: was 4.4:1 accent on cream (fails AA at 12px).
   Now muted on cream (~7.6:1) — passes AA comfortably. */
.decision-tree .dt-edge-label {
  color: var(--text);
}

/* Missing token used by .flow / .decision-tree borders.
   Was falling back to a hard-coded cream that vanished in dark mode. */
:root { --ink-faint: var(--hair); }

/* ── five-forces ─────────────────────────────────────────── */
.five-forces-wrap { display: block; margin: 0 auto; max-width: 760px; }
.five-forces { width: 100%; max-width: 720px; height: auto; display: block; margin: 0 auto; }
.ff-legend {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text);
}
.ff-legend-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
}
.ff-legend-center .ff-legend-tag { color: var(--accent); }
.ff-legend-tag {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--text);
}
.ff-legend-desc {
  font-family: Inter, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .ff-legend-row { grid-template-columns: 1fr; gap: 4px; }
}
/* reduce-motion: keep static */
@media (prefers-reduced-motion: reduce) {
  .five-forces line, .five-forces path, .five-forces rect { transition: none !important; animation: none !important; }
}

/* ── platform ─────────────────────────────────────────────── */
.platform-wrap { display: block; margin: 0 auto; max-width: 760px; }
.platform { width: 100%; max-width: 720px; height: auto; display: block; margin: 0 auto; }
.plat-legend {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text);
}
.plat-legend-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
}
.plat-legend-tag {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--text);
}
.plat-legend-desc {
  font-family: Inter, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .plat-legend-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── loop ─────────────────────────────────────────────────── */
.loop-wrap { display: block; margin: 0 auto; max-width: 760px; }
.loop-diagram { width: 100%; max-width: 720px; height: auto; display: block; margin: 0 auto; }
.loop-legend {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  font-family: Inter, sans-serif;
  font-size: 14px;
  color: var(--text);
}
.loop-legend-row {
  display: grid;
  grid-template-columns: 28px 160px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
}
.loop-legend-num {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--accent);
}
.loop-legend-label {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--text);
}
.loop-legend-desc {
  font-family: Inter, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .loop-legend-row { grid-template-columns: 28px 1fr; }
  .loop-legend-desc { grid-column: 1 / -1; margin-top: 2px; }
}

/* New diagram wrappers: full width inside .hero-diagram grid, isolated block context */
.five-forces-wrap, .platform-wrap, .loop-wrap {
  width: 100%;
  display: block;
  position: relative;
  isolation: isolate;
  margin-bottom: 32px;
}

/* ── Accessible breadcrumb (ol-based) ────────────────────── */

.crumb-nav { margin: 32px 0 10px; }

ol.crumb {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

ol.crumb li { display: flex; align-items: center; }

ol.crumb li + li::before {
  content: '/';
  margin: 0 10px;
  opacity: 0.5;
}

ol.crumb a { color: var(--muted); }
ol.crumb a:hover { color: var(--accent); text-decoration: none; }

/* ── Visually hidden (a11y utility) ──────────────────────── */

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

/* ── All-frameworks index page ───────────────────────────── */

.all-fw-course {
  margin: 48px 0 0;
  padding-bottom: 40px;
  border-bottom: var(--hair-w) solid var(--hair);
}

.all-fw-course:last-of-type { border-bottom: 0; }

.all-fw-course h2.display {
  color: var(--course, var(--accent));
  margin-bottom: 24px;
}

.all-fw-row {
  padding: 16px 0;
  border-bottom: var(--hair-w) solid var(--hair);
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.all-fw-row:last-child { border-bottom: 0; }

.all-fw-meta {
  margin: 0;
}

.all-fw-mod {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--course, var(--muted));
}

.all-fw-mod:hover { color: var(--accent); text-decoration: none; }

.all-fw-name {
  font-family: var(--serif-display);
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}

.all-fw-name em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}

.all-fw-comps {
  font-size: 12px;
  letter-spacing: 0.05em;
  margin: 0;
}

.all-fw-rule {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.all-fw-search {
  margin: 24px 0 32px;
}

.all-fw-search input {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-elevated);
  border: var(--hair-w) solid var(--hair);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 150ms;
}

.all-fw-search input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.all-fw-search input::placeholder { color: var(--faint); }

@media (max-width: 640px) {
  .all-fw-search input { max-width: 100%; font-size: 16px; }
  .all-fw-name { font-size: 18px; }
  .all-fw-row { padding: 18px 0; gap: 8px; }
}
