/* =============================================================
   LOST LANDS — Mono / Architectural design system
   Light theme, planar, grid-based, thin-bordered.
   Maps the design/DESIGN.md tokens to the existing component
   classes (.hero, .prose, .toc, .card, .stop, .myth, etc.)
   ============================================================= */

:root {
  /* — Colors (light theme defaults) — */
  --canvas:        #ffffff;
  --canvas-alt:    #f4f4f2;  /* very pale gray for alternating sections */
  --ink:           #292929;
  --ink-deep:      #000000;
  --ink-soft:      #6a6a6a;
  --rule:          #292929;
  --rule-soft:     #d4d4d2;
  --hero-overlay:  rgba(0, 0, 0, 0.45);  /* hero image darkening overlay */
  --card-flag-bg:  #efeeec;
  --card-flag-hover-bg: #e6e5e2;
  --accent:        #4D5093;  /* slate-indigo accent for active states */
  --accent-soft:   rgba(77, 80, 147, 0.12);
  --accent-hover:  #3a3d75;

  /* — Typography (free Google Fonts substitutes for the spec'd custom faces) —
     NH (Helvetica Neue)       → Inter
     S-Condensed (Impact)      → Barlow Condensed
     EV (Roboto Thin)          → Inter (weight 100)
     S-Works (Bebas Neue Pro)  → Bebas Neue
     Plus a serif for long-form reading (the volumes are books, after all) → Source Serif 4 */
  --font-nh:          "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-condensed:   "Barlow Condensed", "Inter", system-ui, sans-serif;
  --font-thin:        "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display:     "Bebas Neue", "Barlow Condensed", "Inter", sans-serif;
  --font-serif:       "Source Serif 4", "Source Serif Pro", Georgia, serif;

  /* — Type scale (from tokens) — */
  --t-caption:    12px;
  --t-body:       16px;
  --t-sub:        18px;
  --t-h:          25px;
  --t-hl:         32px;
  --t-ds:         40px;
  --t-d:          43px;

  --lh-caption:   1.18;
  --lh-body:      1.5;
  --lh-sub:       1.25;
  --lh-h:         1.27;
  --lh-hl:        1.2;
  --lh-d:         1.34;

  --tr-tight:     -0.02em;
  --tr-wide:      0.1em;
  --tr-wider:     0.2em;

  /* — Spacing — */
  --s-4:  4px;
  --s-8:  8px;
  --s-12: 12px;
  --s-20: 20px;
  --s-25: 25px;
  --s-43: 43px;
  --s-50: 50px;

  /* — Layout — */
  --maxw:   1440px;
  --readw:  720px;
  --wide:   1080px;
}

/* === Dark theme — applied when the user toggles it, or as the default
       on systems with prefers-color-scheme: dark (unless the user has
       explicitly chosen light). Inverts the editorial palette to a soft
       paper-on-ink scheme without going pure-black. === */
:root[data-theme="dark"] {
  --canvas:        #161616;
  --canvas-alt:    #1f1f1f;
  --ink:           #ebe9e4;
  --ink-deep:      #ffffff;
  --ink-soft:      #9a9893;
  --rule:          #ebe9e4;
  --rule-soft:     #3a3a37;
  --hero-overlay:  rgba(0, 0, 0, 0.55);
  --card-flag-bg:  #1f1f1f;
  --card-flag-hover-bg: #2a2a2a;
  --accent:        #7d80c2;
  --accent-soft:   rgba(125, 128, 194, 0.16);
  --accent-hover:  #9a9dd6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas:        #161616;
    --canvas-alt:    #1f1f1f;
    --ink:           #ebe9e4;
    --ink-deep:      #ffffff;
    --ink-soft:      #9a9893;
    --rule:          #ebe9e4;
    --rule-soft:     #3a3a37;
    --hero-overlay:  rgba(0, 0, 0, 0.55);
    --card-flag-bg:  #1f1f1f;
    --card-flag-hover-bg: #2a2a2a;
  }
}

/* Image-heavy elements get slightly muted in dark mode so they don't
   shout against the dark canvas. */
:root[data-theme="dark"] .card-img:not(.card-flag),
:root[data-theme="dark"] .hero-image .hero-bg {
  filter: brightness(0.78) saturate(0.85);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-img:not(.card-flag),
  :root:not([data-theme="light"]) .hero-image .hero-bg {
    filter: brightness(0.78) saturate(0.85);
  }
}

/* — Reset — */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-nh);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-tight);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: opacity 160ms ease;
}
a:hover { opacity: 0.55; }

