/* ================================================================
   carlm451.github.io — Shared Stylesheet
   ================================================================
   Three page types share this file:
     1. Landing page   (index.html)         — body.page-landing
     2. Course index   (tdl-index.html …)   — body.page-index
     3. Chapter pages  (tdl-01-*.html …)    — body.page-chapter
   ================================================================ */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=JetBrains+Mono:wght@400;500&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* === DESIGN TOKENS === */
:root {
  --bg: #f4f7f5;
  --bg-alt: #e8eeea;
  --text: #1a2e22;
  --text-muted: #5a7060;
  --accent: #c25a30;
  --accent2: #2a6b4a;
  --accent3: #3a6b5a;
  --accent4: #6a5a7a;
  --border: #c2d0c8;
  --card: #ffffff;
  --shadow: 0 2px 12px rgba(20,40,30,0.07);
  --shadow-lg: 0 8px 32px rgba(20,40,30,0.12);
}

/* === RESET & BASE === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 19px; }
body {
  font-family: 'Crimson Pro', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
p { margin-bottom: 1rem; }
strong { font-weight: 600; }
em { font-style: italic; }

/* === LAYOUT === */
.container { max-width: 820px; margin: 0 auto; padding: 0 2rem; }

/* ----------------------------------------------------------------
   HEADER — dark forest green
   ---------------------------------------------------------------- */
