/* ==========================================================================
   LA RUTA DE LA SEDA — Sistema de Diseño Editorial y Cartográfico
   Paleta: Lapislázuli nocturno · Seda cruda · Oro hilado · Bermellón cinabrio · Ocre de Dunhuang
   ========================================================================== */

@font-face {
  font-family: 'Georgia-Fallback';
  src: local('Georgia'), local('Times New Roman');
  size-adjust: 89%;
  ascent-override: 96%;
  descent-override: 24%;
}

:root {
  --font-display: 'Cormorant Garamond', 'Georgia-Fallback', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --night-950: #070b14;
  --night-900: #0b1220;
  --night-800: #131f35;
  --lapis-800: #142845;
  --lapis-700: #1d3b63;

  --parchment-100: #f6f0e6;
  --parchment-200: #efe5d4;
  --parchment-300: #e3d3ba;
  --ochre-100: #ede0ca;
  --ochre-200: #dfd0b5;

  --ink-900: #181512;
  --ink-700: #3d362e;
  --ink-500: #695e52;

  --silk-light: #f5efe4;
  --silk-muted: rgba(245, 239, 228, 0.74);

  --gold-400: #f3c86f;
  --gold-500: #d8a24a;
  --gold-700: #9a6c21;

  --vermilion-500: #c84b31;
  --vermilion-600: #a83720;
  --turquoise-400: #59d7e0;
  --turquoise-600: #2b838c;

  --plague-bg: #110d0f;
  --plague-surface: #1b1518;
  --plague-red: #db3c30;

  --topbar-h: 54px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--silk-light);
  background-color: var(--night-950);
  max-width: 100%;
  overflow-x: clip;
}

section[id] {
  scroll-margin-top: var(--topbar-h);
}

#prologo {
  scroll-margin-top: 0;
}

main {
  max-width: 100%;
}

svg, canvas {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 0.55em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

button, input {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

.theme-parchment :focus-visible,
.theme-ochre :focus-visible {
  outline-color: var(--vermilion-600);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* ==========================================================================
   BARRA SUPERIOR FIJA E HILO DE PROGRESO
   ========================================================================== */
.silk-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 100;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(216, 162, 74, 0.2);
}

.silk-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.silk-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400), var(--turquoise-400));
  box-shadow: 0 0 10px rgba(243, 200, 111, 0.65);
  transition: background 0.4s ease;
}

body.is-plague-atmosphere .silk-progress-fill {
  background: linear-gradient(90deg, var(--gold-500), var(--plague-red));
}

.topbar-inner {
  width: min(1280px, calc(100% - 2rem));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--silk-light);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-width: 0;
}

.brand-knot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(216, 162, 74, 0.24);
}

.chapter-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chapter-nav-link {
  color: rgba(245, 239, 228, 0.68);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.36rem 0.62rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.chapter-nav-link:hover {
  color: var(--silk-light);
  background: rgba(255, 255, 255, 0.06);
}

.chapter-nav-link.is-active {
  color: var(--night-950);
  background: var(--gold-400);
  font-weight: 600;
}

.mobile-chapter-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(216, 162, 74, 0.16);
  color: var(--gold-400);
  border: 1px solid rgba(216, 162, 74, 0.38);
  border-radius: 999px;
  padding: 0.36rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   PRÓLOGO: ESCENA 3D CON CAMBIO DE ESCALA (CAPULLO -> GLOBO DE EURASIA)
   ========================================================================== */
.prologue-scrolly {
  position: relative;
  background: radial-gradient(circle at 65% 42%, #13213c 0%, #070b14 70%);
}

.prologue-sticky-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  z-index: 1;
}

.prologue-canvas {
  width: 100%;
  height: 100%;
}

.prologue-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 11, 20, 0.82) 0%, rgba(7, 11, 20, 0.35) 48%, rgba(7, 11, 20, 0.08) 100%),
    linear-gradient(180deg, rgba(7, 11, 20, 0.42) 0%, transparent 22%, transparent 80%, rgba(7, 11, 20, 0.92) 100%);
}

.scroll-cue {
  position: absolute;
  bottom: 1.35rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  opacity: 0.78;
}

.scroll-cue-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--gold-400);
  white-space: nowrap;
}

.scroll-cue-line {
  width: 1px;
  height: 26px;
  background: linear-gradient(180deg, var(--gold-400), transparent);
}

.prologue-steps-track {
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  margin-top: -100svh;
  width: min(1200px, calc(100% - 2.5rem));
  margin-inline: auto;
  pointer-events: none;
}

.prologue-step {
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding-block: 3rem;
}