/* =====  Top navigation — fixed thin black bar  ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 25px;
  background: var(--canvas);
  border-bottom: 1px solid var(--ink);
}
.nav-brand {
  font-family: var(--font-condensed);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink);
  border: none;
}
.nav-links {
  display: flex; gap: 0;
}
.nav-links a {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
  border: none;
  padding: 6px 16px;
  border-left: 1px solid var(--rule-soft);
}
.nav-links a:hover { background: var(--ink); color: var(--canvas); opacity: 1; }
.nav-links a.nav-active { background: var(--accent); color: #ffffff; }
.nav-links a.nav-active:hover { background: var(--canvas); color: var(--ink); }

.scroll-progress {
  position: fixed; left: 0; top: 0; height: 2px;
  width: 0%;
  background: var(--ink);
  z-index: 60;
}

/* =====  Hero  ===== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 120px 25px 50px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-bottom: 1px solid var(--ink);
  background: var(--canvas);
}
.hero-eyebrow {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 13vw, 200px);
  line-height: 0.88;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  align-self: end;
  padding-top: 60px;
  padding-bottom: 24px;
}
.hero-title em {
  font-style: normal;
  font-family: var(--font-display);
  display: block;
  color: var(--ink);
}
.hero-title em::before { content: "— "; opacity: 0.4; }

.hero-sub {
  font-family: var(--font-nh);
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 720px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.hero-meta {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
}
.hero-meta > div { padding: 12px 16px 12px 0; border-right: 1px solid var(--rule-soft); }
.hero-meta > div:last-child { border-right: none; }
.hero-meta strong { display: block; font-weight: 500; font-size: 14px; margin-top: 4px; letter-spacing: 0.08em; }

.hero-scroll {
  position: absolute;
  bottom: 16px; left: 25px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
}

/* Hero with image variant — text sits over the image in white with a
   dark gradient wash for legibility. Same treatment in both light and
   dark themes, so the editorial cover-image effect is consistent. */
.hero-image {
  position: relative;
  overflow: hidden;
}
.hero-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.50) 0%, rgba(0,0,0,0.30) 40%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
  z-index: 1;
}
.hero-image > * { position: relative; z-index: 2; }
.hero-image .hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  filter: grayscale(0.25) contrast(1.08);
}
.hero-image .hero-eyebrow,
.hero-image .hero-title,
.hero-image .hero-title em,
.hero-image .hero-sub,
.hero-image .hero-meta,
.hero-image .hero-meta > div,
.hero-image .hero-meta strong,
.hero-image .hero-scroll {
  color: #ffffff;
}
.hero-image .hero-eyebrow,
.hero-image .hero-sub,
.hero-image .hero-meta,
.hero-image .hero-meta > div {
  border-color: rgba(255,255,255,0.65);
}

/* =====  Sections  ===== */
section { padding: 50px 25px; border-bottom: 1px solid var(--ink); }
section:last-of-type { border-bottom: none; }
.section-narrow { max-width: var(--readw); margin: 0 auto; }
.section-wide   { max-width: var(--wide);  margin: 0 auto; }
.section-max    { max-width: var(--maxw);  margin: 0 auto; }
.section-alt    { background: var(--canvas-alt); }

.kicker {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 8px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--ink);
  display: inline-block;
  padding-right: 60px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 32px;
}
.section-title em {
  font-style: normal;
  display: block;
  font-family: var(--font-display);
}
.section-title em::before { content: "— "; opacity: 0.4; }

.lede {
  font-family: var(--font-nh);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 40px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--ink);
}

/* =====  Long-form reading: serif body inside .prose  ===== */
.prose p {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0;
  color: var(--ink);
  margin-bottom: 1.3em;
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 56px 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.prose h3 {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink);
  margin: 40px 0 14px;
}
.prose blockquote {
  font-family: var(--font-nh);
  font-style: normal;
  font-weight: 300;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 48px 0;
  padding: 24px 0 24px 28px;
  border-left: 2px solid var(--ink);
}
.prose blockquote cite {
  display: block;
  margin-top: 16px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  font-style: normal;
  color: var(--ink-soft);
}

.drop-cap::first-letter {
  font-family: var(--font-display);
  font-weight: 400;
  float: left;
  font-size: 6em;
  line-height: 0.85;
  padding: 4px 14px 0 0;
  color: var(--ink);
}

/* Figures (images) inside chapters */
.prose figure {
  margin: 48px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 16px 0;
}
.prose figure.bleed {
  margin-left: -25px;
  margin-right: -25px;
}
.prose figure img {
  width: 100%;
  filter: grayscale(0.15) contrast(1.02);
}
.prose figure figcaption {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
}
.prose figure figcaption b { font-weight: 500; }
.prose figure figcaption em { font-style: normal; color: var(--ink-soft); text-align: right; }

hr.rule {
  border: none;
  height: 1px;
  background: var(--ink);
  margin: 64px 0;
  max-width: none;
}
hr.ornament {
  border: none;
  height: 1px;
  background: var(--ink);
  margin: 0;
  position: relative;
}

