@font-face {
  font-family: 'Newsreader Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url('/assets/fonts/newsreader-latin.woff2?v=62981321d9') format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url('/assets/fonts/plus-jakarta-sans-latin.woff2?v=153fc85b70') format('woff2');
}

:root {
  --vellum-bg: #F6F1E7;
  --vellum-paper: #FAF6EE;
  --vellum-deep: #EAE0CA;
  --vellum-border: #D6C399;
  --ink-primary: #1A2230;
  --ink-body: #263246;
  --ink-muted: #515F75;
  --brass-gold: #B8862D;
  --brass-deep: #7A5210;
  --brass-glow: #E5BA64;
  --sea-teal: #2A6F7B;
  --sea-deep: #184F59;
  --emerald-ok: #256D49;
  --crimson-warn: #9E3B2E;
  --font-serif: 'Newsreader Variable', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow-soft: 0 12px 32px rgba(26, 34, 48, 0.08);
  --shadow-lift: 0 22px 48px rgba(26, 34, 48, 0.16);
  --dock-height: 54px;
}

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

html {
  background-color: var(--vellum-bg);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--vellum-bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(229, 186, 100, 0.14), transparent 38%),
    radial-gradient(circle at 88% 42%, rgba(42, 111, 123, 0.10), transparent 42%);
  color: var(--ink-body);
  overflow-x: clip;
  min-height: 100vh;
  position: relative;
}

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

.skip-link {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 200;
  background: var(--ink-primary);
  color: var(--vellum-paper);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-220%);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Persistent Floating Celestial Sun-Motes & Star Glints Canvas */
#celestial-motes-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.85;
}

/* Top-Centered Floating Brass Astrolabe Pill Dock */
.astrolabe-dock {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(1240px, calc(100vw - 20px));
  height: var(--dock-height);
  background: rgba(250, 246, 238, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--brass-gold);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(26, 34, 48, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  gap: 6px;
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink-primary);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 4px;
}

.dock-compass-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-brand:hover .dock-compass-icon {
  transform: rotate(90deg) scale(1.08);
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.dock-nav::-webkit-scrollbar {
  display: none;
}

.dock-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-body);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.dock-link:hover {
  background: rgba(184, 134, 45, 0.16);
  color: var(--ink-primary);
}
.dock-link[aria-current="page"] {
  background: var(--ink-primary);
  color: var(--vellum-paper);
  box-shadow: 0 4px 12px rgba(26, 34, 48, 0.22);
}

.dock-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--brass-gold);
  background: linear-gradient(180deg, #FAF6EE, #EFE4CC);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dock-cmd-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 45, 0.28);
}
.dock-kbd {
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--vellum-paper);
  border: 1px solid var(--vellum-border);
  color: var(--brass-deep);
}

/* Vivid Full-Bleed Sunlit Hero Panorama Stage */
.hero-stage {
  position: relative;
  z-index: 2;
  padding: 96px 20px 56px;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 2px solid var(--brass-gold);
}

.hero-backdrop-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

@keyframes heroSlowDrift {
  0% { transform: scale(1.02) translate3d(0, 0, 0); }
  50% { transform: scale(1.06) translate3d(-1%, -0.8%, 0); }
  100% { transform: scale(1.02) translate3d(0, 0, 0); }
}

.hero-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
  filter: saturate(1.14) contrast(1.04);
  animation: heroSlowDrift 26s ease-in-out infinite;
}

/* Crystal-clear upper sky & sea chart, blending softly only into the bottom border */
.hero-vellum-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(246, 241, 231, 0.08) 0%, rgba(246, 241, 231, 0.22) 55%, rgba(246, 241, 231, 0.88) 92%, #F6F1E7 100%),
    linear-gradient(90deg, rgba(246, 241, 231, 0.55) 0%, rgba(246, 241, 231, 0.05) 62%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 28px;
  align-items: end;
}

/* Sculpted Illuminated Vellum Folio Plaque */
.hero-plaque {
  background: rgba(250, 246, 238, 0.90);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(184, 134, 45, 0.78);
  border-radius: 20px;
  padding: 26px 30px;
  box-shadow:
    0 22px 50px rgba(26, 34, 48, 0.18),
    inset 0 0 0 4px rgba(250, 246, 238, 0.55),
    inset 0 0 0 5px rgba(184, 134, 45, 0.26);
}