.prologue-hero-step {
  min-height: 100vh;
  min-height: 100svh;
}

.prologue-card {
  pointer-events: auto;
  width: 100%;
  max-width: 500px;
  background: rgba(10, 16, 30, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(216, 162, 74, 0.28);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.9rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.hero-opening-card {
  max-width: 550px;
  background: rgba(9, 14, 26, 0.84);
  padding: 2.05rem 2.15rem;
}

.card-accent-vermilion {
  border-left-color: var(--vermilion-500);
}

.eyebrow, .step-kicker, .chapter-number, .visual-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 0.6rem;
}

.prologue-card h1 {
  font-size: clamp(2.05rem, 4.2vw, 3.6rem);
  color: #fff9ef;
  margin-bottom: 0.45em;
}

.prologue-card h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  color: #fff8ec;
}

.prologue-card .lead {
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  color: rgba(245, 239, 228, 0.9);
}

.prologue-card p {
  color: rgba(245, 239, 228, 0.84);
}

/* ==========================================================================
   DIVISORES DE HORIZONTE CON PARALLAX MULTIPLANO E HILO DORADO CONTINUO
   ========================================================================== */
.horizon-transition {
  position: relative;
  height: 112px;
  overflow: hidden;
  margin-top: -1px;
  margin-bottom: -1px;
}

/* Puntada vertical sutil del hilo de seda cosiendo un capítulo con el siguiente */
.horizon-transition::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(216, 162, 74, 0.52), transparent);
  pointer-events: none;
  z-index: 2;
}

