@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./fonts/cormorant-garamond-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/inter-latin-600-normal.woff2') format('woff2');
}

:root {
  --ink: #070b0e;
  --ink-2: #0b1216;
  --gold: #d9b36a;
  --gold-dim: #8c7238;
  --gold-soft: #f0dfb4;
  --paper: #f6efe3;
  --paper-2: #ede3d1;
  --paper-ink: #1a1813;
  --paper-muted: #6e6656;
  --celadon: #8fb6ad;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

/* soft vignette + horizon glow */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(30, 44, 66, 0.35) 0%, rgba(7, 9, 13, 0) 55%),
    radial-gradient(100% 100% at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.72) 100%);
}
.vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ---------- chrome ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(16px, 3vw, 34px) clamp(18px, 4vw, 48px);
  pointer-events: none;
  z-index: 5;
}

.wordmark { pointer-events: auto; }

.wordmark .kicker {
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 10px;
}

.wordmark h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 4.5vw, 58px);
  letter-spacing: 0.005em;
  line-height: 0.98;
}

.wordmark h1 em {
  font-style: italic;
  color: var(--gold);
}

.wordmark .tagline {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  line-height: 1.2;
  color: var(--gold-soft);
}

.wordmark .intro-copy {
  margin: 8px 0 0;
  max-width: 38ch;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(246, 239, 227, 0.76);
}

.controls {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.btn {
  appearance: none;
  border: 1px solid rgba(217, 179, 106, 0.28);
  background: rgba(10, 13, 18, 0.55);
  color: var(--gold-soft);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.btn:hover { border-color: var(--gold); color: #fff; background: rgba(217, 179, 106, 0.12); }
.btn[aria-pressed='true'] { border-color: var(--gold); color: var(--ink); background: var(--gold); }

/* ---------- info panel ---------- */

.panel {
  position: fixed;
  top: calc(50% + 14px);
  right: clamp(16px, 3vw, 46px);
  width: min(404px, calc(100vw - 32px));
  max-height: min(80vh, 660px);
  transform: translate(24px, -50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease), visibility 0.45s;
  z-index: 6;
}

.panel.open {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 40%),
    linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--paper-ink);
  border-radius: 3px;
  padding: 21px 27px 16px;
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.85),
    0 2px 0 rgba(255, 255, 255, 0.6) inset,
    0 0 0 1px rgba(27, 26, 21, 0.16);
  overflow: hidden auto;
  max-height: min(80vh, 660px);
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 26, 21, 0.25) transparent;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

.card .ghost-symbol {
  position: absolute;
  top: -26px;
  right: -6px;
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  color: rgba(27, 26, 21, 0.06);
  pointer-events: none;
  user-select: none;
}

.card .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--paper-muted);
  margin-bottom: 12px;
}
.card .eyebrow .of {
  color: rgba(27, 26, 21, 0.32);
  letter-spacing: 0.18em;
}
.card .eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(27, 26, 21, 0.16);
}

.card h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 35px;
  letter-spacing: -0.005em;
  line-height: 1.0;
}

.card .dates {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 0;
}

.chip {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(27, 26, 21, 0.2);
  color: var(--paper-ink);
  background: rgba(255, 255, 255, 0.4);
}
.chip.element { border-color: currentColor; }

.card p.lead {
  margin: 11px 0 0;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.48;
}

.card .myth {
  margin: 10px 0 0;
  padding-left: 13px;
  border-left: 2px solid rgba(217, 179, 106, 0.6);
  font-size: 12.5px;
  line-height: 1.5;
  font-style: italic;
  color: var(--paper-muted);
}

.card .section-label {
  margin: 10px 0 5px;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.trait-list { display: flex; flex-wrap: wrap; gap: 6px; }

.trait {
  font-family: var(--serif);
  font-size: 14.5px;
  padding: 1px 11px;
  border-radius: 2px;
  background: rgba(27, 26, 21, 0.07);
}

.compat { display: flex; flex-wrap: wrap; gap: 8px; }

.compat button {
  appearance: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--paper-ink);
  background: transparent;
  border: 1px solid rgba(27, 26, 21, 0.28);
  border-radius: 2px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.compat button:hover { background: rgba(217, 179, 106, 0.24); border-color: var(--gold-dim); }
.compat button span { font-family: var(--serif); font-size: 14px; }

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper-muted);
  font-size: 18px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}
.close:hover { background: rgba(27, 26, 21, 0.08); color: var(--paper-ink); }