.breadcrumb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sea-deep);
}
.breadcrumb-nav a {
  color: var(--sea-deep);
  text-decoration: none;
  padding: 2px 0;
}
.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(184, 134, 45, 0.16), rgba(42, 111, 123, 0.12));
  border: 1px solid var(--brass-gold);
  color: var(--brass-deep);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-inner h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.95rem, 3.6vw, 2.95rem);
  line-height: 1.13;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.hero-lead {
  margin: 0;
  max-width: 740px;
  font-size: 1.07rem;
  line-height: 1.62;
  color: var(--ink-body);
  font-weight: 500;
}

.hero-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Interactive Brass Astrolabe Medallion with Mouse Parallax */
.hero-astrolabe-ornament {
  width: 220px;
  height: 220px;
  justify-self: end;
  position: relative;
  filter: drop-shadow(0 14px 28px rgba(26, 34, 48, 0.25));
  transform: perspective(600px) rotateX(calc(var(--my, 0) * -12deg)) rotateY(calc(var(--mx, 0) * 12deg));
  transition: transform 0.15s ease-out;
}
.astrolabe-ring-outer {
  transform-origin: 105px 105px;
  animation: slowAstrolabeSpin 36s linear infinite;
}
.astrolabe-ring-inner {
  transform-origin: 105px 105px;
  animation: slowAstrolabeSpinReverse 22s linear infinite;
}

@keyframes slowAstrolabeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes slowAstrolabeSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Sticky Horizontal Astral Milestone Ruler */
.milestone-ruler {
  position: sticky;
  top: 72px;
  z-index: 45;
  max-width: 1180px;
  margin: -20px auto 28px;
  padding: 0 16px;
}
.milestone-ruler-inner {
  background: rgba(250, 246, 238, 0.96);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--brass-gold);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(26, 34, 48, 0.10);
  overflow: hidden;
}
.milestone-progress-track {
  height: 4px;
  background: rgba(184, 134, 45, 0.18);
  width: 100%;
}
.milestone-progress-bar {
  height: 100%;
  width: var(--scroll-pct, 0%);
  background: linear-gradient(90deg, var(--sea-teal), var(--brass-gold), #D97706);
  transition: width 0.1s linear;
}
.milestone-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.milestone-links::-webkit-scrollbar {
  display: none;
}
.milestone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.milestone-pill:hover {
  background: var(--vellum-deep);
  color: var(--ink-primary);
}
.milestone-pill.is-current {
  background: var(--ink-primary);
  color: var(--vellum-paper);
  font-weight: 700;
}

/* Main Content Editorial Container */
.atlas-main {
  position: relative;
  z-index: 4;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px 68px;
}

/* Scroll-Triggered Choreographed Reveal */
.reveal-card.will-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-card.will-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.prose-section,
[id] {
  scroll-margin-top: 144px;
}

.prose-section {
  margin-bottom: 54px;
}

.prose-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.7vw, 2.2rem);
  line-height: 1.22;
  color: var(--ink-primary);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--vellum-border);
  position: relative;
}
.prose-section h2::after {
  content: '✦';
  position: absolute;
  right: 4px;
  bottom: 8px;
  font-size: 1rem;
  color: var(--brass-gold);
}

.prose-section h3 {
  font-family: var(--font-serif);
  font-size: 1.34rem;
  color: var(--ink-primary);
  margin: 26px 0 10px;
}

.prose-section p,
.prose-section li {
  font-size: 1.03rem;
  line-height: 1.76;
  color: var(--ink-body);
}

.prose-section ul,
.prose-section ol {
  padding-left: 22px;
  margin: 14px 0 20px;
}
.prose-section li {
  margin-bottom: 8px;
}

.prose-section a {
  color: var(--sea-deep);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.prose-section a:hover {
  color: var(--brass-deep);
}

.lead-dropcap::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 3.4rem;
  line-height: 0.88;
  padding: 4px 10px 0 0;
  color: var(--brass-deep);
  font-weight: 700;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  background: var(--vellum-deep);
  color: var(--ink-primary);
  padding: 2px 6px;
  border-radius: 5px;
}