header {
  background: linear-gradient(175deg, #132a1e 0%, #1a3828 40%, #1e402e 100%);
  color: #dce8e0;
  padding: 3.5rem 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 80%, rgba(42,107,74,0.2), transparent),
    radial-gradient(ellipse 500px 300px at 80% 20%, rgba(194,90,48,0.08), transparent);
}
header .container { position: relative; z-index: 1; }
header h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.6rem;
  color: #f0f5f2;
}
header h1 strong { font-weight: 700; color: #f0f5f2; }
header .subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: #a0b8a8;
  max-width: 560px;
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   LANDING PAGE — body.page-landing
   ---------------------------------------------------------------- */
.page-landing header { padding: 4.5rem 2rem 3.5rem; }
.page-landing header .container { max-width: 780px; }
body.page-landing header h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
  color: #f0f5f2;
}
body.page-landing header .me {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #a0b8a8;
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
body.page-landing header .me .me-highlight {
  display: inline-block;
  background: rgba(194,90,48,0.15);
  border: 1px solid rgba(194,90,48,0.4);
  color: #e8a878;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
body.page-landing header .me a { color: #80b090; text-decoration: none; }
body.page-landing header .me a:hover { color: #a8d0b8; }

.page-landing main,
.page-index main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* Section labels (landing + course index) */
.section-label {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1rem;
  margin-top: 3rem;
  display: block;
  line-height: 1.2;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
}
.section-label:first-child { margin-top: 0; }
.section-label::after {
  content: none;
}

/* Landing page cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  text-decoration: none;
  display: block;
  color: var(--text);
}
a.card:hover {
  box-shadow: 0 6px 24px rgba(20,40,30,0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.card.featured {
  border-left: 4px solid var(--accent2);
  position: relative;
}
.card.featured .live-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent2);
  color: white;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.card.placeholder {
  opacity: 0.5;
  pointer-events: none;
  border-style: dashed;
}
.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
  line-height: 1.3;
}
.card .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.card .tag {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}
.tag.topology { background: rgba(194,90,48,0.1); color: var(--accent); }
.tag.ml       { background: rgba(42,107,74,0.1); color: var(--accent2); }
.tag.physics  { background: rgba(58,107,90,0.1); color: var(--accent3); }
.tag.compute  { background: rgba(106,90,122,0.1); color: var(--accent4); }
.tag.math     { background: rgba(90,100,60,0.12); color: #5a6a30; }

.card p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.card .meta {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.76rem;
  color: #8a9e90;
  margin-top: 0.5rem;
}
.card .meta .status {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.3rem;
  position: relative;
  top: -1px;
}
.status.live    { background: var(--accent2); }
.status.wip     { background: var(--accent); }
.status.planned { background: #8a9e90; }

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

/* ----------------------------------------------------------------
   COURSE INDEX — body.page-index
   ---------------------------------------------------------------- */
.page-index header { padding: 4rem 2rem 3rem; }
.page-index header .container { max-width: 780px; }
body.page-index header h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f0f5f2;
}
.page-index header .back {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  color: #80b090;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}
.page-index header .back:hover { color: #a8d0b8; }
.page-index .section-label { margin-top: 2.5rem; }

/* Chapter cards (course index) */
.ch-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.6rem;
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  color: var(--text);
}
a.ch-card:hover {
  box-shadow: 0 6px 24px rgba(20,40,30,0.12);
  border-color: var(--accent2);
  transform: translateY(-1px);
}
.ch-card .ch-num {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--border);
  min-width: 2.2rem;
  text-align: center;
  line-height: 1;
  padding-top: 0.3rem;
}
a.ch-card:hover .ch-num { color: var(--accent2); }
.ch-card .ch-body { flex: 1; }
.ch-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.2rem; line-height: 1.3; }
.ch-card p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}
.ch-card .topics {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  color: #8a9e90;
  margin-top: 0.3rem;
}
.ch-card .rank-dots { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.rank-dot { width: 8px; height: 8px; border-radius: 50%; }
.rank-dot.r0 { background: var(--accent); }
.rank-dot.r1 { background: var(--accent2); }
.rank-dot.r2 { background: var(--accent3); }
.rank-dot.r3 { background: var(--accent4); }

.prereq {
  background: #eaf2ec;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.prereq strong { color: var(--text); }

/* ----------------------------------------------------------------
   CHAPTER PAGES — body.page-chapter
   ---------------------------------------------------------------- */

/* Breadcrumb */
header .breadcrumb {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  color: #80b090;
  margin-bottom: 0.8rem;
}
header .breadcrumb a { color: #a0c8b0; text-decoration: none; }
header .breadcrumb a:hover { color: #c8e0d0; }

/* Chapter number in header */
header .ch-num {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: #e8a878;
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Sticky chapter navigation */
nav.ch-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
nav.ch-nav .container { display: flex; justify-content: space-between; align-items: center; }
nav.ch-nav a {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--accent2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
nav.ch-nav a:hover { color: var(--accent); }
nav.ch-nav .disabled { color: var(--border); pointer-events: none; }
nav.ch-nav .ch-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Progress bar under chapter nav */
.progress-bar {
  height: 3px;
  background: var(--border);
  position: sticky;
  top: 45px; /* just below ch-nav */
  z-index: 9;
}
.progress-bar .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 80ms ease-out;
}

/* Sections */
section { margin-bottom: 3.5rem; padding-top: 1rem; }
section h2 {
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
section h2 .sec-num {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: var(--accent2);
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
}
section h3 { font-size: 1.3rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.5rem; }
section h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   COMPONENTS — used across chapter pages
   ---------------------------------------------------------------- */

/* Definition boxes */
.def-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 1.8rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.def-box.green  { border-left-color: var(--accent2); }
.def-box.blue   { border-left-color: var(--accent3); }
.def-box.purple { border-left-color: var(--accent4); }
.def-box .def-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.def-box.green  .def-label { color: var(--accent2); }
.def-box.blue   .def-label { color: var(--accent3); }
.def-box.purple .def-label { color: var(--accent4); }

/* Insight / callout boxes */
.insight {
  background: linear-gradient(135deg, #eaf2ec, #e4eee6);
  border-radius: 8px;
  padding: 1.3rem 1.6rem;
  margin: 1.5rem 0;
  position: relative;
}
.insight::before {
  content: '\1F4A1'; /* lightbulb */
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  font-size: 1.1rem;
  background: var(--bg);
  padding: 0 0.3rem;
}
.insight.physics::before { content: '\269B\FE0F'; }
.insight.warning::before { content: '\26A0\FE0F'; }
.insight.key::before     { content: '\1F511'; }
.insight p:last-child { margin-bottom: 0; }
.insight strong { color: var(--accent); }

/* Figures (SVG diagrams) */
.figure {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: var(--shadow);
}
.figure svg { max-width: 100%; height: auto; }
.figure .caption {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  text-align: left;
  line-height: 1.5;
}
.figure .caption strong { color: var(--text); font-weight: 600; }

/* Math blocks */
.math-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.math-block .math-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

/* Comparison tables */
.comp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
}
.comp-table th {
  background: var(--bg-alt);
  font-weight: 700;
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.comp-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Numbered steps */
.steps { margin: 1.5rem 0; padding-left: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 0.8rem 0 0.8rem 3rem;
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}
.steps li:last-child { border-left-color: transparent; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -0.85rem;
  top: 0.7rem;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--accent2);
  color: white;
  border-radius: 50%;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inline & block code */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
pre {
  background: #132a1e;
  color: #d8e8e0;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  box-shadow: var(--shadow);
}
pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
/* Syntax tokens (lightweight, no external lib needed) */
pre .kw   { color: #e8a878; } /* keywords — warm amber */
pre .fn   { color: #7ec8a0; } /* functions — soft green */
pre .str  { color: #a0c8b0; } /* strings — sage */
pre .num  { color: #c0a0c8; } /* numbers — muted plum */
pre .cmt  { color: #5a7060; font-style: italic; } /* comments */

/* Divider */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 3rem 0;
}

/* ----------------------------------------------------------------
   IN-PAGE TABLE OF CONTENTS — chapter pages
   ---------------------------------------------------------------- */
.toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.8rem;
  margin: 1.5rem 0 2.5rem;
  box-shadow: var(--shadow);
}
.toc-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
}
.toc ol li { padding: 0.2rem 0; }
.toc ol li a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.toc ol li a:hover { color: var(--accent2); }
.toc ol li a .toc-num {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.82rem;
  color: var(--accent2);
  margin-right: 0.5rem;
}
.toc ol ol {
  padding-left: 1.4rem;
  margin-top: 0.1rem;
}
.toc ol ol li a {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.toc ol ol li a:hover { color: var(--accent2); }

/* ----------------------------------------------------------------
   FOOTER NAV — chapter prev/next cards
   ---------------------------------------------------------------- */
.footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.footer-nav a {
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  color: var(--text);
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.footer-nav a:hover { border-color: var(--accent2); box-shadow: var(--shadow); }
.footer-nav .dir {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent2);
  display: block;
  margin-bottom: 0.2rem;
}
.footer-nav .title { font-size: 0.9rem; font-weight: 600; }
.footer-nav .next { text-align: right; }
.footer-nav .spacer { flex: 1; }

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */

/* Dark footer — chapter pages */
.page-chapter footer {
  background: #132a1e;
  color: #6a8a78;
  padding: 2.5rem 2rem;
  margin-top: 3rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  text-align: center;
}
.page-chapter footer a { color: #80b090; text-decoration: none; }

/* Light footer — landing & index pages */
.page-landing footer,
.page-index footer {
  text-align: center;
  padding: 2.5rem 2rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  max-width: 780px;
  margin: 0 auto;
}
.page-landing footer a,
.page-index footer a { color: var(--accent2); text-decoration: none; }
.page-landing footer a:hover,
.page-index footer a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   SVG TOKENS — graph/complex diagram elements
   ---------------------------------------------------------------- */
.node-v    { fill: #e8a88a; stroke: #c25a30; }
.node-e    { fill: #8ec8a8; stroke: #2a6b4a; }
.node-f    { fill: #a8c8b8; stroke: #3a6b5a; }
.edge-line { stroke: #5a7060; stroke-width: 1.5; }
.label-text { font-family: 'Source Sans 3', sans-serif; font-size: 11px; fill: #1a2e22; text-anchor: middle; }
.label-sm   { font-family: 'Source Sans 3', sans-serif; font-size: 10px; fill: #5a7060; text-anchor: middle; }

/* ----------------------------------------------------------------
   BACK TO TOP BUTTON
   ---------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  color: var(--accent2);
  font-size: 1.1rem;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
  z-index: 20;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent2);
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 700px) {
  html { font-size: 17px; }
  header h1 { font-size: 32px; }
  body.page-landing header h1 { font-size: 32px; }
  .container { padding: 0 1.2rem; }
  .page-landing main,
  .page-index main { padding: 2rem 1.2rem; }
  .footer-nav { flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .section-label { font-size: 24px; }
  .toc { margin: 1rem 0 1.5rem; }
}

/* ----------------------------------------------------------------
   PRINT
   ---------------------------------------------------------------- */
@media print {
  /* Hide interactive elements */
  nav.ch-nav,
  .progress-bar,
  .back-to-top,
  .footer-nav,
  .toc { display: none; }

  /* Reset colors for printing */
  body { background: white; color: black; font-size: 11pt; }
  header {
    background: none !important;
    color: black;
    padding: 1rem 0;
    border-bottom: 2px solid #333;
  }
  header::before { display: none; }
  header h1 { color: black; font-size: 1.6rem; }
  header h1 strong { color: #333; }
  header .subtitle,
  header .breadcrumb { color: #555; }
  header .ch-num { color: #c25a30; }

  /* Content */
  .container { max-width: 100%; padding: 0; }
  .def-box, .insight, .figure, .math-block {
    box-shadow: none;
    break-inside: avoid;
    border-color: #ccc;
  }
  .figure svg { max-width: 100%; }

  /* Footer */
  footer { background: none !important; color: #555; border-top: 1px solid #ccc; padding: 1rem 0; }
  footer a { color: #333; }

  /* Links show URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
    font-style: italic;
  }
  /* But not nav links */
  header a::after,
  footer a::after { content: none !important; }
}
