/* =====================================================================
   KLEOS I — Glory That Outlives The Mission
   Design system. Blueprint: the Spirit & Opportunity edition.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #070b17;
  --bg-2: #0b1026;
  --panel: #10182a;
  --panel-2: #151f38;
  --ink: #f3f5fb;
  --muted: #b2bbd0;
  --faint: #7f8aa6;
  --line: rgba(255,255,255,.12);
  --line-2: rgba(255,255,255,.2);
  --card: rgba(255,255,255,.055);

  --gold: #ffcf5a;
  --ice: #8fd3ff;
  --mars: #ff9d73;
  --mars-fill: #e0784a;

  /* mission accent (overridden per page) */
  --accent: var(--gold);
  --accent-ink: #1a1405;
  --accent-soft: rgba(255,207,90,.14);
  --accent-line: rgba(255,207,90,.42);

  --radius: 18px;
  --radius-sm: 12px;
  --max: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --font: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
body[data-mission="surveyor"] { --accent: var(--ice); --accent-ink: #06141f; --accent-soft: rgba(143,211,255,.13); --accent-line: rgba(143,211,255,.42); }
body[data-mission="mars"]     { --accent: var(--mars); --accent-ink: #1f0c04; --accent-soft: rgba(255,157,115,.14); --accent-line: rgba(255,157,115,.45); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1.05rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
img, svg, canvas { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.03em; margin: 0; }
p { margin: 0 0 1rem; }
::selection { background: var(--accent-soft); color: #fff; }
:focus-visible { outline: 3px solid #fff2b8; outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }
abbr { text-decoration: underline dotted; cursor: help; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--gold); color: #111; padding: .6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 1rem; }
.mono { font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }
.eyebrow { font: 500 .74rem/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; display: inline-flex; align-items: center; gap: .6rem; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }

/* ---------- progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 120; pointer-events: none; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--gold), #ff8a5b, #ff6fb1); transform-origin: left; transform: scaleX(0); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); background: rgba(7,11,23,.78); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.site-header__in { height: 100%; width: min(100% - 2.5rem, 1320px); margin-inline: auto; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: .16em; font-size: 1.1rem; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 800; }
.brand__mark { width: 26px; height: 26px; border-radius: 50%; position: relative; background: radial-gradient(circle at 35% 30%, #fff3c8, var(--gold) 45%, #b8821c); box-shadow: 0 0 18px rgba(255,207,90,.45); }
.brand__mark::after { content: ""; position: absolute; inset: -5px -9px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 50%; transform: rotate(-28deg); }
.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; }
.nav a { display: block; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 600; transition: color .2s, background .2s; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav a[aria-current] { color: var(--accent-ink); background: var(--accent); }
.search-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .8rem; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer; font-size: .88rem; transition: border-color .2s, color .2s; }
.search-btn:hover { border-color: var(--accent); color: #fff; }
.kbd { font: 500 .7rem var(--mono); padding: .1rem .4rem; border: 1px solid var(--line-2); border-radius: 5px; color: var(--faint); }
.nav-toggle { display: none; width: 44px; height: 40px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); border-radius: 10px; cursor: pointer; padding: 0; }
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 1200px) {
  .nav-toggle { display: block; order: 3; }
  .search-btn { margin-left: auto; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; background: rgba(7,11,23,.97); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s var(--ease); max-height: calc(100vh - var(--header-h)); overflow: auto; }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: .25rem; }
  .nav a { padding: .85rem 1rem; border-radius: 12px; background: rgba(255,255,255,.04); font-size: 1rem; }
  .search-btn .label-text, .search-btn .kbd { display: none; }
  .search-btn { padding: .6rem; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.5rem; border-radius: 999px; font-weight: 800; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px -8px var(--accent); }
.btn--primary:hover { color: var(--accent-ink); box-shadow: 0 12px 34px -8px var(--accent); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: rgba(255,255,255,.04); }
.btn--ghost:hover { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.btn--sm { padding: .5rem 1rem; font-size: .85rem; }
.arrow { transition: transform .2s var(--ease); display: inline-block; }
a:hover > .arrow, .btn:hover .arrow { transform: translateX(4px); }

/* ---------- section scaffolding ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); margin-bottom: .8rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }
h3.sub { font-size: 1.45rem; margin: 3rem 0 1rem; }

/* ---------- HOME HERO ---------- */
.home-hero { position: relative; min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); display: flex; align-items: center; overflow: hidden; background: radial-gradient(1100px 600px at 78% 45%, #1d2850 0, transparent 60%), radial-gradient(900px 500px at 10% 100%, #2c1d4a 0, transparent 60%), linear-gradient(180deg, #050814, var(--bg)); isolation: isolate; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2rem; align-items: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero-copy .eyebrow { font-size: .78rem; }
.hero-title { font-size: clamp(2.6rem, 6.4vw, 5.6rem); line-height: .98; letter-spacing: -.055em; font-weight: 800; margin-bottom: 1.4rem; }
.hero-title .grad { background: linear-gradient(90deg, var(--gold), #ff8a5b 60%, #ff6fb1); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.hero-lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: #cdd5e8; max-width: 46ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-hint { margin-top: 2.2rem; display: flex; align-items: center; gap: .8rem; color: var(--faint); font: 500 .72rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.hero-hint i { width: 1px; height: 34px; background: linear-gradient(var(--gold), transparent); display: block; animation: drip 2s ease-in-out infinite; }
@keyframes drip { 0%{transform:scaleY(0);transform-origin:top} 50%{transform:scaleY(1);transform-origin:top} 51%{transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

.hero-visual { position: relative; aspect-ratio: 1 / 1; max-width: 560px; width: 100%; margin-inline: auto; }
.orbit-ring { position: absolute; border: 1px dashed rgba(220,229,255,.22); border-radius: 50%; inset: 6%; }
.orbit-ring.two { inset: 22% -4%; transform: rotate(-24deg); border-color: rgba(255,207,90,.2); }
.orb { position: absolute; border-radius: 50%; }
.orb.moon { width: 46%; aspect-ratio: 1; left: 4%; top: 8%; background:
  radial-gradient(circle at 30% 32%, rgba(0,0,0,.18) 0 6%, transparent 7%),
  radial-gradient(circle at 62% 24%, rgba(0,0,0,.16) 0 4%, transparent 5%),
  radial-gradient(circle at 54% 62%, rgba(0,0,0,.2) 0 8%, transparent 9%),
  radial-gradient(circle at 28% 70%, rgba(0,0,0,.14) 0 5%, transparent 6%),
  radial-gradient(circle at 34% 28%, #eceae3, #8a909f 62%, #262c3d);
  box-shadow: inset -28px -24px 50px rgba(0,0,0,.6), 0 0 80px rgba(200,210,255,.12); animation: float 9s ease-in-out infinite; }
.orb.mars { width: 34%; aspect-ratio: 1; right: 2%; bottom: 8%; background:
  radial-gradient(circle at 60% 66%, rgba(80,20,10,.35) 0 9%, transparent 10%),
  radial-gradient(circle at 36% 40%, rgba(80,20,10,.25) 0 6%, transparent 7%),
  radial-gradient(circle at 34% 28%, #ffc08e, #b0482f 62%, #3a1a1c);
  box-shadow: inset -22px -18px 40px rgba(0,0,0,.6), 0 0 70px rgba(255,140,90,.18); animation: float 11s ease-in-out -3s infinite; }
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
.earth-dot { position: absolute; right: 22%; top: 12%; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #bfe4ff, #2f6fb8 60%, #0d2a55); box-shadow: 0 0 24px rgba(90,160,255,.5); }
.hotspot { position: absolute; z-index: 3; display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; font-size: .8rem; font-weight: 700; }
.hotspot .pin { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--gold)); box-shadow: 0 0 0 0 var(--c, var(--gold)); animation: ping 2.4s ease-out infinite; flex: none; border: 2px solid #fff; }
.hotspot .tag { padding: .3rem .65rem; background: rgba(7,11,23,.88); border: 1px solid var(--line-2); border-radius: 999px; white-space: nowrap; transition: border-color .2s, transform .2s var(--ease); }
.hotspot:hover .tag, .hotspot:focus-visible .tag { border-color: var(--c, var(--gold)); transform: translateX(3px); }
.hotspot:hover { color: #fff; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, #ffcf5a) 70%, transparent); } 80%,100% { box-shadow: 0 0 0 14px transparent; } }
.hs-eagle { left: 22%; top: 28%; --c: var(--gold); }
.hs-surveyor { left: 10%; top: 56%; --c: var(--ice); }
.hs-spirit { right: 20%; bottom: 44%; --c: var(--mars); flex-direction: row-reverse; }
.hs-oppy { right: 6%; bottom: 14%; --c: var(--mars); flex-direction: row-reverse; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 440px; order: -1; margin-bottom: .5rem; }
  .home-hero { align-items: flex-start; }
  .hotspot .tag { font-size: .7rem; padding: .22rem .5rem; }
}

/* ---------- stat strip ---------- */
.stat-strip { border-block: 1px solid var(--line); background: rgba(255,255,255,.025); }
.stat-strip ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-strip li { padding: 1.6rem 1.2rem; border-left: 1px solid var(--line); text-align: left; }
.stat-strip li:first-child { border-left: 0; }
.num { display: block; font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; line-height: 1.05; color: var(--accent); letter-spacing: -.04em; }
.label { display: block; margin-top: .35rem; font-size: .88rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 760px) { .stat-strip ul { grid-template-columns: 1fr 1fr; } .stat-strip li:nth-child(3) { border-left: 0; } .stat-strip li:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- portals (mission cards) ---------- */
.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.portal { --p: var(--gold); --p-ink: #1a1405; position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), border-color .3s, box-shadow .35s; isolation: isolate; }
.portal.apollo { --p: var(--gold); --p-ink: #1a1405; }
.portal.surveyor { --p: var(--ice); --p-ink: #06141f; }
.portal.mars { --p: var(--mars); --p-ink: #1f0c04; }
.portal:hover { transform: translateY(-8px); border-color: var(--p); box-shadow: 0 30px 60px -28px color-mix(in srgb, var(--p) 55%, transparent); color: var(--ink); }
.portal__art { position: relative; height: 250px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--p) 28%, transparent), transparent 65%), linear-gradient(180deg, #0a1022, #172039); }
.portal__art svg { width: min(72%, 250px); height: auto; filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); transition: transform .5s var(--ease); }
.portal:hover .portal__art svg { transform: scale(1.07) translateY(-4px); }
.portal__art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 70px; background: linear-gradient(transparent, var(--panel)); }
.portal__chip { position: absolute; z-index: 2; top: 1rem; left: 1rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(7,11,23,.82); border: 1px solid var(--line-2); font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--p); }
.portal__body { padding: 1.4rem 1.6rem 1.7rem; display: flex; flex-direction: column; flex: 1; }
.portal__index { font: 500 .68rem var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--faint); }
.portal h3 { font-size: 1.85rem; margin: .5rem 0 .6rem; }
.portal p { color: var(--muted); font-size: .96rem; flex: 1; }
.portal__go { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--p); font-weight: 800; font-size: .92rem; }
.portal__go small { color: var(--faint); font-weight: 600; font-size: .8rem; }
.portal__done { display: none; position: absolute; top: 1rem; right: 1rem; z-index: 2; padding: .3rem .65rem; border-radius: 999px; background: var(--p); color: var(--p-ink); font-size: .7rem; font-weight: 800; }
.portal__done.is-on { display: inline-block; }
@media (max-width: 960px) { .portal-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; } .portal__art { height: 210px; } }

/* ---------- explore tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tile { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: var(--ink); transition: transform .25s var(--ease), border-color .25s, background .25s; }
.tile:hover { transform: translateY(-4px); border-color: var(--gold); background: rgba(255,207,90,.07); color: var(--ink); }
.tile__icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,207,90,.12); border: 1px solid rgba(255,207,90,.35); color: var(--gold); }
.tile__icon svg { width: 26px; height: 26px; }
.tile h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
@media (max-width: 900px) { .tile-grid { grid-template-columns: 1fr; } }

/* ---------- two worlds / manifesto ---------- */
.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.world { padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); }
.world--moon { border-top: 3px solid var(--gold); }
.world--mars { border-top: 3px solid var(--mars); }
.world h3 { font-size: 1.6rem; margin-bottom: .6rem; }
.world p { color: var(--muted); }
.world .links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.pill { display: inline-flex; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: .85rem; font-weight: 700; text-decoration: none; color: var(--ink); transition: .2s; }
.pill:hover { border-color: var(--gold); background: rgba(255,207,90,.1); color: #fff; }
@media (max-width: 800px) { .worlds { grid-template-columns: 1fr; } }

/* ---------- random fact ---------- */
.fact-feature { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; padding: clamp(1.3rem, 3vw, 2rem); border: 1px solid var(--accent-line); border-radius: 22px; background: radial-gradient(circle at 0 0, var(--accent-soft), transparent 60%), rgba(255,255,255,.03); }
.fact-feature__badge { font: 500 .7rem var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--accent); writing-mode: vertical-rl; transform: rotate(180deg); }
.fact-feature h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.fact-feature p { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .fact-feature { grid-template-columns: 1fr; } .fact-feature__badge { writing-mode: initial; transform: none; } }

/* ---------- continue banner ---------- */
.continue { display: none; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; padding: 1rem 1.4rem; border-radius: 16px; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.continue.is-on { display: flex; }
.continue p { margin: 0; color: var(--ink); }
.continue small { color: var(--muted); display: block; }

/* ---------- PAGE HERO (hubs + chapters) ---------- */
.page-hero { position: relative; overflow: hidden; padding: clamp(2.2rem, 6vw, 4.5rem) 0 clamp(2.4rem, 5vw, 3.8rem); background: radial-gradient(800px 420px at 85% 0%, var(--accent-soft), transparent 70%), linear-gradient(180deg, #080d21, var(--bg)); border-bottom: 1px solid var(--line); isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; background-image: radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 90px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 160px 20px, #cfd8ff, transparent), radial-gradient(1px 1px at 230px 120px, #fff, transparent); background-size: 260px 160px; }
.page-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin: 0 0 1.3rem; padding: 0; list-style: none; font-size: .82rem; color: var(--faint); }
.crumbs li + li::before { content: "/"; margin-right: .6rem; opacity: .5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); letter-spacing: -.05em; margin-bottom: 1rem; max-width: 18ch; }
.page-hero h1 em { font-style: normal; color: var(--accent); }
.page-hero .lead { font-size: clamp(1.05rem, 1.8vw, 1.22rem); color: #cdd5e8; max-width: 58ch; margin-bottom: 1.6rem; }
.hero-art { width: clamp(180px, 26vw, 320px); padding: 1.4rem 1.2rem 1rem; border-radius: 22px; background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), rgba(255,255,255,.03)); border: 1px solid var(--line); animation: float 8s ease-in-out infinite; }
.hero-art svg { width: 100%; height: auto; }
.chapter-meter { width: min(100%, 420px); height: 5px; border-radius: 99px; background: rgba(255,255,255,.13); overflow: hidden; margin-top: 1.5rem; }
.chapter-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #fff); border-radius: inherit; }
.chapter-meter-label { margin-top: .5rem; font: 500 .7rem var(--mono); letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
@media (max-width: 820px) { .page-hero__grid { grid-template-columns: 1fr; } .hero-art { display: none; } }

.fact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-top: 2rem; }
.fact-row .f { padding: .9rem 1.1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; background: rgba(255,255,255,.04); }
.fact-row .f strong { display: block; color: #fff; font-size: 1.1rem; letter-spacing: -.02em; }
.fact-row .f span { font-size: .8rem; color: var(--muted); }

.subnav { position: sticky; top: var(--header-h); z-index: 60; background: rgba(7,11,23,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; display: flex; gap: .3rem; margin: 0; padding: .55rem 0; overflow-x: auto; scrollbar-width: none; }
.subnav a { display: block; padding: .4rem .9rem; border-radius: 999px; color: var(--muted); font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.subnav a.is-active { color: var(--accent-ink); background: var(--accent); }

/* ---------- story voice ---------- */
.story { display: grid; grid-template-columns: minmax(200px, 330px) 1fr; gap: 2rem 3rem; align-items: center; margin: 0 0 3.5rem; }
.story--flip { grid-template-columns: 1fr minmax(200px, 330px); }
.story--flip .art { order: 2; }
.art { margin: 0; padding: 1.5rem 1.2rem 1rem; border: 1px solid var(--line); border-radius: 22px; text-align: center; background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), rgba(255,255,255,.03)); }
.art figcaption { margin-top: .7rem; font-size: .82rem; color: var(--muted); }
.voice { position: relative; padding: 1.6rem 1.9rem; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 18px; }
.voice p { color: #d8deee; }
.voice p:last-child { margin-bottom: 0; }
.speaker { font: 500 .78rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 .9rem !important; }
.voice strong { color: #fff; }
@media (max-width: 820px) { .story, .story--flip { grid-template-columns: 1fr; } .story--flip .art { order: 0; } .art { max-width: 320px; margin-inline: auto; } }

/* svg art */
.shadow { fill: rgba(0,0,0,.35); } .metal { fill: #c8ccd8; stroke: #8d93a8; stroke-width: 2; } .panel { fill: #3b57a8; stroke: #8fa6ee; stroke-width: 2; }
.lens { fill: #1b2250; } .window { fill: #1b2250; stroke: #9aa3cc; stroke-width: 1.5; } .ascent { fill: #d8dae4; stroke: #8d93a8; stroke-width: 2; }
.foil { fill: #e3a93d; stroke: #9d6d17; stroke-width: 2; } .engine { fill: #5b6074; stroke: #343850; stroke-width: 2; } .leg { stroke: #b8bccb; stroke-width: 4; stroke-linecap: round; }
.pad { fill: #9aa0b4; } .line { stroke: #c8ccd8; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wheel { fill: #2d3144; stroke: #9aa0b4; stroke-width: 4; } .sun { fill: #6f2f1d; } .storm { fill: #a8512f; } .storm2 { fill: #d0764a; } .mirror { fill: #9fd8ff; stroke: #6aa9d4; stroke-width: 2; }

/* ---------- callout, stats, details ---------- */
.callout { margin: 0 0 3rem; padding: 1.6rem 1.9rem; border: 1px solid var(--accent-line); border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), rgba(255,255,255,.02)); }
.callout h3 { margin: 0 0 .5rem; color: var(--accent); font-size: 1.25rem; }
.callout p { margin: 0; color: #d8deee; }
.stats { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stats li { padding: 1.3rem 1.1rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; transition: transform .25s var(--ease), border-color .25s; }
.stats li:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; align-items: start; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .2rem 1.2rem; transition: background .2s, border-color .2s; }
details[open] { background: rgba(255,255,255,.1); border-color: var(--accent-line); }
summary { cursor: pointer; font-weight: 700; padding: .9rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; color: var(--accent); flex: none; line-height: 1; transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 1rem; color: var(--muted); }
.sub-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-top: 3rem; }
.sub-row .sub { margin: 0 0 1rem; }
.btn-small { padding: .4rem 1rem; border-radius: 999px; cursor: pointer; background: transparent; color: var(--accent); border: 1.5px solid var(--accent); font-weight: 700; font-size: .88rem; }
.btn-small:hover { background: var(--accent-soft); }

/* ---------- chapter grid (hub pages) ---------- */
.chapter-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.8rem; }
.progress-pill { display: inline-flex; align-items: center; gap: .7rem; padding: .5rem 1rem; border: 1px solid var(--line-2); border-radius: 999px; font-size: .85rem; color: var(--muted); }
.progress-pill b { color: var(--accent); }
.progress-pill .track { width: 80px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.14); overflow: hidden; }
.progress-pill .track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s var(--ease); }
.chapter-grid { counter-reset: ch; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.chapter-card { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.3rem 1.3rem 1.2rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, var(--accent-soft), rgba(255,255,255,.02) 55%); text-decoration: none; color: var(--ink); overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.chapter-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 22px 40px -24px var(--accent); color: var(--ink); }
.chapter-card__n { font: 800 2.6rem/1 var(--font); letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.5px var(--accent); margin-bottom: .6rem; transition: color .25s; }
.chapter-card:hover .chapter-card__n { color: var(--accent); }
.chapter-card strong { font-size: 1.1rem; line-height: 1.25; letter-spacing: -.02em; }
.chapter-card span.d { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.chapter-card .tag { margin-top: .7rem; font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.chapter-card .check { position: absolute; top: 1rem; right: 1rem; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: .85rem; font-weight: 900; }
.chapter-card.is-visited .check { display: grid; }

/* ---------- media: images, 3D ---------- */
.media-card { margin: 0 0 2rem; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); }
.media-card figcaption { padding: .9rem 1.3rem 1.1rem; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); }
.media-card figcaption a { color: var(--accent); }
.nasa-img { position: relative; background: #0a1022; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; }
.nasa-img img { width: 100%; max-height: 620px; object-fit: contain; background: #05080f; transition: transform .6s var(--ease); }
.nasa-img.is-wide img { object-fit: cover; }
.nasa-img:hover img { transform: scale(1.02); }
.nasa-img .zoom { position: absolute; right: 1rem; bottom: 1rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(7,11,23,.85); border: 1px solid var(--line-2); font-size: .75rem; font-weight: 700; opacity: 0; transition: opacity .2s; }
.nasa-img:hover .zoom, .nasa-img:focus-visible .zoom { opacity: 1; }
.media-card.is-broken .nasa-img { display: none; }
.media-fallback { display: none; padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 12px, transparent 12px 24px); }
.media-card.is-broken .media-fallback { display: block; }
.media-fallback strong { display: block; color: var(--ink); margin-bottom: .3rem; }
.model-stage { position: relative; background: radial-gradient(circle at 50% 40%, #1c2745, #080d1b 75%); }
.model-stage model-viewer, .model-stage iframe { display: block; width: 100%; height: clamp(340px, 52vw, 560px); border: 0; background: transparent; --poster-color: transparent; }
.model-status { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1.5rem; color: var(--muted); font-size: .92rem; pointer-events: none; transition: opacity .4s; }
.model-status .spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto .8rem; }
.model-stage.is-ready .model-status { opacity: 0; }
.model-stage.is-failed .spin { display: none; }
.model-stage.is-failed .model-status { pointer-events: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.model-tools { position: absolute; left: 1rem; bottom: 1rem; z-index: 2; display: flex; gap: .5rem; flex-wrap: wrap; }
.model-hint { position: absolute; right: 1rem; top: 1rem; z-index: 2; padding: .3rem .7rem; border-radius: 999px; background: rgba(7,11,23,.8); border: 1px solid var(--line-2); font: 500 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.media-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.media-split .media-card { margin: 0; }
@media (max-width: 800px) { .media-split { grid-template-columns: 1fr; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; flex-direction: column; background: rgba(3,5,12,.94); padding: 1rem; }
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 82vh; max-width: min(96vw, 1400px); object-fit: contain; border-radius: 10px; }
.lightbox p { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; text-align: center; max-width: 80ch; }
.lightbox button { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255,255,255,.08); color: #fff; font-size: 1.3rem; cursor: pointer; }
.lightbox button:hover { background: var(--gold); color: #111; }
.lb-close { top: 1rem; right: 1rem; } .lb-prev { left: 1rem; top: 50%; } .lb-next { right: 1rem; top: 50%; }

/* ---------- gallery grid ---------- */
.gallery { columns: 3 280px; column-gap: 1rem; }
.gallery .media-card { break-inside: avoid; margin-bottom: 1rem; }

/* ---------- CHAPTER PAGE ---------- */
.chapter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: clamp(2rem, 5vw, 4.5rem); padding-block: clamp(2.2rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem); align-items: start; }
.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin: 3rem 0 1rem; color: var(--accent); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #cdd5e8; font-size: 1.07rem; }
.prose strong { color: #fff; }
.prose blockquote { margin: 1.8rem 0; padding: 1.3rem 1.6rem; border-left: 4px solid var(--accent); border-radius: 0 16px 16px 0; background: linear-gradient(90deg, var(--accent-soft), transparent); color: #fff; font-size: 1.25rem; font-weight: 600; line-height: 1.5; letter-spacing: -.01em; }
.prose .note { padding: 1rem 1.3rem; border: 1px solid var(--accent-line); border-radius: 14px; background: var(--accent-soft); font-size: .95rem; }
.prose .note strong { color: var(--accent); }
.prose .fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin: 1.8rem 0; max-width: none; }
.prose .fact { padding: 1rem 1.1rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 14px; background: var(--card); }
.prose .fact span { display: block; color: var(--muted); font-size: .8rem; letter-spacing: .02em; }
.prose .fact strong { display: block; margin-top: .2rem; color: #fff; font-size: 1.12rem; line-height: 1.3; letter-spacing: -.02em; }
.prose .media-card { max-width: none; margin: 2rem 0; }
.source-note { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--faint); }
.source-note a { color: var(--muted); }
.chapter-rail { position: sticky; top: calc(var(--header-h) + 24px); }
.rail { padding: 1.3rem; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.rail h2 { font: 500 .7rem var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; }
.rail ol { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rail li a { display: flex; gap: .7rem; align-items: baseline; padding: .55rem .6rem; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: .88rem; line-height: 1.35; transition: .15s; }
.rail li a::before { counter-increment: r; content: counter(r, decimal-leading-zero); font: 500 .7rem var(--mono); color: var(--faint); flex: none; }
.rail li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail li a[aria-current] { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.rail li a[aria-current]::before { color: var(--accent-ink); }
.rail li a.is-visited:not([aria-current])::after { content: "✓"; margin-left: auto; color: var(--accent); font-weight: 800; }
.rail__hub { display: block; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 700; text-decoration: none; }
@media (max-width: 960px) { .chapter-layout { grid-template-columns: 1fr; } .chapter-rail { position: static; order: 2; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
.pager a { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-decoration: none; color: var(--ink); transition: .25s var(--ease); }
.pager a:hover { border-color: var(--accent); transform: translateY(-3px); background: var(--accent-soft); color: var(--ink); }
.pager small { font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pager strong { font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.3; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }
.pager .only-hub { grid-column: 1 / -1; text-align: center; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next, .pager .prev { grid-column: 1; text-align: left; } }

.next-mission { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.6rem 1.8rem; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(120deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); }
.next-mission h3 { font-size: 1.5rem; margin-top: .3rem; }

/* ---------- timeline ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.2rem; }
.chip { padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 700; font-size: .88rem; cursor: pointer; transition: .2s; }
.chip:hover { color: #fff; border-color: #fff; }
.chip[aria-pressed="true"] { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 130px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), var(--mars), var(--mars)); opacity: .5; }
.tl li { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 0 2.2rem; padding: 0 0 1.6rem; }
.tl li[hidden] { display: none; }
.tl time { font: 500 .78rem var(--mono); letter-spacing: .04em; color: var(--muted); text-align: right; padding-top: .95rem; padding-right: 1rem; }
.tl .dot { position: absolute; left: 124px; top: 1.15rem; width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--gold)); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--c, var(--gold)); }
.tl .ev { padding: 1rem 1.3rem; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--gold)); border-radius: 14px; background: var(--card); transition: .25s var(--ease); }
.tl .ev:hover { transform: translateX(4px); background: rgba(255,255,255,.09); }
.tl .ev p { margin: 0; color: #e3e8f6; }
.tl .ev a { display: inline-block; margin-top: .4rem; font-size: .82rem; font-weight: 700; text-decoration: none; color: var(--c, var(--gold)); }
.tl li[data-world="moon"] { --c: var(--gold); } .tl li[data-world="mars"] { --c: var(--mars); }
@media (max-width: 640px) { .tl::before { left: 6px; } .tl li { grid-template-columns: 1fr; padding-left: 2rem; } .tl time { text-align: left; padding: 0 0 .4rem; } .tl .dot { left: 0; top: .35rem; } }

/* ---------- glossary, quiz, converter ---------- */
.two-col { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.glossary { margin: 0; display: grid; gap: .8rem; }
.glossary div { padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.glossary dt { font-weight: 800; color: var(--gold); }
.glossary dd { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.quiz-card { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line-2); border-radius: 24px; background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); box-shadow: 0 30px 60px -40px #000; }
.quiz-top { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font: 500 .74rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.quiz-track { height: 6px; margin: .8rem 0 1.5rem; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.quiz-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--mars)); transition: width .4s var(--ease); }
.quiz-cat { font: 500 .7rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: .5rem; }
.quiz-card h3 { margin: 0 0 1.2rem; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.3; }
.quiz-options { display: grid; gap: .65rem; }
.quiz-options button { display: flex; gap: .9rem; align-items: center; width: 100%; padding: .9rem 1rem; text-align: left; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255,255,255,.04); cursor: pointer; transition: .15s; }
.quiz-options button .k { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 500 .75rem var(--mono); background: rgba(255,255,255,.08); }
.quiz-options button:hover:not(:disabled) { border-color: var(--gold); background: rgba(255,207,90,.1); transform: translateX(3px); }
.quiz-options button:disabled { cursor: default; opacity: .85; }
.quiz-options button.is-correct { border-color: #62d49a; background: rgba(98,212,154,.15); } .quiz-options button.is-correct .k { background: #62d49a; color: #052; }
.quiz-options button.is-wrong { border-color: #ff8a8a; background: rgba(255,100,100,.13); } .quiz-options button.is-wrong .k { background: #ff8a8a; color: #300; }
.quiz-feedback { min-height: 3.6em; margin: 1.1rem 0; color: var(--muted); font-size: .95rem; }
.quiz-feedback.is-correct { color: #8ce0b4; } .quiz-feedback.is-wrong { color: #ffaaaa; }
.quiz-result { text-align: center; padding: 1rem 0; }
.quiz-result .big { font-size: clamp(3rem, 9vw, 5rem); font-weight: 800; letter-spacing: -.06em; color: var(--gold); line-height: 1; }
.quiz-result .links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }
.converter { display: grid; grid-template-columns: auto minmax(120px, 200px); gap: .6rem 1rem; align-items: center; padding: 1.4rem 1.6rem; margin-bottom: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.converter[hidden] { display: none; }
.converter label { font-weight: 700; }
.converter input { width: 100%; padding: .6rem .9rem; border-radius: 10px; border: 2px solid var(--accent-line); background: rgba(0,0,0,.3); color: var(--ink); font: inherit; font-size: 1.1rem; }
.converter__out { grid-column: 1 / -1; margin: .25rem 0 0; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.converter .hint { grid-column: 1 / -1; margin: 0; font-size: .88rem; color: var(--muted); }
.converter .presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- search palette ---------- */
.palette { position: fixed; inset: 0; z-index: 250; display: none; align-items: flex-start; justify-content: center; padding: min(14vh, 8rem) 1rem 1rem; background: rgba(3,5,12,.7); backdrop-filter: blur(6px); }
.palette.is-open { display: flex; }
.palette__box { width: min(100%, 680px); max-height: 72vh; display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 20px; background: #0d1426; box-shadow: 0 40px 90px -20px #000; overflow: hidden; }
.palette__bar { display: flex; align-items: center; gap: .8rem; padding: 0 1.1rem; border-bottom: 1px solid var(--line); }
.palette__bar svg { flex: none; width: 20px; height: 20px; color: var(--faint); }
.palette__input { flex: 1; min-width: 0; padding: 1.1rem 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.1rem; }
.palette__list { list-style: none; margin: 0; padding: .5rem; overflow: auto; }
.palette__item a { display: block; padding: .75rem .9rem; border-radius: 12px; text-decoration: none; color: var(--ink); }
.palette__item.is-active a, .palette__item a:hover { background: rgba(255,207,90,.12); }
.palette__item .t { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.palette__item .t em { font: 500 .66rem var(--mono); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: var(--gold); flex: none; padding-top: .25rem; }
.palette__item .s { display: block; margin-top: .15rem; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.palette__item mark { background: rgba(255,207,90,.3); color: #fff; border-radius: 3px; }
.palette__empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.palette__foot { display: flex; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.1rem; border-top: 1px solid var(--line); color: var(--faint); font-size: .78rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #050813; padding: 3.5rem 0 2rem; color: var(--muted); font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font: 500 .7rem var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--gold); margin-bottom: .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .blurb { max-width: 36ch; }
.footer-sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--faint); }
.footer-sources p { margin: 0 0 .5rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.back-to-top { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: var(--gold); color: #171717; font-size: 1.3rem; font-weight: 900; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.4); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.search-hidden { display: none !important; }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }
body { animation: pagein .4s ease both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { .site-header, .progress, .back-to-top, .subnav, .chapter-rail, .palette { display: none !important; } body { background: #fff; color: #000; } }

/* ---------- TEAM ---------- */
.team-band { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .team-band { grid-template-columns: 1fr; } }
.team-photo { margin: 0; border: 1px solid var(--line-2); border-radius: 24px; overflow: hidden; background: var(--panel); box-shadow: 0 30px 70px -40px #000; }
.team-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.team-photo figcaption { padding: .9rem 1.3rem 1.1rem; font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); }
.team-photo figcaption strong { color: var(--ink); }
.team-list { list-style: none; margin: 1.4rem 0 1.8rem; padding: 0; display: grid; gap: .7rem; }
.team-list li { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: transform .25s var(--ease), border-color .25s; }
.team-list li:hover { transform: translateX(4px); border-color: var(--c, var(--gold)); }
.team-list .avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 800 .95rem var(--font); letter-spacing: .02em; color: #0a0f1d; background: var(--c, var(--gold)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--gold)) 22%, transparent); }
.team-list strong { display: block; font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.25; }
.team-list small { color: var(--faint); font: 500 .68rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }

/* ---------- TEXT-TO-SPEECH ---------- */
.tts { position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 95; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: .7rem; max-width: calc(100vw - 2.4rem); }
.tts__fab { display: inline-flex; align-items: center; gap: .55rem; height: 48px; padding: 0 1.15rem 0 .95rem; border-radius: 999px; border: 1px solid var(--accent-line); background: rgba(10,15,32,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ink); font-weight: 800; font-size: .9rem; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.5); transition: transform .2s var(--ease), border-color .2s; }
.tts__fab:hover { transform: translateY(-2px); border-color: var(--accent); }
.tts__fab svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.tts__fab.is-playing { border-color: var(--accent); }
.tts__fab.is-playing svg { animation: ttspulse 1.1s ease-in-out infinite; }
@keyframes ttspulse { 50% { transform: scale(1.18); } }
.tts__panel { width: min(370px, calc(100vw - 2.4rem)); padding: 1.1rem 1.15rem 1.2rem; border: 1px solid var(--line-2); border-radius: 20px; background: #0d1426; box-shadow: 0 30px 70px -15px #000; }
.tts__panel[hidden] { display: none; }
.tts__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.tts__top strong { font-size: .98rem; letter-spacing: -.01em; }
.tts__x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--muted); }
.tts__x:hover { color: #fff; border-color: #fff; }
.tts__now { min-height: 2.6em; margin: 0 0 .7rem; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.tts__bar { height: 4px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 1rem; }
.tts__bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.tts__ctrls { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1rem; }
.tts__ctrls button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); cursor: pointer; color: var(--ink); transition: .15s; }
.tts__ctrls button:hover { border-color: var(--accent); background: var(--accent-soft); }
.tts__ctrls button svg { width: 18px; height: 18px; }
.tts__ctrls .tts__play { width: 56px; height: 56px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tts__ctrls .tts__play:hover { background: var(--accent); filter: brightness(1.1); }
.tts__ctrls .tts__play svg { width: 22px; height: 22px; }
.tts__opts { display: grid; grid-template-columns: 90px 1fr; gap: .6rem; }
.tts__opts label { display: grid; gap: .25rem; font: 500 .64rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.tts__opts select { width: 100%; padding: .5rem .5rem; border-radius: 10px; border: 1px solid var(--line-2); background: #151f38; color: var(--ink); font: 600 .85rem var(--font); letter-spacing: 0; text-transform: none; }
.tts__note { margin: .8rem 0 0; font-size: .74rem; color: var(--faint); line-height: 1.4; }
.tts-current { background: var(--accent-soft) !important; box-shadow: 0 0 0 6px var(--accent-soft); border-radius: 6px; transition: background .2s, box-shadow .2s; }
@media (max-width: 560px) { .tts { left: .8rem; bottom: .8rem; } .tts__fab span { display: none; } .tts__fab { padding: 0 .9rem; } }
@media print { .tts { display: none !important; } }
.team-list .avatar { overflow: hidden; }
.team-list .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-list li.is-lg .avatar { width: 64px; height: 64px; }

/* Legacy Room entry point */
.legacy-home-callout { display:flex; justify-content:space-between; align-items:center; gap:1.5rem; margin-top:1.5rem; padding:1.5rem; border:1px solid rgba(255,207,90,.35); border-radius:18px; background:linear-gradient(110deg,rgba(255,207,90,.08),rgba(255,255,255,.025)); }
.legacy-home-callout h3 { font-size:1.45rem; margin:.2rem 0 .5rem; }
.legacy-home-callout p:not(.eyebrow) { color:var(--muted); margin:0; max-width:62ch; }
@media(max-width:650px) { .legacy-home-callout { align-items:flex-start; flex-direction:column; } }
