/* =====================================================================
   Pediatric Airway Reference — site styles
   Steven McGaughey, MD MCI · OHSU Department of Emergency Medicine
   Editorial register · single column · Okabe & Ito accents as wayfinding
   ===================================================================== */

:root {
  /* Okabe & Ito — used semantically */
  --ok-black:    #1a1a1a;
  --ok-orange:   #E69F00;
  --ok-skyblue:  #56B4E9;
  --ok-green:    #009E73;
  --ok-yellow:   #F0E442;
  --ok-blue:     #0072B2;
  --ok-vermilion:#D55E00;
  --ok-purple:   #CC79A7;

  /* Per-part accent — overridden on each section */
  --p1: var(--ok-blue);
  --p2: var(--ok-orange);
  --p3: var(--ok-green);
  --p4: var(--ok-purple);
  --p5: var(--ok-vermilion);

  /* Ink & ground */
  --ink:        #111111;
  --ink-soft:   #444444;
  --ink-mute:   #7a7a7a;
  --rule:       #d9d6d0;
  --rule-soft:  #ececec;
  --paper:      #fbfaf6;
  --paper-pure: #ffffff;

  /* Layout — generous editorial column */
  --measure: 50rem;
  --col-w: 62rem;
}

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

html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-feature-settings: "kern", "liga", "onum";
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--col-w);
  margin: 0 auto;
  padding: 4rem 3.5rem 9rem;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: 60px; line-height: 1.02; letter-spacing: -0.025em; font-weight: 600; }
h1 em { font-style: italic; font-weight: 500; color: var(--ink-soft); }
h2 { font-size: 36px; line-height: 1.1;  letter-spacing: -0.02em; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 600; }
h4 { font-size: 14px; line-height: 1.3;  font-weight: 600; letter-spacing: 0.01em; }

p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
p.lede { font-size: 19px; line-height: 1.5; color: var(--ink-soft); font-style: italic; max-width: 36rem; }
p.lede em { font-style: normal; color: var(--ink); }

em { font-style: italic; }
strong { font-weight: 600; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 120ms ease;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 2px solid var(--ok-blue); outline-offset: 2px; }

/* small-caps mono labels */
.label, .l-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.num { font-variant-numeric: tabular-nums; }

.swatch {
  display: inline-block;
  width: 0.7em; height: 0.7em;
  margin-right: 0.45em;
  vertical-align: 0;
  border-radius: 1px;
  background: var(--ink);
}

/* Inline marginalia */
.aside {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  border-left: 2px solid var(--rule);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1rem 0 1.4rem;
  max-width: 40rem;
}
.aside.b { border-color: var(--ok-blue); }
.aside.o { border-color: var(--ok-orange); }
.aside.g { border-color: var(--ok-green); }
.aside.p { border-color: var(--ok-purple); }
.aside.v { border-color: var(--ok-vermilion); }
.aside strong { font-style: normal; color: var(--ink); font-weight: 500; }
.aside .tag {
  display: block;
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.3rem;
}

/* ============================================================
   Cover — page header
   ============================================================ */
.cover {
  padding: 0 0 3rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 5rem;
}
.cover-meta { display: none; }  /* legacy strip — hidden on both pages */
.cover .url { display: none; }
.cover-meta .swatch {
  width: 14px; height: 14px;
  background: var(--p1);
  border-radius: 0;
  margin-right: 0;
}
.cover-meta .label { color: var(--ink); }
.cover-meta .label.dim { color: var(--ink-mute); }
.cover-meta .sep { color: var(--rule); margin: 0 0.2rem; }

.cover h1 { font-size: 64px; margin: 0 0 1rem; }
.cover .byline {
  font-size: 17px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 0.4rem;
}
.cover .byline strong { font-style: normal; color: var(--ink); font-weight: 500; }

.cover .url {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 1rem;
}

/* Cover actions row (download / print) */
.cover .actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--ok-blue); outline-offset: 2px; }
.btn .icon { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; display: inline-block; }