.astral-divider {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 28px;
  margin: 4px auto 30px;
  overflow: visible;
}
.astral-divider path {
  stroke-dasharray: 420;
  stroke-dashoffset: var(--dash-offset, 0);
  transition: stroke-dashoffset 0.35s ease-out;
}

/* Illustrated Four Realms Bento Cards with 3D Tilt & Golden Specular Glare */
.realm-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 26px 0 32px;
}

.tilt-card {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.tilt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    380px circle at var(--gx, 50%) var(--gy, 0%),
    rgba(229, 186, 100, 0.22),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tilt-card:hover::after {
  opacity: 1;
}

.realm-card {
  background: var(--vellum-paper);
  border: 1.5px solid var(--vellum-border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.realm-card:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--brass-gold);
}

.realm-art-banner {
  position: relative;
  height: 196px;
  overflow: hidden;
  border-bottom: 2px solid var(--brass-gold);
  background: var(--vellum-deep);
}
.realm-art-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.realm-card:hover .realm-art-banner img {
  transform: scale(1.06);
}
.realm-order-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(26, 34, 48, 0.88);
  color: #FAF6EE;
  border: 1px solid var(--brass-glow);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.realm-card-body {
  padding: 20px 24px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.realm-card-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--brass-deep);
  margin-bottom: 6px;
}
.realm-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.realm-card p {
  margin: 0 0 14px;
  font-size: 0.96rem;
}
.text-arrow-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 0.93rem;
  font-weight: 800;
  color: var(--sea-deep);
  text-decoration: none;
}
.text-arrow-link:hover {
  color: var(--brass-deep);
  text-decoration: underline;
}

.three-col-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0;
}
.vellum-subcard {
  background: var(--vellum-paper);
  border: 1.5px solid var(--vellum-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.subcard-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brass-deep);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.vellum-subcard h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
}

/* Illustration & Interactive SVG Blueprint Plates */
.vellum-plate {
  margin: 28px 0;
  background: var(--vellum-paper);
  border: 1.5px solid var(--brass-gold);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}
.plate-scrubber-bar {
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--vellum-border);
  margin-bottom: 12px;
}
.plate-frame {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: var(--vellum-deep);
}
.plate-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.plate-zoom-trigger {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(26, 34, 48, 0.88);
  color: var(--vellum-paper);
  border: 1px solid var(--brass-gold);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.plate-zoom-trigger:hover {
  background: var(--ink-primary);
  transform: scale(1.04);
}
.vellum-plate figcaption {
  padding: 11px 8px 4px;
  font-size: 0.91rem;
  color: var(--ink-muted);
  text-align: center;
  font-weight: 500;
}

/* Signature Interactive #1: Upgraded Overworld Cartography Atlas */
.atlas-stage-shell {
  background: linear-gradient(180deg, #FAF6EE 0%, #F2E9D5 100%);
  border: 2px solid var(--brass-gold);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(26, 34, 48, 0.12);
  margin: 22px 0 34px;
}

.atlas-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--vellum-border);
  margin-bottom: 14px;
}
.atlas-filter-group,
.atlas-controls-row,
.atlas-layer-group,
.atlas-utility-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.atlas-controls-row {
  justify-content: space-between;
}
.toolbar-kicker {
  font-size: 0.79rem;
  font-weight: 800;
  color: var(--brass-deep);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.atlas-chip,
.atlas-layer-btn,
.atlas-toggle-btn,
.atlas-zoom-btn {
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-paper);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.atlas-chip:hover,
.atlas-layer-btn:hover,
.atlas-zoom-btn:hover {
  border-color: var(--brass-gold);
  transform: translateY(-1px);
}
.atlas-chip.is-active,
.atlas-layer-btn.is-active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--vellum-paper);
  box-shadow: 0 4px 10px rgba(26, 34, 48, 0.2);
}
.atlas-toggle-btn.is-active {
  background: rgba(184, 134, 45, 0.22);
  border-color: var(--brass-gold);
  color: var(--brass-deep);
}
.atlas-progress-pill {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--emerald-ok);
  background: rgba(37, 109, 73, 0.12);
  border: 1px solid rgba(37, 109, 73, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
}