.night-to-parchment { background: var(--night-950); }
.parchment-to-atlas { background: #f3ece0; }
.atlas-to-ochre     { background: #091322; }
.ochre-to-lapis     { background: #e6d5b8; }
.lapis-to-river     { background: #12213a; }
.gold-to-plague     { background: #0d1424; }
.plague-to-modern   { background: #110d0f; }

.horizon-svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  width: 100%;
  height: 138%;
  display: block;
}

/* ==========================================================================
   ESTRUCTURA GENERAL DE CAPÍTULOS Y TEMAS CROMÁTICOS
   ========================================================================== */
.chapter-section {
  position: relative;
  padding-block: clamp(3.8rem, 7.5vw, 6.6rem);
}

.theme-parchment {
  background-color: #f3ece0;
  color: var(--ink-900);
}

.theme-ochre {
  background: linear-gradient(180deg, #efe3ce 0%, #e6d5b8 100%);
  color: var(--ink-900);
}

.theme-lapis {
  background: linear-gradient(180deg, #0d182b 0%, #12213a 100%);
  color: var(--silk-light);
}

.theme-night-gold {
  background: linear-gradient(180deg, #101d33 0%, #0d1424 100%);
  color: var(--silk-light);
}

.theme-plague {
  background: linear-gradient(180deg, #181013 0%, #221316 26%, var(--plague-bg) 100%);
  color: #efe6e4;
}

.theme-modern {
  background: linear-gradient(180deg, #0c1322 0%, #080d18 100%);
  color: var(--silk-light);
}

.theme-parchment .chapter-number,
.theme-parchment .visual-kicker,
.theme-ochre .chapter-number,
.theme-ochre .visual-kicker {
  color: var(--vermilion-600);
}

.theme-plague .chapter-number {
  color: #ff6b5e;
}

.chapter-header {
  max-width: 780px;
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}

.chapter-header h2 {
  font-size: clamp(2rem, 4.2vw, 3.35rem);
}

.chapter-intro {
  font-size: clamp(1.02rem, 1.45vw, 1.22rem);
  opacity: 0.88;
}

/* ==========================================================================
   CAPÍTULO I: TARJETAS DE MITOS, SEDA COMO DINERO Y RELEVOS
   ========================================================================== */
.myth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 2.5rem;
}

.myth-card {
  position: relative;
  min-width: 0;
  background: #fbf7f0;
  border: 1px solid rgba(24, 21, 18, 0.14);
  border-top: 3px solid var(--vermilion-500);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.5rem;
  box-shadow: 0 10px 28px rgba(24, 21, 18, 0.05);
}

.myth-stamp {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--vermilion-600);
  border: 1.5px solid rgba(168, 55, 32, 0.45);
  padding: 0.14rem 0.46rem;
  border-radius: 4px;
  transform: rotate(3deg);
}

.myth-false {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--ink-500);
  text-decoration: line-through;
  margin-bottom: 0.45rem;
  padding-right: 4rem;
}

.myth-card h3 {
  font-size: 1.42rem;
  color: var(--ink-900);
}

.myth-card p {
  font-size: 0.95rem;
  color: var(--ink-700);
}

.visual-box {
  min-width: 0;
  background: #fbf7f0;
  border: 1px solid rgba(24, 21, 18, 0.15);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2.2rem);
  margin-bottom: 2.4rem;
  box-shadow: 0 14px 36px rgba(24, 21, 18, 0.06);
}

.visual-box:last-child {
  margin-bottom: 0;
}

.visual-box h3 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.currency-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.15rem;
}

.currency-unit {
  min-width: 0;
  background: #f2eadc;
  border: 1px solid rgba(24, 21, 18, 0.1);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.currency-svg {
  width: 100%;
  height: auto;
  max-height: 98px;
}

.currency-stats strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.currency-stats span {
  font-size: 0.9rem;
  color: var(--ink-700);
}

.currency-equals {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--vermilion-600);
  text-align: center;
}

/* Simulador de Relevos */
.relay-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-action {
  background: var(--vermilion-500);
  color: #fffaf2;
  border: none;
  border-radius: 999px;
  padding: 0.66rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn-action:hover {
  background: var(--vermilion-600);
  transform: translateY(-1px);
}

.relay-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.25rem;
  margin-bottom: 1.6rem;
}

.relay-track-bg {
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: rgba(24, 21, 18, 0.14);
  z-index: 0;
}

.relay-track-fill {
  height: 100%;
  width: 0%;
  background: var(--vermilion-500);
  transition: width 0.35s ease;
}

.relay-node-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0;
  color: var(--ink-700);
  text-align: center;
}

.relay-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3ece0;
  border: 2px solid rgba(24, 21, 18, 0.28);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.relay-node-btn.is-passed .relay-dot {
  background: #ead4b0;
  border-color: var(--vermilion-500);
  color: var(--ink-900);
}

.relay-node-btn.is-active .relay-dot {
  background: var(--vermilion-500);
  border-color: var(--vermilion-500);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(200, 75, 49, 0.18);
}

.relay-node-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.relay-readout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1.4rem;
  background: #f3eadb;
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.relay-main-info, .relay-price-meter {
  min-width: 0;
}

.relay-stage-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--vermilion-600);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.relay-main-info h4 {
  font-size: 1.5rem;
  margin-bottom: 0.45rem;
}

.relay-narrative {
  color: var(--ink-700);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.relay-meta-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.meta-pill {
  min-width: 0;
  background: #fbf7f0;
  border: 1px solid rgba(24, 21, 18, 0.1);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.meta-pill span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  color: var(--ink-500);
}

.meta-pill strong {
  font-size: 0.83rem;
  color: var(--ink-900);
}

.relay-price-meter {
  background: #1b1815;
  color: var(--silk-light);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meter-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--gold-400);
}

.meter-big-number {
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 700;
  color: #fff6e3;
  margin-block: 0.25rem;
}

.price-pips-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 5px;
  margin-block: 0.6rem;
}

.price-pip {
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.25s ease;
}

.price-pip.is-lit {
  background: var(--gold-400);
  box-shadow: 0 0 6px rgba(243, 200, 111, 0.45);
}

.meter-footnote {
  font-size: 0.8rem;
  color: rgba(245, 239, 228, 0.74);
  line-height: 1.48;
}

/* ==========================================================================
   CAPÍTULO II: ATLAS CARTOGRÁFICO INTERACTIVO
   ========================================================================== */
.atlas-scrolly-section {
  position: relative;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  align-items: start;
  background-color: #091322;
  color: var(--silk-light);
}

.atlas-narrative-column {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 2;
  padding: 12vh 1.35rem 22vh;
  background: #08101e;
  border-right: 1px solid rgba(216, 162, 74, 0.22);
}

.atlas-sticky-viewport {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  min-width: 0;
  z-index: 3;
  overflow: hidden;
  background: #091322;
}

.atlas-top-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 1.2rem;
  background: rgba(8, 15, 28, 0.96);
  border-bottom: 1px solid rgba(216, 162, 74, 0.2);
  z-index: 4;
}

.atlas-hud-left {
  min-width: 0;
}

.hud-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
}

.hud-step-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff8eb;
  margin: 0;
}

.atlas-quick-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.atlas-quick-step-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 239, 228, 0.8);
  border: 1px solid rgba(216, 162, 74, 0.24);
  border-radius: 999px;
  padding: 0.28rem 0.68rem;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.atlas-quick-step-btn:hover {
  background: rgba(216, 162, 74, 0.2);
  color: #fff;
}

.atlas-quick-step-btn.is-active {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--night-950);
  font-weight: 700;
}

