/* ─── /lore styles ────────────────────────────────────────────────
   Adapted from the V2 "Transmission" design demo. All rules are
   scoped under .lore-page so they cannot leak. Demo's tx2v2- class
   prefix renamed to lore- here; cross-reference is one find/replace.

   Demo design tokens (Cinzel / Garamond / JetBrains Mono and
   --ink / --ink-2 / --ink-3 / --ink-4) are mapped to site tokens.
   Important: --lore-ink-4 must be a SOLID dim grey, not a transparent
   overlay - it's used for small labels and rail ticks where opacity
   stacking blows out legibility against the dark background.
   ──────────────────────────────────────────────────────────────── */

/* When a lore modal is open, lock the document scroll. Replaces the
   previous body.style.overflow JS hack. */
html.lore-modal-open,
html.lore-modal-open body { overflow: hidden; }

.lore-page {
  --lore-ink:    var(--text-bright);      /* #e6edf3 - body text */
  --lore-ink-2:  var(--text);             /* #b8d4cc - secondary text */
  --lore-ink-3:  #8b9d96;                 /* dim but readable - mark labels, hints */
  --lore-ink-4:  #5a6e68;                 /* legible-on-dark grey - smallest labels */
  --lore-mono:   var(--font-mono);
  --lore-serif:  var(--font-body);        /* Exo 2 italic stands in for Garamond */
  /* Display + impact use the demo's actual fonts: stenciled brutalist
     ("Inquisitors / Oracles / Warlords" stack and LUMINARA REACH reveal)
     and a geometric futuristic for chapter titles / ark names. */
  --lore-display: 'Audiowide', 'Orbitron', monospace;
  --lore-epic:    'Audiowide', 'Orbitron', monospace;
  --lore-impact:  'Saira Stencil One', 'Audiowide', system-ui, sans-serif;

  --lore-teal:        #00c8b4;
  --lore-teal-bright: #51e9b6;
  --lore-amber:       #e8a020;
  --lore-amber-bright:#ffc858;
  --lore-teal-dim:    rgba(0, 200, 180, 0.7);
  --lore-amber-dim:   rgba(232, 160, 32, 0.7);
  --lore-teal-glow:   0 0 24px rgba(0, 200, 180, 0.5);
  --lore-amber-glow:  0 0 24px rgba(232, 160, 32, 0.5);

  /* Faction sigils. Drop the matching file at the path below and refresh;
     missing files fall through to the placeholder treatment defined on
     .lore-contender-sigil. Aspect target is portrait 363:504 (matches the
     72x100 slot exactly under `contain`); other aspects letterbox. */
  --lore-sigil-i:   url("/images/lore/sigils/i.svg");
  --lore-sigil-ii:  url("/images/lore/sigils/ii.svg");
  --lore-sigil-iii: url("/images/lore/sigils/iii.svg");
  --lore-sigil-iv:  url("/images/lore/sigils/iv.svg");

  position: relative;
  min-height: 100vh;
  padding-top: var(--nav-height);
  isolation: isolate;
  background: #02080b;        /* deeper than site bg to give chapters their stage */
  color: var(--lore-ink-2);
}

/* ─── Ambient backdrop layers ──────────────────────────────── */
/* Multi-layer nebula sky. Pure CSS - the existing global #stars canvas
   from base.njk does the live star sparkle on top; no per-pixel shader
   needed. Cheap on weak GPUs and renders identically on every device. */
.lore-sky {
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* Top horizon teal glow */
    radial-gradient(ellipse 95% 55% at 50% -5%, rgba(0, 130, 120, 0.28), transparent 60%),
    /* Mid-right cool nebula */
    radial-gradient(ellipse 55% 45% at 82% 30%, rgba(40, 200, 200, 0.10), transparent 70%),
    /* Mid-left violet patch */
    radial-gradient(ellipse 50% 40% at 18% 38%, rgba(110, 80, 200, 0.10), transparent 70%),
    /* Lower-left warm amber */
    radial-gradient(ellipse 70% 45% at 25% 78%, rgba(232, 160, 32, 0.07), transparent 70%),
    /* Lower-right deep teal */
    radial-gradient(ellipse 80% 50% at 75% 90%, rgba(0, 200, 180, 0.13), transparent 65%),
    /* Bottom band */
    radial-gradient(ellipse 110% 25% at 50% 100%, rgba(0, 150, 130, 0.16), transparent 70%),
    /* Deep base */
    linear-gradient(to bottom, #02080b 0%, #030b10 60%, #02080b 100%);
  animation: lore-sky-breathe 24s ease-in-out infinite;
  will-change: opacity;
}
@keyframes lore-sky-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.86; }
}

/* Slow-drifting nebula veil overlaid on the sky. Single pseudo-element
   doing a long-duration position drift - barely perceptible but adds
   life. Replaces what the broken shader was supposed to do. */
.lore-sky::after {
  content: "";
  position: absolute;
  inset: -10% -20%;
  background:
    radial-gradient(ellipse 30% 20% at 30% 40%, rgba(0, 200, 180, 0.06), transparent 70%),
    radial-gradient(ellipse 24% 16% at 70% 60%, rgba(180, 100, 220, 0.05), transparent 70%),
    radial-gradient(ellipse 20% 14% at 50% 80%, rgba(232, 160, 32, 0.04), transparent 70%);
  filter: blur(40px);
  animation: lore-sky-drift 60s ease-in-out infinite;
  will-change: transform;
}
@keyframes lore-sky-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(2%, -3%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .lore-sky, .lore-sky::after { animation: none; }
}

.lore-vignette {
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 110% 90% at 50% 50%, transparent 55%, rgba(0,0,0,0.85) 100%);
}

.lore-grain {
  position: fixed;
  top: var(--nav-height); left: 0; right: 0; bottom: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* ─── Chapter rail (scroll variant) ────────────────────────── */
.lore-rail {
  position: fixed;
  top: calc(var(--nav-height) + 80px);
  bottom: 160px;
  left: 32px;
  width: 28px;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lore-rail-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 200, 180, 0.28) 8%,
    rgba(0, 200, 180, 0.28) 92%,
    transparent 100%);
  transform: translateX(-50%);
}
.lore-rail-tick {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  left: 0;
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-ink-3);
  transition: color 0.5s, opacity 0.5s;
  transform: translateY(-50%);
  pointer-events: auto;
  text-decoration: none;
  white-space: nowrap;
}
.lore-rail-tick:hover,
.lore-rail-tick:focus-visible { color: var(--lore-ink); outline: none; }
.lore-rail-tick i {
  width: 10px; height: 10px;
  border: 1px solid rgba(0, 200, 180, 0.45);
  background: #02080b;
  border-radius: 50%;
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s, transform 0.5s;
}
.lore-rail-tick:hover i { transform: scale(1.2); }
.lore-rail-tick.is-active { color: var(--lore-teal); }
.lore-rail-tick.is-active i {
  background: var(--lore-teal);
  border-color: var(--lore-teal);
  box-shadow: 0 0 14px var(--lore-teal);
  transform: scale(1.2);
}
.lore-rail-tick.is-final.is-active { color: var(--lore-amber); }
.lore-rail-tick.is-final.is-active i {
  background: var(--lore-amber);
  border-color: var(--lore-amber);
  box-shadow: 0 0 14px var(--lore-amber);
}