.atlas-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: stretch;
}

.atlas-viewport {
  position: relative;
  border-radius: 14px;
  border: 2px solid var(--brass-gold);
  overflow: hidden;
  background: #C9E0E3;
  min-height: 520px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 32px rgba(26, 34, 48, 0.18);
}
.atlas-viewport.is-dragging {
  cursor: grabbing;
}

.atlas-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.atlas-viewport.is-dragging .atlas-canvas {
  transition: none;
}

.atlas-sea-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.96;
  filter: saturate(1.12) contrast(1.03);
}
.atlas-vellum-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 52%, rgba(26, 34, 48, 0.18) 100%);
  pointer-events: none;
}

@keyframes seaChordFlow {
  to { stroke-dashoffset: -6; }
}

.atlas-chords-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.atlas-chord {
  fill: none;
}
.chord-route {
  stroke: rgba(26, 34, 48, 0.58);
  stroke-width: 0.48;
  stroke-dasharray: 1.2 0.8;
}
.chord-portal {
  stroke: #0F6A7B;
  stroke-width: 0.65;
  stroke-dasharray: 1.8 1.2;
  animation: seaChordFlow 1.8s linear infinite;
}
.chord-beam {
  stroke: #EAB308;
  stroke-width: 0.92;
  stroke-dasharray: 2.2 0.8;
  filter: drop-shadow(0 0 2px rgba(234, 179, 8, 0.85));
  animation: seaChordFlow 1.1s linear infinite;
}
.atlas-active-trace {
  fill: none;
  stroke: #C53030;
  stroke-width: 1.05;
  stroke-dasharray: 2 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.25s ease;
  animation: seaChordFlow 0.9s linear infinite;
}
.atlas-active-trace.is-tracing {
  opacity: 1;
}

.atlas-stage-shell.portals-hidden .chord-portal,
.atlas-stage-shell.portals-hidden .chord-beam {
  opacity: 0;
}

.atlas-cardinal-watermark {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #FAF6EE;
  background: rgba(26, 34, 48, 0.82);
  border: 1px solid var(--brass-gold);
  padding: 3px 10px;
  border-radius: 999px;
  pointer-events: none;
}
.wm-north { top: 2.5%; left: 50%; transform: translateX(-50%); }
.wm-south { bottom: 9.5%; left: 50%; transform: translateX(-50%); }
.wm-east { right: 2%; top: 28%; }
.wm-west { left: 2%; top: 28%; }

@keyframes pinRadar {
  0% { transform: scale(0.8); opacity: 0.85; }
  100% { transform: scale(2.3); opacity: 0; }
}

