/**
 * Archive / cryptic folio overlay — aged ink, sealed tomes, occult marginalia.
 * Loaded after main.css.
 */

:root {
  --bg: #0c0a08;
  --bg-paper: #1a1610;
  --mesh-1: #2a2218;
  --mesh-2: #1f1814;
  --mesh-3: #2e1810;
  --text: #d4c4a8;
  --text-dim: #7a6f5c;
  --text-faded: #4a4238;
  --ink: #2a1f14;
  --accent: #c9a227;
  --accent-dim: #8b6914;
  --blood: #6b2830;
  --glow-teal: #4a6b5a;
  --glow-coral: #8b4a32;
  --glow-purple: #5c4a6b;
  --glow-amber: #c9a227;
  --glow-blue: #4a5a6b;
  --glow-red: #8b3038;
  --parchment: #2a241c;
  --parchment-edge: #3d3428;
  --wax: #6b2028;
}

body {
  font-family: 'IM Fell English', 'EB Garamond', 'Palatino Linotype', Georgia, serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 162, 39, 0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

body.myth-mode {
  --accent: #9a4a52;
  --mesh-1: #1a1010;
  --mesh-2: #140c0c;
  --mesh-3: #2a1010;
}

/* Paper grain + candle vignette */
.scanlines {
  opacity: 0;
}
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.vignette {
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 0%, rgba(8, 6, 4, 0.5) 70%),
    radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.92) 100%);
}
.ink-stain {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.12;
  filter: blur(40px);
}
.ink-stain-1 { top: 10%; left: -5%; background: #2a1810; }
.ink-stain-2 { bottom: 15%; right: -8%; background: #1a1018; width: 320px; height: 320px; }

/* Archive frame corners */
.archive-frame {
  position: fixed;
  inset: 12px;
  z-index: 5;
  pointer-events: none;
  border: 1px solid rgba(201, 162, 39, 0.12);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
}
.archive-frame::before,
.archive-frame::after {
  content: '◆ ─── ◆ ─── ◆ ─── ◆ ─── ◆ ─── ◆ ─── ◆';
  position: absolute;
  left: 0;
  right: 0;
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 0.35em;
  color: rgba(201, 162, 39, 0.2);
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}
.archive-frame::before { top: -4px; }
.archive-frame::after { bottom: -4px; }

.corner-rune {
  position: fixed;
  z-index: 6;
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(18px, 3vw, 28px);
  color: rgba(201, 162, 39, 0.15);
  pointer-events: none;
  line-height: 1;
}
.corner-rune.tl { top: 20px; left: 20px; }
.corner-rune.tr { top: 20px; right: 20px; }
.corner-rune.bl { bottom: 20px; left: 20px; }
.corner-rune.br { bottom: 20px; right: 20px; }

#aurora-canvas,
#bg-canvas,
#hero-canvas,
#myth-canvas,
#burst-canvas {
  pointer-events: none;
  contain: strict;
}
#aurora-canvas { opacity: 0.18; filter: sepia(0.6) brightness(0.85); }
#bg-canvas, #hero-canvas { opacity: 0.55; filter: sepia(0.45); }

body.perf-lite #ambient-mesh,
body.fx-disabled #ambient-mesh {
  display: none;
}
body.perf-lite .paper-grain {
  opacity: 0.25;
}
body.perf-lite .floating-glyph {
  animation-duration: 18s !important;
}
body.fx-disabled canvas[id$='-canvas'] {
  visibility: hidden;
}
#ambient-mesh {
  background:
    radial-gradient(ellipse 60% 50% at var(--cursor-x) var(--cursor-y), rgba(201, 162, 39, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 15% 90%, rgba(42, 34, 24, 0.9) 0%, transparent 45%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(31, 24, 20, 0.85) 0%, transparent 40%);
  animation: meshDrift 28s ease-in-out infinite alternate;
}

.scroll-progress {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), var(--accent), var(--accent-dim), transparent);
  box-shadow: none;
}

.cursor-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(201, 162, 39, 0.5);
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.cursor-ring {
  border-color: rgba(201, 162, 39, 0.35);
  border-radius: 2px;
}
body.myth-mode .cursor-dot { background: var(--blood); box-shadow: 0 0 6px rgba(139, 48, 56, 0.5); }
body.myth-mode .cursor-ring { border-color: rgba(139, 48, 56, 0.4); }

