/* Yodaism Archives
   A holocron console: thin HUD rails, dark panels, Yoda's words as the light source.
   Single deep-space theme. */

:root {
  color-scheme: dark;
  --void: #05070f;
  --hull: #0c1222;
  --carbonite: #161e33;
  --rail: #26324f;
  --text: #dce6f5;
  --muted: #8a98b5;
  --holo: #7fd8ff;
  --holo-deep: #2a7fb0;
  --moss: #a3bf6e;
  --crawl: #f5d547;
  --sith: #ff4f4f;

  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --hud: "Chakra Petch", "Eurostile", "Arial", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-fast: 160ms;
  --t-base: 320ms;
  --t-jump: 760ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-holo: cubic-bezier(.34, 1.56, .64, 1);

  --hc-art: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke='%237fd8ff' stroke-width='1.6'><rect x='4' y='4' width='92' height='92'/><rect x='14' y='14' width='72' height='72' stroke-opacity='.5'/><circle cx='50' cy='50' r='20'/><circle cx='50' cy='50' r='9' stroke-opacity='.7'/><path d='M50 14v16M50 70v16M14 50h16M70 50h16' stroke-opacity='.8'/><path d='M50 30l20 20-20 20-20-20z' stroke-opacity='.6'/></g><path d='M4 4h20L4 24zM96 4H76l20 20zM4 96h20L4 76zM96 96H76l20-20z' fill='%237fd8ff' fill-opacity='.6'/></svg>");
}