.atlas-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--ink-primary);
  background: rgba(250, 246, 238, 0.97);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(26, 34, 48, 0.28);
  transition: transform 0.18s ease, background-color 0.18s ease;
  z-index: 4;
}
.node-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid var(--brass-glow);
  opacity: 0;
  pointer-events: none;
}
.atlas-node.is-selected .node-pulse,
.atlas-node:hover .node-pulse {
  animation: pinRadar 1.6s ease-out infinite;
}
.atlas-node:hover,
.atlas-node.is-selected {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--ink-primary);
  color: var(--vellum-paper);
  border-color: var(--brass-glow);
  z-index: 9;
}
.atlas-node.is-filtered-out {
  opacity: 0.14;
  pointer-events: none;
}
.node-pin {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass-gold);
  flex-shrink: 0;
}
.realm-north .node-pin { background: #C87D20; }
.realm-east .node-pin { background: #C53D2F; }
.realm-south .node-pin { background: #188498; }
.realm-west .node-pin { background: #26925B; }
.realm-gold-rooms .node-pin { background: #FACC15; box-shadow: 0 0 8px #FACC15; }
.realm-antipode .node-pin { background: #8B5CF6; }
.atlas-node.is-explored {
  border-color: var(--emerald-ok);
}
.atlas-node.is-explored::after {
  content: '✓';
  color: var(--emerald-ok);
  font-weight: 900;
  margin-left: 2px;
}
.atlas-node.is-selected.is-explored::after {
  color: #86EFAC;
}

.atlas-hover-tooltip {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  background: rgba(26, 34, 48, 0.94);
  color: #FAF6EE;
  border: 1px solid var(--brass-glow);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  max-width: 240px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, calc(-100% - 14px));
}

.atlas-legend-pill {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(250, 246, 238, 0.92);
  border: 1px solid var(--brass-gold);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-primary);
  pointer-events: none;
}
.lg-dot {
  display: inline-block;
  width: 10px;
  height: 3px;
  vertical-align: middle;
  margin-right: 5px;
  border-radius: 2px;
}
.lg-beam { background: #EAB308; }
.lg-portal { background: #0F6A7B; }
.lg-trace { background: #C53030; }

.atlas-drawer {
  background: var(--vellum-paper);
  border: 1.5px solid var(--vellum-border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.drawer-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.drawer-badge {
  background: var(--ink-primary);
  color: var(--vellum-paper);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
}
.drawer-layer {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brass-deep);
}
.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-primary);
}
.drawer-meta-list {
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
}
.drawer-meta-list dt {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 800;
}
.drawer-meta-list dd {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--ink-primary);
}
.drawer-summary {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.56;
}
.drawer-tip-box {
  background: var(--vellum-bg);
  border-left: 3px solid var(--brass-gold);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.87rem;
  line-height: 1.54;
}
.drawer-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.btn-brass-trace {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1.5px solid var(--brass-gold);
  background: linear-gradient(90deg, rgba(184, 134, 45, 0.16), rgba(197, 48, 48, 0.10));
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease;
}
.btn-brass-trace:hover {
  transform: translateY(-1px);
  background: rgba(184, 134, 45, 0.28);
}

.drawer-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
}
.drawer-check-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--emerald-ok);
}

.btn-brass-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink-primary);
  color: var(--vellum-paper) !important;
  text-decoration: none !important;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--brass-gold);
  box-shadow: 0 6px 16px rgba(26, 34, 48, 0.18);
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.btn-brass-solid:hover {
  background: var(--sea-deep);
  transform: translateY(-1px);
}

.btn-brass-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--brass-gold);
  background: var(--vellum-paper);
  color: var(--ink-primary) !important;
  text-decoration: none !important;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.btn-brass-outline:hover {
  background: var(--vellum-deep);
  transform: translateY(-1px);
}

/* NEW Signature Interactive #2: 2.5D Game-Board Tactical Replay Theatre */
.viz-theatre-shell {
  background: linear-gradient(165deg, #182232 0%, #111926 100%);
  color: #F6F1E7;
  border: 2px solid var(--brass-gold);
  border-radius: 22px;
  padding: 22px;
  margin: 26px 0 36px;
  box-shadow: 0 24px 56px rgba(17, 25, 38, 0.32), inset 0 1px 0 rgba(229, 186, 100, 0.28);
}
.viz-theatre-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.viz-theatre-shell .hint-kicker {
  color: var(--brass-glow);
}
.viz-theatre-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.52rem);
  font-weight: 700;
  color: #FAF6EE;
}
.viz-playback-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.viz-ctrl-btn,
.viz-autoplay-btn {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(229, 186, 100, 0.55);
  background: rgba(250, 246, 238, 0.08);
  color: #FAF6EE;
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
}
.viz-ctrl-btn:hover,
.viz-autoplay-btn:hover {
  background: rgba(229, 186, 100, 0.22);
  border-color: var(--brass-glow);
}
.viz-autoplay-btn.is-playing {
  background: linear-gradient(180deg, #EAB85C, #C08B2B);
  border-color: #FDE68A;
  color: #141C29;
  box-shadow: 0 0 16px rgba(234, 184, 92, 0.42);
}

.viz-deck-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.viz-deck-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(214, 195, 153, 0.25);
  background: rgba(250, 246, 238, 0.05);
  color: #CBD5E1;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}
.viz-deck-tab:hover {
  border-color: var(--brass-glow);
  background: rgba(250, 246, 238, 0.12);
  color: #FFF;
}
.viz-deck-tab.is-active {
  background: linear-gradient(180deg, #FAF6EE, #EDE1C7);
  color: var(--ink-primary);
  border-color: var(--brass-glow);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}
.viz-tab-main {
  font-size: 0.84rem;
  font-weight: 800;
}
.viz-tab-sub {
  font-size: 0.71rem;
  opacity: 0.82;
}

.viz-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 0.88fr);
  gap: 18px;
  align-items: stretch;
}