/* ---------- bottom rail ---------- */

.rail {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(217, 179, 106, 0.16);
  background: rgba(8, 10, 14, 0.6);
  backdrop-filter: blur(10px);
  z-index: 5;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(246, 239, 227, 0.42);
  font-size: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
  flex: 0 0 auto;
}
.rail button:hover { color: var(--gold-soft); transform: translateY(-1px); }
.rail button[aria-current='true'] { color: var(--ink); background: var(--gold); }

/* ---------- hint ---------- */


/* ---------- the loom scrubber (v8) ---------- */
.loom {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 5;
  width: min(404px, calc(100vw - 40px));
  padding: 11px 16px 10px;
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 4%, rgba(9, 15, 19, 0.68));
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px -30px #000, inset 0 1px 0 rgba(246, 239, 227, 0.05);
  transform: translateX(-50%);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
    border-color 0.45s var(--ease), background 0.45s var(--ease);
}
.loom-read {
  display: flex;
  align-items: center;
  gap: 9px;
}
.loom-date {
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.52);
}
.loom-group {
  padding-left: 9px;
  border-left: 1px solid rgba(246, 239, 227, 0.14);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}
.loom-open {
  appearance: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.loom-open:hover { color: var(--paper); }
.loom-open i {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}
.loom-open:hover i { transform: translateX(3px); }
.loom-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-family: "Noto Sans Symbols", "Cormorant Garamond", "Noto Sans CJK SC", serif;
  font-size: 14px;
  line-height: 1;
}
.loom-glyph svg { display: block; }
.loom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  margin: 3px 0 1px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--gold) 78%, transparent) 0 var(--fill, 0%),
    color-mix(in srgb, var(--gold) 13%, transparent) var(--fill, 0%) 100%
  );
  outline: none;
  cursor: pointer;
}
.loom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #0a1014;
  background: var(--gold);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent),
    0 0 14px color-mix(in srgb, var(--gold) 45%, transparent);
  cursor: grab;
}
.loom-range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #0a1014;
  background: var(--gold);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent);
  cursor: grab;
}
.loom-range:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 8px;
}
.loom-cap {
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(246, 239, 227, 0.26);
  transition: color 0.3s var(--ease);
}
.loom.hinting .loom-cap { color: rgba(246, 239, 227, 0.45); }
.loom.hinting .loom-range::-webkit-slider-thumb {
  animation: thumbPulse 2.2s ease-in-out infinite;
}
.loom.hinting .loom-range::-moz-range-thumb {
  animation: thumbPulse 2.2s ease-in-out infinite;
}
@keyframes thumbPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent),
      0 0 12px color-mix(in srgb, var(--gold) 30%, transparent);
  }
  50% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 85%, transparent),
      0 0 24px color-mix(in srgb, var(--gold) 65%, transparent);
  }
}
body.panel-open .loom {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.planet-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  width: 258px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 179, 106, 0.3);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -24px #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
  pointer-events: none;
}
.planet-tip.show { opacity: 1; visibility: visible; }
.pt-head { display: flex; align-items: baseline; gap: 8px; }
.pt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  transform: translateY(-1px);
}
.pt-name {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--paper);
}
.pt-epi {
  margin-left: auto;
  max-width: 104px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  color: var(--faint);
}
.pt-line {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(246, 239, 227, 0.68);
  text-align: left;
  hyphens: none;
}
.pt-signs {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.pt-hint {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.centre-toast {
  position: fixed;
  left: clamp(18px, 4vw, 48px);
  bottom: 26px;
  z-index: 6;
  transform: translateY(8px);
  opacity: 0;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  border-radius: 999px;
  background: rgba(9, 15, 19, 0.72);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.centre-toast.show { opacity: 1; transform: translateY(0); }

.hint {
  position: fixed;
  left: clamp(18px, 4vw, 48px);
  bottom: clamp(16px, 2.6vw, 30px);
  max-width: 30vw;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.32);
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.5s var(--ease);
}
.hint.hide { opacity: 0; }

/* ---------- intro ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 18px;
  background: radial-gradient(80% 70% at 50% 45%, #101722 0%, #05070a 70%);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
.intro.gone { opacity: 0; visibility: hidden; }

.intro-inner {
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: 6px 0;
  text-align: center;
}

.intro .mark {
  width: min(184px, 48vw);
  height: auto;
  aspect-ratio: 1;
  display: block;
  margin: 4px auto 26px;
  animation: spin 120s linear infinite;
}
.intro .mark svg { display: block; width: 100%; height: 100%; }
.im-ring { fill: none; stroke: rgba(217, 179, 106, 0.22); stroke-width: 1; }
.im-ring.inner { stroke: rgba(217, 179, 106, 0.12); }
.im-tick { stroke: rgba(217, 179, 106, 0.18); stroke-width: 0.6; }
.im-glyph {
  font-family: "Noto Sans Symbols", "Cormorant Garamond", serif;
  font-size: 13px;
  fill: #d9b36a;
}
.im-planet { opacity: 0.85; }
.im-core { fill: #d9b36a; }
@keyframes spin { to { transform: rotate(360deg); } }

.intro-kicker {
  font-size: 10px;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 16px;
}

.intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 9vw, 78px);
  margin: 0 0 18px;
  letter-spacing: -0.012em;
  line-height: 0.95;
}
.intro h1 em { color: var(--gold); font-style: italic; }

.intro p {
  width: 100%;
  max-width: 48ch;
  margin: 0 auto 30px;
  color: rgba(246, 239, 227, 0.62);
  font-size: 14.5px;
  line-height: 1.7;
}

.intro .enter {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 15px 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.intro .enter:hover { background: var(--gold); color: var(--ink); }

/* ---------- loader ---------- */

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  z-index: 30;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-dim);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
/* the wordmark is already fading in underneath: drop the loader's text at once
   so the two never ghost through each other while the ink veil clears */
.loader.gone { opacity: 0; visibility: hidden; color: transparent; }

@media (max-width: 780px) {

  .panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; transform: translateY(24px); }
  .panel.open { transform: translateY(0); }
  .card { max-height: 58vh; border-radius: 16px 16px 0 0; }
  .rail { display: none; }
  .planet-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  width: 258px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 179, 106, 0.3);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -24px #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
  pointer-events: none;
}
.planet-tip.show { opacity: 1; visibility: visible; }
.pt-head { display: flex; align-items: baseline; gap: 8px; }
.pt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  transform: translateY(-1px);
}
.pt-name {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--paper);
}
.pt-epi {
  margin-left: auto;
  max-width: 104px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  color: var(--faint);
}
.pt-line {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(246, 239, 227, 0.68);
  text-align: left;
  hyphens: none;
}
.pt-signs {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.pt-hint {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.centre-toast {
  position: fixed;
  left: clamp(18px, 4vw, 48px);
  bottom: 26px;
  z-index: 6;
  transform: translateY(8px);
  opacity: 0;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  border-radius: 999px;
  background: rgba(9, 15, 19, 0.72);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.centre-toast.show { opacity: 1; transform: translateY(0); }

.hint { display: none; }
  .loom {
    display: grid;
    bottom: 10px;
    width: calc(100vw - 20px);
    padding: 9px 13px 8px;
    border-radius: 12px;
  }
  .loom-cap { display: none; }
  .loom-date { font-size: 8px; }
  .loom-open { font-size: 9px; }
}

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

/* ---------- v2: element filter ---------- */

.filters {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 7px;
  border: 1px solid rgba(217, 179, 106, 0.18);
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.55);
  backdrop-filter: blur(8px);
}

.chipbtn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(246, 239, 227, 0.45);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.chipbtn:hover { color: var(--gold-soft); }
.chipbtn[aria-pressed='true'] { color: var(--ink); background: var(--gold); }

/* ---------- v2: date band inside the card ---------- */

.yearbar {
  position: relative;
  height: 3px;
  margin-top: 9px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(27, 26, 21, 0.1) 0 calc(100% / 12 - 1px),
      rgba(27, 26, 21, 0.22) calc(100% / 12 - 1px) calc(100% / 12)
    );
}

