/* The Investor's Canon — shared stylesheet (v2, premium edition) */

:root {
  --bg: #f9f5ec;
  --bg-alt: #f1e9d8;
  --bg-card: #ffffff;
  --ink: #1c1913;
  --ink-soft: #5b5346;
  --ink-faint: #736b5c;
  --navy: #16233d;
  --navy-soft: #24406b;
  --gold: #845c25;
  --gold-bright: #c68f43;
  --gold-line: linear-gradient(90deg, #a1702e, #d9ac5f);
  --rule: #e2d8c1;
  --rule-strong: #d1c19c;
  --pill-bg: #ecdfc0;
  --pill-text: #7a5322;
  --shadow-sm: 0 1px 2px rgba(28, 25, 19, 0.06);
  --shadow-md: 0 6px 20px -8px rgba(22, 35, 61, 0.18);
  --shadow-lg: 0 18px 44px -16px rgba(22, 35, 61, 0.24);
  --serif: "Source Serif 4", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --display: "Fraunces", "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171310;
    --bg-alt: #1f1a14;
    --bg-card: #231e17;
    --ink: #eee6d6;
    --ink-soft: #b8ab93;
    --ink-faint: #9c9384;
    --navy: #1c2a45;
    --navy-soft: #2d4670;
    --gold: #dba85a;
    --gold-bright: #efc27e;
    --gold-line: linear-gradient(90deg, #dba85a, #efc27e);
    --rule: #362d20;
    --rule-strong: #4a3d29;
    --pill-bg: #33270f;
    --pill-text: #efc27e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 26px -10px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 22px 50px -18px rgba(0, 0, 0, 0.65);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

::selection { background: var(--gold); color: #fffdf8; }

/* ---------- Accessibility ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Reading progress bar (chapter pages) ---------- */
.reading-progress-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%; width: 0%;
  background: var(--gold-line);
  border-radius: 0 2px 2px 0;
  will-change: width;
  transition: width 0.1s ease-out;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(161, 112, 46, 0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(22, 35, 61, 0.05), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.72;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 920px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}

.brand span { color: var(--gold); }

.header-links {
  font-family: var(--sans);
  font-size: 13.5px;
}

.header-links a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.header-links a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- Cover / hero ---------- */
.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 76px 24px 48px;
  text-align: center;
}

.hero .kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--display);
  font-size: 54px;
  line-height: 1.1;
  margin: 0 0 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.hero .subtitle {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 24px;
}

.byline {
  font-family: var(--sans);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  color: #fffdf8;
  background: var(--navy);
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--navy-soft);
}
.hero-cta .arrow { transition: transform 0.2s; }
.hero-cta:hover .arrow { transform: translateX(3px); }

.hero-cta-note {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  margin: 10px 0 0;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--pill-text);
  background: var(--pill-bg);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 8px 18px 8px 8px;
  margin-top: 26px;
  box-shadow: var(--shadow-sm);
}

.progress-pill .progress-track {
  width: 84px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill-text) 18%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-pill .progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gold-line);
}

/* ---------- Intro copy ---------- */
.about-book {
  max-width: 640px;
  margin: 0 auto 60px;
  padding: 0 24px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  text-align: center;
}

.about-book strong { color: var(--ink); font-weight: 600; }

/* ---------- Simple part list (legacy .part rows, kept for compatibility) ---------- */
.toc {
  max-width: 920px;
  margin: 20px auto 80px;
  padding: 0 24px;
}

.toc h2 {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 6px;
}