.viz-board-frame {
  background: #0D141F;
  border: 1.5px solid rgba(229, 186, 100, 0.65);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.55);
}

.viz-hud-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
}
.hud-realm-chip {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93C5FD;
  background: rgba(30, 58, 138, 0.45);
  border: 1px solid rgba(147, 197, 253, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
}
.hud-key-pill {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  color: #FEF08A;
  background: rgba(180, 83, 9, 0.42);
  border: 1px solid rgba(251, 191, 36, 0.65);
  padding: 4px 12px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}
.hud-turn-pill {
  font-size: 0.76rem;
  font-weight: 800;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

.tactical-board-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 3;
  border-radius: 11px;
  background: #142230;
  border: 1px solid rgba(229, 186, 100, 0.32);
}

.viz-turn-scrubber {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.turn-dot {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(229, 186, 100, 0.28);
  background: rgba(250, 246, 238, 0.06);
  color: #CBD5E1;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.turn-dot:hover {
  border-color: var(--brass-glow);
  color: #FFF;
}
.turn-dot.is-active {
  background: var(--brass-gold);
  border-color: #FDE68A;
  color: #141C29;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(184, 134, 45, 0.36);
}

.viz-board-legend {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(229, 186, 100, 0.22);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #CBD5E1;
}
.b-ico {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.ico-facing { background: #FACC15; }
.ico-stone { background: #94A3B8; border: 1.5px solid #FACC15; }
.ico-crystal { background: #38BDF8; transform: rotate(45deg); border-radius: 2px; }
.ico-goal { background: #D97706; }

.viz-briefing-sidebar {
  background: var(--vellum-paper);
  color: var(--ink-body);
  border: 1.5px solid var(--brass-gold);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.briefing-scen-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink-primary);
}
.briefing-active-step-box {
  background: linear-gradient(90deg, rgba(184, 134, 45, 0.18), rgba(42, 111, 123, 0.10));
  border: 1px solid var(--brass-gold);
  border-radius: 10px;
  padding: 10px 12px;
}
.briefing-box-kicker {
  display: block;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brass-deep);
  margin-bottom: 3px;
}
.briefing-active-step-box p {
  margin: 0;
  font-size: 0.89rem;
  font-weight: 700;
  line-height: 1.48;
  color: var(--ink-primary);
}
.briefing-compare-box {
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.briefing-compare-box p {
  margin: 3px 0 0;
  font-size: 0.84rem;
  line-height: 1.48;
}
.box-trap {
  background: rgba(158, 59, 46, 0.09);
  border-left: 3px solid var(--crimson-warn);
}
.box-trap strong { color: var(--crimson-warn); }
.box-law {
  background: rgba(37, 109, 73, 0.10);
  border-left: 3px solid var(--emerald-ok);
}
.box-law strong { color: var(--emerald-ok); }

.briefing-step-log {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}
.briefing-step-log li {
  font-size: 0.8rem;
  line-height: 1.42;
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--vellum-bg);
  border: 1px solid var(--vellum-border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.briefing-step-log li:hover {
  border-color: var(--brass-gold);
}
.briefing-step-log li.is-current {
  background: var(--ink-primary);
  color: var(--vellum-paper);
  border-color: var(--ink-primary);
  font-weight: 700;
}

/* Signature Interactive #3: 3-Tier Spoiler-Safe Hint Stepper */
.hint-stepper-card {
  background: var(--vellum-paper);
  border: 2px solid var(--brass-gold);
  border-radius: 18px;
  padding: 22px 24px;
  margin: 28px 0;
  box-shadow: var(--shadow-soft);
}
.hint-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--sea-deep);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hint-card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 14px;
}
.hint-tier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.hint-tab {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-bg);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.hint-tab:hover {
  border-color: var(--brass-gold);
}
.hint-tab.is-active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: var(--vellum-paper);
}
.hint-tier-panel {
  background: var(--vellum-bg);
  border: 1px solid var(--vellum-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.tier-lead {
  margin: 0;
  font-size: 0.99rem;
}

.svg-step-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.step-pill,
.step-autoplay-mini,
.step-lightbox-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-paper);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.step-pill:hover,
.step-autoplay-mini:hover {
  border-color: var(--brass-gold);
}
.step-pill.is-active {
  background: var(--sea-deep);
  border-color: var(--sea-deep);
  color: #FFF;
}
.step-autoplay-mini.is-playing {
  background: var(--brass-gold);
  border-color: var(--brass-gold);
  color: #1A2230;
}
.step-lightbox-btn {
  margin-left: auto;
  border-color: var(--brass-gold);
  color: var(--brass-deep);
}

.svg-inline-stage svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.svg-inline-stage .bp-step {
  transition: opacity 0.28s ease, filter 0.28s ease;
}
.svg-inline-stage[data-active-step="1"] .bp-step:not([data-step="1"]),
.svg-inline-stage[data-active-step="2"] .bp-step:not([data-step="2"]),
.svg-inline-stage[data-active-step="3"] .bp-step:not([data-step="3"]),
.svg-inline-stage[data-active-step="4"] .bp-step:not([data-step="4"]) {
  opacity: 0.15;
  filter: grayscale(0.55);
}

.svg-step-caption-list {
  margin: 14px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
.svg-step-caption-list li {
  font-size: 0.92rem;
  padding: 5px 10px;
  border-radius: 7px;
  transition: background-color 0.2s ease;
}
.svg-step-caption-list li.is-highlighted {
  background: rgba(184, 134, 45, 0.22);
  font-weight: 700;
  color: var(--ink-primary);
}

/* Data Tables & 108-Row Database Explorer */
.table-scroll,
.db-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1.5px solid var(--vellum-border);
  border-radius: 14px;
  background: var(--vellum-paper);
  margin: 18px 0 24px;
  box-shadow: var(--shadow-soft);
}

.atlas-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
  min-width: 640px;
}
.atlas-data-table caption {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-primary);
  background: var(--vellum-bg);
  border-bottom: 1px solid var(--vellum-border);
}
.atlas-data-table th,
.atlas-data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--vellum-border);
  text-align: left;
  vertical-align: top;
}
.atlas-data-table th {
  background: var(--vellum-deep);
  color: var(--ink-primary);
  font-weight: 800;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.atlas-data-table tbody tr:hover {
  background: rgba(184, 134, 45, 0.07);
}
.table-sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.ev-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.ev-official {
  background: rgba(37, 109, 73, 0.14);
  color: var(--emerald-ok);
}
.ev-community {
  background: rgba(42, 111, 123, 0.14);
  color: var(--sea-deep);
}

.db-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--vellum-paper);
  border: 1.5px solid var(--brass-gold);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.db-search-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-bg);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.db-select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.db-select {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-bg);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
}
.db-view-switch {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}
.view-btn {
  min-height: 38px;
  padding: 6px 13px;
  border-radius: 9px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-bg);
  color: var(--ink-primary);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.view-btn.is-active {
  background: var(--ink-primary);
  color: var(--vellum-paper);
}
.db-status-line {
  margin: 10px 2px 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.db-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.db-folio-card {
  background: var(--vellum-paper);
  border: 1px solid var(--vellum-border);
  border-radius: 12px;
  padding: 16px;
}
.folio-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.folio-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.folio-card-meta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brass-deep);
  margin-bottom: 8px;
}
.folio-card-tip {
  font-size: 0.88rem;
  background: var(--vellum-bg);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 0;
}