/* =====  Cards / Atlas grid  ===== */
.grid { display: grid; gap: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid > * { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.grid > *:nth-child(3n) { border-right: none; }
.grid-2 > *:nth-child(2n) { border-right: none; }
.grid-4 > *:nth-child(4n) { border-right: none; }
.grid { border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid > * { border-right: none !important; }
}

.card {
  display: block;
  padding: 25px;
  background: var(--canvas);
  text-decoration: none;
  border: none;
  color: var(--ink);
  transition: background 160ms ease, color 160ms ease;
}
.card:hover { background: var(--accent); color: #ffffff; opacity: 1; }
.card:hover .card-num,
.card:hover .card-desc,
.card:hover .card-title,
.card:hover .card-title em { color: #ffffff; }
.card:hover .card-desc,
.card:hover .card-title em { opacity: 0.92; }
.card-num {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 16px;
  display: block;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: inherit;
}
.card-title em {
  font-style: normal;
  display: block;
  font-size: 0.55em;
  letter-spacing: 0.04em;
  margin-top: 4px;
  color: inherit;
  opacity: 0.65;
  font-family: var(--font-condensed);
  font-weight: 400;
}
.card-desc {
  font-family: var(--font-nh);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

/* Card with image */
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: grayscale(0.8) contrast(1.05);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ink);
}
.card:hover .card-img { filter: grayscale(0) contrast(1); }

/* Flag thumbnails for the atlas — preserve full design, neutral matte background */
.card-img.card-flag {
  object-fit: contain;
  background: #efeeec;
  padding: 28px 24px;
  filter: none;
  border-bottom: 1px solid var(--ink);
}
.card:hover .card-img.card-flag {
  background: #e6e5e2;
  filter: none;
}

/* =====  3D Globe section  ===== */
.globe-wrap {
  position: relative;
  margin: 40px 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: #f6f5f3;
  overflow: hidden;
}
.globe-canvas {
  width: 100%;
  height: 940px;
  display: block;
  touch-action: none;
  cursor: grab;
}
.globe-canvas:active { cursor: grabbing; }

/* Tablet and below: drop the legend out of the absolute overlay
   entirely so the globe centres in the viewport. On any non-desktop
   width, the legend stacks below the canvas. */
@media (max-width: 1100px) {
  .globe-wrap { display: flex; flex-direction: column; }
  .globe-canvas { height: 640px; order: 1; }
  .globe-key {
    position: static;
    width: 100%;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--ink);
    order: 2;
  }
  .globe-key-list { max-height: 280px; }
}
@media (max-width: 720px) {
  .globe-canvas { height: 460px; }
  .globe-key-list { max-height: 240px; }
}
.globe-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--canvas);
  padding: 6px 10px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
  z-index: 4;
}
.globe-tooltip::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -5px;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--ink);
  transform: translateX(-50%);
}
.globe-key {
  position: absolute;
  top: 0; left: 0;
  width: 280px;
  max-height: 100%;
  padding: 14px 0 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 3;
  display: flex; flex-direction: column;
}
:root[data-theme="dark"] .globe-key {
  background: rgba(22, 22, 22, 0.92);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .globe-key { background: rgba(22, 22, 22, 0.92); }
}
.globe-key-eyebrow {
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.2em;
  margin: 0 0 8px;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.globe-key-list {
  list-style: none;
  padding: 0; margin: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  /* Hide scrollbar visually while keeping scroll functional */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.globe-key-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.globe-key-list li {
  margin: 0;
  border-bottom: 1px solid var(--rule-soft);
}
.globe-key-list li:last-child { border-bottom: none; }
.globe-legend-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(48px, auto) 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 5px 14px 5px 12px;
  background: transparent;
  border: none;
  border-left: 6px solid var(--state-color, var(--ink));
  cursor: pointer;
  text-align: left;
  font-family: var(--font-condensed);
  color: var(--ink);
  transition: background 160ms ease, padding-left 160ms ease;
}
.globe-legend-item:hover {
  background: var(--canvas-alt);
  padding-left: 14px;
}
.globe-legend-item.is-active {
  background: var(--state-color, var(--ink));
  color: #ffffff;
}
.globe-legend-item.is-active .globe-legend-vol,
.globe-legend-item.is-active .globe-legend-years {
  color: rgba(255,255,255,0.85);
}
.globe-legend-vol {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.globe-legend-name {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  line-height: 1.0;
  color: inherit;
}
.globe-legend-years {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.globe-key-note {
  color: var(--ink-soft);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  margin: 0;
  padding: 10px 16px 0;
  border-top: 1px solid var(--rule-soft);
}
@media (max-width: 900px) {
  .globe-canvas { height: 720px; }
  .globe-key {
    position: static;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--ink);
  }
}
@media (max-width: 700px) {
  .globe-canvas { height: 520px; }
  .globe-key { font-size: 10px; }
  .globe-legend-name { font-size: 12px; }
}

/* =====  Table of Contents  ===== */
.toc {
  list-style: none;
  border-top: 1px solid var(--ink);
}
.toc-item { border-bottom: 1px solid var(--ink); }
.toc-link {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 32px;
  padding: 20px 0;
  align-items: baseline;
  text-decoration: none;
  border: none;
  color: var(--ink);
  transition: padding-left 200ms ease, background 200ms ease;
}
.toc-link:hover { padding-left: 16px; background: var(--accent); color: #ffffff; opacity: 1; }
.toc-link:hover .toc-num,
.toc-link:hover .toc-title,
.toc-link:hover .toc-year { color: #ffffff; }
.toc-link:hover .toc-title small { color: rgba(255,255,255,0.85); }
.toc-num {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
}
.toc-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.toc-title small {
  display: block;
  font-family: var(--font-nh);
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--ink-soft);
  margin-top: 6px;
}
.toc-year {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Pull-quote inserted at the head of a chapter section or between
   paragraphs — pulled from existing prose or a primary source. */
.prose .pull-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding: 12px 0 12px 24px;
  margin: 36px 0;
  max-width: none;
}
.prose .pull-quote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Breakout panel — short factual sidebar inside an article, typically
   a list of key dates / numbers / people. */
.prose .breakout {
  background: var(--accent-soft);
  border: 1px solid var(--rule-soft);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  margin: 32px 0;
  font-family: var(--font-condensed);
}
.prose .breakout-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.prose .breakout ul,
.prose .breakout ol {
  list-style: none;
  margin: 0; padding: 0;
}
.prose .breakout li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
}
.prose .breakout li b {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Bulleted lists in prose */
.prose ul.tick {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.prose ul.tick li {
  position: relative;
  padding: 8px 0 8px 28px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-serif);
  line-height: 1.55;
}
.prose ul.tick li:last-child { border-bottom: none; }
.prose ul.tick li::before {
  content: "·";
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 22px;
  color: var(--ink-soft);
}

/* Image lightbox — full-screen overlay for clicking on maps and figures.
   The image opens at fit-to-window; click again to step through 2×, 3×, back
   to 1×. Drag to pan when zoomed. ESC or background click to close. */
.foreword-map img.is-clickable,
.prose figure img.is-clickable { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 14, 0.94);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.lightbox-overlay.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}
.lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
  box-sizing: border-box;
  touch-action: pinch-zoom;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 180ms ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  background: rgba(0,0,0,0.4);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 22px;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(0,0,0,0.7); }
.lightbox-hint {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  pointer-events: none;
}
@media (max-width: 720px) {
  .lightbox-stage { padding: 16px; }
  .lightbox-hint { font-size: 10px; }
}

/* Foreword map — territorial map sourced from World History Encyclopedia,
   displayed unmodified per CC BY-NC-ND / CC BY-SA terms. The caption
   carries the required attribution. */
.foreword-map {
  margin: 32px 0 8px;
}
.foreword-map img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule-soft);
}
.foreword-map figcaption {
  margin-top: 10px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  line-height: 1.5;
}
.foreword-map figcaption strong {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.foreword-map figcaption a {
  color: var(--ink-soft);
  border-bottom: 1px dotted var(--ink-soft);
}
.foreword-map figcaption a:hover { color: var(--ink); }

/* =====  Chapter page  ===== */

/* Chapter sidebar — a fixed-position table-of-contents on desktop,
   collapsible <details> at the top of the article on mobile. The same
   markup serves both via media queries. */
.chap-sidebar {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.06em;
  background: var(--canvas);
  border: 1px solid var(--ink);
  margin: 0 auto;
  max-width: 760px;
  padding: 0;
}
.chap-sidebar-details { padding: 14px 18px; }
.chap-sidebar summary {
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
  font-family: var(--font-condensed);
  letter-spacing: 0.15em;
  font-size: 11px;
  display: flex; gap: 10px; align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.chap-sidebar summary::-webkit-details-marker { display: none; }
.chap-sidebar summary::after {
  content: "▾";
  margin-left: auto;
  font-size: 12px;
}
.chap-sidebar-details[open] summary::after { content: "▴"; }
.chap-sidebar-vol { font-weight: 600; color: var(--ink); }
.chap-sidebar-volname { color: var(--ink-soft); font-weight: 400; }

.chap-sidebar-list {
  list-style: none; padding: 0; margin: 12px 0 0;
}
.chap-sidebar-list li { margin: 0; }
.chap-sidebar-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 6px 6px;
  border: none;
  color: var(--ink);
  text-decoration: none;
  border-radius: 2px;
  align-items: baseline;
}
.chap-sidebar-list a:hover { background: var(--canvas-alt); }
.chap-sidebar-list a.is-current { background: var(--accent); color: #ffffff; }
.chap-sidebar-list a.is-current .chap-sidebar-num,
.chap-sidebar-list a.is-current .chap-sidebar-title { color: #ffffff; }
.chap-sidebar-num {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-align: right;
}
.chap-sidebar-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--ink);
}

/* Desktop: lift the sidebar out as a fixed left-rail nav so it doesn't
   push the chapter hero down. */
@media (min-width: 1200px) {
  .chap-sidebar {
    position: fixed;
    left: 18px;
    top: 96px;
    width: 240px;
    max-width: none;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    z-index: 5;
    margin: 0;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06);
  }
  .chap-sidebar summary { pointer-events: none; }
  .chap-sidebar summary::after { display: none; }
}