/* ─── Main column ──────────────────────────────────────────── */
.lore-main {
  position: relative;
  z-index: 4;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 56px 80px;
}

/* ─── Chapter shell ────────────────────────────────────────── */
.lore-chapter {
  position: relative;
  padding: 96px 0;
  scroll-margin-top: calc(var(--nav-height) + 32px);
}
.lore-chapter:first-of-type { padding-top: 32px; }

.lore-chapter-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: var(--lore-teal);
  margin-bottom: 24px;
  text-transform: uppercase;
}
.lore-chapter-mark::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--lore-teal);
  box-shadow: 0 0 8px var(--lore-teal);
}
.lore-chapter-mark em {
  font-style: normal;
  color: var(--lore-ink-3);
  letter-spacing: 0.24em;
}

/* Chapter intro (h2 + sub) — was undefined before. */
.lore-chapter-intro {
  margin-bottom: 56px;
  text-align: left;
}
.lore-chapter.lore-reach .lore-chapter-intro,
.lore-chapter.lore-contenders .lore-chapter-intro,
.lore-opener .lore-chapter-intro { text-align: left; }

.lore-chapter-h {
  font-family: var(--lore-epic);
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--lore-ink);
  margin: 14px 0 12px;
  line-height: 1.1;
  text-shadow: 0 0 32px rgba(0, 200, 180, 0.22);
}
.lore-chapter-sub {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--lore-ink-2);
  letter-spacing: 0.02em;
  margin: 0;
  opacity: 0.85;
}
@media (max-width: 768px) {
  .lore-chapter-h { font-size: 34px; }
  .lore-chapter-intro { margin-bottom: 36px; }
}

/* ─── Chapter bridge (transition) ──────────────────────────── */
.lore-bridge {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px auto;
  max-width: 720px;
  padding: 14px 0;
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--lore-ink-3);
  text-align: center;
}
.lore-bridge-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 200, 180, 0.4), transparent);
}
.lore-bridge-glyph {
  color: var(--lore-teal);
  font-size: 14px;
  text-shadow: 0 0 10px var(--lore-teal);
  letter-spacing: 0.02em;
}
.lore-bridge-text { font-style: italic; }

/* ─── Reveal animations (IntersectionObserver-driven) ──────── */
.lore-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.2s cubic-bezier(.2,.6,.2,1), transform 1.2s cubic-bezier(.2,.6,.2,1);
}
.lore-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.lore-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}
.lore-stagger.is-in > * { opacity: 1; transform: translateY(0); }
.lore-stagger.is-in > *:nth-child(1) { transition-delay: 0.08s; }
.lore-stagger.is-in > *:nth-child(2) { transition-delay: 0.36s; }
.lore-stagger.is-in > *:nth-child(3) { transition-delay: 0.64s; }
.lore-stagger.is-in > *:nth-child(4) { transition-delay: 0.92s; }
.lore-stagger.is-in > *:nth-child(5) { transition-delay: 1.20s; }
.lore-stagger.is-in > *:nth-child(6) { transition-delay: 1.48s; }

/* ─── Chapter 00 — Opener ──────────────────────────────────── */
.lore-opener { padding-top: 32px; padding-bottom: 64px; }
.lore-opener-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  margin-bottom: 56px;
  text-transform: uppercase;
}
.lore-opener-eyebrow .lore-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lore-teal);
  box-shadow: var(--lore-teal-glow);
  animation: lore-pulse-strong 2s ease-in-out infinite;
}
.lore-opener-eyebrow .lore-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, var(--lore-teal), transparent);
}

.lore-impact-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 0;
  max-width: 900px;
}

.lore-before-prefix {
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.44em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
  margin-bottom: -16px;
}

.lore-impact {
  font-family: var(--lore-impact);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.06;
  letter-spacing: 0.005em;
  color: var(--lore-ink);
  margin: 0;
  position: relative;
  text-wrap: balance;
}
.lore-impact .lore-before {
  display: inline-block;
  font-family: var(--lore-mono);
  font-weight: 400;
  font-size: 0.22em;
  letter-spacing: 0.42em;
  color: var(--lore-ink-3);
  vertical-align: middle;
  margin-right: 18px;
  transform: translateY(-0.45em);
}
.lore-impact--dim { color: var(--lore-ink-2); }
.lore-impact--crown {
  color: var(--lore-amber);
  font-style: italic;
  font-weight: 600;
  text-shadow: 0 0 40px rgba(232, 160, 32, 0.5);
}
.lore-impact--crown::after {
  content: "";
  display: block;
  width: 96px; height: 1px;
  background: linear-gradient(to right, var(--lore-amber), transparent);
  margin-top: 28px;
  box-shadow: 0 0 10px var(--lore-amber);
}

/* ─── Chapter 01 — The Fall ────────────────────────────────── */
.lore-fall {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 80px;
  align-items: center;
}
.lore-fall-text {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 48px;
  line-height: 1.2;
  font-weight: 300;
  color: var(--lore-ink);
  margin: 0;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.lore-fall-text em {
  font-style: italic;
  color: var(--lore-amber);
  text-shadow: 0 0 24px rgba(232, 160, 32, 0.45);
  font-weight: 400;
}

/* The planet - image-based. Real PNG drops in at
   /images/lore/planet-home-dying.png. If missing, the
   .lore-planet-img.is-placeholder rule renders a radial-gradient
   stand-in clearly visible as a dying world. */
.lore-planet {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.lore-planet-cell {
  position: relative;
  width: 86%;
  aspect-ratio: 1;
}
.lore-planet-atmo {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 140, 60, 0.18) 38%,
    rgba(255, 100, 40, 0.08) 52%,
    transparent 66%);
  filter: blur(10px);
  animation: lore-atmo-breathe 6s ease-in-out infinite;
}
@keyframes lore-atmo-breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.04); }
}
.lore-planet-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 36px rgba(0, 0, 0, 0.6));
  animation: lore-planet-rotate 120s linear infinite;
}
.lore-planet-img.is-placeholder {
  /* Stand-in until real PNG lands. Clearly a "dying world" but
     unmistakeably a placeholder so the user knows what to ship. */
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,120,40,0.45) 0%, transparent 18%),
    radial-gradient(circle at 30% 65%, rgba(255,80,30,0.35) 0%, transparent 14%),
    radial-gradient(circle at 70% 35%, rgba(255,100,20,0.30) 0%, transparent 12%),
    radial-gradient(circle at 36% 30%, #1d4a48 0%, #0a2426 40%, #04141a 70%, #020c10 100%);
  box-shadow:
    inset -20px -30px 70px rgba(0,0,0,0.78),
    inset 16px 12px 36px rgba(255,120,40,0.16),
    0 0 70px rgba(255,80,30,0.18);
  width: 86%; height: 86%;
  margin: 7%;
}
@keyframes lore-planet-rotate { to { transform: rotate(360deg); } }
.lore-planet-ring {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  border: 1px solid rgba(0,200,180,0.18);
  border-right-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-22deg);
  pointer-events: none;
}
.lore-planet-ring::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(0,200,180,0.14);
}
.lore-planet-caption {
  position: absolute;
  bottom: -36px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: var(--lore-amber);
  text-transform: uppercase;
  white-space: nowrap;
}
.lore-planet-caption::before,
.lore-planet-caption::after {
  content: "";
  width: 18px; height: 1px;
  background: rgba(232, 160, 32, 0.4);
}