/* Callouts & FAQ */
.callout-brass {
  background: var(--vellum-paper);
  border: 1.5px solid var(--brass-gold);
  border-left-width: 5px;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 18px 0 24px;
}
.callout-brass p {
  margin: 0;
}

.faq-ledger-list {
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--vellum-paper);
  border: 1px solid var(--vellum-border);
  border-radius: 12px;
  padding: 14px 18px;
}
.faq-question {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink-primary);
  cursor: pointer;
  min-height: 32px;
}
.faq-answer p {
  margin: 10px 0 0;
  font-size: 0.97rem;
}

/* Next Voyages Relay */
.next-voyages-relay {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 2px solid var(--vellum-border);
}
.relay-kicker {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brass-deep);
  margin-bottom: 14px;
}
.relay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.relay-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--vellum-paper);
  border: 1.5px solid var(--vellum-border);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink-primary);
  box-shadow: var(--shadow-soft);
}
.relay-card:hover {
  border-color: var(--brass-gold);
  box-shadow: var(--shadow-lift);
}
.relay-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--sea-deep);
  letter-spacing: 0.06em;
}
.relay-title {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  line-height: 1.28;
}
.relay-desc {
  font-size: 0.89rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* Footer */
.atlas-footer {
  position: relative;
  z-index: 4;
  background: var(--vellum-deep);
  border-top: 2px solid var(--brass-gold);
  padding: 40px 20px 48px;
  color: var(--ink-body);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
}
.footer-brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 8px;
}
.footer-disclaimer {
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--ink-body);
  margin: 0;
}
.footer-col-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brass-deep);
  margin-bottom: 10px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.footer-links a {
  display: inline-block;
  padding: 5px 0;
  color: var(--ink-primary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.footer-links a:hover {
  color: var(--sea-deep);
  text-decoration: underline;
}

/* Command Palette & HD Lightbox Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(26, 34, 48, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 76px 16px 24px;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.cmd-dialog {
  width: min(680px, 100%);
  background: var(--vellum-paper);
  border: 2px solid var(--brass-gold);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}
.cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--vellum-border);
}
.cmd-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
}
.cmd-close-btn {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--vellum-border);
  background: var(--vellum-bg);
  font-weight: 700;
  cursor: pointer;
}
.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  margin: 0;
  list-style: none;
}
.cmd-result-link {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-primary);
}
.cmd-result-link:hover,
.cmd-result-link:focus {
  background: var(--vellum-deep);
}
.cmd-res-meta {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--sea-deep);
}
.cmd-res-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.lightbox-dialog {
  width: min(1080px, 100%);
  background: var(--vellum-paper);
  border: 2px solid var(--brass-gold);
  border-radius: 16px;
  padding: 14px;
  margin: auto;
}
.lightbox-dialog img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  background: var(--vellum-bg);
}
.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}
.lightbox-caption {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-primary);
}

/* Responsive Breakpoints: 1024 / 768 / 390 / 320 Zero Overflow */
@media (max-width: 1040px) {
  .viz-deck-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero-inner,
  .viz-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-astrolabe-ornament {
    display: none;
  }
  .atlas-workbench {
    grid-template-columns: minmax(0, 1fr);
  }
  .three-col-cards,
  .relay-grid,
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .realm-bento-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .viz-deck-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .viz-turn-scrubber {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .viz-theatre-shell {
    padding: 14px 12px;
  }
  .astrolabe-dock {
    padding: 0 8px 0 10px;
    gap: 4px;
  }
  .dock-brand-text {
    display: none;
  }
  .dock-kbd {
    display: none;
  }
  .dock-link {
    padding: 0 9px;
    font-size: 0.82rem;
  }
  .dock-cmd-btn {
    padding: 0 10px;
    font-size: 0.8rem;
  }
  .hero-stage {
    padding: 84px 12px 32px;
    min-height: 400px;
  }
  .hero-plaque {
    padding: 18px 18px;
  }
  .atlas-main {
    padding: 10px 14px 48px;
  }
  .atlas-viewport {
    min-height: 340px;
  }
  .atlas-cardinal-watermark {
    font-size: 0.6rem;
    padding: 2px 7px;
  }
  .atlas-legend-pill {
    display: none;
  }
  .db-view-switch {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .astrolabe-ring-outer,
  .astrolabe-ring-inner,
  .hero-backdrop-img,
  .chord-portal,
  .chord-beam,
  .atlas-active-trace,
  .node-pulse,
  .tilt-card,
  .reveal-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  #celestial-motes-canvas {
    display: none !important;
  }
}