/* Tablet/mobile: replace the inline collapsible with a square floating
   button anchored to the bottom-left of the viewport. The native
   <details> mechanism handles the open/close state with no JS. */
@media (max-width: 1199px) {
  .chap-sidebar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    margin: 0;
    width: auto;
    max-width: none;
    z-index: 50;
    background: transparent;
    border: none;
  }
  .chap-sidebar-details { padding: 0; }
  .chap-sidebar summary {
    width: 56px; height: 56px;
    background: var(--canvas);
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    justify-content: center;
    gap: 0;
    transition: background 160ms ease, color 160ms ease;
  }
  .chap-sidebar summary:hover { background: var(--accent); color: #ffffff; }
  .chap-sidebar summary .chap-sidebar-vol,
  .chap-sidebar summary .chap-sidebar-volname { display: none; }
  .chap-sidebar summary::before {
    content: "";
    width: 26px; height: 26px;
    background: var(--accent);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 2 2 L 14 2 L 14 14 L 30 14 L 30 30 L 2 30 Z"/></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 2 2 L 14 2 L 14 14 L 30 14 L 30 30 L 2 30 Z"/></svg>') center / contain no-repeat;
    transition: background 160ms ease;
  }
  .chap-sidebar summary:hover::before { background: #ffffff; }
  .chap-sidebar summary::after { display: none; }

  .chap-sidebar-details[open] {
    background: var(--canvas);
    border: 1px solid var(--ink);
    border-radius: 10px;
    width: min(320px, calc(100vw - 40px));
    box-shadow: 0 16px 40px rgba(0,0,0,0.28);
    overflow: hidden;
  }
  .chap-sidebar-details[open] summary {
    width: 100%; height: auto;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 10px 10px 0 0;
    padding: 14px 18px;
    box-shadow: none;
    justify-content: flex-start;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
  .chap-sidebar-details[open] summary::before {
    width: 18px; height: 18px;
    background: #ffffff;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M 4 4 L 16 16 M 16 4 L 4 16" stroke="black" stroke-width="2" fill="none"/></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M 4 4 L 16 16 M 16 4 L 4 16" stroke="black" stroke-width="2" fill="none"/></svg>') center / contain no-repeat;
    margin-right: 6px;
  }
  .chap-sidebar-details[open] summary .chap-sidebar-vol { display: inline; font-weight: 600; }
  .chap-sidebar-details[open] summary .chap-sidebar-volname { display: inline; opacity: 0.85; }
  .chap-sidebar-details[open] .chap-sidebar-list {
    margin: 0;
    padding: 10px 14px 14px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--canvas);
  }
}

.chap-hero {
  min-height: 80vh;
  padding: 120px 25px 50px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--canvas);
  border-bottom: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.chap-hero.has-image {
  background: var(--ink);
  color: #ffffff;
}
.chap-hero.has-image::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
  filter: grayscale(0.6) contrast(1.05) brightness(0.58);
  z-index: 0;
}
.chap-hero.has-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.65) 100%);
  z-index: 0;
  pointer-events: none;
}
.chap-hero.has-image > * { position: relative; z-index: 1; }
.chap-hero.has-image .chap-num,
.chap-hero.has-image .chap-title,
.chap-hero.has-image .chap-title em,
.chap-hero.has-image .chap-sub,
.chap-hero.has-image .chap-meta {
  color: #ffffff;
  border-color: rgba(255,255,255,0.7);
}