/* TOC — map of pages, now anchored at the very top of the page */
.toc {
  margin: 0 0 4rem;
  padding-top: 0;
  border-top: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.toc a {
  display: block;
  background: var(--paper);
  padding: 1.1rem 1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  border-top: 4px solid var(--c, var(--ink));
  transition: background 120ms ease;
}
.toc a:hover { background: var(--paper-pure); text-decoration: none; }
.toc a[aria-current="page"] { background: var(--paper-pure); }
.toc a[aria-current="page"]::after {
  content: "you are here";
  display: block;
  margin-top: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c, var(--ink));
}
.toc .n {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c, var(--ink));
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.toc .t {
  font-family: "Source Serif 4", serif;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
}

/* ============================================================
   Part band — strong colored signpost per section
   ============================================================ */
section.part { margin: 7rem 0; scroll-margin-top: 2rem; }
section.part:first-of-type { margin-top: 5rem; }

.part-band {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem 1.5rem;
  align-items: end;
  padding-bottom: 1.2rem;
  border-bottom: 6px solid var(--c, var(--ink));
  margin-bottom: 2rem;
}
.part-band .marker {
  width: 14px; height: 64px;
  background: var(--c);
  margin-bottom: 0.2rem;
}
.part-band .meta { align-self: end; }
.part-band .num {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.part-band h2 {
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.part-band .dek {
  grid-column: 1 / -1;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 17.5px;
  line-height: 1.5;
  max-width: 38rem;
  margin: 0.6rem 0 0;
}

/* Per-part color bindings */
section.p1 { --c: var(--p1); }
section.p2 { --c: var(--p2); }
section.p3 { --c: var(--p3); }
section.p4 { --c: var(--p4); }
section.p5 { --c: var(--p5); }

/* small subhead inside a part */
.subhead {
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.subhead .label { color: var(--c); display: block; margin-bottom: 0.3rem; }
.subhead h3 { font-size: 22px; line-height: 1.2; }

/* ============================================================
   CICO decision diagram — typeset, no boxes
   ============================================================ */
.cico { margin: 1.5rem 0 0; }
.cico .step {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
.cico .step:last-of-type { border-bottom: 1px solid var(--rule); }
.cico .step-label {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.2rem;
  align-items: baseline;
}
.cico .step-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
  font-weight: 600;
}
.cico .step-num.b { color: var(--ok-blue); }
.cico .step-num.v { color: var(--ok-vermilion); }
.cico .step-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}
.cico .step-body {
  grid-column: 2 / -1;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 15.5px;
  margin-top: 0.3rem;
}
.cico .arrow {
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1;
  padding: 0.4rem 0;
}

/* ============================================================
   Two-pathway fork
   ============================================================ */
.fork {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 1.5rem;
  border-top: 2px solid var(--ink);
}
.fork .pathway { padding: 1.6rem 1.5rem 1.6rem 0; border-bottom: 1px solid var(--ink); }
.fork .pathway + .pathway { padding-left: 1.5rem; padding-right: 0; border-left: 1px solid var(--rule); }
.fork .pathway .marker {
  height: 4px;
  margin-bottom: 1rem;
  background: var(--col);
}
.fork .pathway .label { color: var(--col); margin-bottom: 0.3rem; }
.fork .pathway h3 {
  font-size: 24px;
  line-height: 1.15;
  color: var(--col);
  margin-bottom: 0.4rem;
}
.fork .pathway .source {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 1rem;
}
.fork .pathway p { font-size: 15.5px; line-height: 1.55; }
.fork .pathway.left  { --col: var(--ok-blue); }
.fork .pathway.right { --col: var(--ok-vermilion); }

/* ============================================================
   Anchors block
   ============================================================ */
.anchors {
  margin-top: 2.5rem;
  padding: 1.4rem 0 1.4rem 1.5rem;
  border-left: 4px solid var(--ok-green);
}
.anchors .label { color: var(--ok-green); margin-bottom: 0.4rem; display: block; }
.anchors h3 { margin-bottom: 1rem; }
.anchors ol {
  counter-reset: anc;
  list-style: none;
  padding: 0;
  margin: 0;
}
.anchors ol > li {
  counter-increment: anc;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.6rem;
  font-size: 16px;
  line-height: 1.45;
}
.anchors ol > li:first-child { border-top: 0; padding-top: 0; }
.anchors ol > li::before {
  content: counter(anc, decimal-leading-zero);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ok-green);
  font-weight: 600;
  padding-top: 0.25rem;
}

/* ============================================================
   Anatomy comparison list (First Steps page)
   ============================================================ */
.anatomy-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  counter-reset: anat;
}
.anatomy-list > li {
  counter-increment: anat;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.2rem;
  align-items: baseline;
}
.anatomy-list > li:last-child { border-bottom: 1px solid var(--rule); }
.anatomy-list > li > .label {
  color: var(--c, var(--ok-vermilion));
  font-weight: 600;
}
.anatomy-list > li .body {
  font-size: 16px;
  line-height: 1.55;
}
.anatomy-list > li .body .name {
  font-weight: 600;
  color: var(--ink);
}
.anatomy-list > li .body em {
  color: var(--ink-soft);
  font-style: italic;
}