/* Hero — sealed folio */
.end-portal {
  display: block !important;
  opacity: 0.12;
  filter: sepia(0.85) brightness(0.7);
  transform: scale(0.85);
}
.end-portal .portal-core {
  background: radial-gradient(circle, rgba(201, 162, 39, 0.25), transparent 70%) !important;
  box-shadow: none !important;
}
.end-portal .portal-ring {
  border-color: rgba(201, 162, 39, 0.15) !important;
}

.archive-sigil {
  position: absolute;
  width: min(380px, 80vw);
  height: min(380px, 80vw);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.22;
  pointer-events: none;
}
.archive-sigil svg {
  width: 100%;
  height: 100%;
  animation: sigilBreath 8s ease-in-out infinite;
}
@keyframes sigilBreath {
  0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 20px rgba(201, 162, 39, 0.15)); }
  50% { opacity: 1; filter: drop-shadow(0 0 35px rgba(201, 162, 39, 0.25)); }
}

.classified-stamp {
  position: absolute;
  top: 18%;
  right: 12%;
  font-family: 'Special Elite', 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(107, 40, 48, 0.55);
  border: 3px double rgba(107, 40, 48, 0.45);
  padding: 8px 14px;
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 3;
  text-transform: uppercase;
}
body.myth-mode .classified-stamp {
  color: rgba(139, 48, 56, 0.7);
  border-color: rgba(139, 48, 56, 0.5);
  content: none;
}

.voxel, .floating-glyph {
  font-family: 'Cinzel Decorative', serif;
  font-size: 14px;
  color: rgba(201, 162, 39, 0.12);
  background: none;
  border: none;
  box-shadow: none;
  width: auto;
  height: auto;
  animation: glyphDrift 12s ease-in-out infinite;
}
@keyframes glyphDrift {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.08; }
  50% { transform: translateY(-16px) rotate(8deg); opacity: 0.18; }
}

.hero-badge {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--accent-dim);
  border: 1px solid rgba(201, 162, 39, 0.25);
  background: rgba(26, 22, 16, 0.6);
  box-shadow: none;
  animation: none;
}
.hero-badge::before,
.hero-badge::after {
  content: ' · ';
  opacity: 0.5;
}