/* Page transitions between pages (Chrome, Edge, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 260ms ease-in both pageOut; }
::view-transition-new(root) { animation: 520ms var(--ease-out) both pageIn; }
@keyframes pageOut { to { opacity: 0; transform: scale(.97); filter: blur(2px); } }
@keyframes pageIn { from { opacity: 0; transform: scale(1.04); } }

* { box-sizing: border-box; }
html { background: var(--void); scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--void); color: var(--text);
  font: 400 1rem/1.6 var(--body);
  padding-inline: 16px; padding-block: 0 48px;
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.wrap { position: relative; z-index: 1; max-width: 1120px; margin-inline: auto; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--holo); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--holo); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--hull); padding: 8px 12px; }
.skip-link:focus { top: 12px; }

/* HUD bar ----------------------------------------------------------------- */
.hud {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  max-width: 1120px; margin-inline: auto;
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
  padding-block: 14px 12px; border-bottom: 1px solid var(--rail);
  background: linear-gradient(to bottom, var(--void) 70%, color-mix(in oklab, var(--void) 0%, transparent));
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 600 .82rem/1 var(--hud); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.brand b { color: var(--holo); font-weight: 600; }
.brand-mark { width: 14px; height: 14px; border: 1.5px solid var(--holo); transform: rotate(45deg); box-shadow: 0 0 10px var(--holo), inset 0 0 6px var(--holo); }
.worlds-nav { order: 3; flex: 1 1 100%; display: flex; gap: 4px 16px; justify-content: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid color-mix(in oklab, var(--rail) 60%, transparent); }
.worlds-nav a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font: 500 .7rem/1 var(--hud); letter-spacing: .12em; text-transform: uppercase; padding: 6px 2px; transition: color var(--t-fast); }
.worlds-nav a i { width: 7px; height: 7px; border-radius: 50%; background: var(--p); box-shadow: 0 0 6px var(--p); }
.worlds-nav a:hover, .worlds-nav a[aria-current="page"] { color: var(--text); }
.worlds-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--p); }
.hud-tools { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.rank-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 500 .7rem/1.1 var(--hud); letter-spacing: .1em; text-transform: uppercase; }
.rank-chip b { font-weight: 600; color: var(--crawl); }
.rank-chip em { font-style: normal; color: var(--muted); }
.rank-sigil { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--crawl); box-shadow: 0 0 10px -3px var(--crawl); font: 800 .8rem/1 var(--display); color: var(--crawl); }
.rank-chip.bump .rank-sigil { animation: bump 700ms var(--ease-holo); }
@keyframes bump { 40% { transform: scale(1.35); box-shadow: 0 0 22px var(--crawl); } }
.hud-sound { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: 0; padding: 0; font: 500 .7rem/1 var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hud-sound em, .ov-skip em, .site-foot em { font-style: normal; color: var(--holo); }
.hud-sound .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.hud-sound .bars b { width: 2px; height: 30%; background: var(--muted); }
.hud-sound[aria-pressed="true"] { color: var(--text); }
.hud-sound[aria-pressed="true"] .bars b { background: var(--holo); animation: eq .9s ease-in-out infinite; }
.hud-sound[aria-pressed="true"] .bars b:nth-child(2) { animation-delay: -.3s; }
.hud-sound[aria-pressed="true"] .bars b:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* Shared type + panels --------------------------------------------------------- */
.eyebrow { font: 600 .74rem/1 var(--hud); letter-spacing: .18em; text-transform: uppercase; color: var(--holo); }
.section { padding-block: 64px 0; display: grid; gap: 24px; }
.section-head { display: grid; gap: 10px; max-width: 68ch; }
.section-head h2 { font: 800 clamp(2rem, 5vw, 3rem)/.95 var(--display); text-transform: uppercase; }
.section-head p, .panel-note { color: var(--muted); }
.panel {
  position: relative; background: color-mix(in oklab, var(--hull) 88%, transparent);
  border: 1px solid var(--rail); border-radius: 4px; padding: 22px; display: grid; gap: 16px; align-content: start; min-width: 0;
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--holo-deep); border-style: solid; pointer-events: none; }
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font: 700 1.6rem/1 var(--display); text-transform: uppercase; }
.small { color: var(--muted); font-size: .92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.plain-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.why { font: 400 .8rem/1.5 var(--mono); color: var(--muted); border-left: 2px solid var(--p, var(--holo)); padding-left: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  font: 600 .78rem/1 var(--hud); letter-spacing: .14em; text-transform: uppercase;
  padding: 11px 16px; border-radius: 2px; border: 1px solid var(--holo-deep);
  background: color-mix(in oklab, var(--holo) 8%, transparent); color: var(--holo);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: color-mix(in oklab, var(--holo) 18%, transparent); box-shadow: 0 0 18px color-mix(in oklab, var(--holo) 35%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.gold { color: var(--crawl); border-color: color-mix(in oklab, var(--crawl) 55%, transparent); background: color-mix(in oklab, var(--crawl) 8%, transparent); }
.btn.gold:hover { box-shadow: 0 0 18px color-mix(in oklab, var(--crawl) 30%, transparent); }

.badge { font: 600 .68rem/1 var(--hud); letter-spacing: .12em; text-transform: uppercase; padding: 6px 8px; border-radius: 2px; border: 1px solid; }
.badge.light { color: var(--moss); border-color: color-mix(in oklab, var(--moss) 50%, transparent); }
.badge.gold { color: var(--crawl); border-color: color-mix(in oklab, var(--crawl) 45%, transparent); }
.badge.holo { color: var(--holo); border-color: color-mix(in oklab, var(--holo) 45%, transparent); }
.badge.sith { color: var(--sith); border-color: color-mix(in oklab, var(--sith) 45%, transparent); }

/* Hero ------------------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 40px 0; }
.thesis { display: grid; gap: 18px; }
.thesis h1 { font: 800 clamp(2.8rem, 7.5vw, 5.2rem)/.86 var(--display); text-transform: uppercase; }
.thesis h1 span { color: var(--crawl); display: block; }
.thesis p { font-size: 1.08rem; max-width: 48ch; }
.hero-stage {
  position: relative; height: 470px; display: grid; place-items: end center; padding-bottom: 54px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 86%, color-mix(in oklab, var(--holo) 12%, transparent), transparent 62%);
}
.hero-stage .hc-scene { --hs: 118px; }
.hero-hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font: 600 .68rem/1 var(--hud); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hero-stage.opened .hero-hint { visibility: hidden; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rail); border: 1px solid var(--rail); margin-top: 32px; }
.stat { background: var(--hull); padding: 16px 18px; display: grid; gap: 4px; }
.stat strong { font: 700 clamp(1.5rem, 3.4vw, 2.2rem)/1 var(--display); color: var(--crawl); font-variant-numeric: tabular-nums; }
.stat span { font: 500 .7rem/1.3 var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Holocron ---------------------------------------------------------------------- */
.hc-scene { --hs: 150px; position: relative; width: var(--hs); height: var(--hs); perspective: 900px; cursor: pointer; border: 0; padding: 0; background: none; animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -8px; } }
.hc-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-24deg); transition: transform 1.4s var(--ease-out); }
.hc { position: absolute; inset: 0; transform-style: preserve-3d; animation: hcSpin 16s linear infinite; }
@keyframes hcSpin { to { transform: rotateY(360deg); } }
.hc-face { --d: calc(var(--hs) / 2); position: absolute; inset: 0; transform-style: preserve-3d; transform: var(--r) translateZ(var(--d)); transition: transform 1.3s var(--ease-out); }
.hc-q {
  position: absolute; width: 50%; height: 50%;
  background-color: color-mix(in oklab, var(--hull) 80%, transparent);
  background-image: var(--hc-art); background-size: 200% 200%;
  border: 1px solid color-mix(in oklab, var(--holo) 35%, transparent);
  box-shadow: inset 0 0 14px color-mix(in oklab, var(--holo) 22%, transparent);
  transition: transform 1.3s var(--ease-out), box-shadow .8s, background-color .8s;
}
.q1 { left: 0; top: 0; background-position: 0 0; } .q2 { left: 50%; top: 0; background-position: 100% 0; }
.q3 { left: 0; top: 50%; background-position: 0 100%; } .q4 { left: 50%; top: 50%; background-position: 100% 100%; }
.hc-core {
  position: absolute; inset: 22%; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, #fff 0, var(--holo) 28%, color-mix(in oklab, var(--holo) 25%, transparent) 55%, transparent 72%);
  opacity: .35; transform: scale(.7); transition: transform 1.1s var(--ease-out), opacity 1.1s; animation: corePulse 3s ease-in-out infinite;
}
@keyframes corePulse { 50% { opacity: .6; } }
.hc-beam {
  position: absolute; left: 50%; bottom: 50%; width: calc(var(--hs) * 1.9); height: calc(var(--hs) * 2.6); pointer-events: none;
  transform: translateX(-50%) scaleY(0); transform-origin: 50% 100%; opacity: 0; mix-blend-mode: screen;
  clip-path: polygon(43% 100%, 57% 100%, 100% 0, 0 0);
  background: linear-gradient(to top, color-mix(in oklab, var(--holo) 50%, transparent), color-mix(in oklab, var(--holo) 5%, transparent) 80%, transparent);
  transition: transform .9s var(--ease-out) .55s, opacity .6s .55s;
}
.hc-scene.open { animation-play-state: paused; }
.hc-scene.open .hc-tilt { transform: rotateX(-10deg); }
.hc-scene.open .hc-face { --d: calc(var(--hs) * .8); }
.hc-scene.open .q1 { transform: translate(-16%, -16%); } .hc-scene.open .q2 { transform: translate(16%, -16%); }
.hc-scene.open .q3 { transform: translate(-16%, 16%); } .hc-scene.open .q4 { transform: translate(16%, 16%); }
.hc-scene.open .hc-q { background-color: color-mix(in oklab, var(--holo) 12%, var(--hull)); box-shadow: inset 0 0 22px color-mix(in oklab, var(--holo) 55%, transparent), 0 0 18px color-mix(in oklab, var(--holo) 35%, transparent); }
.hc-scene.open .hc-core { opacity: 1; transform: scale(2.2); animation: none; }
.hc-scene.open .hc-beam { transform: translateX(-50%) scaleY(1); opacity: .85; }