/* ============================================================
   Physiology principles (numbered)
   ============================================================ */
.principles {
  list-style: none;
  counter-reset: prn;
  padding: 0;
  margin: 1.5rem 0 0;
}
.principles > li {
  counter-increment: prn;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.2rem;
  align-items: baseline;
}
.principles > li:last-child { border-bottom: 1px solid var(--rule); }
.principles > li::before {
  content: counter(prn, decimal-leading-zero);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--c, var(--ok-green));
  padding-top: 0.25rem;
}
.principles .name {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  display: block;
}
.principles .body {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.principles .body em { color: var(--ink-mute); font-style: italic; }
.principles .body strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   Tables — Tufte rules
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  margin: 1rem 0 0.5rem;
}
table.data {
  font-family: "Inter", -apple-system, sans-serif;
  font-feature-settings: "tnum", "ss01";
}
table thead th {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  text-align: left;
  padding: 0.55rem 0.7rem 0.55rem 0;
  border-top: 1.5px solid var(--c, var(--ink));
  border-bottom: 1px solid var(--ink);
  vertical-align: bottom;
  white-space: nowrap;
}
table tbody td {
  padding: 0.5rem 0.7rem 0.5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: baseline;
}
table tbody tr:last-child td { border-bottom: 1px solid var(--ink); }
table th.r, table td.r { text-align: right; padding-right: 1.1rem; }
table th.c, table td.c { text-align: center; }
table tbody td:first-child,
table tbody th:first-child {
  padding-left: 0;
  font-weight: 500;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  text-align: left;
}

table caption {
  caption-side: bottom;
  text-align: left;
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-mute);
  margin-top: 0.8rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
}
table caption strong { color: var(--ink); font-weight: 500; }

/* formula chips inline beneath the table */
.formulas {
  margin-top: 1.2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.formulas b { font-weight: 500; color: var(--ink); }

/* ============================================================
   Method comparison
   ============================================================ */
.methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1.5px solid var(--ink);
  margin-top: 1rem;
}
.methods .m {
  padding: 1.4rem 1.6rem 1.4rem 0;
  border-bottom: 1px solid var(--ink);
}
.methods .m + .m { padding-left: 1.6rem; border-left: 1px solid var(--rule); padding-right: 0; }
.methods .m h3 { font-size: 18px; margin-bottom: 0.2rem; font-weight: 600; }
.methods .m .role {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok-blue);
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.methods .m.alt .role { color: var(--ok-vermilion); }
.methods .m dl {
  margin: 0.8rem 0 0;
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.4rem 0.8rem;
  font-size: 14px;
}
.methods .m dt {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 0.18em;
}
.methods .m dd { margin: 0; line-height: 1.45; }
.methods .m .caveat {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
}

/* ============================================================
   Why 1:4 + failure mode
   ============================================================ */
.why14 { margin: 2.5rem 0 0; }
.why14 .label { color: var(--ok-green); margin-bottom: 0.4rem; display: block; }