.chap-num {
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}
.chap-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 0.88;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  align-self: end;
  padding-top: 40px;
  padding-bottom: 24px;
}
.chap-title em {
  font-style: normal;
  display: block;
  font-family: var(--font-display);
}
.chap-title em::before { content: "— "; opacity: 0.4; }

.chap-sub {
  font-family: var(--font-nh);
  font-weight: 300;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 720px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.chap-meta {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
}

.chap-body {
  max-width: var(--readw);
  margin: 0 auto;
  padding: 80px 25px;
}

/* =====  Chapter foot navigation  ===== */
.chap-foot {
  border-top: 1px solid var(--ink);
  background: var(--canvas);
}
.chap-foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.chap-foot-link {
  padding: 32px 25px;
  border: none;
  color: var(--ink);
  display: block;
  transition: background 160ms ease, color 160ms ease;
}
.chap-foot-link { background: var(--canvas); color: var(--ink); }
.chap-foot-link:hover { background: var(--accent); color: #ffffff; opacity: 1; }
.chap-foot-link:hover small { color: rgba(255,255,255,0.75); }
.chap-foot-link small {
  display: block;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.chap-foot-link strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  display: block;
}
.chap-foot-link + .chap-foot-link { border-left: 1px solid var(--ink); }
.chap-foot-link.next { text-align: right; }
@media (max-width: 700px) {
  .chap-foot-inner { grid-template-columns: 1fr; }
  .chap-foot-link + .chap-foot-link { border-left: none; border-top: 1px solid var(--ink); }
  .chap-foot-link.next { text-align: left; }
}

/* =====  Site footer  ===== */
.site-foot {
  border-top: 1px solid var(--ink);
  padding: 32px 25px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
  background: var(--canvas);
}
.site-foot p { margin-bottom: 6px; }
.site-foot a { color: var(--ink); border: none; }

/* =====  Aside / mythbusters / travel stop blocks  ===== */
.aside {
  margin: 40px 0;
  padding: 24px;
  border: 1px solid var(--ink);
  background: var(--canvas);
}
.aside h4 {
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.aside p { font-family: var(--font-serif); font-size: 16px; line-height: 1.6; }

.myth {
  margin: 0;
  padding: 32px 25px;
  border-bottom: 1px solid var(--ink);
  background: var(--canvas);
}
.myth:last-child { border-bottom: none; }
.myth-claim {
  font-family: var(--font-nh);
  font-weight: 300;
  font-style: normal;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.myth-claim::before { content: "“"; margin-right: 2px; }
.myth-claim::after  { content: "”"; margin-left: 2px; }
.myth-verdict {
  display: inline-block;
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  margin-bottom: 20px;
}
.myth-verdict.partly { background: var(--ink); color: var(--canvas); }
.myth-verdict.true   { background: var(--canvas); color: var(--ink); }
.myth-body { font-family: var(--font-serif); font-size: 17px; line-height: 1.65; }
.myth-body p { margin-bottom: 1em; }
.myth-body p:last-child { margin-bottom: 0; }

/* =====  Travel stops  ===== */
.stop {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 36px 0;
  border-bottom: 1px solid var(--ink);
  align-items: start;
}
.stop-image {
  margin: 0 0 18px;
}
.stop-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: grayscale(0.3) contrast(1.03);
  display: block;
  border-bottom: 1px solid var(--ink);
}
.stop-image figcaption {
  display: none;
}
:root[data-theme="dark"] .stop-image img {
  filter: grayscale(0.3) contrast(1.03) brightness(0.82);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stop-image img {
    filter: grayscale(0.3) contrast(1.03) brightness(0.82);
  }
}
.stop:last-child { border-bottom: none; }
.stop-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  line-height: 0.85;
  color: var(--ink);
  text-transform: uppercase;
}
.stop-place {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.stop-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.0;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.stop-body p { font-family: var(--font-serif); font-size: 17px; line-height: 1.65; margin-bottom: 1em; }
.stop-meta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex; gap: 24px; flex-wrap: wrap;
}
.stop-meta b { color: var(--ink); font-weight: 500; }

/* =====  Outline button (per spec)  ===== */
.btn {
  display: inline-block;
  padding: 14px 24px;
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--canvas); opacity: 1; }

/* =====  Decorative letter / divider  ===== */
.divider-letter {
  text-align: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--ink);
}
.divider-letter span {
  font-family: var(--font-display);
  font-size: 64px;
  letter-spacing: 0.4em;
}

