/* ============================================================================
   ARTICLE CHASSIS — shared overrides & promotions
   Loaded AFTER each article's inline <style> so the cascade resolves in our
   favour. We do NOT redefine the chassis from scratch — we only:
     1. Fix bugs (AI-PM-OS hard-coded amber link/drop-cap colours).
     2. Tame mobile typography with clamp() everywhere it matters.
     3. Promote four-series-best components (pull-quote, sources-row, …) so
        every article inherits them whether the author wrote markup for them
        or not.
     4. Add five aesthetic moves (accent rail, auto kicker, sticky TOC,
        sections sheet, dark Remember-This card, marginalia mistake-card).
     5. Pause infinite background animations off-screen + honour
        prefers-reduced-motion.
   ============================================================================ */

/* --------------------------------------------------------------------------
   1.  RESPONSIVE TYPE SYSTEM (heart of the polish)
   -------------------------------------------------------------------------- */
:where(.text-col) p,
:where(.text-col) li,
.mistake-card p,
.spec-content,
.enterprise-lens p,
.exercise-block p,
.learning-text {
  font-size: clamp(1.05rem, 0.92rem + 0.7vw, 1.35rem);
  line-height: 1.72;
}

/* Lists in body prose — match the paragraph face exactly so bullets
   never feel like a different system. Applies globally so every topic
   inherits the same uniform rhythm. */
.text-col ul,
.text-col ol {
  font-family: var(--font-body);
  color: var(--ink-body);
  letter-spacing: -0.01em;
  margin: 0 0 2.2rem;
  padding-left: 1.4rem;
}
.text-col ul:not(.learning-list) { list-style: none; padding-left: 0; }
.text-col ul:not(.learning-list) > li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-body);
  color: var(--ink-body);
  letter-spacing: -0.01em;
}
.text-col ul:not(.learning-list) > li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.85em;
  width: 0.55rem; height: 1px;
  background: var(--color-model, currentColor);
  opacity: 0.55;
}
.text-col ol > li {
  margin-bottom: 0.85rem;
  font-family: var(--font-body);
  color: var(--ink-body);
}

/* Bold runs stay in the body face — kill the Inter+1.25rem jump */
.text-col p strong,
.text-col li strong,
.mistake-card p strong,
.enterprise-lens p strong,
.exercise-block p strong {
  font-family: inherit !important;
  font-weight: 600 !important;
  color: var(--ink-pure);
  font-size: 1em !important;
  letter-spacing: inherit;
}

/* Headings — fluid scale, keep the serif drama */
.text-col h2 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  margin: clamp(3rem, 8vw, 6.5rem) 0 clamp(1.25rem, 3vw, 2.5rem);
}
.text-col h3 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); }
.text-col h4 { font-size: clamp(0.78rem, 0.72rem + 0.3vw, 0.9rem); }

.article-title { font-size: clamp(2.2rem, 7.5vw, 8rem); line-height: 1.04; }

.drop-cap::first-letter {
  font-size: clamp(4rem, 2.5rem + 5vw, 6.8rem) !important;
  padding-right: 0.1em !important;
  padding-top: 0.06em !important;
}

.learning-num {
  font-size: clamp(2rem, 1.4rem + 1.6vw, 2.8rem);
  min-width: clamp(38px, 4vw, 50px);
}

@media (max-width: 720px) {
  .paper-canvas {
    padding: 2.75rem 1.1rem 4rem !important;
    margin-top: -3vh !important;
    border-radius: 24px 24px 0 0 !important;
  }
  .learning-block { padding: 2.25rem 1.25rem !important; }
  .learning-item  { gap: 1rem !important; }
  .text-col p, .text-col li { line-height: 1.65; }
}

/* Code, ASCII telemetry, terminal blocks — phone-safe scrolling */
.code-block,
.dashboard-block,
.spec-content.input-box {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (max-width: 720px) {
  .code-block, .dashboard-block, .spec-content.input-box {
    font-size: clamp(0.74rem, 0.66rem + 0.4vw, 0.9rem) !important;
  }
}

/* --------------------------------------------------------------------------
   2.  BUG FIXES (the AI-PM-OS amber leakage)
   -------------------------------------------------------------------------- */
/* Drop-cap second-stop tied to series via --color-glow */
body[class*="series-"] .drop-cap::first-letter {
  background: linear-gradient(135deg, var(--color-model), var(--color-glow, var(--color-model))) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
/* Link hover follows the series accent, not stale amber */
body[class*="series-"] .text-col p a:hover,
body[class*="series-"] .text-col li a:hover { color: var(--color-model) !important; }

/* --------------------------------------------------------------------------
   3.  HERO ACCENT RAIL  (B4.1) — anchors which series you're in
   -------------------------------------------------------------------------- */
.topic-pill { position: relative; }
body[class*="series-"] .topic-pill::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-model);
  box-shadow: 0 0 12px var(--color-model);
  transform: translateX(-50%);
}