.failure {
  margin: 2rem 0 0;
  padding: 1.4rem 1.6rem;
  background: color-mix(in oklch, var(--ok-yellow) 18%, var(--paper));
  border-top: 3px solid var(--ok-vermilion);
  border-bottom: 1px solid var(--ink);
}
.failure .label { color: var(--ok-vermilion); font-weight: 600; display: block; margin-bottom: 0.5rem; }
.failure h3 { font-size: 19px; margin-bottom: 0.5rem; }
.failure p { margin: 0; font-size: 15.5px; line-height: 1.5; }

/* ============================================================
   Cross-link to the other page
   ============================================================ */
.cross-link {
  display: block;
  margin: 5rem 0 0;
  padding: 1.5rem 0 1.5rem 1.5rem;
  border-left: 4px solid var(--c, var(--ok-blue));
  text-decoration: none;
  color: var(--ink);
}
.cross-link:hover { text-decoration: none; }
.cross-link:hover .nav-title { text-decoration: underline; text-decoration-color: var(--c, var(--ok-blue)); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.cross-link .nav-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c, var(--ok-blue));
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}
.cross-link .nav-title {
  font-family: "Source Serif 4", serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 0.3rem;
}
.cross-link .nav-title::after {
  content: "  →";
  color: var(--c, var(--ok-blue));
  font-weight: 500;
}
.cross-link .nav-sub {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  max-width: 38rem;
}

/* ============================================================
   Sources
   ============================================================ */
.sources ol {
  list-style: none;
  counter-reset: src;
  padding: 0;
  margin: 1.5rem 0 0;
  column-count: 2;
  column-gap: 3rem;
  column-rule: 1px solid var(--rule-soft);
}
.sources ol > li {
  counter-increment: src;
  break-inside: avoid;
  padding: 0.7rem 0 1rem;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  font-size: 13.5px;
  line-height: 1.5;
}
.sources ol > li::before {
  content: counter(src, decimal-leading-zero);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--p5);
  font-weight: 600;
  padding-top: 0.2rem;
}
.sources cite { font-style: normal; color: var(--ink); }
.sources cite em { font-style: italic; }
.sources .doi {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
  word-break: break-all;
}
.sources .gloss {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 13px;
  margin-top: 0.25rem;
}

/* ============================================================
   Colophon
   ============================================================ */
.colophon {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.7;
}
.colophon .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.colophon .disclaimer {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 11.5px;
  font-family: "Source Serif 4", serif;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: 36rem;
}
.colophon a { color: inherit; }

/* ============================================================
   Anatomy figure (image wrapper)
   ============================================================ */
.figure {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-pure);
}
.figure .figure-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.figure-pair .figure-grid { grid-template-columns: 1fr 1fr; }
.figure-trio .figure-grid { grid-template-columns: 1fr 1fr 1fr; }
.figure .figure-grid > div { display: flex; flex-direction: column; gap: 0.4rem; }
.figure .figure-grid img {
  border: 1px solid var(--rule);
  background: var(--paper-pure);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
/* Anatomy pair — heterogeneous aspect ratios; let each image fill its 50% column */
.figure-anatomy-pair .figure-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 1.5rem; }
.figure-anatomy-pair .figure-grid img {
  aspect-ratio: auto;
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
}
/* Half-width figure (single image, ~50% column) */
.figure-half img {
  display: block;
  max-width: 50%;
  margin: 0 auto;
}
@media (max-width: 760px) {
  .figure-half img { max-width: 80%; }
  .figure-anatomy-pair .figure-grid { grid-template-columns: 1fr; }
}
.figure .figure-grid .cap {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1.3;
}
.figure figcaption {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 0.7rem;
  line-height: 1.6;
}
.figure figcaption strong { color: var(--ink); font-weight: 500; }

/* ============================================================
   Print — tight 2-page reference (production)
   ============================================================ */