/* =====  Index strip (running header strip with metadata)  ===== */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--canvas);
}
.strip > div {
  padding: 16px 20px;
  border-right: 1px solid var(--ink);
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
}
.strip > div:last-child { border-right: none; }
.strip b { display: block; font-weight: 500; font-size: 14px; margin-top: 4px; letter-spacing: 0.04em; }
@media (max-width: 700px) {
  .strip { grid-template-columns: 1fr 1fr; }
  .strip > div:nth-child(2n) { border-right: none; }
  .strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
}

/* =====  Image gallery row (used on chapter pages)  ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 48px 0;
  border: 1px solid var(--ink);
}
.gallery figure {
  margin: 0;
  border: none;
  padding: 0;
  border-right: 1px solid var(--ink);
}
.gallery figure:last-child { border-right: none; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(0.3); display: block; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery figure { border-right: none; border-bottom: 1px solid var(--ink); }
  .gallery figure:last-child { border-bottom: none; }
}

/* =====  Inline chapter figures  ===== */
.prose figure {
  margin: 36px 0;
  break-inside: avoid;
}
.prose figure img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(0.25) contrast(1.02);
}
.prose figure figcaption {
  font-family: var(--font-condensed);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.45;
  color: var(--ink-soft);
  padding: 10px 0 0;
  border-top: 1px solid var(--rule-soft);
  margin-top: 8px;
}
.prose figure figcaption strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  display: block;
  margin-bottom: 3px;
}
:root[data-theme="dark"] .prose figure img {
  filter: grayscale(0.25) contrast(1.02) brightness(0.82);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose figure img {
    filter: grayscale(0.25) contrast(1.02) brightness(0.82);
  }
}