.yearbar .fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}

@media (max-width: 780px) {
  .filters { display: none; }
}

/* ---------- v4: tradition switcher ---------- */

.cultures {
  position: fixed;
  left: clamp(18px, 3.2vw, 46px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 5;
}

.cultures-label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.26);
  margin-bottom: 2px;
}

.cultures button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  position: relative;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.05;
  color: rgba(246, 239, 227, 0.42);
  transition: color 0.3s var(--ease);
}

.cultures button span {
  display: block;
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.22);
  transition: color 0.3s var(--ease);
}

.cultures button:hover { color: var(--gold-soft); }
.cultures button[aria-pressed='true'] { color: var(--gold); }
.cultures button[aria-pressed='true'] span { color: rgba(246, 239, 227, 0.42); }

.cultures button::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 5px;
  width: 2px;
  height: 15px;
  background: var(--gold);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.cultures button[aria-pressed='true']::before { opacity: 1; transform: scaleY(1); }

.flash {
  position: fixed;
  inset: 0;
  background: #04070a;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.19s linear;
}
.flash.on { opacity: 0.94; }

.chipbtn .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

.rail button svg { display: block; margin: 0 auto; }
.rail button.cjk { font-size: 16px; }
.compat button svg { display: block; }
.card .ghost-symbol svg { display: block; }
.card .ghost-symbol .rune { width: 132px; height: 132px; }