/* Scan readouts panel. */
.lore-scan-panel {
  margin-top: 64px;
  padding: 28px;
  border: 1px solid rgba(0, 200, 180, 0.22);
  background:
    linear-gradient(to bottom, rgba(0, 200, 180, 0.05), transparent 60%),
    rgba(2, 8, 11, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.lore-scan-panel::before,
.lore-scan-panel::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 1px solid var(--lore-teal);
  pointer-events: none;
}
.lore-scan-panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.lore-scan-panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.lore-scan-readout {
  border: 1px solid rgba(0, 200, 180, 0.15);
  padding: 14px 16px;
  background: rgba(2, 10, 13, 0.5);
}
.lore-scan-label {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lore-scan-value {
  font-family: var(--lore-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--lore-ink);
  font-feature-settings: "tnum";
}
.lore-scan-value.is-redacted { color: var(--lore-ink-4); }
.lore-scan-value.is-critical { color: #ff6c5a; text-shadow: 0 0 12px rgba(255, 108, 90, 0.4); }
.lore-scan-panel.is-scanned .lore-scan-value:not(.is-redacted) {
  color: var(--lore-teal);
  text-shadow: 0 0 12px rgba(0, 200, 180, 0.45);
  transition: color 0.6s, text-shadow 0.6s;
}

.lore-scan-countdown {
  margin-top: 12px;
  padding: 18px 22px;
  border-top: 1px solid rgba(232, 160, 32, 0.3);
  font-family: var(--lore-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-amber);
  text-transform: uppercase;
  grid-column: 1 / -1;
  text-align: center;
  font-feature-settings: "tnum";
  text-shadow: 0 0 16px rgba(232, 160, 32, 0.4);
}

.lore-scan-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(0, 200, 180, 0.22) 48%,
    rgba(0, 200, 180, 0.45) 50%,
    rgba(0, 200, 180, 0.22) 52%,
    transparent 100%);
  opacity: 0;
}
.lore-scan-panel.is-scanning .lore-scan-sweep {
  opacity: 1;
  animation: lore-scan-down 2.2s ease-out;
}
@keyframes lore-scan-down {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.lore-scan-btn {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding: 14px 32px;
  border: 1px solid var(--lore-teal);
  background: rgba(0, 200, 180, 0.06);
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: background 0.3s, box-shadow 0.3s, transform 0.18s;
}
.lore-scan-btn::before,
.lore-scan-btn::after {
  content: "";
  width: 8px; height: 8px;
  border: 1px solid var(--lore-teal);
}
.lore-scan-btn::before { border-right: 0; border-bottom: 0; }
.lore-scan-btn::after  { border-left: 0; border-top: 0; }
.lore-scan-btn:hover {
  background: rgba(0, 200, 180, 0.14);
  box-shadow: 0 0 28px rgba(0, 200, 180, 0.35);
}
.lore-scan-btn:active { transform: scale(0.97); }
.lore-scan-btn[disabled] { opacity: 0.85; cursor: progress; }
.lore-scan-btn.is-locked,
.lore-scan-btn[hidden] { display: none !important; }
.lore-scan-btn--reset { border-color: rgba(232, 160, 32, 0.55); color: var(--lore-amber); }
.lore-scan-btn--reset .lore-scan-btn-dot { background: var(--lore-amber); box-shadow: 0 0 10px var(--lore-amber); }
.lore-scan-btn--reset::before, .lore-scan-btn--reset::after { border-color: var(--lore-amber); }
.lore-scan-btn--reset:hover { background: rgba(232, 160, 32, 0.1); box-shadow: 0 0 22px rgba(232, 160, 32, 0.35); }
.lore-scan-btn .lore-scan-btn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lore-teal);
  box-shadow: 0 0 10px var(--lore-teal);
  animation: lore-pulse-strong 1.4s ease-in-out infinite;
}

/* ─── Chapter 02 — The Covenants ───────────────────────────── */
.lore-arks {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 80px;
  align-items: center;
}
.lore-arks-svg {
  position: relative;
  aspect-ratio: 1000 / 440;
  width: 100%;
  padding: 24px;
  background:
    linear-gradient(to bottom, rgba(0,200,180,0.03), transparent 60%),
    rgba(2, 8, 11, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 200, 180, 0.18);
}
.lore-arks-svg::before,
.lore-arks-svg::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 1px solid var(--lore-teal);
  pointer-events: none;
}
.lore-arks-svg::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.lore-arks-svg::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.lore-arks-svg svg { width: 100%; height: auto; display: block; }

.lore-arks-body {
  font-family: var(--lore-serif);
  font-size: 22px;
  line-height: 1.65;
  font-weight: 300;
  color: var(--lore-ink-2);
  margin: 0;
  font-style: italic;
}
.lore-arks-body em {
  color: var(--lore-teal);
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 0 14px rgba(0, 200, 180, 0.3);
}
.lore-arks-tag {
  display: inline-block;
  margin-top: 28px;
  padding: 8px 16px;
  border: 1px solid rgba(0, 200, 180, 0.4);
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  text-transform: uppercase;
  background: rgba(0, 200, 180, 0.05);
}

.lore-arks-cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.lore-ark-card {
  position: relative;
  padding: 18px 18px 22px;
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 2px solid var(--lore-ark-c, var(--lore-teal));
  background: rgba(2, 10, 13, 0.65);
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.25s;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lore-ark-card:hover,
.lore-ark-card:focus-visible,
.lore-ark-card.is-focused {
  background: rgba(0, 200, 180, 0.06);
  border-color: rgba(0, 200, 180, 0.4);
  border-left-color: var(--lore-ark-c, var(--lore-teal));
  transform: translateY(-3px);
  outline: none;
}
.lore-ark-icon {
  width: 28px;
  margin-bottom: 6px;
  color: var(--lore-ark-c, var(--lore-teal));
  filter: drop-shadow(0 0 6px currentColor);
}
.lore-ark-card-num {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-ark-c, var(--lore-teal));
  text-transform: uppercase;
}
.lore-ark-card-name {
  font-family: var(--lore-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--lore-ink);
  margin: 0;
}
.lore-ark-card-hint {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--lore-ink-2);
  margin: 0;
  line-height: 1.4;
}
.lore-ark-card-cargo {
  font-family: var(--lore-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-ink-3);
  margin-top: 6px;
  text-transform: uppercase;
}

/* ─── Ark detail modal (Act II) ─────────────────────────────
   Plain fixed flex overlay. Centered both axes, no horizontal
   overflow. Game-UI feel: corner brackets with strong glow,
   subtle inner grid pattern, holographic accent line. */