.atlas-map-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#eurasia-map-svg {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.atlas-geo-text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  fill: rgba(226, 200, 152, 0.44);
  pointer-events: none;
}

.geo-tag-sea {
  fill: rgba(114, 196, 214, 0.38);
  font-style: italic;
}

.city-label-text {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  fill: #fdf6e9;
  paint-order: stroke;
  stroke: #08111f;
  stroke-width: 3.2px;
  stroke-linejoin: round;
  transition: opacity 0.25s ease;
}

/* En vista panorámica general ocultamos etiquetas secundarias salvo selección o foco */
.atlas-cities.is-overview-zoom .atlas-city:not(.is-featured):not(.is-selected):not(:hover):not(:focus-visible) .city-label-text {
  opacity: 0;
  pointer-events: none;
}

.belitung-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: #8ff0f7;
  paint-order: stroke;
  stroke: #08111f;
  stroke-width: 3px;
}

.atlas-city:focus-visible {
  outline: none;
}

.atlas-city .city-pulse-ring {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.atlas-city.is-step-active .city-pulse-ring,
.atlas-city.is-selected .city-pulse-ring,
.atlas-city:hover .city-pulse-ring,
.atlas-city:focus-visible .city-pulse-ring {
  opacity: 0.88;
}

.atlas-city.is-selected .city-core-dot {
  fill: #ff6e4a;
}

.atlas-legend {
  position: absolute;
  top: 0.7rem;
  left: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  background: rgba(8, 15, 28, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 162, 74, 0.22);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  font-size: 0.72rem;
  color: rgba(245, 239, 228, 0.86);
  pointer-events: none;
}

.leg-line {
  display: inline-block;
  width: 15px;
  height: 2.5px;
  vertical-align: middle;
  margin-right: 4px;
}

.leg-land { background: #f5c469; }
.leg-sea { background: #59d7e0; }
.leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffdf9a;
  vertical-align: middle;
  margin-right: 4px;
}

.city-inspector-card {
  position: absolute;
  right: 0.95rem;
  bottom: 0.85rem;
  width: min(330px, calc(100% - 1.8rem));
  background: rgba(9, 16, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(216, 162, 74, 0.34);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  z-index: 3;
}

.inspector-header-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.inspector-tap-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--turquoise-400);
  flex-shrink: 0;
}

.inspector-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  margin-bottom: 0.18rem;
}

.city-inspector-card h4 {
  font-size: 1.18rem;
  color: #fff8ea;
  margin-bottom: 0.12rem;
}

.inspector-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--turquoise-400);
  margin-bottom: 0.38rem;
}

.inspector-desc {
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(245, 239, 228, 0.86);
  margin-bottom: 0.4rem;
}

.inspector-evidence-wrap {
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(243, 200, 111, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.35rem;
}

.elevation-dock {
  background: rgba(7, 12, 22, 0.97);
  border-top: 1px solid rgba(216, 162, 74, 0.22);
  padding: 0.4rem 1.1rem 0.3rem;
  min-width: 0;
}

.elevation-dock-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(245, 239, 228, 0.72);
  margin-bottom: 0.12rem;
}

.elev-extremes {
  color: var(--gold-400);
}

#elevation-profile-svg {
  width: 100%;
  height: 94px;
  display: block;
}

.atlas-step-card {
  margin-bottom: 52vh;
  background: rgba(13, 23, 42, 0.92);
  border: 1px solid rgba(216, 162, 74, 0.24);
  border-left: 3px solid rgba(216, 162, 74, 0.45);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.atlas-step-card:last-child {
  margin-bottom: 8vh;
}

.atlas-step-card.is-active {
  background: rgba(18, 32, 56, 0.98);
  border-left-color: var(--gold-400);
  border-color: rgba(243, 200, 111, 0.62);
}

.step-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  margin-bottom: 0.4rem;
}

.atlas-step-card h3 {
  font-size: 1.5rem;
  color: #fff8eb;
}

.atlas-step-card p {
  font-size: 0.93rem;
  color: rgba(245, 239, 228, 0.86);
}

/* ==========================================================================
   CAPÍTULO III: LOGÍSTICA ANIMAL, CARAVANSERAI 3D, SOGDIANOS Y ESTEPA
   ========================================================================== */
.logistics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin-bottom: 2.5rem;
}

.logistic-stat {
  min-width: 0;
  background: #faf5ec;
  border: 1px solid rgba(24, 21, 18, 0.13);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.15rem;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--vermilion-600);
  margin-bottom: 0.35rem;
}

.stat-num small {
  font-size: 1.15rem;
  font-weight: 600;
}

.stat-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  color: var(--ink-900);
}