@media (max-width: 780px) {
  .cultures {
    left: 16px;
    right: 16px;
    top: 84px;
    transform: none;
    flex-direction: row;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .cultures::-webkit-scrollbar { display: none; }
  .cultures-label { display: none; }
  .cultures button { font-size: 17px; white-space: nowrap; }
  .cultures button span { display: none; }
  .cultures button::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: -5px;
    width: auto;
    height: 1.5px;
    transform: scaleX(0.4);
  }
  .cultures button[aria-pressed='true']::before { transform: scaleX(1); }
}

/* the chrome recedes while a card is open */
.cultures { transition: opacity 0.45s var(--ease); }
body.panel-open .cultures { opacity: 0.28; }
body.panel-open .cultures:hover,
body.panel-open .cultures:focus-within { opacity: 1; }

@media (max-width: 900px) {
  .planet-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  width: 258px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 179, 106, 0.3);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -24px #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
  pointer-events: none;
}
.planet-tip.show { opacity: 1; visibility: visible; }
.pt-head { display: flex; align-items: baseline; gap: 8px; }
.pt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  transform: translateY(-1px);
}
.pt-name {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--paper);
}
.pt-epi {
  margin-left: auto;
  max-width: 104px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  color: var(--faint);
}
.pt-line {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(246, 239, 227, 0.68);
  text-align: left;
  hyphens: none;
}
.pt-signs {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.pt-hint {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.centre-toast {
  position: fixed;
  left: clamp(18px, 4vw, 48px);
  bottom: 26px;
  z-index: 6;
  transform: translateY(8px);
  opacity: 0;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  border-radius: 999px;
  background: rgba(9, 15, 19, 0.72);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.centre-toast.show { opacity: 1; transform: translateY(0); }

.hint { display: none; }
}

/* ---------- v5: showcase layer ---------- */

.controls { flex-wrap: wrap; justify-content: flex-end; }

.tint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(72% 62% at 50% 44%, var(--tint, rgba(0, 0, 0, 0)) 0%, rgba(0, 0, 0, 0) 72%);
}

.bridge {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--paper-muted);
}
.bridge button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--gold-dim);
  background: none;
  padding: 0 0 1px;
  font: inherit;
  color: var(--paper-ink);
  cursor: pointer;
}
.bridge button:hover { color: var(--gold-dim); }

.atlas {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: rgba(4, 6, 9, 0.84);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.atlas.open { opacity: 1; visibility: visible; }

.atlas-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) clamp(20px, 4vw, 48px) 56px;
}

.atlas-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.atlas-kicker {
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 10px;
}

.atlas-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1;
}
.atlas-head h2 em {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.46em;
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.01em;
}
.atlas-head p {
  max-width: 56ch;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.62;
  color: rgba(246, 239, 227, 0.55);
}

.atlas-close {
  appearance: none;
  border: 1px solid rgba(246, 239, 227, 0.2);
  background: transparent;
  color: rgba(246, 239, 227, 0.7);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.atlas-close:hover { border-color: var(--gold); color: var(--gold); }

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 10px;
}

.atlas-card {
  appearance: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px 16px 15px;
  text-align: left;
  color: var(--paper);
  background: rgba(246, 239, 227, 0.035);
  border: 1px solid rgba(246, 239, 227, 0.09);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.atlas-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--group);
  opacity: 0.55;
}
.atlas-card:hover {
  background: rgba(246, 239, 227, 0.075);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.atlas-mark {
  height: 46px;
  display: flex;
  align-items: center;
  color: var(--gold-soft);
}
.atlas-glyph { font-family: var(--serif); font-size: 33px; line-height: 1; }
.atlas-glyph.cjk { font-family: 'Noto Serif CJK SC', 'Noto Serif CJK JP', serif; font-size: 30px; }
.atlas-name { font-family: var(--serif); font-size: 21px; line-height: 1.1; }
.atlas-dates {
  font-size: 9.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.45;
  color: rgba(246, 239, 227, 0.42);
}
.atlas-group {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.5);
}
.atlas-group i { width: 5px; height: 5px; border-radius: 50%; background: var(--group); }