.lore-ark-modal[hidden] { display: none; }
.lore-ark-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, 5vh) max(16px, 4vw);
  /* Crucial: prevent any child from forcing horizontal scroll. */
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.lore-ark-modal-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 30, 36, 0.6), rgba(2, 6, 9, 0.92)),
    rgba(2, 8, 11, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.lore-ark-modal.is-open .lore-ark-modal-scrim { opacity: 1; }

.lore-ark-modal-card {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: min(720px, calc(100vh - 80px));
  box-sizing: border-box;
  padding: 36px 40px 32px;
  background:
    /* faint diagonal grid - game UI feel */
    repeating-linear-gradient(45deg,
      rgba(0, 200, 180, 0.025) 0 1px,
      transparent 1px 36px),
    repeating-linear-gradient(-45deg,
      rgba(0, 200, 180, 0.025) 0 1px,
      transparent 1px 36px),
    /* subtle holographic ark-tint glow from upper-left */
    radial-gradient(ellipse 70% 70% at 0% 0%,
      color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 14%, transparent), transparent 60%),
    /* deep translucent body */
    linear-gradient(135deg, rgba(4, 14, 18, 0.62), rgba(2, 8, 11, 0.78));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--lore-ark-c, var(--lore-teal));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.6),
    0 0 80px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 25%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: scale(0.94) translateY(14px);
  transition: opacity 0.45s ease-out, transform 0.45s cubic-bezier(.2, .8, .2, 1);
}
.lore-ark-modal.is-open .lore-ark-modal-card {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.lore-ark-modal-card::before,
.lore-ark-modal-card::after {
  content: "";
  position: absolute;
  width: 28px; height: 28px;
  pointer-events: none;
}
.lore-ark-modal-card::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--lore-ark-c, var(--lore-teal));
  border-left: 1px solid var(--lore-ark-c, var(--lore-teal));
  box-shadow: 0 0 12px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 55%, transparent);
}
.lore-ark-modal-card::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--lore-ark-c, var(--lore-teal));
  border-right: 1px solid var(--lore-ark-c, var(--lore-teal));
  box-shadow: 0 0 12px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 55%, transparent);
}

.lore-ark-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 10, 14, 0.6);
  border: 1px solid color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 50%, transparent);
  color: var(--lore-ink);
  font-family: var(--lore-mono);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.18s;
}
.lore-ark-modal-close:hover,
.lore-ark-modal-close:focus-visible {
  color: var(--lore-ark-c, var(--lore-teal));
  border-color: var(--lore-ark-c, var(--lore-teal));
  background: color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 14%, rgba(2, 10, 14, 0.6));
  box-shadow: 0 0 18px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 60%, transparent);
  outline: none;
}
.lore-ark-modal-close:active { transform: scale(0.95); }