/* =====  Bibliography  ===== */
.bib-section {
  border-top: 1px solid var(--rule-soft);
  padding-top: 32px;
  margin-top: 40px;
}
.bib-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.bib-section-eyebrow {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.bib-section h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.bib-list { list-style: none; padding: 0; margin: 0; }
.bib-list li {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.55;
  padding: 10px 0;
  border-bottom: 1px dotted var(--rule-soft);
  color: var(--ink);
}
.bib-list li:last-child { border-bottom: none; }
.bib-list em { font-style: italic; }
.bib-list cite { font-style: normal; }
.bib-list .bib-note {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  font-family: var(--font-nh);
  letter-spacing: -0.005em;
}

/* =====  Theme toggle button  ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 8px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--ink);
  cursor: pointer;
  border-radius: 50%;
  transition: background 160ms ease, transform 160ms ease;
}
.theme-toggle:hover { background: var(--canvas-alt); transform: translateY(-1px); }
.theme-toggle:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.theme-toggle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 50%, transparent 50%, transparent 100%);
  border: 1px solid var(--ink);
}

/* =====  Reading progress  ===== */
.toc-progress {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  margin-right: 12px;
  background: transparent;
  flex-shrink: 0;
  vertical-align: middle;
  align-self: center;
  position: relative;
  top: -1px;
}
.toc-progress.is-read {
  background: var(--ink);
}
.toc-progress.is-read::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 3px;
  height: 6px;
  border: solid var(--canvas);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.toc-progress-summary {
  border: 1px solid var(--ink);
  padding: 22px 26px;
  margin-bottom: 24px;
  background: var(--canvas-alt);
}
.toc-progress-eyebrow {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.toc-progress-count {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.toc-progress-bar {
  height: 4px;
  background: var(--rule-soft);
  position: relative;
  overflow: hidden;
}
.toc-progress-bar-fill {
  height: 100%;
  background: var(--ink);
  transition: width 320ms ease;
}
.toc-progress-resume {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-condensed);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* End of Chapter pill — sits at the bottom of every chapter body */
.chap-end-mark {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 6px 14px;
  font-family: var(--font-condensed);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: 2px;
  margin-top: 12px;
}

/* Footer Land name highlight */
.site-foot .vol-land-name {
  background: var(--accent);
  color: #ffffff;
  padding: 3px 10px;
  margin-left: 4px;
}

/* Hero meta labels — accent rectangle behind the title word
   (Volumes / Chapters / Span / Continents). */
.hero-meta-label {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  padding: 2px 8px;
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-image .hero-meta-label { background: var(--accent); color: #ffffff; }

/* Hero title em — the "are no longer there." portion in accent.
   Applies to image-hero pages too, where the rest of the title is white
   over the photo overlay — the em then pops in accent. */
.hero-title em { color: var(--accent); }

/* "Two ways to use this guidebook" section — full accent treatment. */
.section-two-ways {
  background: var(--accent);
  color: #ffffff;
  padding-top: 64px;
  padding-bottom: 64px;
}
.section-two-ways .kicker,
.section-two-ways .section-title,
.section-two-ways .section-title em,
.section-two-ways .prose strong,
.section-two-ways .prose em { color: #ffffff; }
.section-two-ways .prose p { color: rgba(255,255,255,0.92); }
.section-two-ways .prose a { color: #ffffff; border-bottom-color: rgba(255,255,255,0.6); }

/* Resume banner on the homepage */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
  border: none;
  margin-top: 0;
  transition: background 200ms ease;
}
.resume-banner { background: var(--accent); }
.resume-banner:hover { background: var(--accent-hover); opacity: 1; }
.resume-banner-eyebrow { color: rgba(255,255,255,0.7); opacity: 1; }
.resume-banner-title { color: #ffffff; }
.resume-banner-title span { color: rgba(255,255,255,0.78); opacity: 1; }
.resume-banner-arrow { color: #ffffff; }
.resume-banner-eyebrow {
  font-family: var(--font-condensed);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 4px;
}
.resume-banner-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
  color: var(--canvas);
}
.resume-banner-title span {
  font-family: var(--font-nh);
  font-weight: 300;
  font-size: 14px;
  text-transform: capitalize;
  letter-spacing: 0;
  opacity: 0.7;
}
.resume-banner-arrow {
  font-family: var(--font-display);
  font-size: 24px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* =====  Timeline  =====
   One row per state. A coloured bar shows the time span; the label
   floats next to the bar (right by default, left if the bar's end is
   far enough right that an outside label would clip). Even ten-year
   states like Green Ukraine therefore remain fully labelled. */
.timeline-wrap {
  margin: 40px 0 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 24px 0 0;
  position: relative;
  overflow: hidden;
}
.timeline-track {
  position: relative;
  width: 100%;
}
.timeline-row {
  position: relative;
  height: 44px;
  border-bottom: 1px solid var(--rule-soft);
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-left: none;
  border-right: none;
  transition: background 160ms ease;
}
.timeline-row:hover { background: var(--canvas-alt); opacity: 1; }
.timeline-row:last-child { border-bottom: none; }
.timeline-bar {
  position: absolute;
  top: 10px; bottom: 10px;
  min-width: 6px;
  background: var(--state-color, var(--ink));
  border: 1px solid var(--ink);
  border-radius: 1px;
  pointer-events: none;
}
.timeline-row:hover .timeline-bar { filter: brightness(1.08); }
.timeline-row-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-condensed);
  white-space: nowrap;
  pointer-events: none;
  padding: 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.timeline-row-label .vol {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.timeline-row-label .name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink);
}
.timeline-row-label .dates {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
/* When the bar is wide enough to host the label inside, recolour the
   text for contrast against the coloured fill. */
.timeline-row-label.is-inside .vol,
.timeline-row-label.is-inside .name,
.timeline-row-label.is-inside .dates {
  color: #ffffff;
  opacity: 0.95;
}
.timeline-axis {
  position: relative;
  height: 30px;
  border-top: 1px solid var(--ink);
  margin-top: 0;
}
.timeline-tick {
  position: absolute;
  top: 10px;
  transform: translateX(-50%);
  font-family: var(--font-condensed);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.timeline-tick::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1px;
  height: 6px;
  background: var(--ink-soft);
  transform: translateX(-50%);
}
.timeline-key {
  margin-top: 32px;
  border-top: 1px solid var(--rule-soft);
  padding-top: 24px;
  max-width: var(--readw);
}
.timeline-key-eyebrow {
  font-family: var(--font-condensed);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.timeline-key p:not(.timeline-key-eyebrow) {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
@media (max-width: 700px) {
  .timeline-row { height: 38px; }
  .timeline-row-label .name { font-size: 13px; }
  .timeline-row-label .vol, .timeline-row-label .dates { display: none; }
}

/* =====  Responsive — tablet  ===== */
@media (max-width: 900px) {
  .hero-title { font-size: 36px; line-height: 1.05; }
  .chap-title { font-size: 32px; line-height: 1.08; }
  .section-title { font-size: 26px; }
}

/* =====  Responsive — phone  ===== */
@media (max-width: 700px) {
  .nav { padding: 10px 16px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 4px 8px; font-size: 11px; }
  .theme-toggle { width: 28px; height: 28px; margin-left: 6px; }
  section { padding: 40px 16px; }
  .hero { padding: 100px 16px 40px; min-height: auto; }
  .hero-title { font-size: 30px; }
  .hero-sub { font-size: 16px; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .chap-hero { padding: 100px 16px 40px; min-height: auto; }
  .chap-title { font-size: 28px; }
  .chap-sub { font-size: 16px; }
  .chap-body { padding: 40px 16px 50px; }
  /* Improved mobile reading typography: slightly larger body, more open
     line-height, and wider character measure for thumbs */
  .prose p { font-size: 17px; line-height: 1.72; }
  .prose h2 { font-size: 22px; margin-top: 2em; }
  .prose blockquote { font-size: 19px; padding-left: 14px; line-height: 1.5; }
  .toc-link { grid-template-columns: 40px 1fr; gap: 16px; padding: 16px 0; }
  .toc-title { font-size: 18px; }
  .toc-title small { font-size: 12px; margin-top: 4px; }
  .toc-year { display: none; }
  .stop { grid-template-columns: 1fr; gap: 12px; }
  .stop-num { font-size: 40px; }
  .drop-cap::first-letter { font-size: 4em; }
  .myth-claim { font-size: 19px; }
  .prose figure.bleed { margin-left: -16px; margin-right: -16px; }
  /* Resume banner on phones: stack the content */
  .resume-banner { padding: 14px 18px; }
  .resume-banner-title { font-size: 16px; }
  .resume-banner-title span { display: block; margin-top: 2px; font-size: 12px; }
  /* TOC progress summary on phones */
  .toc-progress-summary { padding: 18px 18px; }
  .toc-progress-count { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