.atlas-foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(246, 239, 227, 0.08);
  max-width: 72ch;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(246, 239, 227, 0.35);
}

@media (max-width: 780px) {
  .atlas-inner { padding: 22px 16px 40px; }
  .atlas-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
  .atlas-card { padding: 12px 12px 11px; }
  .atlas-head h2 em { display: block; margin: 6px 0 0; }
  .atlas-head p { display: none; }
}

.actions { display: flex; gap: 8px; }
.actions a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.rail button { font-family: 'Noto Sans Symbols', var(--sans); }
.card .ghost-symbol { font-family: var(--serif), 'Noto Sans Symbols'; }
.compat button span { font-family: var(--serif), 'Noto Sans Symbols'; }
.atlas-glyph { font-family: var(--serif), 'Noto Sans Symbols', serif; }

/* keep the tradition index legible over the wheel at narrow widths */
.cultures::before {
  content: '';
  position: absolute;
  inset: -28px -48px -28px -46px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 96% at 18% 50%, rgba(5, 8, 11, 0.94) 0%, rgba(5, 8, 11, 0.72) 52%, rgba(5, 8, 11, 0) 100%);
}

/* ---------- v6: the fuller note ---------- */

.panel { transition: opacity 0.45s var(--ease), transform 0.55s var(--ease), visibility 0.45s, width 0.45s var(--ease); }
.panel.reading { width: min(474px, calc(100vw - 32px)); }

.card-body {
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}
.card-body.swap-out { opacity: 0; transform: translateY(6px); }

.dates-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.note-tab {
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--gold-dim);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.note-tab:hover { color: var(--paper-ink); }
.note-tab i {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.4s var(--ease);
}
.note-tab[aria-expanded='true'] i { transform: rotate(180deg); }