/* --------------------------------------------------------------------------
   4.  AUTO SECTION KICKER  (B4.2) — injected by article.js
   -------------------------------------------------------------------------- */
.text-col h2 .h2-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.85rem;
  padding-left: 2.4rem;
  position: relative;
  line-height: 1;
}
.text-col h2 .h2-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.8rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   5.  STICKY TOC + MOBILE SECTIONS SHEET  (B4.3)
   -------------------------------------------------------------------------- */
.article-toc {
  position: fixed;
  top: 50%;
  right: clamp(1rem, 2vw, 2rem);
  transform: translateY(-50%);
  width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 50;
  font-family: var(--font-sans);
  display: none;
  padding: 0.25rem 0;
  scrollbar-width: thin;
}
.article-toc.is-ready { display: block; }
.article-toc::before {
  content: "On this page";
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
  padding-left: 0.9rem;
}
.article-toc a {
  display: block;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-faint);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.article-toc a:hover { color: var(--ink-main); }
.article-toc a.is-active {
  color: var(--ink-main);
  border-left-color: var(--color-model);
  font-weight: 600;
}
@media (max-width: 1199px) { .article-toc { display: none !important; } }
@media (min-width: 1200px) {
  /* Keep TOC clear of any wide content */
  .article-toc.is-ready { display: block; }
}