.part {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.part:hover { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.part:hover .part-title { color: var(--gold); }

.part-num {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.part-title {
  font-size: 21px;
  transition: color 0.15s ease;
}

.part-desc {
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.5;
}

.part-status {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  justify-self: end;
}

.part-status.ready { color: var(--gold); font-weight: 700; }

/* ---------- Full roadmap: volumes, parts, chapters ---------- */
.roadmap {
  max-width: 920px;
  margin: 0 auto 90px;
  padding: 0 24px;
}

.volume-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  margin: 0 auto 54px;
  max-width: 720px;
  padding: 0 24px;
}

.volume-nav a {
  color: var(--pill-text);
  background: var(--pill-bg);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.volume-nav a:hover {
  background: var(--navy);
  color: #f4ead4;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.volume-block { margin-bottom: 50px; }

.volume-title {
  font-family: var(--display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  font-weight: 600;
  background: var(--gold-line);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding-bottom: 8px;
  margin: 0 0 24px;
  border-bottom: 2px solid var(--gold);
}

.toc-part { margin-bottom: 30px; }

.toc-part-head {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 9px;
  margin-bottom: 2px;
}

.toc-part-head .part-roman {
  color: #fff;
  font-weight: 700;
  margin-right: 10px;
  background: var(--navy);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.chapter-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 11px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, transform 0.15s ease;
}

a.chapter-row:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

a.chapter-row:hover .ch-title { color: var(--gold); }

.chapter-row .ch-num {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-faint);
}

.chapter-row .ch-title {
  font-size: 16.5px;
  transition: color 0.15s ease;
}

.chapter-row .ch-status {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  justify-self: end;
}

.chapter-row .ch-status.ready {
  color: var(--gold);
  font-weight: 700;
}

.chapter-row.pending { cursor: default; }
.chapter-row.pending .ch-title { color: var(--ink-faint); }
.chapter-row.pending:hover { background: none; box-shadow: none; }

/* ---------- Chapter pages ---------- */
.chapter {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 110px;
}

.chapter-kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
}

.chapter h1 {
  font-family: var(--display);
  font-size: 38px;
  line-height: 1.22;
  margin: 0 0 34px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.chapter h2 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  margin: 54px 0 16px;
  color: var(--ink);
  padding-top: 6px;
  border-top: 3px solid var(--gold);
}

.chapter h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 34px 0 12px;
}

.chapter p { margin: 0 0 19px; }

.chapter ul, .chapter ol {
  margin: 0 0 19px;
  padding-left: 24px;
}

.chapter li { margin-bottom: 9px; }

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

/* ---------- Callouts ---------- */
.callout {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 22px 20px 26px;
  margin: 30px 0;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 3px;
  background: var(--gold-line);
}

.callout .callout-label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold);
  margin-bottom: 9px;
  display: block;
}

/* ---------- Tables ---------- */
table.figures {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-family: var(--sans);
  font-size: 14.5px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table.figures th, table.figures td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid var(--rule);
}

table.figures th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bg);
  font-weight: 700;
  background: var(--navy);
  border-bottom: none;
}

table.figures tr:nth-child(even) td { background: var(--bg-alt); }
table.figures tr:last-child td { border-bottom: none; }

/* ---------- Chapter recap ---------- */
.recap {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px 28px 24px;
  margin: 48px 0 0;
}

.recap::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  background: var(--gold-line);
  border-radius: 0 0 3px 3px;
}

.recap h3 {
  margin-top: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.recap ul { margin-bottom: 0; }

/* ---------- Chapter prev/next nav ---------- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
  margin-top: 60px;
  padding-top: 0;
  border-top: none;
  font-family: var(--sans);
  font-size: 14px;
}

.chapter-nav a {
  flex: 1;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-card);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.chapter-nav a:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chapter-nav a:last-child { text-align: right; }

/* ---------- Framework overview page ---------- */
.framework-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 56px 24px 110px;
}

.framework-page .chapter-kicker {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 14px;
}

.framework-page h1 {
  font-family: var(--display);
  font-size: 38px;
  line-height: 1.22;
  margin: 0 0 22px;
  font-weight: 500;
}

.framework-page > p {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 0 22px;
}

.framework-figure {
  margin: 0 0 64px;
}

.framework-figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--rule);
  display: block;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.framework-figure figcaption {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 16px;
  line-height: 1.55;
}

.framework-figure figcaption strong {
  color: var(--ink);
}

/* ---------- Framework diagram 1: the roadmap ---------- */
.fw-roadmap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.fw-volume {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px 18px;
}

.fw-volume-head {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}


.fw-vol-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: var(--pill-bg);
  padding: 3px 8px;
  border-radius: 999px;
}

.fw-part-list { list-style: none; margin: 0; padding: 0; }