.lore-ark-modal-inner {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.lore-ark-modal-glyph {
  position: relative;
  min-width: 0;
}
.lore-ark-modal-glyph::before {
  /* HUD-style framing around the ark glyph */
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 35%, transparent);
  pointer-events: none;
}
.lore-ark-modal-glyph svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 65%, transparent));
}
.lore-ark-modal-text { min-width: 0; }
.lore-ark-modal-num {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--lore-ark-c, var(--lore-teal));
  text-transform: uppercase;
}
.lore-ark-modal-num::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--lore-ark-c, var(--lore-teal));
  box-shadow: 0 0 8px var(--lore-ark-c, var(--lore-teal));
}
.lore-ark-modal-name {
  font-family: var(--lore-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--lore-ink);
  margin: 10px 0 8px;
  line-height: 1.05;
  text-shadow: 0 0 22px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 45%, transparent);
  word-break: break-word;
}
.lore-ark-modal-tagline {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--lore-ark-c, var(--lore-teal));
  margin: 0 0 20px;
  word-break: break-word;
}
.lore-ark-modal-body {
  font-family: var(--lore-serif);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--lore-ink-2);
  margin: 0 0 22px;
  word-break: break-word;
}
.lore-ark-modal-cargo {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 28%, transparent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 22px;
  font-family: var(--lore-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
}
.lore-ark-modal-cargo li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.lore-ark-modal-cargo li::before {
  content: "▸";
  color: var(--lore-ark-c, var(--lore-teal));
  font-size: 12px;
}

@media (max-width: 720px) {
  .lore-ark-modal-card {
    padding: 28px 22px 24px;
    max-height: calc(100vh - 32px);
  }
  .lore-ark-modal-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .lore-ark-modal-glyph { max-width: 320px; margin: 0 auto; }
  .lore-ark-modal-cargo { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .lore-ark-modal-scrim,
  .lore-ark-modal-card { transition: none; }
}

/* ─── Chapter 03 — The Crossing ────────────────────────────── */
.lore-voyage {
  height: 100%;
  padding: 0;
}
.lore-voyage-body {
  max-width: 760px;
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.55;
  font-weight: 300;
  color: var(--lore-ink-2);
  margin: 0 0 40px;
}
.lore-voyage-body em {
  color: var(--lore-ink);
  font-style: italic;
  border-bottom: 1px dashed rgba(0, 200, 180, 0.45);
  padding-bottom: 1px;
}
/* Seamless: transparent flex-column stage so the page nebula + starfield
   show through. The WebGL flythrough fills the middle viewport; the holo-
   frame (.lore-voyage-frame) is the only chrome. The old opaque panel +
   backdrop-blur + corner brackets are gone. */
/* Full-viewport stage: the canvas IS the background; HUD overlays on top. */
.lore-voyage-stage {
  position: absolute;
  inset: 0;
  background: transparent;
  border: 0;
}
/* Header text reads over a live starfield now - give it a soft shadow. */
.lore-voyage-header { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }

/* HUD overlays the full-viewport canvas; only the interactive controls
   capture pointer events. */
.lore-voyage-hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.lore-voyage-header {
  position: absolute;
  top: clamp(72px, 12vh, 130px);
  left: clamp(16px, 4vw, 52px);
  right: clamp(16px, 4vw, 52px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.lore-voyage-controls {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(22px, 7vh, 60px);
  padding: 0 clamp(16px, 6vw, 110px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.lore-voyage-controls .lore-voyage-scrubber,
.lore-voyage-controls .lore-voyage-replay { pointer-events: auto; }
.lore-voyage-year {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
}
.lore-voyage-year-label { color: var(--lore-ink-3); }
.lore-voyage-year b {
  /* Use the mono font for the year so digits are fixed-width - prevents
     the "dirty" look where letters shift as the number grows. */
  font-family: var(--lore-mono);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--lore-teal);
  text-shadow: 0 0 16px rgba(0, 200, 180, 0.5);
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums;
  min-width: 150px;
  display: inline-block;
  text-align: left;
}
.lore-voyage-year-unit {
  font-family: var(--lore-mono);
  font-size: 10px;
  color: var(--lore-ink-3);
  letter-spacing: 0.32em;
}
.lore-voyage-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--lore-ink-2);
}
.lore-voyage-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lore-teal);
  box-shadow: 0 0 10px currentColor;
  animation: lore-pulse-strong 2s ease-in-out infinite;
}
.lore-voyage-stage.is-arrived .lore-voyage-status-dot { background: var(--lore-amber); color: var(--lore-amber); }
.lore-voyage-stage.is-arrived .lore-voyage-status { color: var(--lore-amber); }
.lore-voyage-stage.is-arrived .lore-voyage-year b { color: var(--lore-amber); text-shadow: 0 0 16px rgba(232, 160, 32, 0.5); }

.lore-voyage-viewport { display: contents; }   /* legacy node unused in the full-viewport layout */
.lore-voyage-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
/* Understated holo-frame over the canvas: four corner ticks + a faint
   pulsing border. */
/* No border frame: the canvas blends directly into the page background. */
.lore-voyage-frame { display: none; }
.lore-voyage-frame--unused { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.lore-voyage-frame::before {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid rgba(0, 200, 180, 0.14);
  animation: lore-voyage-frame-pulse 6s ease-in-out infinite;
}
@keyframes lore-voyage-frame-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.lore-voyage-frame-tick {
  position: absolute; width: 18px; height: 18px;
  border: 1px solid rgba(0, 200, 180, 0.55);
}
.lore-voyage-frame-tick--tl { top: 6px;    left: 6px;  border-right: 0; border-bottom: 0; }
.lore-voyage-frame-tick--tr { top: 6px;    right: 6px; border-left: 0;  border-bottom: 0; }
.lore-voyage-frame-tick--bl { bottom: 6px; left: 6px;  border-right: 0; border-top: 0; }
.lore-voyage-frame-tick--br { bottom: 6px; right: 6px; border-left: 0;  border-top: 0; }
@media (prefers-reduced-motion: reduce) { .lore-voyage-frame::before { animation: none; } }
.lore-voyage-stars {
  position: absolute; inset: 0;
  pointer-events: none;
  will-change: transform;
}
.lore-voyage-stars i {
  position: absolute;
  width: 2px; height: 2px;
  background: #cfe9e3;
  border-radius: 50%;
  will-change: transform;
}
.lore-voyage-stars--far i  { width: 1px; height: 1px; opacity: 0.45; }
.lore-voyage-stars--mid i  { opacity: 0.7; }
.lore-voyage-stars--near i { width: 2.5px; height: 2.5px; opacity: 0.95; animation: lore-twinkle 4s ease-in-out infinite; }
@keyframes lore-twinkle {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 0.35; }
}

/* Speed streaks - horizontal warp lines emitted while user drags
   or autoplay accelerates. */
.lore-voyage-streaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.lore-voyage-streak {
  position: absolute;
  height: 1px;
  right: -220px;
  background: linear-gradient(to left, rgba(207, 233, 227, 0.85), rgba(207, 233, 227, 0));
  animation: lore-voyage-streak 0.6s linear forwards;
  will-change: transform, opacity;
}
@keyframes lore-voyage-streak {
  0%   { transform: translateX(0);    opacity: 0; }
  10%  {                              opacity: 1; }
  100% { transform: translateX(-1400px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lore-voyage-streaks { display: none; }
}

.lore-voyage-horizon {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 50%;
  background:
    radial-gradient(ellipse 80% 80% at 100% 50%, rgba(0, 200, 180, 0.22), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.lore-voyage-stage.is-arrived .lore-voyage-horizon { opacity: 1; }

.lore-voyage-ark {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  /* Anchor the ark icon at its left/middle so the tag stays inside the
     viewport even when the ark is near the right edge.

     CRITICAL: no transition on `left`. rAF drives `left` 60×/sec; a
     50ms CSS transition would constantly chase those updates and
     re-snap the position - that's what made the ark look like it was
     "rolling back" each frame. Let rAF be the source of truth. */
  transform: translate(-12px, -50%);
  pointer-events: none;
  will-change: left;
}
.lore-voyage-ark-trail {
  position: absolute;
  right: 8px; top: 50%;
  width: 80px; height: 1px;
  background: linear-gradient(to left, var(--lore-ark-c, var(--lore-teal)), transparent);
  opacity: 0.7;
  transform: translateY(-50%);
}
.lore-voyage-ark-icon {
  width: 18px;
  color: var(--lore-ark-c, var(--lore-teal));
  filter: drop-shadow(0 0 5px currentColor);
}
.lore-voyage-ark-tag {
  font-family: var(--lore-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--lore-ark-c, var(--lore-teal));
  background: rgba(2, 8, 11, 0.85);
  padding: 2px 6px;
  border: 1px solid var(--lore-ark-c, var(--lore-teal));
  text-transform: uppercase;
}

.lore-voyage-pulse {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-amber);
  text-transform: uppercase;
}
.lore-voyage-pulse i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lore-amber);
  box-shadow: var(--lore-amber-glow);
  animation: lore-pulse-strong 1.4s ease-in-out infinite;
}
.lore-voyage-pulse em {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--lore-ink-2);
  text-transform: none;
}

.lore-voyage-scrubber {
  position: relative;
  height: 56px;
  padding: 18px 8px 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.lore-voyage-scrubber-track {
  position: relative;
  height: 2px;
  background: rgba(0, 200, 180, 0.16);
}
.lore-voyage-scrubber-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--lore-teal);
  box-shadow: 0 0 8px var(--lore-teal);
  width: 0%;
}
.lore-voyage-scrubber-thumb {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border: 1.5px solid var(--lore-teal);
  background: rgba(0, 200, 180, 0.18);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 14px rgba(0, 200, 180, 0.6);
  cursor: grab;
  transition: box-shadow 0.2s;
}
.lore-voyage-scrubber.is-dragging .lore-voyage-scrubber-thumb {
  cursor: grabbing;
  box-shadow: 0 0 22px rgba(0, 200, 180, 0.85);
}
.lore-voyage-scrubber-thumb:focus-visible {
  outline: 2px solid var(--lore-teal-bright);
  outline-offset: 4px;
}

.lore-voyage-marks {
  position: relative;
  height: 38px;
  margin-top: 8px;
}
.lore-voyage-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  transition: color 0.4s;
}
.lore-voyage-mark i {
  width: 1px; height: 10px;
  background: rgba(0, 200, 180, 0.3);
  margin-bottom: 6px;
  transition: background 0.4s;
}
.lore-voyage-mark.is-past { color: var(--lore-teal); }
.lore-voyage-mark.is-past i { background: var(--lore-teal); box-shadow: 0 0 6px var(--lore-teal); }

.lore-voyage-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}
.lore-voyage-foot-note {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
}
.lore-voyage-replay {
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--lore-teal);
  background: transparent;
  border: 1px solid rgba(0, 200, 180, 0.4);
  padding: 9px 16px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.lore-voyage-replay:hover {
  background: rgba(0, 200, 180, 0.1);
  border-color: var(--lore-teal);
  box-shadow: 0 0 14px rgba(0, 200, 180, 0.3);
}