/* Mobile sections pill + sheet */
.toc-pill {
  position: fixed;
  right: 1rem;
  bottom: 1.1rem;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(15, 17, 24, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.toc-pill svg { width: 14px; height: 14px; }
.toc-pill.is-ready { display: inline-flex; }
@media (min-width: 1200px) { .toc-pill { display: none !important; } }

.toc-sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  background: rgba(8, 10, 14, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px 22px 0 0;
  padding: 1.5rem 1.25rem 2rem;
  transform: translateY(110%);
  transition: transform 0.4s var(--ease-cinematic, cubic-bezier(.16,1,.3,1));
  max-height: 75vh;
  overflow-y: auto;
  display: none;
}
.toc-sheet.is-mounted { display: block; }
.toc-sheet.is-open { transform: translateY(0); }
.toc-sheet-cap {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.85rem;
}
.toc-sheet a {
  display: block;
  padding: 0.85rem 0.4rem;
  font-family: var(--font-body, 'Newsreader', serif);
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.toc-sheet a:last-child { border-bottom: none; }
.toc-sheet a .toc-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-model, #fff);
  margin-right: 0.85rem;
  letter-spacing: 0.1em;
}
@media (min-width: 1200px) { .toc-sheet { display: none !important; } }

/* --------------------------------------------------------------------------
   6.  PROMOTED COMPONENTS (every series gets these)
   -------------------------------------------------------------------------- */

/* Pull quote — promoted from harness/AI-PM-OS */
.text-col .pull-quote,
.pull-quote {
  margin: clamp(2.5rem, 6vw, 5rem) 0;
  padding: clamp(1.5rem, 3vw, 3rem) 0 clamp(1.5rem, 3vw, 3rem) clamp(1.25rem, 2.5vw, 2.75rem);
  border-left: 4px solid var(--color-model, #9D4EDD);
  position: relative;
}
.pull-quote p {
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: clamp(1.25rem, 0.95rem + 1.4vw, 1.85rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-main, #111318);
  line-height: 1.25;
  margin: 0 0 1rem 0;
  letter-spacing: -0.01em;
}
.pull-quote cite {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  color: var(--ink-faint, #5A5D67);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.pull-quote cite::before { content: "— "; }

/* Sources row — promoted from AI-PM-OS, auto-built by article.js for any
   ref-section that doesn't already use it */
.sources-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-main, #111318);
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.source-chip:hover {
  background: var(--color-model-light, rgba(0, 0, 0, 0.06));
  border-color: var(--color-model, currentColor);
  transform: translateY(-1px);
}
.source-chip .source-domain {
  color: var(--ink-faint, #5A5D67);
  font-weight: 500;
}

/* Editorial divider — opt-in via class="editorial-hr" */
.editorial-hr {
  border: none;
  height: 1px;
  margin: clamp(3rem, 6vw, 5rem) auto;
  width: clamp(120px, 20vw, 240px);
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18), transparent);
}

/* --------------------------------------------------------------------------
   "Next Actions" heading — shared across episodes.
   Consistent eyebrow, typography, spacing rhythm, and mobile fallback.
   -------------------------------------------------------------------------- */
.next-actions-heading {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-main, #0B0F14);
  margin: clamp(2.25rem, 4.5vw, 3.5rem) 0 clamp(1rem, 1.6vw, 1.5rem);
  position: relative;
  padding-top: clamp(1.25rem, 2vw, 1.75rem);
}
.next-actions-heading::before {
  content: "Next Actions";
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint, #5A5D67);
  margin-bottom: 0.75rem;
}
@media (max-width: 640px) {
  .next-actions-heading {
    font-size: clamp(1.5rem, 6vw, 1.9rem);
    margin-top: 2rem;
    padding-top: 1rem;
  }
  .next-actions-heading::before {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    margin-bottom: 0.55rem;
  }
}

/* --------------------------------------------------------------------------
   7.  REMEMBER-THIS DARK CARD  (B4.4) — auto-applied by article.js when an
        h2 reads "Remember This"; markup stays exactly as today.
   -------------------------------------------------------------------------- */
.remember-card {
  background: var(--ink-main, #111318);
  border-radius: clamp(18px, 2.5vw, 24px);
  padding: clamp(2rem, 4vw, 3.5rem);
  margin: clamp(3rem, 6vw, 5rem) 0;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
}
.remember-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right,
    color-mix(in srgb, var(--color-model, #9D4EDD) 18%, transparent),
    transparent 60%);
  pointer-events: none;
}
.remember-card .remember-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-model, #9D4EDD);
  display: block;
  margin-bottom: 1.25rem;
}
.remember-card .remember-title {
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
  font-weight: 400;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
}
.remember-card .remember-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}
.remember-card .remember-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}
.remember-card .remember-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--color-model, #9D4EDD);
  background: color-mix(in srgb, var(--color-model, #9D4EDD) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-model, #9D4EDD) 35%, transparent);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  line-height: 1;
  white-space: nowrap;
  align-self: start;
  margin-top: 0.15rem;
}
.remember-card .remember-text {
  font-family: var(--font-body, 'Newsreader', serif);
  font-size: clamp(1.05rem, 0.92rem + 0.5vw, 1.25rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}
.remember-card .remember-text strong {
  color: #fff;
  font-weight: 600;
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   8.  MISTAKE-CARD MARGINALIA  (B4.5) — at >=1200px the anti-pattern card
        floats into the right margin, like a New Yorker pull-callout.
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
  .text-col .mistake-card {
    float: right;
    width: 320px;
    margin: 0.4rem -360px 1.5rem 1.75rem;
    padding: 2rem !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(225, 29, 72, 0.10);
  }
  .text-col .mistake-card::before { display: none; }
  .text-col .mistake-card h3 { font-size: 1.15rem !important; line-height: 1.25 !important; }
  .text-col .mistake-card p { font-size: 0.95rem !important; line-height: 1.55 !important; }
}

/* --------------------------------------------------------------------------
   9.  PERFORMANCE & A11Y
   -------------------------------------------------------------------------- */
/* Pause infinite background animations off-screen — toggled by article.js */
.is-offscreen .hero-bg-img { animation-play-state: paused !important; }
.is-offscreen .noise-overlay { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg-img,
  .noise-overlay,
  .rocket-assembly,
  .rocket-exhaust::before,
  .rocket-exhaust::after { animation: none !important; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto !important; }
}

@media (prefers-contrast: more) {
  mark.pastel-highlight {
    mix-blend-mode: normal !important;
    background-image: none !important;
    background-color: var(--color-model-light, #ffeb99) !important;
    background-size: 100% 100% !important;
  }
}

/* --------------------------------------------------------------------------
   10.  FOCUS STATES (subtle but always present)
   -------------------------------------------------------------------------- */
.text-col p a:focus-visible,
.text-col li a:focus-visible,
.magnetic-btn:focus-visible,
.next-card:focus-visible,
.toc-pill:focus-visible,
.article-toc a:focus-visible,
.toc-sheet a:focus-visible,
.source-chip:focus-visible,
.post-nav-pill:focus-visible {
  outline: 2px solid var(--color-model, #9D4EDD);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   11.  REFERENCES — modernise the bare ref-section everywhere
   -------------------------------------------------------------------------- */
.ref-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ref-section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}
.ref-section p {
  font-size: 1rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   12.  FIGURE CAPTION CONTRAST — global fix for grey-on-dark unreadability
        Any inline figure caption that sits on a dark slab must read white,
        not a thin italic grey. Applies to every .cf-caption variant.
   -------------------------------------------------------------------------- */
.concept-fig .cf-caption,
.practice-fig .cf-caption,
.cf-caption {
  color: #FFFFFF !important;
  font-style: normal !important;
  font-family: var(--font-body, 'Newsreader', Georgia, serif) !important;
  font-weight: 500 !important;
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.18rem) !important;
  line-height: 1.55 !important;
  letter-spacing: 0.005em;
  background: #0B0F14 !important;
}

/* Any layered slab where white-on-dark text is set with low opacity should
   be opaque enough to read on phones too. */
.pf-layer .pf-gloss { opacity: 1 !important; color: rgba(255,255,255,0.92) !important; }

/* --------------------------------------------------------------------------
   13.  REFERENCES — keep them simple. The auto chip-grid felt heavy, so we
        hide the JS-injected .sources-row and let the original numbered <p>
        list stand on its own with cleaner typography.
   -------------------------------------------------------------------------- */
.ref-section .sources-row { display: none !important; }
.ref-section p { display: block !important; }
.ref-section p {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-faint, #5A5D67);
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
  text-indent: -1.25rem;
}
.ref-section p a {
  color: var(--ink-main, #111318);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.18);
  padding-bottom: 1px;
  transition: border-color 0.2s, color 0.2s;
}
.ref-section p a:hover {
  color: var(--color-model);
  border-bottom-color: var(--color-model);
}

/* --------------------------------------------------------------------------
   14.  SVG TEXT CONTRAST — permanent global rule
        Goal: every SVG label is readable, regardless of which surface the
        figure is dropped onto. Authors can opt in via a wrapper class, OR
        the JS auto-detector in article.js will tag dark-surface SVGs with
        data-svg-on-dark="true".
   -------------------------------------------------------------------------- */

/* A. Canonical "dark surface" wrappers — any SVG inside flips to white text. */
.fig-on-dark svg text,
.fig-on-dark svg tspan,
.dark-slab svg text,
.dark-slab svg tspan,
.cf-stage--dark svg text,
.cf-stage--dark svg tspan,
.practice-fig.is-dark svg text,
.practice-fig.is-dark svg tspan,
figure[data-surface="dark"] svg text,
figure[data-surface="dark"] svg tspan,
svg[data-svg-on-dark="true"] text,
svg[data-svg-on-dark="true"] tspan {
  fill: #F4F4F5 !important;
}

/* B. Tier-2 muted + Tier-3 accent overrides. */
.fig-on-dark svg text[data-tone="muted"],
.dark-slab svg text[data-tone="muted"],
.cf-stage--dark svg text[data-tone="muted"],
figure[data-surface="dark"] svg text[data-tone="muted"],
svg[data-svg-on-dark="true"] text[data-tone="muted"],
.fig-on-dark svg .t-muted,
.dark-slab svg .t-muted,
svg[data-svg-on-dark="true"] .t-muted {
  fill: rgba(244,244,245,0.72) !important;
}
.fig-on-dark svg text[data-tone="accent"],
.dark-slab svg text[data-tone="accent"],
.cf-stage--dark svg text[data-tone="accent"],
figure[data-surface="dark"] svg text[data-tone="accent"],
svg[data-svg-on-dark="true"] text[data-tone="accent"],
.fig-on-dark svg .t-accent,
.dark-slab svg .t-accent,
svg[data-svg-on-dark="true"] .t-accent {
  fill: var(--color-model, #06B6D4) !important;
}

/* Hairline strokes — the cream/grey rules baked into many SVGs disappear on
   dark. Lift them to a faint white so axes / dividers stay legible. */
.fig-on-dark svg line[stroke="#D4D1C8"],
.fig-on-dark svg line[stroke="#E8E6E0"],
.dark-slab svg line[stroke="#D4D1C8"],
.dark-slab svg line[stroke="#E8E6E0"],
svg[data-svg-on-dark="true"] line[stroke="#D4D1C8"],
svg[data-svg-on-dark="true"] line[stroke="#E8E6E0"] {
  stroke: rgba(255,255,255,0.18) !important;
}

/* C. Gradient-filled labels stay coloured but pick up a thin halo so they
   don't dissolve into the dark plate. */
.fig-on-dark svg text[fill^="url("],
.dark-slab svg text[fill^="url("],
svg[data-svg-on-dark="true"] text[fill^="url("] {
  paint-order: stroke fill;
  stroke: rgba(0,0,0,0.45);
  stroke-width: 0.6px;
}

/* D. Forced-colors (Windows high-contrast) — always defer to the OS. */
@media (forced-colors: active) {
  svg text, svg tspan { fill: CanvasText !important; }
}

/* E. Print — figures land on white paper, restore the dark fills. */
@media print {
  .fig-on-dark svg text,
  .dark-slab svg text,
  .cf-stage--dark svg text,
  figure[data-surface="dark"] svg text,
  svg[data-svg-on-dark="true"] text,
  svg[data-svg-on-dark="true"] tspan {
    fill: #0A0A0C !important;
    stroke: none !important;
  }
}

/* ==========================================================================
   15.  TYPE TOKENS — single source of truth for size, leading, tracking.
        Every prose element below pulls from these so no article ever
        introduces an arbitrary 1.08 / 0.68 / 1.85 rem one-off again.
   ========================================================================== */
:root,
.paper-canvas {
  /* Display tier */
  --type-display-xl: clamp(2.6rem, 1.5rem + 4vw, 4.2rem);
  --type-display-l:  clamp(2rem,   1.4rem + 3vw, 3.5rem);
  --type-display-m:  clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem);
  /* Body tier */
  --type-body-l:     clamp(1.05rem, 0.92rem + 0.7vw, 1.3rem);
  --type-body-m:     clamp(0.95rem, 0.88rem + 0.4vw, 1.1rem);
  --type-body-s:     clamp(0.85rem, 0.8rem  + 0.25vw, 0.95rem);
  /* Mono tier */
  --type-mono-l:     clamp(0.85rem, 0.78rem + 0.3vw, 1rem);
  --type-mono-m:     clamp(0.78rem, 0.72rem + 0.2vw, 0.88rem);
  --type-mono-s:     clamp(0.65rem, 0.6rem  + 0.15vw, 0.75rem);
  /* Leading + tracking */
  --lh-tight: 1.18;
  --lh-snug:  1.4;
  --lh-prose: 1.72;
  --lh-loose: 1.9;
  --ls-display: -0.02em;
  --ls-prose:   -0.01em;
  --ls-mono:     0.04em;
  --ls-eyebrow:  0.22em;
}

/* ==========================================================================
   16.  CHASSIS OVERRIDES — defeat per-article inline drift.
        Two years of hand-authoring left ~3,200 inline `font-family` and
        ~1,000 inline `font-size` declarations across 117 articles. We do
        NOT touch the markup. We win on specificity here, with surgical
        scoping to .text-col so brand chrome (rocket, hero pill, footer)
        is untouched.
   ========================================================================== */

/* 16.a  Body prose — one face, one size, one leading. ---------------------- */
.paper-canvas .text-col p,
.paper-canvas .text-col li,
.paper-canvas .text-col blockquote {
  font-family: var(--font-body) !important;
  font-size: var(--type-body-l) !important;
  line-height: var(--lh-prose) !important;
  letter-spacing: var(--ls-prose);
  color: var(--ink-body);
}

/* 16.b  Bold + italic stay in the body face. Kills the Inter font-jump. -- */
.paper-canvas .text-col p strong,
.paper-canvas .text-col li strong,
.paper-canvas .text-col p em,
.paper-canvas .text-col li em,
.paper-canvas .text-col p b,
.paper-canvas .text-col li b {
  font-family: inherit !important;
  font-size: 1em !important;
  font-weight: 600 !important;
  letter-spacing: inherit !important;
  color: var(--ink-pure);
}
.paper-canvas .text-col p em,
.paper-canvas .text-col li em { font-weight: 400 !important; font-style: italic; }

/* 16.c  Inline code — single canonical chip, no per-occurrence style. ----- */
.paper-canvas .text-col code,
.paper-canvas .text-col p code,
.paper-canvas .text-col li code,
.paper-canvas .text-col h2 code,
.paper-canvas .text-col h3 code {
  font-family: var(--font-mono) !important;
  font-size: 0.88em !important;
  font-weight: 500;
  background: rgba(11,15,20,0.06);
  color: var(--ink-pure);
  padding: 0.12em 0.42em;
  border-radius: 5px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 16.d  Headings — pull from tokens, lock the cadence. -------------------- */
.paper-canvas .text-col h2 {
  font-family: var(--font-display) !important;
  font-size: var(--type-display-l) !important;
  line-height: var(--lh-tight) !important;
  letter-spacing: var(--ls-display) !important;
  font-weight: 400 !important;
}
.paper-canvas .text-col h3 {
  font-family: var(--font-display) !important;
  font-size: var(--type-display-m) !important;
  line-height: var(--lh-snug) !important;
  letter-spacing: var(--ls-display) !important;
  font-weight: 500 !important;
}
.paper-canvas .text-col h4,
.paper-canvas .text-col .eyebrow,
.paper-canvas .text-col .cf-eyebrow {
  font-family: var(--font-mono) !important;
  font-size: var(--type-mono-s) !important;
  letter-spacing: var(--ls-eyebrow) !important;
  text-transform: uppercase;
  font-weight: 700 !important;
}

/* 16.e  Captions / refs / chips — one mono token, predictable rhythm. ---- */
.paper-canvas .ref-section p,
.paper-canvas .text-col figcaption,
.paper-canvas .text-col .caption {
  font-size: var(--type-body-s) !important;
  line-height: var(--lh-snug) !important;
}

/* ==========================================================================
   17.  CADENCE — paragraph rhythm, measure, hyphenation, mobile readability
   ========================================================================== */
.paper-canvas .text-col {
  max-width: min(64ch, 100%);
  margin-inline: auto;
  padding-inline: clamp(0.25rem, 1.5vw, 1rem);
}
.paper-canvas .text-col p {
  margin-block-end: clamp(1.4rem, 0.9rem + 1.2vw, 2rem);
  text-wrap: pretty;
  hanging-punctuation: first last;
}
.paper-canvas .text-col h2,
.paper-canvas .text-col h3 {
  text-wrap: balance;
}

/* Tap-friendly link affordance. */
.paper-canvas .text-col a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: max(1px, 0.06em);
}

/* Wide tables / spec blocks never blow out the viewport on mobile. */
.paper-canvas .text-col table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Mobile cadence — softer paddings, narrower measure, gentler hyphenation. */
@media (max-width: 720px) {
  .paper-canvas {
    padding: 2.6rem 1.15rem 4rem !important;
    border-radius: 22px 22px 0 0 !important;
  }
  .paper-canvas .text-col {
    max-width: 38ch;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  .paper-canvas .text-col p {
    margin-block-end: 1.35rem;
    line-height: 1.65 !important;
  }
}

/* Strip any leftover read-time chrome — user explicitly does not want it. */
.read-time, .meta-time, .reading-time, [data-read-time] { display: none !important; }

/* --------------------------------------------------------------------------
   18.  NO-BLEED HARDENING (Nov 2026)
        Prevent any translucent block from peeking under the global Nav on
        mobile. The footer .series-strip ships with an inline
        background:rgba(255,255,255,.6) that bleeds when scrolled to the top
        edge of the dark page. Neutralise it globally and ensure the hero +
        paper-canvas paint an opaque base first.
   -------------------------------------------------------------------------- */
nav.series-strip {
  background: transparent !important;
  border-color: rgba(255,255,255,0.08) !important;
  position: static !important;
}
nav.series-strip > span {
  color: var(--text-faint, #9CA3AF) !important;
}
header.article-hero { background: var(--bg-base, #030407); }
.paper-canvas { isolation: isolate; }

/* --------------------------------------------------------------------------
   19.  SERIES-STRIP CHIPS — dark-mode restyle (Jul 2026)
   19.  SERIES-STRIP CHIPS — light-canvas restyle (Jul 2026, rev-2)
        The strip renders inside the paper-canvas footer (light background),
        not on the dark hero. Repaint each chip so it works against paper:
        deep-tone accent text, translucent color fill, full-color border on
        hover, colored dot + soft series shadow. Inline styles in the HTML
        set the baseline; these rules refine + unify hover across articles.
        Uses attribute selectors + !important so the inline styles yield.
   -------------------------------------------------------------------------- */
nav.series-strip { gap: .5rem .65rem !important; }
nav.series-strip {
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid rgba(11,15,20,0.08) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
nav.series-strip > span {
  font-family: var(--font-mono, 'JetBrains Mono', monospace) !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: #6B7280 !important;
}
nav.series-strip .series-chip {
  padding: .5rem .95rem .5rem .8rem !important;
  border-radius: 999px !important;
  font-size: .86rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  background: rgba(255,255,255,0.55) !important;
  transition: background .24s ease, border-color .24s ease, color .24s ease, transform .24s ease, box-shadow .24s ease !important;
}
nav.series-strip .series-chip:hover { transform: translateY(-1px); }
nav.series-strip .series-chip > span:first-child {
  /* the colored dot span inline-styled in HTML */
  transition: transform .24s ease, box-shadow .24s ease;
}
nav.series-strip .series-chip:hover > span:first-child { transform: scale(1.15); }
/* Agentic — cyan */
nav.series-strip .series-chip[href="/writing/agentic"] {
  color: #0E7490 !important;
  background: rgba(6,182,212,0.05) !important;
  border-color: rgba(6,182,212,0.45) !important;
}
nav.series-strip .series-chip[href="/writing/agentic"]:hover {
  background: rgba(6,182,212,0.12) !important;
  border-color: #06B6D4 !important;
  color: #155E75 !important;
  box-shadow: 0 0 0 1px rgba(6,182,212,0.35), 0 8px 22px -10px rgba(6,182,212,0.55) !important;
}
/* Harness — rose */
nav.series-strip .series-chip[href="/writing/harness"] {
  color: #9F1239 !important;
  background: rgba(244,63,94,0.05) !important;
  border-color: rgba(244,63,94,0.45) !important;
}
nav.series-strip .series-chip[href="/writing/harness"]:hover {
  background: rgba(244,63,94,0.12) !important;
  border-color: #F43F5E !important;
  color: #881337 !important;
  box-shadow: 0 0 0 1px rgba(244,63,94,0.35), 0 8px 22px -10px rgba(244,63,94,0.55) !important;
}
/* Evals — purple */
nav.series-strip .series-chip[href="/writing/evals"] {
  color: #6B21A8 !important;
  background: rgba(157,78,221,0.05) !important;
  border-color: rgba(157,78,221,0.45) !important;
}
nav.series-strip .series-chip[href="/writing/evals"]:hover {
  background: rgba(157,78,221,0.12) !important;
  border-color: #9D4EDD !important;
  color: #581C87 !important;
  box-shadow: 0 0 0 1px rgba(157,78,221,0.35), 0 8px 22px -10px rgba(157,78,221,0.55) !important;
}
/* AI PM OS — amber */
nav.series-strip .series-chip[href="/writing/ai-pm-os"] {
  color: #92400E !important;
  background: rgba(245,158,11,0.06) !important;
  border-color: rgba(245,158,11,0.50) !important;
}
nav.series-strip .series-chip[href="/writing/ai-pm-os"]:hover {
  background: rgba(245,158,11,0.14) !important;
  border-color: #F59E0B !important;
  color: #78350F !important;
  box-shadow: 0 0 0 1px rgba(245,158,11,0.40), 0 8px 22px -10px rgba(245,158,11,0.55) !important;
}
/* Frontier — emerald (in case chips include it) */
nav.series-strip .series-chip[href="/writing/frontier"] {
  color: #065F46 !important;
  background: rgba(16,185,129,0.05) !important;
  border-color: rgba(16,185,129,0.45) !important;
}
nav.series-strip .series-chip[href="/writing/frontier"]:hover {
  background: rgba(16,185,129,0.12) !important;
  border-color: #10B981 !important;
  color: #064E3B !important;
  box-shadow: 0 0 0 1px rgba(16,185,129,0.35), 0 8px 22px -10px rgba(16,185,129,0.55) !important;
}