.logistic-stat p {
  font-size: 0.86rem;
  color: var(--ink-700);
}

.khan-showcase-card {
  min-width: 0;
  background: #faf5ec;
  border: 1px solid rgba(24, 21, 18, 0.16);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.8rem;
  box-shadow: 0 18px 44px rgba(24, 21, 18, 0.09);
}

.khan-topbar {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  border-bottom: 1px solid rgba(24, 21, 18, 0.1);
}

.khan-topbar h3 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
}

.khan-cam-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.khan-cam-btn {
  background: #efe4d2;
  color: var(--ink-900);
  border: 1px solid rgba(24, 21, 18, 0.18);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.khan-cam-btn.is-active {
  background: var(--ink-900);
  color: #fff8eb;
  border-color: var(--ink-900);
}

.khan-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(290px, 48vw, 480px);
  background: #dcc6a0;
}

.khan-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.khan-canvas:active {
  cursor: grabbing;
}

.khan-overlay-caption {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.8rem;
  max-width: 520px;
  background: rgba(18, 15, 12, 0.82);
  backdrop-filter: blur(8px);
  color: #fdf6e9;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border-left: 3px solid var(--gold-400);
  font-size: 0.84rem;
  pointer-events: none;
}

.khan-solar-bar {
  padding: 0.95rem 1.5rem;
  background: #1b1714;
  color: var(--silk-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.solar-label {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.solar-label strong {
  color: var(--gold-400);
}

.khan-solar-bar input[type="range"] {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
  accent-color: var(--gold-400);
  cursor: pointer;
}

/* Sogdianos y Cartas Antiguas */
.sogdian-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.8rem;
}

.sogdian-narrative, .ancient-letter-card {
  min-width: 0;
}

.sogdian-narrative h3 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
}

.sogdian-narrative p {
  color: var(--ink-700);
}

.ancient-letter-card {
  margin: 0;
  background: #201b17;
  color: #f4ecde;
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.75rem;
  border-left: 4px solid var(--gold-400);
  box-shadow: 0 18px 40px rgba(24, 21, 18, 0.16);
}

.letter-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  margin-bottom: 0.8rem;
}

.letter-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.26rem, 2vw, 1.6rem);
  line-height: 1.38;
  color: #fffaf0;
  margin-bottom: 1rem;
}

.letter-footer {
  font-size: 0.83rem;
  color: rgba(244, 236, 222, 0.76);
  line-height: 1.52;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.75rem;
}

/* Bloque editorial sobre los Imperios Nómadas de la Estepa */
.steppe-partner-box {
  min-width: 0;
  background: #faf5ec;
  border: 1px solid rgba(24, 21, 18, 0.15);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2.15rem);
  box-shadow: 0 14px 36px rgba(24, 21, 18, 0.06);
}

.steppe-partner-head {
  max-width: 780px;
  margin-bottom: 1.45rem;
}

.steppe-partner-head h3 {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  color: var(--ink-900);
}

.steppe-partner-head p {
  font-size: 0.95rem;
  color: var(--ink-700);
}

.steppe-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.steppe-card {
  min-width: 0;
  background: #f2e7d5;
  border: 1px solid rgba(24, 21, 18, 0.11);
  border-top: 3px solid var(--gold-700);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.25rem;
}

.steppe-era {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vermilion-600);
  margin-bottom: 0.35rem;
}

.steppe-card h4 {
  font-size: 1.28rem;
  color: var(--ink-900);
  margin-bottom: 0.4rem;
}

.steppe-card p {
  font-size: 0.88rem;
  color: var(--ink-700);
}

/* ==========================================================================
   CAPÍTULO IV: GABINETE 3D DE OBJETOS MESTIZOS Y MATRIZ DE FLUJOS
   ========================================================================== */
.artifacts-cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.9rem;
  background: rgba(8, 15, 28, 0.62);
  border: 1px solid rgba(216, 162, 74, 0.26);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 2.5rem;
}

.artifacts-stage-col, .artifacts-info-col {
  min-width: 0;
}