/* ─── Chapter 04 — Revelations ─────────────────────────────── */
.lore-revelations-lead {
  font-family: var(--lore-epic);
  font-style: italic;
  font-size: 32px;
  font-weight: 500;
  color: var(--lore-ink);
  letter-spacing: 0.01em;
  max-width: 820px;
  line-height: 1.42;
  margin: 24px 0 56px;
  text-shadow: 0 0 32px rgba(0, 200, 180, 0.18);
}
.lore-revelations-lead em {
  color: var(--lore-amber);
  font-style: italic;
  text-shadow: 0 0 24px rgba(232, 160, 32, 0.45);
}
.lore-revelations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.lore-revelation {
  position: relative;
  padding: 32px 28px;
  border: 1px solid rgba(0, 200, 180, 0.18);
  background:
    linear-gradient(to bottom, rgba(0, 200, 180, 0.05), transparent 70%),
    rgba(2, 10, 13, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: border-color 0.4s, background 0.4s, transform 0.4s, box-shadow 0.4s;
}
.lore-revelation::before,
.lore-revelation::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
}
.lore-revelation::before { top: -1px; left: -1px; border-top: 1px solid var(--lore-teal); border-left: 1px solid var(--lore-teal); }
.lore-revelation::after  { bottom: -1px; right: -1px; border-bottom: 1px solid var(--lore-teal); border-right: 1px solid var(--lore-teal); }
.lore-revelation:hover {
  border-color: rgba(0, 200, 180, 0.5);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 200, 180, 0.15);
  background:
    linear-gradient(to bottom, rgba(0, 200, 180, 0.12), transparent 70%),
    rgba(2, 10, 13, 0.8);
}
.lore-revelation-num {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.lore-revelation-glyph {
  width: 40px; height: 40px;
  margin-bottom: 20px;
  color: var(--lore-teal);
  filter: drop-shadow(0 0 8px rgba(0, 200, 180, 0.4));
}
.lore-revelation-h {
  font-family: var(--lore-epic);
  font-size: 34px;
  font-weight: 600;
  color: var(--lore-teal);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 18px rgba(0, 200, 180, 0.4);
}
.lore-revelation-p {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 300;
  color: var(--lore-ink-2);
  margin: 0;
  line-height: 1.5;
}
.lore-revelation-p em {
  color: var(--lore-amber);
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 0 14px rgba(232, 160, 32, 0.4);
}

/* ─── Chapter 05 — The Reach (game-style, Three.js-driven) ─── */
.lore-reach {
  position: relative;
  padding: 64px 0 80px;
}

/* The interactive stage - hosts the Three.js canvas + overlays. */
.lore-reach-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  max-width: 1080px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0, 30, 36, 0.4), rgba(2, 6, 9, 0.85)),
    rgba(2, 8, 11, 0.6);
  border: 1px solid rgba(0, 200, 180, 0.25);
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 200, 180, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.lore-reach-stage::before,
.lore-reach-stage::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
  z-index: 5;
}
.lore-reach-stage::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--lore-teal);
  border-left: 1px solid var(--lore-teal);
  box-shadow: 0 0 8px rgba(0, 200, 180, 0.4);
}
.lore-reach-stage::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--lore-teal);
  border-right: 1px solid var(--lore-teal);
  box-shadow: 0 0 8px rgba(0, 200, 180, 0.4);
}

.lore-reach-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;        /* ensure non-zero layout even if aspect-ratio is unreliable */
  cursor: default;
  /* Fallback CSS look while Three.js boots / if WebGL fails entirely -
     the user still sees a hint of a galaxy rather than a black box. */
  background:
    radial-gradient(ellipse 35% 45% at 50% 50%, rgba(255, 220, 150, 0.30), transparent 65%),
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(40, 90, 140, 0.22), transparent 70%),
    #02080f;
}

/* Top chrome: breadcrumb + zoom label. */
.lore-reach-chrome {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 4;
  text-shadow: 0 0 6px rgba(0, 200, 180, 0.5);
}

/* Hover tooltip - positioned by JS via 3D->screen projection. */
/* Ark destination labels - HTML overlay on top of the Three.js canvas.
   Native browser text rendering = pixel-perfect crisp text. Positioned
   per-frame by scene-reach.js via 3D->screen projection of the
   anchor's world position. */
.lore-ark-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}
.lore-ark-label {
  position: absolute;
  left: 0; top: 0;
  transform: translate(var(--ark-x, 0px), var(--ark-y, 0px));
  /* Promote to its own GPU layer so the per-frame sub-pixel reposition
     while the galaxy rotates is smooth, AND the text stays crisp (the
     layer is rasterised once, then just translated). */
  will-change: transform;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Half card width (65) centers it horizontally on the anchor. */
  margin-left: -65px;
  margin-top: -4px;
}
.lore-ark-label[hidden] { display: none; }
.lore-ark-label[data-ark-side="above"] {
  flex-direction: column-reverse;
  margin-top: 0;
  transform: translate(var(--ark-x, 0px), var(--ark-y, 0px)) translateY(-100%);
}

/* Destination dot. All ark markers in the galaxy view use the same
   cyan/teal so they read as a uniform "marker" UI element. The per-
   ark accent colors are reserved for the solar-system view. */
.lore-ark-label-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--lore-teal);
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.5),
    0 0 10px var(--lore-teal),
    0 0 22px color-mix(in srgb, var(--lore-teal) 50%, transparent);
  animation: lore-ark-label-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lore-ark-label-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.85; }
}

/* Leader line. */
.lore-ark-label-leader {
  width: 1.5px;
  height: 22px;
  background: linear-gradient(
    to bottom,
    var(--lore-teal) 0%,
    color-mix(in srgb, var(--lore-teal) 50%, transparent) 100%
  );
  flex-shrink: 0;
}
.lore-ark-label[data-ark-side="above"] .lore-ark-label-leader {
  background: linear-gradient(
    to top,
    var(--lore-teal) 0%,
    color-mix(in srgb, var(--lore-teal) 50%, transparent) 100%
  );
}

/* The card - eyebrow + name, compact. Cyan/teal throughout. */
.lore-ark-label-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  padding: 8px 12px 9px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--lore-teal) 16%, transparent) 0%,
      transparent 60%),
    rgba(2, 8, 11, 0.94);
  border: 1px solid var(--lore-teal);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 4px 18px rgba(0, 0, 0, 0.7),
    0 0 18px color-mix(in srgb, var(--lore-teal) 32%, transparent);
  text-align: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.lore-ark-label-card::before,
.lore-ark-label-card::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  pointer-events: none;
}
.lore-ark-label-card::before {
  top: -1px; left: -1px;
  border-top: 1.5px solid var(--lore-teal);
  border-left: 1.5px solid var(--lore-teal);
}
.lore-ark-label-card::after {
  bottom: -1px; right: -1px;
  border-bottom: 1.5px solid var(--lore-teal);
  border-right: 1.5px solid var(--lore-teal);
}
.lore-ark-label:hover .lore-ark-label-card,
.lore-ark-label:focus-visible .lore-ark-label-card {
  transform: scale(1.05);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 6px 24px rgba(0, 0, 0, 0.85),
    0 0 28px color-mix(in srgb, var(--lore-teal) 55%, transparent);
}
.lore-ark-label:focus-visible { outline: none; }

/* Eyebrow ("Ark I") - small mono, uppercase, teal.
   font-weight 400 (NOT 600) because Share Tech Mono is single-weight;
   asking for 600 makes the browser synthesize bold which renders blurry. */