/* Yoda's hologram: the traced SVG used as a mask, tinted holo blue, with a
   bottom fade and moving scanlines. */
.holo-figure {
  position: absolute; left: 50%; bottom: 114%; width: calc(var(--hs) * 1.85); aspect-ratio: 2165 / 2062; pointer-events: none;
  background: var(--holo); opacity: 0; transform: translateX(-50%); transform-origin: 50% 100%;
  -webkit-mask-image: url("../img/yoda-hologram.svg"), linear-gradient(to top, transparent 0, #000 22%), repeating-linear-gradient(to bottom, #000 0 2px, rgba(0,0,0,.4) 2px 3px);
  -webkit-mask-size: contain, 100% 100%, auto; -webkit-mask-repeat: no-repeat, no-repeat, repeat; -webkit-mask-position: center, 0 0, 0 0;
  -webkit-mask-composite: source-in, source-in;
  mask-image: url("../img/yoda-hologram.svg"), linear-gradient(to top, transparent 0, #000 22%), repeating-linear-gradient(to bottom, #000 0 2px, rgba(0,0,0,.4) 2px 3px);
  mask-size: contain, 100% 100%, auto; mask-repeat: no-repeat, no-repeat, repeat; mask-position: center, 0 0, 0 0;
  mask-composite: intersect, intersect;
  filter: drop-shadow(0 0 10px color-mix(in oklab, var(--holo) 60%, transparent));
}
.holo-figure.on { animation: figureIn 1.1s var(--ease-holo) both, idleFlicker 6s 1.3s infinite, scan 4s linear infinite; }
@keyframes figureIn {
  0% { opacity: 0; transform: translateX(-50%) scaleY(.02); filter: blur(6px) brightness(2); }
  40% { opacity: .85; transform: translateX(-50%) scaleY(1.05); }
  50% { opacity: .3; } 60% { opacity: .9; } 70% { opacity: .5; }
  100% { opacity: .82; transform: translateX(-50%); }
}
@keyframes idleFlicker { 0%, 46%, 52%, 100% { opacity: .82; } 47% { opacity: .45; } 48% { opacity: .78; } 50% { opacity: .55; } }
@keyframes scan { to { -webkit-mask-position: center, 0 0, 0 30px; mask-position: center, 0 0, 0 30px; } }

.hc-caption, .ov-caption { position: absolute; left: 16px; right: 16px; text-align: center; color: var(--holo); text-shadow: 0 0 12px color-mix(in oklab, var(--holo) 50%, transparent); }
.hc-caption { top: 16px; min-height: 3.2em; font: 400 1.1rem/1.4 var(--body); }
.hc-caption small, .ov-caption small { display: block; margin-top: 6px; font: 400 .74rem/1.3 var(--mono); color: var(--muted); text-shadow: none; }

/* Galaxy map -------------------------------------------------------------------- */
.galaxy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.map { position: relative; aspect-ratio: 1; max-width: 420px; width: 100%; justify-self: center; margin: 20px; }
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--rail); animation: spin 120s linear infinite; }
.orbit.inner { inset: 22%; animation-duration: 80s; animation-direction: reverse; }
.map:hover .orbit, .map:focus-within .orbit, .map:hover .planet, .map:focus-within .planet { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes unspin { to { rotate: -360deg; } }
.core { position: absolute; inset: 41%; border-radius: 50%; background: radial-gradient(circle, var(--crawl), color-mix(in oklab, var(--crawl) 10%, transparent) 70%); filter: blur(1px); opacity: .8; }
.planet {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: var(--s, 46px); height: var(--s, 46px); border-radius: 50%; cursor: pointer; display: block;
  background: radial-gradient(circle at 32% 30%, color-mix(in oklab, var(--p) 40%, white), var(--p) 45%, color-mix(in oklab, var(--p) 25%, black));
  box-shadow: 0 0 22px -4px var(--p);
  transition: transform var(--t-base) var(--ease-holo), box-shadow var(--t-base);
  animation: unspin 120s linear infinite;
}
.orbit.inner .planet { animation-duration: 80s; animation-direction: reverse; }
.planet:hover, .planet:focus-visible, .planet.active { transform: translate(-50%, -50%) scale(1.22); box-shadow: 0 0 34px 2px var(--p); }
.planet span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; white-space: nowrap; font: 600 .62rem/1 var(--hud); letter-spacing: .14em; text-transform: uppercase; color: var(--text); text-shadow: 0 0 6px var(--void); }
.planet::before, .planet::after { content: none; position: absolute; pointer-events: none; }
.deco-suns::before, .deco-suns::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #ffe7a3; box-shadow: 0 0 10px #ffd36b; top: -14px; right: -10px; }
.deco-suns::after { width: 6px; height: 6px; top: -4px; right: -18px; background: #ffb86b; }
.deco-ring::before { content: ""; inset: 34% -32%; border-radius: 50%; border: 2px solid color-mix(in oklab, var(--p) 70%, white); transform: rotate(-18deg); opacity: .8; }
.deco-moon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9d6a0; right: -12px; bottom: 2px; box-shadow: 0 0 6px #b9d6a0; }
.deco-city { background: radial-gradient(circle at 30% 40%, #ffe9a8 0 1px, transparent 2px), radial-gradient(circle at 62% 58%, #ffe9a8 0 1px, transparent 2px), radial-gradient(circle at 48% 26%, #ffe9a8 0 1px, transparent 2px), radial-gradient(circle at 70% 34%, #ffe9a8 0 1px, transparent 2px), radial-gradient(circle at 38% 70%, #ffe9a8 0 1px, transparent 2px), radial-gradient(circle at 32% 30%, color-mix(in oklab, var(--p) 40%, white), var(--p) 45%, color-mix(in oklab, var(--p) 25%, black)); }
.deco-lava { background: radial-gradient(circle at 60% 60%, #ffb347 0 3px, transparent 6px), radial-gradient(circle at 35% 45%, #ff7a2f 0 2px, transparent 5px), radial-gradient(circle at 32% 30%, #ff8a7a, #b02020 50%, #2a0505); }
.deco-swamp { background: radial-gradient(circle at 32% 30%, #c7d9a0, #5e7a3e 45%, #1c2812); }
.dest { display: grid; gap: 12px; justify-items: start; view-transition-name: dest; }
.dest h3 { font: 800 2.4rem/.9 var(--display); text-transform: uppercase; }
.dest p { color: var(--muted); }
::view-transition-old(dest) { animation: 260ms ease-in both destOut; }
::view-transition-new(dest) { animation: 480ms var(--ease-out) both destIn; }
@keyframes destOut { to { opacity: 0; transform: perspective(800px) rotateY(-25deg) translateX(-40px); } }
@keyframes destIn { from { opacity: 0; transform: perspective(800px) rotateY(30deg) translateX(60px); } }

/* Section headers ----------------------------------------------------------------- */
.world-head { display: flex; align-items: center; gap: 22px; padding-block: 40px 28px; }
.world-planet { position: relative; left: auto; top: auto; transform: none; flex: none; --s: 64px; animation: none; cursor: default; }
.world-head-text { display: grid; gap: 8px; max-width: 70ch; }
.world-head .eyebrow { color: var(--p); }
.world-head h1 { font: 800 clamp(2.4rem, 6vw, 4rem)/.9 var(--display); text-transform: uppercase; }
.world-head p { color: var(--muted); }
.stub { max-width: 760px; }

/* Ask Yoda -------------------------------------------------------------------------- */
.ask-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ask { display: grid; gap: 14px; }
.ask-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ask input[type="text"] {
  flex: 1 1 220px; min-width: 0; background: var(--void); border: 1px solid var(--rail); border-radius: 2px;
  color: var(--text); font: 400 1.05rem var(--body); padding: 12px 14px;
}
.ask input[type="text"]:focus { outline: none; border-color: var(--holo); box-shadow: 0 0 0 3px color-mix(in oklab, var(--holo) 20%, transparent); }
.era-switch { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.era-switch legend { float: left; margin-right: 6px; font: 500 .7rem/2.4 var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.era-switch label { cursor: pointer; }
.era-switch input { position: absolute; opacity: 0; }
.era-switch span { display: inline-block; padding: 8px 12px; border: 1px solid var(--rail); border-radius: 2px; font: 600 .74rem/1 var(--hud); letter-spacing: .1em; color: var(--muted); }
.era-switch small { font-weight: 500; opacity: .7; }
.era-switch input:checked + span { color: var(--crawl); border-color: color-mix(in oklab, var(--crawl) 55%, transparent); background: color-mix(in oklab, var(--crawl) 8%, transparent); }
.era-switch input:focus-visible + span { outline: 2px solid var(--holo); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 .8rem/1 var(--body); padding: 7px 10px; border-radius: 999px; background: var(--carbonite); border: 1px solid var(--rail); color: var(--text); text-decoration: none; cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.chip:hover { border-color: var(--holo); color: var(--holo); }
.projector { display: grid; justify-items: center; padding-top: 6px; }
.holo-screen {
  width: 100%; padding: 22px 22px 26px; text-align: center; color: var(--holo); font: 400 1.35rem/1.4 var(--body);
  background: repeating-linear-gradient(to bottom, color-mix(in oklab, var(--holo) 7%, transparent) 0 1px, transparent 1px 4px), radial-gradient(ellipse at 50% 120%, color-mix(in oklab, var(--holo) 22%, transparent), transparent 70%);
  border: 1px solid color-mix(in oklab, var(--holo) 30%, transparent); border-radius: 3px;
  text-shadow: 0 0 12px color-mix(in oklab, var(--holo) 55%, transparent);
  min-height: 7.2em; display: grid; place-items: center; transform-origin: 50% 100%;
}
.holo-screen.idle { color: var(--muted); text-shadow: none; font-size: 1.05rem; }
.holo-screen.flicker { animation: materialize 620ms var(--ease-holo); }
@keyframes materialize { 0% { opacity: 0; transform: scaleY(.02) scaleX(.7); filter: blur(4px); } 35% { opacity: .9; transform: scaleY(1.04) scaleX(1); } 45% { opacity: .35; } 55% { opacity: 1; } 62% { opacity: .6; } 100% { opacity: 1; transform: none; filter: none; } }
.emitter { width: 62%; height: 10px; margin-top: -1px; border-radius: 0 0 50% 50%; background: radial-gradient(ellipse at 50% 0, var(--holo), transparent 70%); opacity: .7; }
.match { font: 400 .84rem/1.5 var(--mono); color: var(--muted); text-align: center; min-height: 3em; }
.match b { color: var(--crawl); font-weight: 500; }
.examples { display: grid; gap: 12px; }
.example { display: grid; gap: 6px; text-decoration: none; color: inherit; padding: 12px; border: 1px solid transparent; border-radius: 4px; transition: border-color var(--t-fast), background var(--t-fast); }
.example:hover { border-color: var(--rail); background: color-mix(in oklab, var(--carbonite) 50%, transparent); }
.example.enter { animation: exIn 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 120ms); }

/* Conversations ------------------------------------------------------------------------ */
.convo { display: grid; gap: 18px; padding-top: 36px; max-width: 860px; margin-inline: auto; }
.convo-head { display: flex; align-items: center; gap: 18px; }
.avatar { width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 1.8rem/1 var(--display); color: var(--text); background: var(--carbonite); border: 1px solid var(--rail); }
.convo-title { display: grid; gap: 6px; min-width: 0; }
.convo-title h1 { font: 800 clamp(2rem, 5.4vw, 3.4rem)/.92 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.convo-title p { color: var(--muted); }
.convo-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.care { border: 1px solid color-mix(in oklab, var(--moss) 45%, transparent); background: color-mix(in oklab, var(--moss) 8%, transparent); padding: 12px 14px; border-radius: 4px; font-size: .94rem; }
.force { display: grid; gap: 6px; }
.force-bar { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--sith), color-mix(in oklab, var(--sith) 20%, var(--carbonite)) 45%, color-mix(in oklab, var(--moss) 20%, var(--carbonite)) 55%, var(--moss)); }
.force-bar i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--text); box-shadow: 0 0 12px var(--moss); transform: translate(-50%, -50%); left: var(--pos, 50%); }
.force-labels { display: flex; justify-content: space-between; gap: 10px; font: 500 .66rem/1.2 var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.thread { display: grid; gap: 16px; perspective: 900px; }
.ex { display: grid; gap: 6px; transform-origin: 50% 0; animation: exIn 560ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes exIn { from { opacity: 0; transform: rotateX(-38deg) translateY(18px); } to { opacity: 1; transform: none; } }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 3px; font-size: .98rem; overflow-wrap: anywhere; display: grid; gap: 6px; }
.msg.them { background: var(--carbonite); border: 1px solid var(--rail); justify-self: start; }
.msg.yoda {
  justify-self: end; color: var(--holo);
  background: repeating-linear-gradient(to bottom, color-mix(in oklab, var(--holo) 6%, transparent) 0 1px, transparent 1px 3px), color-mix(in oklab, var(--holo) 6%, var(--hull));
  border: 1px solid color-mix(in oklab, var(--holo) 28%, transparent);
  text-shadow: 0 0 10px color-mix(in oklab, var(--holo) 35%, transparent);
}
.msg.yoda.failed { color: var(--muted); text-shadow: none; background: transparent; border-style: dashed; font-size: .9rem; }
.example .msg { display: block; }
.orig { font: 400 .7rem/1 var(--mono); color: var(--muted); text-decoration: none; justify-self: start; }
.orig::after { content: " ↗"; }
.orig:hover { color: var(--holo); }
.crude-hidden { position: relative; }
.crude-hidden p, .crude-hidden .orig { filter: blur(6px); user-select: none; }
.reveal { position: absolute; inset: 0; z-index: 1; cursor: pointer; background: transparent; border: 0; font: 600 .72rem/1 var(--hud); letter-spacing: .12em; text-transform: uppercase; color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font: 400 .72rem/1.2 var(--mono); color: var(--muted); }
.meta.right { justify-content: flex-end; }
.who { color: var(--text); font-weight: 500; }
.tag { font: 500 .64rem/1 var(--hud); letter-spacing: .1em; text-transform: uppercase; padding: 4px 6px; border-radius: 2px; background: var(--void); border: 1px solid var(--rail); color: var(--muted); }
.tag.topic-fear, .tag.topic-dark-times, .tag.tone-hostile, .tag.topic-hostile { color: var(--sith); border-color: color-mix(in oklab, var(--sith) 40%, transparent); }
.tag.tone-grateful, .tag.tone-fan { color: var(--moss); border-color: color-mix(in oklab, var(--moss) 40%, transparent); }
.tag.topic-star-wars, .tag.topic-training { color: var(--holo); border-color: color-mix(in oklab, var(--holo) 35%, transparent); }
.convo-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-top: 12px; }
.thread.preview .ex:nth-child(n+3) { opacity: .9; }

/* On this day */
.today { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: start; }
.today > .btn { grid-column: 2; justify-self: start; }
.years { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.years li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 4.5rem; gap: 8px; align-items: center; font: 400 .78rem/1 var(--mono); color: var(--muted); }
.years i { display: block; height: 6px; width: var(--w); min-width: 2px; background: var(--rail); border-radius: 3px; }
.years b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.years li.on { color: var(--crawl); } .years li.on i { background: var(--crawl); box-shadow: 0 0 8px var(--crawl); }

/* Error page */
.error-panel { max-width: 640px; margin: 64px auto 0; text-align: center; justify-items: center; }

/* Toasts ---------------------------------------------------------------------------------- */
.toast-zone { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: grid; gap: 10px; perspective: 700px; max-width: calc(100vw - 32px); }
.toast {
  width: min(340px, 100%); display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center;
  background: var(--hull); border: 1px solid color-mix(in oklab, var(--crawl) 50%, var(--rail)); border-radius: 4px; padding: 14px 16px;
  box-shadow: 0 16px 40px -14px color-mix(in oklab, var(--crawl) 45%, transparent);
  transform-origin: 100% 50%; animation: toastIn 620ms var(--ease-holo) both;
}
.toast.out { animation: toastOut 380ms ease-in both; }
.toast .xp-pop { font: 800 1.5rem/1 var(--display); color: var(--crawl); }
.toast b { display: block; font: 600 .7rem/1.2 var(--hud); letter-spacing: .14em; text-transform: uppercase; color: var(--crawl); }
.toast span { font-size: .9rem; }
@keyframes toastIn { from { opacity: 0; transform: rotateY(-70deg) translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: rotateY(50deg) translateX(30px); } }

/* Warp flash */
.warp-flash { position: fixed; inset: 0; z-index: 15; pointer-events: none; background: radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--holo) 30%, transparent), transparent 60%); opacity: 0; }
.warp-flash.go { animation: flash var(--t-jump) ease-out; }
@keyframes flash { 0%, 70% { opacity: 0; } 82% { opacity: .9; } 100% { opacity: 0; } }

/* First-visit opening ----------------------------------------------------------------------- */
.intro-ov { position: fixed; inset: 0; z-index: 30; overflow: hidden; }
body.intro-on > :not(#stars, .intro-ov, .warp-flash) { visibility: hidden; }
body.intro-on .intro-ov { visibility: visible; }
.ov-skip { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 3; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ov-intro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--holo); font: 400 clamp(1.3rem, 3.2vw, 2.2rem)/1.45 var(--body); opacity: 0; pointer-events: none; }
.ov-intro.show { animation: intro 3.4s ease forwards; }
@keyframes intro { 0% { opacity: 0; } 20%, 70% { opacity: 1; } 100% { opacity: 0; } }
.ov-crawl-stage {
  position: absolute; inset: 0; perspective: 420px; perspective-origin: 50% 15%; overflow: hidden; opacity: 0; transition: opacity 1.2s;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%); mask-image: linear-gradient(to bottom, transparent 0%, #000 40%);
}
.ov-crawl-stage.show { opacity: 1; } .ov-crawl-stage.fade { opacity: 0; }
.ov-crawl-tilt { position: absolute; inset: 0; transform: rotateX(28deg); transform-origin: 50% 100%; }
.ov-crawl { position: absolute; left: 50%; top: 100%; width: min(84vw, 680px); transform: translateX(-50%); color: var(--crawl); text-align: justify; hyphens: auto; font: 700 clamp(1.5rem, 3.6vw, 2.8rem)/1.32 var(--display); letter-spacing: .02em; }
.ov-crawl .ep { text-align: center; letter-spacing: .12em; font-size: .8em; }
.ov-crawl .ep-title { text-align: center; font-size: 1.6em; font-weight: 800; margin-block: 4px 24px; letter-spacing: .04em; }
.ov-crawl p { margin-bottom: 24px; }
.ov-crawl.run { animation: ovCrawl var(--dur, 40s) linear forwards; }
@keyframes ovCrawl { to { transform: translate(-50%, calc(-1 * var(--dist, 2400px))); } }
.ov-holo { position: absolute; inset: 0; display: grid; place-items: end center; padding-bottom: 16vh; opacity: 0; pointer-events: none; transition: opacity .8s; }
.ov-holo.show { opacity: 1; pointer-events: auto; }
.ov-holo .hc-scene { --hs: clamp(112px, 20vmin, 190px); }
.ov-holo.show .hc-arrive { animation: arrive 2.6s var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: scale(.04); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.ov-prompt { position: absolute; left: 0; right: 0; bottom: 8vh; text-align: center; font: 600 .8rem/1 var(--hud); letter-spacing: .22em; text-transform: uppercase; color: var(--holo); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.ov-caption { top: 9vh; min-height: 3em; font: 400 clamp(1.2rem, 2.8vw, 1.9rem)/1.4 var(--body); }
.ov-enter { position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .6s; }
.ov-enter.show { opacity: 1; pointer-events: auto; }

/* Footer -------------------------------------------------------------------------------------- */
.site-foot { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--rail); display: grid; gap: 18px; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.foot-grid p { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.foot-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.disclaimer { font: 400 .74rem/1.5 var(--mono); color: var(--muted); }

/* Responsive -------------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .worlds-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 900px) {
  .hero, .galaxy, .ask-layout, .today { grid-template-columns: minmax(0, 1fr); }
  .today > .btn { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hud-tools .rank-chip span:last-child { display: none; }
  .hero-stage { height: 400px; }
  .hero-stage .hc-scene { --hs: 100px; }
  .msg { max-width: 94%; }
  .world-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  @view-transition { navigation: none; }
}