.artifacts-stage-col {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 48%, #1d3559 0%, #0a1324 76%);
  border: 1px solid rgba(216, 162, 74, 0.2);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.artifact-canvas-header {
  padding: 0.55rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(245, 239, 228, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.artifacts-canvas {
  width: 100%;
  height: 330px;
  cursor: grab;
}

.artifacts-canvas:active {
  cursor: grabbing;
}

.artifact-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.artifact-tab-btn {
  min-width: 0;
  background: #0d182d;
  color: rgba(245, 239, 228, 0.8);
  border: none;
  padding: 0.72rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.artifact-tab-btn:hover {
  background: #152644;
  color: #fff;
}

.artifact-tab-btn.is-active {
  background: var(--gold-400);
  color: var(--night-950);
}

.artifacts-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.artifacts-info-col h3 {
  font-size: clamp(1.6rem, 2.7vw, 2.25rem);
  color: #fff8eb;
}

.artifact-recipe {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--turquoise-400);
  background: rgba(89, 215, 224, 0.1);
  border: 1px solid rgba(89, 215, 224, 0.26);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.artifact-description {
  color: rgba(245, 239, 228, 0.88);
  margin-bottom: 1.15rem;
}

.talas-debunk-note {
  background: rgba(216, 162, 74, 0.1);
  border-left: 3px solid var(--gold-400);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: rgba(245, 239, 228, 0.86);
}

/* Matriz bilateral de intercambios */
.exchange-matrix-box {
  min-width: 0;
  background: rgba(8, 15, 28, 0.62);
  border: 1px solid rgba(216, 162, 74, 0.24);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.exchange-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.exchange-top-bar h3 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

.exchange-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.exchange-filter-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 239, 228, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.exchange-filter-btn.is-active {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--night-950);
  font-weight: 700;
}

.exchange-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
  margin-bottom: 1.25rem;
}

.exchange-dir-col {
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.05rem;
}

.dir-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.dir-west { color: var(--gold-400); }
.dir-east { color: var(--turquoise-400); }

.exchange-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exchange-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  background: rgba(15, 27, 48, 0.9);
  color: var(--silk-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.48rem 0.74rem;
  font-size: 0.83rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.exchange-chip:hover {
  border-color: var(--gold-400);
}

.exchange-chip.is-selected {
  background: rgba(243, 200, 111, 0.18);
  border-color: var(--gold-400);
  box-shadow: 0 0 0 2px rgba(243, 200, 111, 0.2);
}

.chip-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gold-400);
}
.cat-ideas .chip-cat-dot { background: #b18cff; }
.cat-goods .chip-cat-dot { background: var(--turquoise-400); }
.cat-bio .chip-cat-dot { background: #e86f52; }

.exchange-detail-panel {
  min-width: 0;
  background: #0a1220;
  border: 1px solid rgba(216, 162, 74, 0.32);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.3rem;
}

.exchange-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.exchange-detail-head h4 {
  font-size: 1.4rem;
  color: #fff8eb;
  margin: 0;
}

.exchange-detail-meta {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--gold-400);
}

.exchange-detail-path {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--turquoise-400);
  margin-bottom: 0.5rem;
}

.exchange-detail-body {
  font-size: 0.93rem;
  color: rgba(245, 239, 228, 0.86);
}

/* ==========================================================================
   CAPÍTULO V: EL RÍO DEL TIEMPO (1.600 AÑOS)
   ========================================================================== */
.time-river-card {
  min-width: 0;
  background: rgba(8, 14, 26, 0.76);
  border: 1px solid rgba(216, 162, 74, 0.28);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2.1rem);
}

.era-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 1.15rem;
}

.era-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 239, 228, 0.78);
  border: 1px solid rgba(216, 162, 74, 0.22);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.era-pill-btn.is-active {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--night-950);
  font-weight: 700;
}

.time-river-svg-wrap {
  background: rgba(4, 8, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem 0.35rem;
  margin-bottom: 1.35rem;
}

.river-legend-note {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: rgba(245, 239, 228, 0.62);
  margin-bottom: 0.2rem;
}

#time-river-svg {
  width: 100%;
  height: auto;
  display: block;
}

.era-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1.4rem;
  align-items: start;
}

.era-detail-left, .era-detail-right {
  min-width: 0;
}

.era-years-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--gold-400);
  margin-bottom: 0.35rem;
}

.era-detail-left h3 {
  font-size: 1.7rem;
  color: #fff8eb;
  margin-bottom: 0.35rem;
}

.era-empires-line {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--turquoise-400);
}

.era-detail-right p {
  color: rgba(245, 239, 228, 0.88);
  font-size: 0.95rem;
}

.era-milestone-box {
  margin-top: 0.75rem;
  background: rgba(216, 162, 74, 0.12);
  border-left: 3px solid var(--gold-400);
  padding: 0.55rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem !important;
  color: #ffe5ad !important;
}

/* ==========================================================================
   CAPÍTULO VI: MAPA DE CONTAGIO DE LA PESTE NEGRA (1338–1351)
   ========================================================================== */
.contagion-card {
  min-width: 0;
  background: var(--plague-surface);
  border: 1px solid rgba(219, 60, 48, 0.35);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2.2rem;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}