.lore-ark-label-eyebrow {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--lore-teal);
  margin-bottom: 4px;
  line-height: 1;
}
/* Name ("Ouranion") - Audiowide, single weight 400, proper case. */
.lore-ark-label-name {
  font-family: var(--lore-display);
  font-size: clamp(14px, 2.6vw, 17px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--lore-ink, #ffffff);
  line-height: 1.05;
}

.lore-reach-tooltip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: rgba(2, 10, 14, 0.92);
  border: 1px solid rgba(0, 200, 180, 0.45);
  padding: 10px 14px 12px;
  min-width: 180px;
  max-width: 280px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 24px rgba(0, 200, 180, 0.2);
}
.lore-reach-tooltip[hidden] { display: none; }
.lore-reach-tooltip-eyebrow {
  font-family: var(--lore-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: var(--lore-teal);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lore-reach-tooltip-name {
  font-family: var(--lore-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--lore-ink);
  margin-bottom: 4px;
}
.lore-reach-tooltip-meta {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--lore-ink-2);
  line-height: 1.35;
}

/* ── Render-quality selector (Auto / Low / Medium / High) ──────────────
   Bottom-left of the galaxy scene. Hoisted to #lore-app, so it positions
   against the viewport and escapes the layer's bottom mask. Lets the player
   override the auto-detected tier (phones now default to Medium); the choice
   persists in localStorage and re-mounts the scene to apply it. */
.lore-reach-quality {
  position: absolute;
  left: 16px; bottom: 16px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  font-family: var(--lore-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lore-ink-3);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}
.lore-reach-quality-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--lore-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--lore-teal);
  background-color: rgba(2, 10, 14, 0.82);
  border: 1px solid rgba(0, 200, 180, 0.4);
  border-radius: 2px;
  padding: 6px 28px 6px 12px;
  cursor: pointer;
  /* CSS-drawn chevron (no asset) */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--lore-teal) 50%),
    linear-gradient(135deg, var(--lore-teal) 50%, transparent 50%);
  background-position: right 13px center, right 8px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.lore-reach-quality-select:hover,
.lore-reach-quality-select:focus-visible {
  border-color: var(--lore-teal);
  box-shadow: 0 0 12px rgba(0, 200, 180, 0.3);
  outline: none;
}
.lore-reach-quality-select option {
  background: #061015;
  color: var(--lore-ink);
}

/* Back button. */
.lore-reach-back {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(2, 10, 14, 0.78);
  border: 1px solid rgba(0, 200, 180, 0.45);
  color: var(--lore-ink);
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 4;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: color 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.lore-reach-back[hidden] { display: none; }
.lore-reach-back:hover,
.lore-reach-back:focus-visible {
  color: var(--lore-teal-bright);
  border-color: var(--lore-teal);
  background: rgba(0, 200, 180, 0.12);
  box-shadow: 0 0 14px rgba(0, 200, 180, 0.4);
  outline: none;
}

/* Caption beneath stage - state-aware hint. */
.lore-reach-caption {
  margin: 20px auto 0;
  max-width: 720px;
  text-align: center;
  font-family: var(--lore-serif);
  font-size: 14px;
  color: var(--lore-ink-3);
  font-style: italic;
}

/* Planet lore card - opens when user clicks a planet in solar view. */
.lore-reach-card[hidden] { display: none; }
.lore-reach-card {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  max-width: 520px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(45deg, rgba(0, 200, 180, 0.025) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, rgba(4, 14, 18, 0.78), rgba(2, 8, 11, 0.92));
  border: 1px solid var(--lore-ark-c, var(--lore-teal));
  padding: 20px 22px;
  z-index: 7;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 0 40px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease-out, transform 0.35s cubic-bezier(.2, .8, .2, 1);
}
.lore-reach-card.is-open {
  opacity: 1;
  transform: translateY(0);
}
.lore-reach-card::before,
.lore-reach-card::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
}
.lore-reach-card::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--lore-ark-c, var(--lore-teal));
  border-left: 1px solid var(--lore-ark-c, var(--lore-teal));
}
.lore-reach-card::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--lore-ark-c, var(--lore-teal));
  border-right: 1px solid var(--lore-ark-c, var(--lore-teal));
}
.lore-reach-card-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 10, 14, 0.7);
  border: 1px solid rgba(0, 200, 180, 0.4);
  color: var(--lore-ink);
  font-family: var(--lore-mono);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.lore-reach-card-close:hover {
  color: var(--lore-ark-c, var(--lore-teal));
  border-color: var(--lore-ark-c, var(--lore-teal));
  background: rgba(0, 200, 180, 0.1);
}
.lore-reach-card-inner {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}
.lore-reach-card-glyph {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lore-reach-card-glyph img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lore-reach-card-text { min-width: 0; }
.lore-reach-card-eyebrow {
  font-family: var(--lore-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.36em;
  color: var(--lore-ark-c, var(--lore-teal));
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lore-reach-card-name {
  font-family: var(--lore-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--lore-ink);
  margin: 0 0 4px;
  text-shadow: 0 0 14px color-mix(in srgb, var(--lore-ark-c, var(--lore-teal)) 35%, transparent);
}
.lore-reach-card-type {
  font-family: var(--lore-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--lore-ink-3);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.lore-reach-card-blurb {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--lore-ink-2);
  margin: 0;
}

@media (max-width: 720px) {
  .lore-reach-stage { aspect-ratio: 4 / 5; }
  .lore-reach-card-inner { grid-template-columns: 1fr; gap: 12px; }
  .lore-reach-card-glyph { width: 72px; height: 72px; margin: 0 auto; }
}

/* Asset placeholder fallback styles (Phase B - until real PNGs land).
   The .is-placeholder class is added by controller.js when an
   <img.lore-asset-fallback> fails to load. CSP-safe (no inline JS). */
.lore-asset-fallback.is-placeholder {
  display: inline-block;
  background:
    repeating-linear-gradient(45deg, rgba(0,200,180,0.05) 0 6px, transparent 6px 12px),
    rgba(2, 8, 11, 0.6);
  border: 1px dashed rgba(0, 200, 180, 0.35);
}
.lore-ark-icon-img {
  width: 36px;
  height: auto;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px var(--lore-ark-c, var(--lore-teal)));
}
.lore-ark-icon-img.is-placeholder {
  width: 36px; height: 18px;
}
.lore-voyage-ark-img {
  width: 28px;
  height: auto;
  filter: drop-shadow(0 0 6px var(--lore-ark-c, var(--lore-teal)));
}
.lore-voyage-ark-img.is-placeholder {
  width: 28px; height: 14px;
}

/* ─── Chapter 06 — Contenders ──────────────────────────────── */
.lore-contenders {
  padding: 96px 0 80px;
  text-align: center;
}
.lore-contenders-lead {
  font-family: var(--lore-epic);
  font-weight: 500;
  font-size: 40px;
  letter-spacing: 0.02em;
  color: var(--lore-ink);
  margin: 0 0 64px;
  line-height: 1.25;
  text-shadow: 0 0 24px rgba(0, 200, 180, 0.18);
}
.lore-contenders-lead em {
  color: var(--lore-amber);
  font-style: italic;
  text-shadow: 0 0 32px rgba(232, 160, 32, 0.5);
}
.lore-contenders-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
}
.lore-contender {
  position: relative;
  padding: 32px 20px 28px;
  border: 1px solid rgba(0, 200, 180, 0.2);
  background:
    linear-gradient(to bottom, rgba(0, 200, 180, 0.05), transparent 70%),
    rgba(2, 10, 13, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: border-color 0.4s, background 0.4s, transform 0.4s, box-shadow 0.4s;
  cursor: default;
}
.lore-contender::before,
.lore-contender::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
}
.lore-contender::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--lore-faction-c, var(--lore-teal));
  border-left: 1px solid var(--lore-faction-c, var(--lore-teal));
}
.lore-contender::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--lore-faction-c, var(--lore-teal));
  border-right: 1px solid var(--lore-faction-c, var(--lore-teal));
}
.lore-contender:hover {
  border-color: rgba(0, 200, 180, 0.55);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 200, 180, 0.18);
  background:
    linear-gradient(to bottom, rgba(0, 200, 180, 0.12), transparent 70%),
    rgba(2, 10, 13, 0.8);
}
.lore-contender--wait { --lore-faction-c: var(--lore-amber); }
.lore-contender--wait:hover {
  border-color: rgba(232, 160, 32, 0.6);
  background:
    linear-gradient(to bottom, rgba(232, 160, 32, 0.1), transparent 70%),
    rgba(2, 10, 13, 0.8);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(232, 160, 32, 0.18);
}