.note-close {
  appearance: none;
  display: flex;
  width: 100%;
  margin: 18px 0 0;
  padding: 10px 0 0;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  border: 0;
  border-top: 1px solid rgba(27, 26, 21, 0.1);
  background: none;
  color: rgba(27, 26, 21, 0.55);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.note-close:hover { color: var(--paper-ink); }
.note-close i { font-style: normal; font-size: 11px; }

.lore {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.lore-inner { overflow: hidden; }
.lore.open { grid-template-rows: 1fr; }

.lore-block { padding-top: 16px; }
.lore-block h4 {
  margin: 0 0 5px;
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.lore-block p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: rgba(27, 26, 21, 0.72);
}

.tourbar {
  height: 2px;
  margin-bottom: 6px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(246, 239, 227, 0.12);
}
.tourbar[hidden] { display: none; }
.tourbar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
@keyframes tourFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- v6: atlas scholarship ---------- */

.atlas-lore {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  max-width: 82ch;
  margin-top: 24px;
}
.atlas-lore h4 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.atlas-lore p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.66;
  color: rgba(246, 239, 227, 0.58);
}
.atlas-note {
  max-width: 84ch;
  margin: 16px 0 0;
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.66;
  color: rgba(246, 239, 227, 0.36);
}

@keyframes atlasIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.atlas-card {
  animation: atlasIn 0.55s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}

@media (max-width: 780px) {
  .panel.reading { width: 100%; }
  .atlas-lore { grid-template-columns: 1fr; gap: 14px; }
  .atlas-head p { display: block; }
}

/* ---------- mobile topbar with the book + centre controls (v8) ---------- */
@media (max-width: 780px) {
  .topbar {
    display: block;
    padding: 16px 18px 8px;
  }
  .wordmark { max-width: 100%; }
  .wordmark h1 { font-size: 40px; }
  .wordmark .tagline { font-size: 17px; margin-top: 5px; }
  .wordmark .intro-copy { font-size: 11px; line-height: 1.4; max-width: 46ch; margin-top: 5px; }
  .wordmark .kicker { font-size: 7px; letter-spacing: 0.3em; }
  .controls {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .actions .btn { padding: 7px 10px; font-size: 9px; letter-spacing: 0.12em; }
  .cultures { top: 176px; }
  .planet-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  width: 258px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 179, 106, 0.3);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -24px #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
  pointer-events: none;
}
.planet-tip.show { opacity: 1; visibility: visible; }
.pt-head { display: flex; align-items: baseline; gap: 8px; }
.pt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  transform: translateY(-1px);
}
.pt-name {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--paper);
}
.pt-epi {
  margin-left: auto;
  max-width: 104px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  color: var(--faint);
}
.pt-line {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.6;
  color: rgba(246, 239, 227, 0.68);
  text-align: left;
  hyphens: none;
}
.pt-signs {
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.pt-hint {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.centre-toast {
    left: 50%;
    bottom: 74px;
    transform: translate(-50%, 8px);
  }
  .centre-toast.show { transform: translate(-50%, 0); }
}


/* ---------- v10: sign dictation ---------- */
.dict {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 9px 0 1px;
  padding-top: 7px;
  border-top: 0.5pt solid rgba(27, 26, 21, 0.13);
}
.dict-btn {
  appearance: none;
  flex: none;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  background: none;
  color: var(--gold-dim);
  font-size: 8px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.dict-btn:hover { background: rgba(217, 179, 106, 0.16); }
.dict-btn.playing { background: var(--gold-dim); color: var(--paper); }
.dict-btn:disabled { opacity: 0.4; cursor: default; }
.dict-label {
  font-family: var(--sans);
  font-size: 7.2px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-muted);
  white-space: nowrap;
}
.dict-seek {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(27, 26, 21, 0.14);
  cursor: pointer;
}
.dict-seek i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 2px;
  background: var(--gold-dim);
}
.dict-seek:focus-visible { outline: 1px solid var(--gold-dim); outline-offset: 4px; }
.dict-time {
  font-family: var(--sans);
  font-size: 6.8px;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-height: 660px) {
  .intro .mark { width: min(148px, 42vw); margin: 0 auto 18px; }
  .intro h1 { font-size: clamp(38px, 8vw, 62px); margin-bottom: 12px; }
  .intro p { font-size: 13.5px; line-height: 1.6; margin-bottom: 22px; }
  .intro-kicker { margin-bottom: 10px; }
  .intro .enter { padding: 12px 26px; }
}

/* Knowledge-base refinement: preserve a visible route to every figure on phones. */
.rail button{color:rgba(246,239,227,.78)}
@media(max-width:780px){.rail{display:flex;bottom:77px;max-width:calc(100vw - 20px);border-radius:12px;scrollbar-width:thin;background:rgba(8,10,14,.88)}.rail button{width:34px;height:34px}.panel-open .rail{display:none}.cultures{top:252px}.actions .btn{font-size:10px;padding:8px 10px}}
/* Visibility must switch before focus is moved into an opened surface. */
.panel{transition:opacity .45s var(--ease),transform .55s var(--ease),width .45s var(--ease)}
.atlas{transition:opacity .5s var(--ease)}