@media print {
  @page { size: Letter portrait; margin: 0.45in 0.5in; }
  html, body { background: white; }
  body { font-size: 9pt; line-height: 1.35; }
  .page { padding: 0; max-width: 100%; }

  /* Hide screen-only chrome */
  .actions, .toc, .cross-link, .cover-meta, .figure { display: none !important; }

  /* Cover compresses to a single header band — no own page */
  .cover {
    padding: 0 0 8pt;
    border-bottom: 0.5pt solid var(--ink);
    margin-bottom: 8pt;
    page-break-after: auto;
  }
  .cover h1 { font-size: 18pt; line-height: 1.1; margin: 0 0 2pt; letter-spacing: -0.015em; }
  .cover h1 br { display: none; }
  .cover h1 em { font-size: 14pt; color: var(--ink-soft); }
  .cover .byline { font-size: 8pt; margin: 0 0 2pt; }
  .cover .lede { font-size: 9pt; line-height: 1.35; max-width: none; margin: 4pt 0 0; }
  .cover .url { display: none; }

  /* Sections flow naturally — let the engine pick breaks */
  section.part { margin: 8pt 0; page-break-inside: auto; }
  .part-band {
    grid-template-columns: 8pt 1fr;
    gap: 4pt 8pt;
    padding-bottom: 3pt;
    border-bottom-width: 2px;
    margin-bottom: 6pt;
    page-break-after: avoid;
  }
  .part-band .marker { width: 4pt; height: 22pt; }
  .part-band .num { font-size: 7.5pt; margin-bottom: 1pt; }
  .part-band h2 { font-size: 12pt; line-height: 1.15; }
  .part-band .dek { font-size: 8.25pt; line-height: 1.35; margin: 2pt 0 0; max-width: none; }

  h3 { font-size: 9.5pt; line-height: 1.2; }
  p { margin: 0 0 4pt; max-width: none; }
  p.lede { font-size: 9pt; }

  /* Lists */
  .anatomy-list > li, .principles > li {
    grid-template-columns: 5rem 1fr;
    gap: 0.5rem;
    padding: 4pt 0;
    page-break-inside: avoid;
  }
  .anatomy-list > li .body, .principles .body { font-size: 8.5pt; line-height: 1.35; }
  .principles .name { font-size: 9.5pt; margin: 0 0 1pt; }
  .principles > li::before { font-size: 8pt; padding-top: 1pt; }

  /* CICO step list */
  .cico .step { padding: 4pt 0; page-break-inside: avoid; }
  .cico .step-label { grid-template-columns: 5.5rem 1fr; gap: 0.6rem; }
  .cico .step-num { font-size: 8pt; }
  .cico .step-title { font-size: 9.5pt; line-height: 1.25; }
  .cico .step-body { font-size: 8.25pt; line-height: 1.35; margin-top: 1pt; }
  .cico .arrow { font-size: 8pt; padding: 1pt 0; }

  /* Fork */
  .fork { page-break-inside: avoid; margin-top: 6pt; }
  .fork .pathway { padding: 6pt 8pt 6pt 0; }
  .fork .pathway + .pathway { padding-left: 8pt; padding-right: 0; }
  .fork .pathway .marker { height: 2pt; margin-bottom: 4pt; }
  .fork .pathway h3 { font-size: 10.5pt; margin-bottom: 2pt; }
  .fork .pathway .source { font-size: 7pt; margin-bottom: 4pt; }
  .fork .pathway p { font-size: 8.25pt; line-height: 1.35; margin: 0; }

  /* Anchors */
  .anchors { margin-top: 6pt; padding: 6pt 0 6pt 8pt; page-break-inside: avoid; }
  .anchors h3 { font-size: 10pt; margin-bottom: 4pt; }
  .anchors ol > li {
    grid-template-columns: 1.4rem 1fr;
    gap: 0.4rem;
    padding: 3pt 0;
    font-size: 8.5pt;
    line-height: 1.3;
  }

  /* Methods */
  .methods { page-break-inside: avoid; margin-top: 4pt; }
  .methods .m { padding: 6pt 8pt 6pt 0; }
  .methods .m + .m { padding-left: 8pt; padding-right: 0; }
  .methods .m h3 { font-size: 10pt; margin-bottom: 1pt; }
  .methods .m .role { font-size: 7.5pt; margin-bottom: 4pt; }
  .methods .m dl { grid-template-columns: 4.5rem 1fr; gap: 1pt 4pt; font-size: 8pt; }
  .methods .m dt { font-size: 7.5pt; padding-top: 1pt; }
  .methods .m dd { line-height: 1.3; }
  .methods .m .caveat { font-size: 7.75pt; line-height: 1.35; margin-top: 4pt; padding-top: 4pt; }

  /* Tables */
  table { font-size: 7.75pt; margin: 4pt 0 2pt; }
  table thead th { font-size: 7.25pt; padding: 3pt 4pt 3pt 0; border-top-width: 1pt; }
  table tbody td { padding: 2.5pt 4pt 2.5pt 0; }
  table caption { font-size: 7.25pt; margin-top: 3pt; line-height: 1.35; }
  .formulas { font-size: 8pt; margin-top: 4pt; gap: 1.2rem; }

  /* Why14 + failure */
  .why14 { margin-top: 6pt; page-break-inside: avoid; }
  .why14 .label { margin-bottom: 1pt; }
  .why14 p { font-size: 8.5pt; line-height: 1.35; }
  .failure {
    margin: 6pt 0 0;
    padding: 5pt 8pt;
    background: #FAF3C2 !important;
    border-top-width: 2pt;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .failure h3 { font-size: 10pt; margin-bottom: 2pt; }
  .failure p { font-size: 8.25pt; line-height: 1.35; }
  .failure .label { margin-bottom: 1pt; }

  /* Asides */
  .aside {
    font-size: 8pt;
    line-height: 1.35;
    padding: 0.05rem 0 0.05rem 0.6rem;
    margin: 4pt 0 6pt;
    max-width: none;
    page-break-inside: avoid;
  }
  .aside .tag { font-size: 7pt; margin-bottom: 1pt; }

  /* Sources — flatten multi-column for predictable break behavior */
  .sources ol { column-count: 1 !important; column-rule: none !important; column-gap: 0 !important; }
  .sources ol > li {
    padding: 2pt 0;
    border-bottom: 0.25pt solid var(--rule-soft);
    font-size: 7.5pt;
    line-height: 1.3;
    grid-template-columns: 1.4rem 1fr;
    gap: 0.4rem;
    page-break-inside: avoid;
  }
  .sources ol > li::before { font-size: 7pt; }
  .sources .doi { font-size: 7pt; }
  .sources .gloss { font-size: 7pt; margin-top: 1pt; }

  /* Colophon */
  .colophon { margin-top: 8pt; padding-top: 4pt; font-size: 6.5pt; line-height: 1.35; page-break-inside: avoid; }
  .colophon .row { gap: 4pt; }
  .colophon .disclaimer { font-size: 7pt; line-height: 1.35; margin-top: 4pt; max-width: none; }

  /* Force colors to print on the markers and the failure box */
  .part-band .marker, .anchors, .swatch, .fork .pathway .marker, .failure {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Page breaks */
  a { color: var(--ink) !important; text-decoration: none !important; }
  thead { display: table-header-group; }
  tr, td, th { page-break-inside: avoid; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .page { padding: 2.5rem 1.4rem 4rem; }
  .figure-pair .figure-grid, .figure-trio .figure-grid { grid-template-columns: 1fr; }
  h1 { font-size: 40px; }
  .cover h1 { font-size: 44px; }
  .toc { grid-template-columns: 1fr; }
  .fork { grid-template-columns: 1fr; border-top-width: 2px; }
  .fork .pathway + .pathway { padding-left: 0; padding-right: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .methods { grid-template-columns: 1fr; }
  .methods .m + .m { padding-left: 0; padding-right: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .sources ol { column-count: 1; }
  .cico .step-label { grid-template-columns: 1fr; gap: 0.2rem; }
  .cico .step-body { grid-column: 1; margin-top: 0.4rem; }
  .anatomy-list > li { grid-template-columns: 1fr; gap: 0.3rem; }
  .principles > li { grid-template-columns: 1fr; gap: 0.3rem; }
  .part-band { grid-template-columns: 1fr; }
  .part-band .marker { width: 48px; height: 8px; }
  table { font-size: 13px; }
  table thead th { font-size: 9.5px; }
  .cover-meta { margin-bottom: 3rem; }
  .cover h1 { font-size: 38px; }
  .cross-link .nav-title { font-size: 22px; }
}

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