.lore-contender-num {
  font-family: var(--lore-epic);
  font-size: 48px;
  font-weight: 700;
  color: var(--lore-faction-c, var(--lore-teal));
  letter-spacing: 0.08em;
  margin: 0 0 16px;
  line-height: 1;
  text-shadow: 0 0 18px currentColor;
}
.lore-contender-sigil {
  width: 72px; height: 100px;
  margin: 0 auto 18px;
  border: 1px dashed rgba(0, 200, 180, 0.35);
  /* Sigil image is the top layer; the stripe pattern only shows in the
     gaps (letterbox margins on off-aspect images, or the whole slot when
     the URL 404s and `--lore-sigil` resolves to `none`). */
  background:
    var(--lore-sigil, none) center / contain no-repeat,
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 200, 180, 0.07) 6px 7px);
}
.lore-contender--wait .lore-contender-sigil {
  border-color: rgba(232, 160, 32, 0.4);
  background:
    var(--lore-sigil, none) center / contain no-repeat,
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(232, 160, 32, 0.08) 6px 7px);
}
.lore-contender-label {
  font-family: var(--lore-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--lore-teal);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.lore-contender--wait .lore-contender-label { color: var(--lore-amber); }
.lore-contender-hint {
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--lore-ink-2);
  margin: 0;
  line-height: 1.4;
  opacity: 0.7;
  transition: opacity 0.3s, color 0.3s;
  min-height: 42px;
}
.lore-contender:hover .lore-contender-hint { opacity: 1; color: var(--lore-ink); }
.lore-contender--wait .lore-contender-hint { color: var(--lore-amber); opacity: 0.8; }

.lore-contender:nth-child(1) { --lore-sigil: var(--lore-sigil-i, none); }
.lore-contender:nth-child(2) { --lore-sigil: var(--lore-sigil-ii, none); }
.lore-contender:nth-child(3) { --lore-sigil: var(--lore-sigil-iii, none); }
.lore-contender:nth-child(4) { --lore-sigil: var(--lore-sigil-iv, none); }

/* ─── Archive decryption roadmap ───────────────────────────── */
.lore-archive {
  margin-top: 96px;
  padding: 56px 0 64px;
  border-top: 1px solid rgba(0, 200, 180, 0.18);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.lore-archive-head {
  font-family: var(--lore-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: var(--lore-teal);
  text-transform: uppercase;
  margin: 0 0 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.lore-archive-head::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--lore-teal);
  box-shadow: 0 0 6px var(--lore-teal);
}
.lore-archive-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(0, 200, 180, 0.4), transparent);
}

.lore-archive-entry {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0, 200, 180, 0.08);
  font-family: var(--lore-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--lore-ink-2);
  text-transform: uppercase;
}
.lore-archive-entry-id {
  font-family: var(--lore-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.14em;
  color: var(--lore-teal);
  text-shadow: 0 0 12px rgba(0, 200, 180, 0.3);
}
.lore-archive-entry-bar {
  position: relative;
  height: 8px;
  background: rgba(0, 200, 180, 0.08);
  border: 1px solid rgba(0, 200, 180, 0.22);
}
.lore-archive-entry-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(to right, rgba(0, 200, 180, 0.85), rgba(0, 200, 180, 0.4));
  box-shadow: 0 0 6px rgba(0, 200, 180, 0.5);
  width: var(--decode, 0%);
  animation: lore-archive-bar 6s ease-in-out infinite;
}
@keyframes lore-archive-bar {
  0%, 100% { width: var(--decode, 0%); }
  50%      { width: calc(var(--decode, 0%) + 3%); }
}
.lore-archive-entry-status {
  color: var(--lore-amber);
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: 0.28em;
}
.lore-archive-entry-note {
  grid-column: 1 / -1;
  font-family: var(--lore-serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--lore-ink-3);
  margin-top: -10px;
  padding-bottom: 6px;
}

/* ─── Keyframes ─────────────────────────────────────────────── */
@keyframes lore-pulse-strong {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.82); }
}
@keyframes lore-orbit {
  to { transform: rotate(360deg); }
}

/* ─── Responsive ────────────────────────────────────────────── */
/* The chapter rail needs ~120px of breathing room on the left.
   Below 1240 it starts crowding the content - hide it outright at
   that point rather than letting it overlap labels. The mobile
   simulator complaint was rooted here. */
@media (max-width: 1240px) {
  .lore-rail { display: none; }
}
@media (max-width: 980px) {
  .lore-main { padding: 40px 32px 64px; }
  .lore-fall { grid-template-columns: 1fr; gap: 48px; }
  .lore-arks { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 768px) {
  .lore-main { padding: 32px 22px 56px; }
  .lore-chapter { padding: 64px 0; }
  .lore-impact { font-size: 38px; }
  .lore-fall-text { font-size: 30px; }
  .lore-arks-body { font-size: 19px; }
  .lore-arks-cards { grid-template-columns: 1fr; }
  .lore-scan-panel { grid-template-columns: repeat(2, 1fr); padding: 20px; }
  .lore-scan-value { font-size: 16px; }
  .lore-scan-countdown { font-size: 14px; padding: 14px 18px; }
  .lore-voyage-viewport { height: 180px; }
  .lore-voyage-year b { font-size: 24px; min-width: 88px; }
  .lore-voyage-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .lore-revelations { grid-template-columns: 1fr; gap: 16px; }
  .lore-revelations-lead { font-size: 22px; }
  .lore-revelation-h { font-size: 28px; }
  .lore-reach-name { font-size: 44px; letter-spacing: 0.12em; }
  .lore-reach-pre { font-size: 14px; }
  .lore-contenders { padding: 64px 0; }
  .lore-contenders-lead { font-size: 26px; margin-bottom: 40px; }
  .lore-contenders-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lore-contender-num { font-size: 36px; }
  .lore-archive-entry { grid-template-columns: 110px 1fr; }
  .lore-archive-entry-status { display: none; }
  .lore-archive-entry-note { font-size: 12px; }
}

/* ─── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lore-page *,
  .lore-page *::before,
  .lore-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .lore-reveal,
  .lore-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .lore-scan-sweep, .lore-planet-sweep { display: none; }
}