/* A fixed reading column keeps the tradition index clear of the masthead. */
@media (min-width: 781px) {
  .wordmark h1 { font-size: clamp(48px, 5vw, 68px); }
  .cultures {
    top: clamp(245px, 35vh, 310px);
    max-height: calc(100vh - 340px);
    transform: none;
    width: min(220px, 18vw);
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  .tradition-note { position: fixed; right: clamp(24px, 4vw, 52px); bottom: 38px; width: min(225px, 19vw); z-index: 4; padding-top: 14px; border-top: 1px solid rgba(217,179,106,.28); transition: opacity .25s; }
  body.panel-open .tradition-note { opacity: 0; pointer-events: none; }
  .tradition-note span { color: var(--gold-dim); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
  .tradition-note p { color: rgba(246,239,227,.68); font-size: 12px; line-height: 1.55; margin: 9px 0 0; }
  .tradition-note .tradition-hint { color: rgba(246,239,227,.42); font-size: 10px; }
}
@media (max-width: 780px) { .tradition-note { display: none; } }
.vignette { background: radial-gradient(110% 90% at 50% 42%, rgba(10,16,25,.1) 0%, rgba(3,5,8,.15) 60%), radial-gradient(100% 100% at 50% 50%, transparent 38%, rgba(0,0,0,.8) 100%); }

@media (min-width: 781px) and (max-height: 600px) { .tradition-note { display: none; } }

/* Celestial sign cards */
.card {
  --paper-ink: #f6efe3;
  --paper-muted: #b3a992;
  background: linear-gradient(150deg, #171c25 0%, #0b1018 62%, #080c12 100%);
  color: var(--paper-ink);
  border: 1px solid rgba(217,179,106,.27);
  border-radius: 5px;
  box-shadow: 0 32px 80px -22px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.05) inset;
  scrollbar-color: rgba(217,179,106,.4) transparent;
}
.card::after { opacity: .04; mix-blend-mode: screen; }
.card .ghost-symbol { color: rgba(217,179,106,.09); }
.card .eyebrow .of { color: rgba(246,239,227,.4); }
.card .eyebrow::after, .card .dict, .card .note-close { border-color: rgba(217,179,106,.2); }
.card .eyebrow::after { background: rgba(217,179,106,.2); }
.card .chip { color: #e9e1d1; background: rgba(255,255,255,.035); border-color: rgba(217,179,106,.3); }
.card .chip.element { border-color: currentColor; }
.card .trait { background: rgba(217,179,106,.12); color: #eee2c9; }
.card .compat button { color: #eee5d3; border-color: rgba(217,179,106,.32); }
.card .compat button:hover { background: rgba(217,179,106,.14); border-color: var(--gold); }
.card .close:hover { background: rgba(217,179,106,.15); color: var(--gold-soft); }
.card .note-close { color: #b3a992; }
.card .note-tab, .card .lore-block h4, .card .dict-btn { color: #d9b36a; }
.card .lore-block p { color: rgba(246,239,227,.78); }
.card .dict-seek { background: rgba(246,239,227,.2); }
.card .yearbar { background: rgba(246,239,227,.15); }

/* Four traditions, each with its own color and a clearer active state. */
.cultures-label { color: rgba(246,239,227,.62); font-weight: 600; letter-spacing: .24em; }
.cultures button[data-culture="western"] { --tradition-color: #e0ba70; --tradition-rgb: 224,186,112; }
.cultures button[data-culture="vedic"] { --tradition-color: #eaa16b; --tradition-rgb: 234,161,107; }
.cultures button[data-culture="chinese"] { --tradition-color: #ed806c; --tradition-rgb: 237,128,108; }
.cultures button[data-culture="celtic"] { --tradition-color: #b3ce89; --tradition-rgb: 179,206,137; }
.cultures button {
  color: rgba(246,239,227,.78);
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.cultures button:hover, .cultures button:focus-visible { color: var(--tradition-color); }
.cultures button[aria-pressed='true'] { color: var(--tradition-color); }
.cultures button span, .cultures button[aria-pressed='true'] span { color: rgba(246,239,227,.58); }
@media (min-width: 781px) {
  .cultures { width: min(240px, 20vw); gap: 7px; }
  .cultures-label { margin: 0 0 5px 3px; }
  .cultures button {
    min-height: 55px; padding: 8px 32px 8px 13px; border: 1px solid rgba(246,239,227,.08);
    border-radius: 6px; font-size: clamp(22px, 1.9vw, 26px);
    background: linear-gradient(100deg, rgba(var(--tradition-rgb),.045), rgba(8,11,17,.48));
  }
  .cultures button:hover, .cultures button:focus-visible { transform: translateX(4px); border-color: rgba(var(--tradition-rgb),.42); background: rgba(var(--tradition-rgb),.1); }
  .cultures button[aria-pressed='true'] { border-color: rgba(var(--tradition-rgb),.55); background: linear-gradient(105deg, rgba(var(--tradition-rgb),.18), rgba(12,16,24,.82)); box-shadow: inset 2px 0 0 var(--tradition-color), 0 8px 24px rgba(0,0,0,.16); }
  .cultures button::before { display:none; }
  .cultures button::after { content:'✦'; position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--tradition-color); font:13px var(--serif); opacity:.65; }
  .cultures button[aria-pressed='true']::after { opacity:1; text-shadow:0 0 12px var(--tradition-color); }
  .cultures button span { font-size: 8px; letter-spacing: .14em; margin-top: 4px; }
  body.panel-open .cultures { opacity: .52; }
}
@media (max-width:780px) {
  .cultures { gap:8px; align-items:stretch; }
  .cultures button { flex:none; font-size:18px; padding:8px 13px; border:1px solid rgba(var(--tradition-rgb),.24); border-radius:999px; background:rgba(8,11,17,.82); }
  .cultures button[aria-pressed='true'] { border-color:var(--tradition-color); background:rgba(var(--tradition-rgb),.16); }
  .cultures button::before { display:none; }
}
@media (prefers-reduced-motion: reduce) { .cultures button:hover, .cultures button:focus-visible { transform:none; } }

@media (min-width: 781px) and (min-height: 690px) { .cultures { max-height: none; overflow: visible; } }

/* An illustrated index for the Western sky. */
.atlas { background: rgba(4,9,16,.96); }
.atlas-inner { max-width: 1220px; }
.atlas-head h2 { font-size: clamp(38px, 4.5vw, 60px); }
.atlas-head p { color: rgba(246,239,227,.72); }
.atlas-grid { grid-template-columns: repeat(auto-fill, minmax(225px,1fr)); gap: 14px; }
.atlas-card { min-height: 182px; padding: 20px; border-color: rgba(217,179,106,.2); background: linear-gradient(145deg, rgba(24,38,52,.84), rgba(9,16,25,.92)); }
.atlas-card:hover { background: linear-gradient(145deg, rgba(31,48,63,.95), rgba(10,19,28,.96)); border-color: var(--group); }
.atlas-mark { height: 44px; color: var(--group); }
.atlas-glyph { font-size: 38px; }
.atlas-name { font-size: 27px; }
.atlas-dates { color: rgba(246,239,227,.67); }
.atlas-group { color: rgba(246,239,227,.73); }
.atlas-constellation { position: absolute; right: 13px; top: 15px; width: 76px; height: 76px; overflow: visible; opacity: .8; }
.atlas-constellation line { stroke: var(--group); stroke-width: .018; }
.atlas-constellation circle { fill: #fff4d6; filter: drop-shadow(0 0 .06px var(--group)); }
.atlas-story { display:block; margin-top:12px; font: 15px/1.35 var(--serif); color:rgba(246,239,227,.75); }
.atlas-discover { margin-top:auto; padding-top:14px; color:var(--gold-soft); font: 9px/1.3 var(--sans); letter-spacing:.12em; text-transform:uppercase; }
@media (max-width:780px) { .atlas-grid { grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); } .atlas-card { padding:15px; } .atlas-constellation { width:54px; height:54px; } }

/* Keep exploration controls together and give the book its own destination. */
.controls { align-items: center; }
.actions { align-items: center; }
.controls .actions .btn, .controls .book-nav { font-size: 11px; letter-spacing: .12em; font-weight: 500; }
.controls .book-nav { display:inline-flex; align-items:center; gap:12px; margin-left:12px; padding:10px 16px; border:1px solid var(--gold); border-radius:5px; color:var(--gold-soft); background:rgba(217,179,106,.1); text-decoration:none; }
.controls .book-nav:hover { background:rgba(217,179,106,.2); color:#fff; }
.book-nav span { font-size:14px; line-height:1; }
@media(max-width:780px) {
  .controls { flex-direction:row; flex-wrap:wrap; align-items:center; gap:7px; }
  .controls .actions .btn, .controls .book-nav { font-size:10px; }
  .controls .book-nav { margin-left:6px; padding:8px 11px; }
}

/* Navigation sits in the observatory rail; the book remains a separate destination. */
@media (min-width:781px) {
  .observatory-concept .actions { position:fixed; left:34px; bottom:32px; z-index:6; display:flex; flex-wrap:wrap; gap:6px; width:218px; padding-top:15px; border-top:1px solid rgba(217,179,106,.2); }
  .observatory-concept .actions .btn { padding:9px 11px; font-size:10px; }
  .observatory-concept .controls { justify-content:flex-end; }
  .observatory-concept .hint { display:none; }
}
@media (min-width:781px) and (max-height:720px) {
  .observatory-concept .cultures { top:245px; gap:0; }
  .observatory-concept .cultures button { min-height:46px; padding-top:4px; padding-bottom:4px; }
  .observatory-concept .actions { bottom:18px; padding-top:9px; }
}
.atlas-guide { max-width:82ch; margin-top:23px; border-left:2px solid var(--gold); padding: 5px 0 5px 18px; }
.atlas-guide h3 { font:400 24px/1.2 var(--serif); color:var(--gold-soft); margin:0; }
.atlas-head .atlas-guide p { max-width:none; margin:8px 0 9px; color:rgba(246,239,227,.78); }
.atlas-guide a { color:var(--gold-soft); font-size:11px; text-underline-offset:4px; }