.fw-part-list li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
}

.fw-part-list li:first-child { border-top: none; }

.fw-part-num {
  font-weight: 700;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.fw-part-name { color: var(--ink-soft); line-height: 1.4; }

.fw-part-ch {
  font-weight: 600;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
}

.fw-roadmap-total {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 10px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .fw-roadmap { grid-template-columns: 1fr; }
}

/* ---------- Framework diagram 2: the two hemispheres ---------- */
.fw-hemispheres {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.fw-hemisphere {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
}

.fw-hemi-head {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
}


.fw-hemi-sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
  margin-bottom: 14px;
}

.fw-hemi-list { list-style: none; margin: 0 0 14px; padding: 0; flex: 1; }

.fw-hemi-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 7px 0;
  border-top: 1px solid var(--rule);
}

.fw-hemi-list li:first-child { border-top: none; }

.fw-pts {
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.fw-hemi-total {
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 8px;
}

.fw-hemi-join {
  align-self: center;
  font-family: var(--display);
  font-size: 26px;
  color: var(--gold);
}

@media (max-width: 640px) {
  .fw-hemispheres { grid-template-columns: 1fr; }
  .fw-hemi-join { transform: rotate(90deg); }
}

/* ---------- Framework diagram 3: the scoring rubric ---------- */
.fw-score {
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.fw-score-row {
  display: grid;
  grid-template-columns: minmax(120px, 230px) 1fr 32px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.fw-score-name {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
}

.fw-score-track {
  background: var(--bg-alt);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.fw-score-bar {
  display: block;
  height: 100%;
  background: var(--gold-line);
  border-radius: 999px;
}

.fw-score-val {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}


.fw-score-total {
  text-align: center;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 10px;
}

@media (max-width: 640px) {
  .fw-score-row { grid-template-columns: 108px 1fr 28px; }
  .fw-score-name { font-size: 11.5px; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0 48px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .hero { padding: 56px 20px 40px; }
  .hero h1 { font-size: 34px; }
  .hero .subtitle { font-size: 16.5px; }
  .chapter h1 { font-size: 28px; }
  .chapter h2 { font-size: 21px; }
  .part { grid-template-columns: 40px 1fr; }
  .part-status { grid-column: 2; justify-self: start; margin-top: 4px; }
  .chapter-row { grid-template-columns: 34px 1fr; }
  .chapter-row .ch-status { grid-column: 2; justify-self: start; margin-top: 3px; }
  .chapter-nav { flex-direction: column; }
  .chapter-nav a:last-child { text-align: left; }
  body { font-size: 17px; }
}

/* ---------- Drop caps (first paragraph of chapter / framework pages) ---------- */
.chapter > p:first-of-type::first-letter,
.framework-page > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 68px;
  line-height: 56px;
  padding: 8px 14px 4px 0;
  color: var(--gold);
  font-weight: 500;
}

/* ---------- Editorial toolkit (opt-in — apply by hand where useful) ---------- */

/* Wrap a phrase in <span class="highlight">...</span> for a soft marker-pen accent. */
.highlight {
  background-image: linear-gradient(transparent 60%, color-mix(in srgb, var(--gold) 35%, transparent) 40%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 0 2px;
  border-radius: 2px;
}

/* Pull-quotes: <blockquote>...<cite>Source</cite></blockquote> */
.chapter blockquote {
  position: relative;
  margin: 48px 0;
  padding: 0 0 0 32px;
  border-left: 3px solid var(--gold);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  font-style: italic;
}

.chapter blockquote cite {
  display: block;
  font-family: var(--sans);
  font-size: 13.5px;
  font-style: normal;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 16px;
}

.chapter blockquote cite::before { content: "— "; color: var(--gold); }

/* Metric callouts: <div class="metrics-grid"><div class="metric-card"><span class="metric-value">18%</span><span class="metric-label">CAR</span></div>...</div> */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--rule-strong);
}

.metric-value {
  display: block;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 4px;
  line-height: 1.1;
}

.metric-label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

/* ---------- Print / PDF export ---------- */
@media print {
  .skip-link, .site-header, .progress-pill, .volume-nav, .chapter-nav, .site-footer,
  .toc, .reading-progress-container, .nav-audio-btn, .nav-print-btn {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  h1, h2, h3, p, li, strong, .chapter-kicker, .callout-label, .recap h3 { color: #000000 !important; }
  .chapter h2 { border-top: 2px solid #000000 !important; }
  .wrap, .chapter, .framework-page { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .callout, .recap, table.figures { background: transparent !important; box-shadow: none !important; border: 1px solid #cccccc !important; }
  .callout::before, .recap::before { background: #666666 !important; }
  table.figures th { background: #eeeeee !important; color: #000000 !important; border-bottom: 2px solid #000000 !important; }
  table.figures tr:nth-child(even) td { background: transparent !important; }
  h1, h2, h3 { page-break-after: avoid; break-after: avoid; }
  p, h2, h3, li { orphans: 3; widows: 3; }
  .callout, .recap, table.figures, .framework-figure img { page-break-inside: avoid; break-inside: avoid; }
  .chapter a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; color: #333333; }

  /* The site footer is hidden above, which would otherwise strip the copyright
     from every printed chapter. Re-attach attribution and the source URL after
     the chapter text so a printed or PDF'd page still says where it came from. */
  .chapter::after {
    content: "The Investor\2019s Canon \2014 Santosh Kumar Adhikari \2014 santoshkumaradhikari.com.np";
    display: block;
    margin-top: 24pt;
    padding-top: 8pt;
    border-top: 1px solid #cccccc;
    font-size: 8.5pt;
    color: #444444;
  }
}

@page {
  margin: 18mm 16mm;
}

/* ---------- Framework diagrams: dark-mode heading fix ---------- */
@media (prefers-color-scheme: dark) {
  .fw-volume-head,
  .fw-hemi-head,
  .fw-score-val {
    color: var(--gold-bright);
  }
}
/* ---------- Glossary & Study Guide pages ---------- */
.term-link {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.term-link:hover { text-decoration: underline; }

.glossary-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 40px;
  padding: 16px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-family: var(--sans);
}

.glossary-jump a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  transition: color 0.15s ease, background 0.15s ease;
}

.glossary-jump a:hover { color: var(--gold); background: var(--bg-card); }

.glossary-letter {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
  margin: 44px 0 6px;
  padding-top: 8px;
  border-top: 3px solid var(--gold);
}

.glossary-letter:first-of-type { margin-top: 0; }

.term-entry { margin: 0 0 26px; }

.term-entry h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 6px;
}

.term-entry p { margin: 0 0 6px; }
.term-entry p:last-child { margin-bottom: 0; }

/* ---------- Print / Download button ---------- */
.nav-print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-left: 2px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-print-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--bg-card);
}

.nav-print-btn svg { width: 17px; height: 17px; }

.print-bar {
  display: flex;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto 30px;
  padding: 0 24px;
}

.print-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.print-bar-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.print-bar-btn svg { width: 16px; height: 16px; }

@media print {
  .print-bar { display: none !important; }
}

/* ---------- Audio / text-to-speech button ---------- */
.nav-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-left: 2px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-audio-btn:hover { color: var(--gold); border-color: var(--gold); background: var(--bg-card); }
.nav-audio-btn.is-playing { color: var(--gold); border-color: var(--gold); background: var(--bg-card); }
.nav-audio-btn svg { width: 17px; height: 17px; }
.nav-audio-btn .audio-icon-playing { display: none; }
.nav-audio-btn.is-playing .audio-icon-idle { display: none; }
.nav-audio-btn.is-playing .audio-icon-playing { display: inline-flex; }

.audio-bar {
  display: flex;
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto 14px;
  padding: 0 24px;
}

.audio-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.audio-bar-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.audio-bar-btn.is-playing { border-color: var(--gold); color: var(--gold); }
.audio-bar-btn svg { width: 16px; height: 16px; }
.audio-bar-btn .audio-icon-playing { display: none; }
.audio-bar-btn.is-playing .audio-icon-idle { display: none; }
.audio-bar-btn.is-playing .audio-icon-playing { display: inline-flex; }

@media print {
  .audio-bar { display: none !important; }
}

/* ---------- Floating audio player bar (Task D upgrade) ---------- */
.audio-player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--bg-card);
  border-top: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
  padding: 10px max(16px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
}
.audio-player-bar[hidden] { display: none; }

.ap-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.15s ease;
}
.ap-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.ap-btn:disabled { opacity: 0.35; cursor: default; }
.ap-btn svg { width: 16px; height: 16px; }
.ap-playpause svg { width: 15px; height: 15px; }

.ap-progress {
  flex: 1 1 160px;
  min-width: 140px;
}
.ap-progress-text {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.ap-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
}
.ap-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.2s ease;
}

.ap-speed, .ap-voice {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 150px;
}
.ap-voice { max-width: 180px; }

.ap-close { margin-left: auto; }

@media (max-width: 640px) {
  .ap-inner { gap: 8px; }
  .ap-voice { display: none; }
  .ap-progress { order: 5; flex-basis: 100%; }
  .ap-close { margin-left: 0; }
}

@media print {
  .audio-player-bar { display: none !important; }
}

/* ---------- Copyright line (auto-injected into every page's footer) ---------- */
.copyright-line {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

/* Skip link — lets keyboard users jump past the header nav straight to the
   chapter text. Visually hidden until it receives focus. */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--accent, #8a5a2b);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

main[tabindex="-1"]:focus {
  outline: none;
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION
   Honours the OS-level "reduce motion" setting. Mirrors the rule already in
   the root site stylesheet so both halves of the site behave the same way.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   2026-08-29 audit fixes
   ================================================================ */

/* Dark mode: table header text used var(--bg), which in dark mode is
   near-black on navy (1.29:1). Use the ink colour instead. */
@media (prefers-color-scheme: dark) {
  table.figures th { color: var(--ink); }
}

/* Mobile header: one scrollable row of links instead of a 3-row wrap. */
@media (max-width: 640px) {
  .header-links {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .header-links::-webkit-scrollbar { display: none; }
  .header-links a { margin-left: 0; flex: 0 0 auto; }
}

/* Chapter publication dates */
.chapter-dates {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: -6px 0 26px;
}

/* "In this chapter" mini-TOC */
.chapter-toc {
  font-family: var(--sans);
  font-size: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 32px;
}
.chapter-toc-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}
/* Headings carry their own numbering (0.1.1, Lesson 35.2…), so suppress the
   list markers to avoid a double-numbered "1. Lesson 35.1 —" effect. */
.chapter-toc ol { margin: 0; padding-left: 0; list-style: none; }
.chapter-toc li { margin: 3px 0; }
.chapter-toc a { color: var(--ink-soft); text-decoration: none; }
.chapter-toc a:hover { color: var(--gold); text-decoration: underline; }

/* Primary-sources note at the foot of each chapter */
.sources-note {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 36px 0 0;
}
.sources-note .sources-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 6px;
}
.sources-note a { color: inherit; }

/* Footer disclaimer */
.footer-disclaimer {
  margin: 14px auto 0;
  max-width: 720px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* Hub: chapter filter */
.toc-filter { max-width: 920px; margin: 0 auto 8px; padding: 0 24px; }
.toc-filter input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.toc-filter input:focus { outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.toc-filter-empty {
  display: none;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-faint);
  text-align: center;
  margin: 18px 0 0;
}
@media print { .toc-filter { display: none !important; } }

/* Reading-time pill keeps the ready style */
.ch-status.ready { white-space: nowrap; }

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

/* ---------- Nepali translate toggle (Google Translate) ---------- */
.nav-translate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  margin-left: 2px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 12.5px/1 "Inter", system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-translate-btn:hover,
.nav-translate-btn.is-active {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--bg-card);
}

/* Hide Google Translate's own UI chrome; the nav button is the only control */
.gt-hidden { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame, .skiptranslate iframe { display: none !important; }
body { top: 0 !important; }
font[style*="background-color"], font[style*="box-shadow"] { background: none !important; box-shadow: none !important; }

@media print {
  .nav-translate-btn { display: none !important; }
}