.contagion-controls-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.45rem;
  background: rgba(12, 9, 11, 0.85);
  border-bottom: 1px solid rgba(219, 60, 48, 0.24);
}

.contagion-year-box {
  min-width: 96px;
}

.contagion-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  color: rgba(239, 230, 228, 0.65);
}

.contagion-big-year {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: #ff6457;
}

.contagion-slider-col {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
}

#contagion-year-slider {
  width: 100%;
  accent-color: var(--plague-red);
  cursor: pointer;
  margin-bottom: 0.55rem;
}

.contagion-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.contagion-year-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(239, 230, 228, 0.8);
  border: 1px solid rgba(219, 60, 48, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.68rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.contagion-year-btn.is-active {
  background: var(--plague-red);
  border-color: var(--plague-red);
  color: #fff;
  font-weight: 600;
}

.contagion-map-wrap {
  width: 100%;
  background: #0d0b0d;
}

#contagion-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.contagion-city-label {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  fill: #f8ecea;
  paint-order: stroke;
  stroke: #0d0b0d;
  stroke-width: 3.4px;
}

.contagion-story-bar {
  padding: 1.25rem 1.45rem;
  background: rgba(16, 12, 14, 0.94);
  border-top: 1px solid rgba(219, 60, 48, 0.24);
}

.contagion-story-bar h3 {
  font-size: 1.45rem;
  color: #ff857a;
  margin-bottom: 0.35rem;
}

.contagion-story-bar p {
  font-size: 0.94rem;
  color: rgba(239, 230, 228, 0.88);
}

.pivotal-consequence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.consequence-item {
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
}

.conseq-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #ff7b70;
  margin-bottom: 0.35rem;
}

.consequence-item h4 {
  font-size: 1.38rem;
  color: #fff5f3;
}

.consequence-item p {
  font-size: 0.92rem;
  color: rgba(239, 230, 228, 0.82);
}

/* ==========================================================================
   CAPÍTULO VII: VELOCIDAD COMPARADA, GEOPOLÍTICA ACTUAL Y CIERRE
   ========================================================================== */
.theme-modern .visual-box {
  background: rgba(14, 23, 40, 0.82);
  border-color: rgba(216, 162, 74, 0.28);
  color: var(--silk-light);
  margin-bottom: 2.5rem;
}

.race-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.45rem;
}

.race-top-row h3 {
  margin-bottom: 0;
  color: #fff8eb;
}

.race-lanes-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.race-lane {
  min-width: 0;
  background: rgba(7, 12, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.88rem 1.05rem;
}

.race-lane-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.race-era-tag {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--gold-400);
  margin-right: 0.3rem;
}

.race-lane-time {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff8eb;
}

.race-track {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.race-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
}

.race-spark {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px currentColor;
}

.race-lane-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: rgba(245, 239, 228, 0.7);
}

.modern-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
  margin-bottom: 3.2rem;
}

.pillar-card {
  min-width: 0;
  background: rgba(16, 26, 46, 0.75);
  border: 1px solid rgba(216, 162, 74, 0.22);
  border-radius: var(--radius-md);
  padding: 1.45rem;
}

.pillar-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  color: var(--turquoise-400);
  margin-bottom: 0.45rem;
}

.pillar-card h3 {
  font-size: 1.42rem;
  color: #fff8eb;
}

.pillar-card p {
  font-size: 0.92rem;
  color: rgba(245, 239, 228, 0.82);
}

.closing-meditation {
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
  padding: 2.4rem 1.2rem 1rem;
}

.closing-knot {
  width: 14px;
  height: 14px;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 6px rgba(243, 200, 111, 0.16), 0 0 24px rgba(243, 200, 111, 0.55);
}

.closing-quote {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.1vw, 2.45rem);
  line-height: 1.28;
  color: #fff9ef;
  margin-bottom: 1rem;
}

.closing-sub {
  font-size: 1rem;
  color: rgba(245, 239, 228, 0.78);
}

/* ==========================================================================
   COLOFÓN Y BIBLIOGRAFÍA
   ========================================================================== */
.sources-footer {
  background: #050810;
  color: rgba(245, 239, 228, 0.8);
  border-top: 1px solid rgba(216, 162, 74, 0.22);
  padding-block: 3.8rem 2.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.45fr);
  gap: 2.4rem;
  margin-bottom: 2.5rem;
}

.footer-col-intro, .sources-list {
  min-width: 0;
}

.footer-col-intro h2 {
  font-size: 2rem;
  color: #fff8eb;
}

.footer-col-intro p {
  font-size: 0.92rem;
  color: rgba(245, 239, 228, 0.72);
}

.sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.sources-list li {
  padding-left: 1rem;
  border-left: 2px solid rgba(216, 162, 74, 0.35);
}

.sources-list strong {
  color: #fff6e5;
}

.footer-bottom {
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(245, 239, 228, 0.58);
}

.back-to-top {
  color: var(--gold-400);
  text-decoration: none;
}

.back-to-top:hover {
  text-decoration: underline;
}

/* ==========================================================================
   DISEÑO ADAPTABLE (TABLET Y MÓVIL < 980px)
   ========================================================================== */
@media (max-width: 980px) {
  .mobile-chapter-btn {
    display: inline-flex;
  }

  .chapter-nav {
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    background: rgba(8, 13, 24, 0.97);
    border-bottom: 1px solid rgba(216, 162, 74, 0.28);
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    display: none;
  }

  .chapter-nav.is-open {
    display: flex;
  }

  .myth-grid,
  .modern-pillars,
  .steppe-cards-grid,
  .relay-readout-grid,
  .sogdian-grid,
  .artifacts-cabinet,
  .exchange-columns,
  .era-detail-grid,
  .pivotal-consequence,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .logistics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .currency-compare-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
  }

  .currency-equals {
    line-height: 1;
  }

  .prologue-vignette {
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.22) 0%, rgba(7, 11, 20, 0.1) 44%, rgba(7, 11, 20, 0.9) 100%);
  }

  .prologue-steps-track {
    width: calc(100% - 1.6rem);
  }

  .prologue-step {
    align-items: flex-end;
    padding-bottom: 4.2rem;
  }

  .prologue-card {
    max-width: 100%;
    padding: 1.25rem 1.3rem;
  }

  /* Capítulo II en móvil: Mapa fijo superior despejado + ficha de ciudad expandible al tocar */
  .atlas-scrolly-section {
    display: block;
  }

  .atlas-sticky-viewport {
    position: sticky;
    top: var(--topbar-h);
    height: 55vh;
    height: 55svh;
    z-index: 8;
    border-bottom: 1px solid rgba(216, 162, 74, 0.35);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  }

  .atlas-top-hud {
    padding: 0.42rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  .hud-kicker {
    display: none;
  }

  .hud-step-title {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .atlas-quick-steps {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .atlas-quick-steps::-webkit-scrollbar {
    display: none;
  }

  .atlas-quick-step-btn {
    flex-shrink: 0;
  }

  .atlas-legend {
    display: none;
  }

  .city-inspector-card {
    position: static;
    width: 100%;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(216, 162, 74, 0.24);
    padding: 0.42rem 0.75rem;
    box-shadow: none;
    background: rgba(9, 16, 30, 0.97);
    cursor: pointer;
  }

  .inspector-tap-hint {
    display: inline-block;
  }

  .inspector-kicker {
    display: none;
  }

  .city-inspector-card h4 {
    font-size: 0.86rem;
    color: var(--gold-400);
    margin: 0;
  }

  .city-inspector-card:not(.is-expanded) .inspector-meta,
  .city-inspector-card:not(.is-expanded) .inspector-evidence-wrap {
    display: none;
  }

  .city-inspector-card:not(.is-expanded) .inspector-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.35;
    margin: 0.12rem 0 0;
  }

  .city-inspector-card.is-expanded {
    max-height: 36svh;
    overflow-y: auto;
    padding: 0.58rem 0.85rem;
  }

  .city-inspector-card.is-expanded .inspector-tap-hint {
    color: var(--gold-400);
  }

  .elevation-dock {
    padding: 0.28rem 0.75rem 0.2rem;
  }

  .elevation-dock-header {
    font-size: 0.62rem;
  }

  .elev-extremes {
    display: none;
  }

  #elevation-profile-svg {
    height: 56px;
  }

  .atlas-narrative-column {
    border-right: none;
    padding: 1.5rem 0.85rem 3rem;
    z-index: 2;
  }

  .atlas-step-card {
    max-width: 100%;
    margin-bottom: 28vh;
    padding: 1.2rem 1.25rem;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  .brand-mark {
    font-size: 1.08rem;
  }

  .logistics-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .relay-meta-pills {
    grid-template-columns: minmax(0, 1fr);
  }

  .relay-node-name {
    font-size: 0.65rem;
  }

  .relay-dot {
    width: 28px;
    height: 28px;
    font-size: 0.74rem;
  }

  .artifacts-canvas {
    height: 260px;
  }

  .khan-topbar,
  .khan-solar-bar,
  .contagion-controls-top,
  .contagion-story-bar {
    padding-inline: 1rem;
  }
}

@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;
  }
}