.hero h1 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.hero h1 .line {
  background: linear-gradient(180deg, #e8dcc0 0%, #c9a227 45%, #8b7355 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
  animation: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}
.hero h1.title-glitch .line {
  animation: inkFlicker 12s infinite;
}
@keyframes inkFlicker {
  0%, 94%, 100% { opacity: 1; }
  95% { opacity: 0.7; text-shadow: 1px 0 #4a3020; }
  96% { opacity: 0.9; text-shadow: -1px 0 #2a1810; }
}

.hero-sub {
  font-family: 'Cinzel', serif;
  color: var(--text-dim);
  letter-spacing: 0.3em;
}
.hero-desc {
  font-style: italic;
  color: var(--text-dim);
  max-width: 480px;
  border-left: 2px solid rgba(201, 162, 39, 0.25);
  padding-left: 16px;
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

.btn-hero {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(26, 22, 16, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(201, 162, 39, 0.1);
}
.btn-hero:hover {
  background: rgba(42, 36, 28, 0.95);
  color: #e8dcc0;
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.15);
  text-shadow: none;
}
.btn-hero.secondary {
  color: var(--text-dim);
  border-color: rgba(122, 111, 92, 0.4);
}

.orbit-sphere {
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
}
.orbit-sphere.teal { background: radial-gradient(circle at 30% 30%, #3d5248, #1a2820); border-color: #5a7a6a; box-shadow: 0 0 20px rgba(74, 107, 90, 0.2); }
.orbit-sphere.coral { background: radial-gradient(circle at 30% 30%, #6b4030, #2a1810); border-color: #8b5a42; }
.orbit-sphere.purple { background: radial-gradient(circle at 30% 30%, #4a3d5a, #1a1420); border-color: #6a5a7a; }
.orbit-label { font-family: 'Cinzel', serif; }

.scroll-hint {
  font-family: 'Cinzel', serif;
  color: var(--text-faded);
}

/* Nav — catalog drawer */
.realm-nav {
  background: rgba(12, 10, 8, 0.94);
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.realm-btn, .tool-btn, .lang-select, .lore-search {
  font-family: 'Cinzel', serif;
  border-color: rgba(201, 162, 39, 0.2);
  background: rgba(20, 17, 14, 0.8);
  color: var(--text-dim);
}
.realm-btn:hover, .tool-btn:hover, .realm-btn.active {
  color: var(--accent);
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.1);
}
.lang-select { color: var(--accent-dim); }

/* Sections */
.section-label {
  font-family: 'Cinzel Decorative', serif;
  color: var(--accent-dim);
  -webkit-text-fill-color: var(--accent-dim);
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0.15em;
}
.section-tag {
  font-family: 'Cinzel', serif;
  color: var(--text-faded);
}
.section.myth .section-label {
  color: #a06068;
  -webkit-text-fill-color: #a06068;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
  -webkit-background-clip: text;
  background-clip: text;
}
.section.mobs .section-label {
  color: #6a8a7a;
  -webkit-text-fill-color: #6a8a7a;
}

.timeline {
  background: rgba(20, 17, 14, 0.7);
  border: 1px solid rgba(201, 162, 39, 0.12);
  border-radius: 2px;
  position: relative;
}
.timeline::before {
  content: '⟨ BUILDER CHRONICLE ⟩';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 7px;
  letter-spacing: 0.25em;
  color: var(--text-faded);
  background: var(--bg);
  padding: 0 10px;
}
.timeline-dot {
  background: var(--accent-dim);
  box-shadow: none;
  border-radius: 0;
  transform: rotate(45deg);
  width: 8px;
  height: 8px;
}
.timeline-step.active .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

.myth-note {
  font-family: 'EB Garamond', serif;
  color: var(--blood);
  text-shadow: none;
  border: 1px dashed rgba(107, 40, 48, 0.4);
  padding: 12px 20px;
  background: rgba(26, 14, 14, 0.4);
}

/* Folio cards */
.node {
  border-radius: 2px;
  background: linear-gradient(165deg, var(--parchment) 0%, #1f1a14 100%) !important;
  border: 1px solid var(--parchment-edge) !important;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(212, 196, 168, 0.06),
    inset 0 -20px 40px rgba(0, 0, 0, 0.2) !important;
  color: var(--text) !important;
}
.node::before {
  background: linear-gradient(135deg, rgba(212, 196, 168, 0.06) 0%, transparent 40%);
}
.node::after {
  display: block !important;
  background: none !important;
  content: '⌁' !important;
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: auto !important;
  height: auto !important;
  top: auto !important;
  left: auto !important;
  inset: auto !important;
  font-family: 'Cinzel Decorative', serif;
  font-size: 14px;
  color: rgba(201, 162, 39, 0.14);
  animation: none !important;
  opacity: 1;
  transform: none !important;
}

.node-label {
  font-family: 'Cinzel', serif !important;
  color: #e0d4bc !important;
  letter-spacing: 0.12em !important;
}
.node-sub {
  color: var(--text-dim) !important;
  font-style: italic;
}

.node-rarity {
  font-family: 'Cinzel', serif;
  border-radius: 0;
  letter-spacing: 0.15em;
}
.rarity-canon {
  background: rgba(74, 107, 90, 0.2) !important;
  color: #8aab9a !important;
  border-color: rgba(74, 107, 90, 0.35) !important;
}
.rarity-legendary {
  background: rgba(201, 162, 39, 0.15) !important;
  color: var(--accent) !important;
  border-color: rgba(201, 162, 39, 0.35) !important;
}
.rarity-mythic {
  background: rgba(107, 40, 48, 0.25) !important;
  color: #c08088 !important;
  border-color: rgba(107, 40, 48, 0.45) !important;
  animation: waxPulse 3s ease-in-out infinite;
}
@keyframes waxPulse {
  50% { box-shadow: 0 0 10px rgba(107, 40, 48, 0.3); }
}

.node.open {
  box-shadow: 0 0 30px rgba(201, 162, 39, 0.12), 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

.dropdown {
  border-radius: 0 0 2px 2px !important;
  background: #14110e !important;
  border: 1px solid var(--parchment-edge) !important;
  border-top: 1px dashed rgba(201, 162, 39, 0.2) !important;
  color: var(--text) !important;
}
.drop-teal, .drop-coral, .drop-purple, .drop-amber,
.drop-gray, .drop-blue, .drop-red {
  background: #14110e !important;
  color: #c8baa4 !important;
  border-color: var(--parchment-edge) !important;
}

.dropdown-body::first-letter {
  font-family: 'Cinzel Decorative', serif !important;
  color: var(--accent) !important;
}

.chip {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  border-radius: 0;
  border-color: rgba(201, 162, 39, 0.2);
  background: rgba(0, 0, 0, 0.25);
}
.chip:hover {
  color: var(--accent) !important;
  border-color: var(--accent-dim) !important;
  box-shadow: none !important;
}

.node-wrap.herobrine-card .node {
  border-color: rgba(107, 40, 48, 0.5) !important;
}
.node-wrap.herobrine-card .node-label {
  animation: herobrineInk 6s infinite;
}
@keyframes herobrineInk {
  0%, 90%, 100% { text-shadow: none; }
  91% { text-shadow: 1px 0 #4a2020, -1px 0 #1a1010; color: #a06068; }
}

.node-wrap.discovered::before {
  content: '◉';
  color: var(--accent-dim);
  font-size: 9px;
  left: auto;
  right: 10px;
  top: auto;
  bottom: 10px;
}

/* Modal — star chart on hide */
.modal {
  background: linear-gradient(160deg, #1a1610, #0e0c0a);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 2px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(0, 0, 0, 0.5);
}
.modal-header h2 {
  font-family: 'Cinzel Decorative', serif !important;
  color: var(--accent) !important;
}
.discovery-hud {
  border: 1px solid rgba(201, 162, 39, 0.2);
  background: rgba(14, 12, 10, 0.92);
  border-radius: 2px;
  font-family: 'Cinzel', serif;
}
.discovery-fill {
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: none;
}

.toast-discover {
  font-family: 'Cinzel', serif;
  background: rgba(26, 22, 16, 0.95);
  border-color: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.dimension-flash {
  background: radial-gradient(circle, rgba(107, 40, 48, 0.4) 0%, transparent 70%);
}

footer {
  font-family: 'Cinzel', serif;
  color: var(--text-faded);
  letter-spacing: 0.3em;
  text-align: center;
}
footer::before {
  content: '◇ ─── ';
  opacity: 0.4;
}
footer::after {
  content: ' ─── ◇';
  opacity: 0.4;
}
footer p {
  margin: 0;
}
.folio-credit {
  margin-top: 14px !important;
  font-family: 'Special Elite', 'Courier New', monospace !important;
  font-size: 10px !important;
  letter-spacing: 0.22em !important;
  color: rgba(201, 162, 39, 0.55) !important;
  text-transform: uppercase;
}

.locale-loading {
  font-family: 'Cinzel', serif;
  color: var(--accent-dim);
  letter-spacing: 0.4em;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-dim), #4a3d28);
  border-radius: 0;
}

#myth-canvas.active { opacity: 0.35; }

.wrapper {
  position: relative;
}
.wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(201, 162, 39, 0.06) 15%, rgba(201, 162, 39, 0.06) 85%, transparent);
  pointer-events: none;
}

/* ── Readable folio focus (no blur on open entry) ── */
.focus-backdrop {
  background: rgba(6, 5, 3, 0.62) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.focus-backdrop.active {
  background: rgba(6, 5, 3, 0.72) !important;
}

body.focus-mode .wrapper .node-wrap:not(.open-wrap) {
  opacity: 0.42;
  transition: opacity 0.35s ease;
  filter: none !important;
}

body.focus-mode #burst-canvas {
  z-index: 44 !important;
}

.node-wrap.open-wrap {
  z-index: 80 !important;
  isolation: isolate;
  filter: none !important;
}

.node-wrap.open-wrap .node,
.node-wrap.open-wrap .dropdown {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.node-wrap.open-wrap .node {
  background: linear-gradient(165deg, #2e281e 0%, #1f1a14 100%) !important;
  border-color: rgba(201, 162, 39, 0.45) !important;
}

.node-wrap.open-wrap .dropdown {
  background: #1c1812 !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(201, 162, 39, 0.08) !important;
}

.node-wrap.open-wrap .dropdown-body {
  font-family: 'IM Fell English', 'EB Garamond', Georgia, serif !important;
  font-size: 18px !important;
  line-height: 1.82 !important;
  color: #ebe2d0 !important;
  letter-spacing: 0.02em;
  text-shadow: none !important;
  overflow-wrap: break-word;
  word-break: break-word;
}

.node-wrap.open-wrap .dropdown-connections h4,
.node-wrap.open-wrap .chip {
  opacity: 1;
}

.node,
.dropdown {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ── Cryptic archive v5 ── */
body.use-system-cursor,
body.use-system-cursor * {
  cursor: auto !important;
}
body.use-system-cursor .cursor-dot,
body.use-system-cursor .cursor-ring {
  display: none !important;
}

.cipher-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 4;
  pointer-events: none;
  opacity: 0.35;
  font-family: 'Special Elite', monospace;
  font-size: 9px;
  line-height: 1.65;
  color: rgba(201, 162, 39, 0.25);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.35em;
  overflow: hidden;
  padding: 24px 6px;
}
.cipher-rail-left { left: 0; border-right: 1px solid rgba(201, 162, 39, 0.08); }
.cipher-rail-right { right: 0; border-left: 1px solid rgba(201, 162, 39, 0.08); }

.archive-wax {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #8b3038, #4a1818 60%, #2a1010);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.08), 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0.5;
}
.archive-wax::after {
  content: 'Δ';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: 22px;
  color: rgba(0,0,0,0.35);
}

.folio-index {
  position: absolute;
  top: 8px;
  left: 10px;
  max-width: calc(100% - 90px);
  font-family: 'Special Elite', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.35;
  color: rgba(201, 162, 39, 0.45);
  z-index: 3;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.node-rarity {
  max-width: 42%;
  line-height: 1.3;
  text-align: right;
  white-space: normal;
}

.node {
  border-radius: 2px;
}
.node.open {
  border-radius: 2px 2px 0 0;
}

.dropdown-body {
  position: relative;
}
.dropdown-body::after {
  content: attr(data-marginalia);
  display: block;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed rgba(201, 162, 39, 0.15);
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--text-faded);
  text-transform: uppercase;
}

.section-header::before {
  content: '§';
  display: block;
  font-family: 'Cinzel Decorative', serif;
  font-size: 20px;
  color: rgba(201, 162, 39, 0.2);
  margin-bottom: 8px;
}

.section.myth .section-header::before {
  content: '☠';
  color: rgba(107, 40, 48, 0.35);
}

.node-arrow {
  font-family: 'Cinzel', serif;
  opacity: 0.45;
}

#lore-svg {
  filter: sepia(0.4) contrast(1.08);
  min-height: 440px;
}
#lore-svg .codex-bg rect {
  pointer-events: none;
}
#lore-svg .lore-link {
  stroke: rgba(201, 162, 39, 0.18);
  stroke-width: 1.2;
}
#lore-svg .lore-link.link-active {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-opacity: 1;
}
#lore-svg .map-node-group {
  cursor: pointer;
}
#lore-svg .map-node-group.map-active .lore-node-circle {
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.5));
}
#lore-svg .map-node-group.map-discovered .lore-node-circle {
  stroke-dasharray: none;
  fill-opacity: 0.55;
}
#lore-svg .map-node-group:not(.map-discovered) .lore-node-circle {
  fill-opacity: 0.22;
  opacity: 0.75;
}
#lore-svg .map-node-group[data-zone="myth"] .lore-node-circle {
  stroke: rgba(139, 48, 56, 0.6);
}

.modal-overlay {
  background: rgba(4, 3, 2, 0.92);
  backdrop-filter: none !important;
}
.modal-body {
  background-image:
    url("data:image/svg+xml,%3Csvg width='120' height='120' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='60' cy='60' r='50' fill='none' stroke='%23c9a227' stroke-opacity='0.06'/%3E%3Cpath d='M60 10 L62 58 L108 60 L62 62 L60 110 L58 62 L12 60 L58 58 Z' fill='none' stroke='%23c9a227' stroke-opacity='0.05'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50h100M50 0v100' stroke='%23c9a227' stroke-opacity='0.04'/%3E%3C/svg%3E");
  background-position: center, 0 0;
  background-repeat: no-repeat, repeat;
}

.locale-loading::after {
  content: ' ᚦ';
  animation: inkFlicker 2s infinite;
}

/* Aged manuscript overlay when reading */
.node-wrap.open-wrap::after {
  content: '⟨ READING ⟩';
  position: absolute;
  top: -8px;
  right: 12px;
  font-family: 'Special Elite', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(201, 162, 39, 0.5);
  pointer-events: none;
  z-index: 5;
}

.hero h1 .line {
  font-family: 'Cinzel Decorative', serif !important;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hero-desc {
  font-family: 'IM Fell English', 'EB Garamond', serif !important;
  font-size: 17px !important;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  gap: 10px !important;
}
.hero-actions .btn-hero.tertiary {
  flex: 1 1 100%;
  max-width: 280px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .cipher-rail { display: none; }
  .archive-wax { opacity: 0.25; width: 40px; height: 40px; }
  .node-wrap.open-wrap .dropdown-body { font-size: 16px !important; }
}
