/* =====================================================================
   PixalCream Studios - motion layer (fx.css + fx.js). Linked AFTER site.css.
   Kill switch: remove the fx.css link and the fx.js script from the pages and the
   site is back to its v3 look. Star extras have their own switch (data-mode="classic"
   on the #stars canvas). Spec: ANIMATION_SPEC.md (IDs G1.., HM-.., WD-.. below).

   Rules this file keeps:
   - continuous motion only animates transform and opacity (one-shot entrances,
     small hover colour/shadow transitions and tiny SVG strokes are the exceptions);
   - every "hidden until revealed" state is under .fx (class added by fx.js), so with
     no JS, or if fx.js 404s, nothing stays invisible;
   - one reduced-motion guard at the end switches every animation and transition off.
   ===================================================================== */

:root { --ease: cubic-bezier(.2, .7, .2, 1); --fx-dur: .7s; --sx: 24px; }
@media (max-width: 1168px) { :root { --sx: 16px; } }   /* the page gutter is only 20 px here: a sideways slide must not widen the page */

/* focus ring (the site had none) */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
:where(:focus-visible) { border-radius: 6px; }
.video-play:focus-visible { outline-offset: -6px; }

/* section is positioned (NO z-index: that would stack above the stars) */
section { position: relative; }

/* ---------- G1 nebula: a slow drifting haze below the stars ---------- */
.nebula {
  position: fixed; inset: -6%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 45% 35% at 78% 14%, rgba(70, 90, 210, .10), transparent 70%),
    radial-gradient(ellipse 40% 30% at 18% 62%, rgba(255, 138, 61, .06), transparent 70%),
    radial-gradient(ellipse 50% 35% at 70% 92%, rgba(78, 201, 255, .06), transparent 70%);
  animation: fx-nebula 120s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes fx-nebula { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-2.5%, 1.5%, 0) scale(1.06); } }
.fx-lite .nebula, .fx-lite .hp-cloud { display: none; }   /* data saver */

/* ---------- G2 reveal on scroll (classes added by fx.js only) ---------- */
.fx .reveal:not(.in) { opacity: 0; transform: translateY(18px); }
.fx .reveal[data-fx="zoom"]:not(.in) { transform: scale(.96); }
.fx .reveal[data-fx="left"]:not(.in) { transform: translateX(calc(var(--sx) * -1)); }
.fx .reveal[data-fx="right"]:not(.in) { transform: translateX(var(--sx)); }
.fx .reveal.in { animation: fx-rise var(--fx-dur) var(--ease) var(--d, 0ms) backwards; }
.fx .reveal.in[data-fx="zoom"] { animation-name: fx-zoom; }
.fx .reveal.in[data-fx="left"] { animation-name: fx-left; }
.fx .reveal.in[data-fx="right"] { animation-name: fx-right; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fx-zoom { from { opacity: 0; transform: scale(.96); } }
@keyframes fx-left { from { opacity: 0; transform: translateX(calc(var(--sx) * -1)); } }
@keyframes fx-right { from { opacity: 0; transform: translateX(var(--sx)); } }
@media (max-width: 860px) {   /* the split is one column here: rise instead of sliding sideways */
  .fx .reveal[data-fx="left"]:not(.in), .fx .reveal[data-fx="right"]:not(.in) { transform: translateY(18px); }
  .fx .reveal.in[data-fx="left"], .fx .reveal.in[data-fx="right"] { animation-name: fx-rise; }
}
@keyframes fx-fade { from { opacity: 0; } }
@keyframes fx-rise-sm { from { opacity: 0; transform: translateY(8px); } }
@keyframes fx-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-drift { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- G3 page entrance (pure CSS, ends visible) ---------- */
.pagehero .kicker { animation: fx-rise .8s var(--ease) backwards; }
.pagehero h1 { animation: fx-rise .8s var(--ease) 90ms backwards; }
.pagehero .lead { animation: fx-rise .8s var(--ease) 200ms backwards; }

/* ---------- G4 nav polish ---------- */
.topbar { transition: background-color .25s, box-shadow .25s, border-color .25s; }
.scrolled .topbar { background: rgba(5, 7, 13, .92); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); border-bottom-color: rgba(78, 201, 255, .22); }
.nav a.on { box-shadow: none; }
.nav a:not(.btn) { position: relative; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: center; transition: transform .3s var(--ease);
}
.nav a.on::after, .nav a:not(.btn):hover::after { transform: scaleX(1); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand b {
    background: linear-gradient(100deg, var(--accent) 42%, #ffe2a0 50%, var(--accent) 58%) 100% 0 / 250% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    transition: background-position .8s var(--ease);
  }
  .brand:hover b { background-position: 0 0; }
}
.menu span, .menu span::before, .menu span::after { transition: transform .25s var(--ease), background-color .2s; }
.nav-open .menu span { background: transparent; }
.nav-open .menu span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .menu span::after { transform: translateY(-7px) rotate(-45deg); }
@keyframes fx-drop { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 940px) {
  .nav a:not(.btn)::after { display: none; }
  .nav a.on { box-shadow: 0 2px 0 var(--accent); }
  .nav-open .nav { animation: fx-drop .28s var(--ease); }
}

/* ---------- G6 scroll progress hairline ---------- */
.topbar .progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); pointer-events: none;
}

/* ---------- G10 back to top ---------- */
.totop {
  position: fixed; z-index: 40; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 15, 28, .88);
  color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
  transition: opacity .3s, transform .3s var(--ease), border-color .2s, visibility 0s .3s;
}
.totop.show { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.totop:hover { border-color: var(--accent-2); }
.totop span { display: block; transition: transform .5s var(--ease); }
.totop:hover span { transform: rotate(360deg); }

/* ---------- G7 section dividers (the line grows when the section scrolls in) ---------- */
.fx-rule::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; margin-inline: auto; height: 1px; pointer-events: none;
  width: min(var(--max), 100% - 40px);
  background: linear-gradient(90deg, transparent, rgba(78, 201, 255, .55), transparent);
  transform: scaleX(0); transition: transform 1.1s var(--ease);
}
.fx-rule.in::before { transform: scaleX(1); }
.fx-rule::after {
  content: ""; position: absolute; top: -1px; left: max(20px, calc((100% - var(--max)) / 2)); width: 60px; height: 3px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(190, 240, 255, .95), rgba(78, 201, 255, 0) 70%); opacity: 0;
}
.fx-rule.in::after { animation: fx-spark 1.4s var(--ease) both; }
@keyframes fx-spark {
  0% { opacity: 0; transform: translateX(0); }
  12% { opacity: 1; }
  80% { opacity: .8; }
  100% { opacity: 0; transform: translateX(calc(min(var(--max), 100vw - 40px) - 60px)); }
}

/* ---------- G12 pause loops that are off screen ---------- */
.is-off, .is-off *, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }

/* ---------- G5 hover micro-interactions (fine pointers only) ---------- */
.btn { position: relative; }
/* primary Steam buttons breathe a glow (fx.js adds .glow); idle effect, so it also runs on phones */
.btn.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 28px 4px rgba(255, 138, 61, .5); opacity: 0;
  animation: fx-breathe 3.4s ease-in-out infinite alternate; will-change: opacity;
}
@keyframes fx-breathe { from { opacity: 0; } to { opacity: .8; } }

@media (hover: hover) and (pointer: fine) {
  /* spotlight: a pre-painted soft circle that follows the pointer (fx.js writes --mx / --my) */
  .spot { position: relative; overflow: hidden; isolation: isolate; }
  .spot:not(.step)::before, .step.spot::after {   /* .step already uses ::before for its number */
    content: ""; position: absolute; left: 0; top: 0; width: 280px; height: 280px; border-radius: 50%; z-index: -1; pointer-events: none;
    background: radial-gradient(circle, rgba(var(--cr, 78, 201, 255), .13), transparent 68%);
    opacity: 0; transform: translate3d(calc(var(--mx, -999px) - 140px), calc(var(--my, -999px) - 140px), 0);
    transition: opacity .3s; will-change: transform;
  }
  .spot:not(.step):hover::before, .step.spot:hover::after { opacity: 1; }
  /* the world cards must not clip (Saelis's ring and Veyra's glow reach outside): a gradient at the pointer instead */
  .world.spot { overflow: visible; }
  .world.spot::before {
    inset: 0; width: auto; height: auto; transform: none; will-change: auto;
    background: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), rgba(78, 201, 255, .12), transparent);
  }

  /* tilt: 4 degrees at most, only on picture tiles and the quote (never body text) */
  .tilt, .tile.tilt:hover {
    transform: perspective(900px) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .35s var(--ease), border-color .25s;
  }
  .tilt.tilting { transition: transform .08s linear, border-color .25s; }
  .tile.tilt:hover { --lift: -4px; }

  /* button sheen */
  .btn::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .38) 50%, transparent 60%) 150% 0 / 250% 100% no-repeat;
  }
  .btn.ghost::after { background-image: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .12) 50%, transparent 60%); }
  .btn:hover::after { animation: fx-sheen .7s var(--ease); }
  @keyframes fx-sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }

  /* screenshot light sweep */
  .shots a::after, .artgrid a::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
  }
  .shots a:hover::after, .artgrid a:hover::after { animation: fx-sweep-x .9s var(--ease); }
  @keyframes fx-sweep-x { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
  .artgrid a { position: relative; }
  .lb-ready .shots a, .lb-ready .artgrid a { cursor: zoom-in; }
}

/* ---------- G8 counters / HM-5 stat strip ---------- */
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; padding: 28px 0 0; }
.stat { padding-top: 14px; border-top: 1px solid var(--line); }
.stat b { display: block; font-size: clamp(2.125rem, 5vw, 3.25rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 2ch; contain: layout paint; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: .875rem; letter-spacing: .04em; }

/* ---------- G9 page leave ---------- */
.leaving main, .leaving footer { opacity: 0; transform: translateY(-6px); transition: opacity .15s ease-in, transform .15s ease-in; }

/* ---------- G11 next-page card and footer ---------- */
.nextcard { position: relative; }
.nextcard::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.nextcard:hover::after, .nextcard:focus-visible::after { transform: scaleX(1); }
.nextcard .arr { display: inline-block; font-style: normal; transition: transform .3s var(--ease); }
.nextcard:hover .arr, .nextcard:focus-visible .arr { transform: translateX(6px); }

/* ---------- G13 voice lines: words fade in one by one ---------- */
.go .w { animation: fx-fade .4s var(--ease) calc(var(--wd, 0ms) + var(--i, 0) * 28ms) backwards; }

/* ---------- G14 callout scan line (echo of the in-game scan pulse) ---------- */
.callout { position: relative; overflow: hidden; }
.callout::after {
  content: ""; position: absolute; left: 0; top: 0; width: 30%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent); opacity: .8;
  animation: fx-scan-x 7s linear infinite; will-change: transform;
}
@keyframes fx-scan-x { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(333%); } }

/* =====================================================================
   HOME
   ===================================================================== */

/* ---------- HM-1 the sky is the hero ---------- */
.hero { background: none; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(90deg, rgba(5, 7, 13, .45), transparent 60%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero-sky {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
}
.hero-glow { position: absolute; left: -12%; bottom: -34%; width: 78%; height: 78%; animation: fx-fade 1.6s var(--ease) .2s backwards, fx-rise24 1.6s var(--ease) .2s backwards; }
.hero-glow::before {
  content: ""; position: absolute; inset: 0; opacity: .7;
  background: radial-gradient(ellipse at 40% 65%, rgba(255, 138, 61, .22), transparent 68%);
  animation: fx-glow-breathe 9s ease-in-out infinite alternate; will-change: opacity;
}
@keyframes fx-glow-breathe { from { opacity: .55; } to { opacity: .85; } }
@keyframes fx-rise24 { from { transform: translateY(24px); } }
@keyframes fx-lift40 { from { transform: translateY(40px); } }

.hero-planet {
  position: absolute; right: -14vw; bottom: -58%; width: min(62vw, 900px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 28% 22%, #2f78c4, #0d2c57 70%);
  box-shadow: 0 0 0 1px rgba(120, 190, 255, .25), 0 0 80px 10px rgba(78, 160, 255, .22);
  animation: fx-fade 1.6s var(--ease) .2s backwards, fx-lift40 2.2s var(--ease) .2s backwards;
}
.hp-land, .hp-cloud {
  position: absolute; top: 0; bottom: 0; left: 0; width: 200%;
  background-repeat: repeat-x; background-size: 50% 100%; will-change: transform;
  animation: fx-drift var(--t) linear infinite;
}
.hp-land {
  --t: 170s;
  background-image:
    radial-gradient(ellipse 13% 8% at 25% 30%, #3e7d4a 0 80%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 9% 6% at 38% 37% , #c9b27a 0 76%, rgba(201, 178, 122, 0) 100%),
    radial-gradient(ellipse 11% 15% at 60% 52%, #3e7d4a 0 80%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 7% 5% at 70% 61%, #c9b27a 0 76%, rgba(201, 178, 122, 0) 100%),
    radial-gradient(ellipse 10% 6% at 30% 70%, #3e7d4a 0 80%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 8% 10% at 80% 24%, #3e7d4a 0 80%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 6% 4% at 52% 20%, #c9b27a 0 76%, rgba(201, 178, 122, 0) 100%),
    radial-gradient(ellipse 9% 5% at 48% 83%, #3e7d4a 0 80%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 5% 3.5% at 22% 56%, #c9b27a 0 76%, rgba(201, 178, 122, 0) 100%);
}
.hp-cloud {
  --t: 115s;
  background-image:
    radial-gradient(ellipse 12% 2.6% at 22% 18%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 10% 2.2% at 66% 27%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 13% 3% at 40% 41%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 9% 2.4% at 78% 54%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 12% 2.8% at 28% 64%, rgba(255, 255, 255, .48), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 10% 2.4% at 58% 76%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 11% 2.6% at 20% 88%, rgba(255, 255, 255, .36), rgba(255, 255, 255, 0) 100%);
}
.hero-planet::after {   /* Veyra lights it from the upper left */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 28% 22%, transparent 35%, rgba(2, 4, 10, .55) 62%, rgba(2, 4, 10, .92));
  box-shadow: inset 8px 6px 34px rgba(130, 200, 255, .22);
}

/* Kheron, the dying moon, drifting on an ellipse (two animations: x with `translate`, y with `transform`) */
.hero-orbit { --ax: 220px; --ay: 46px; position: absolute; right: 18%; top: 20%; width: 0; height: 0; }
.hero-orbit::before {
  content: ""; position: absolute; left: calc(var(--ax) * -1); top: calc(var(--ay) * -1); width: calc(var(--ax) * 2); height: calc(var(--ay) * 2);
  border: 1px dashed rgba(78, 201, 255, .12); border-radius: 50%;
}
.hero-moon {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a49b92, #3a3532); box-shadow: inset -8px -5px 12px rgba(0, 0, 0, .7);
  animation: fx-orbit-x 70s cubic-bezier(.37, 0, .63, 1) infinite alternate, fx-orbit-y 70s cubic-bezier(.37, 0, .63, 1) -35s infinite alternate,
             fx-fade 1.6s var(--ease) .2s backwards;
  will-change: transform;
}
.hero-moon::after {
  content: ""; position: absolute; inset: 20% 30% 30% 45%; border-top: 1px solid rgba(255, 120, 60, .85); transform: rotate(35deg);
  animation: fx-flicker 6.5s linear infinite;
}
@keyframes fx-orbit-x { from { translate: calc(var(--ax) * -1) 0; } to { translate: var(--ax) 0; } }
@keyframes fx-orbit-y { from { transform: translateY(calc(var(--ay) * -1)) scale(.8); } to { transform: translateY(var(--ay)) scale(1.15); } }
@keyframes fx-flicker { 0%, 100% { opacity: .4; } 18% { opacity: 1; } 41% { opacity: .6; } 63% { opacity: .9; } 82% { opacity: .45; } }

/* ---------- HM-2 entrance choreography (pure CSS, ends visible) ---------- */
.hero .eyebrow { animation: fx-rise .8s var(--ease) backwards; }
.hero h1 { animation: fx-rise .8s var(--ease) 120ms backwards; }
.hero p.lead { animation: fx-rise .8s var(--ease) 300ms backwards; }
.hero .cta .btn:nth-child(1) { animation: fx-rise .8s var(--ease) 450ms backwards; }
.hero .cta .btn:nth-child(2) { animation: fx-rise .8s var(--ease) 530ms backwards; }
.hero .badge { animation: fx-rise .8s var(--ease) backwards; }
.hero .badge:nth-child(1) { animation-delay: 650ms; }
.hero .badge:nth-child(2) { animation-delay: 710ms; }
.hero .badge:nth-child(3) { animation-delay: 770ms; }
.hero .badge:nth-child(4) { animation-delay: 830ms; }
.hero .badge:nth-child(5) { animation-delay: 890ms; }
.hero .badge:nth-child(6) { animation-delay: 950ms; }

/* ---------- HM-3 "Paradigms" glows ---------- */
.hero h1 span { position: relative; display: inline-block; }
.hero h1 span::after {
  content: attr(data-text); content: attr(data-text) / ""; position: absolute; inset: 0; color: #ffd36b; -webkit-text-fill-color: #ffd36b; pointer-events: none;
  filter: blur(14px); opacity: 0; animation: fx-pulse 5s ease-in-out infinite; will-change: opacity;
}
@keyframes fx-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .55; } }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 span[data-text] {
    background: linear-gradient(100deg, var(--accent) 42%, #ffe9a8 50%, var(--accent) 58%) 0 0 / 250% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    animation: fx-gold 1.4s var(--ease) .9s backwards;
  }
  .hero h1 span.sw1 { animation-name: fx-gold-b; animation-delay: 0s; }   /* hover replays it: two names, swapped by fx.js, restart cleanly */
  .hero h1 span.sw2 { animation-name: fx-gold-c; animation-delay: 0s; }
  @keyframes fx-gold { from { background-position: 100% 0; } to { background-position: 0 0; } }
  @keyframes fx-gold-b { from { background-position: 100% 0; } to { background-position: 0 0; } }
  @keyframes fx-gold-c { from { background-position: 100% 0; } to { background-position: 0 0; } }
}

/* ---------- HM-4 scroll chevron ---------- */
.hero-scroll { position: absolute; left: 50%; bottom: 20px; width: 34px; height: 34px; margin-left: -17px; z-index: 2; display: grid; place-items: center; transition: opacity .3s; }
.hero-scroll span { display: block; width: 11px; height: 11px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); animation: fx-bob 2.2s ease-in-out infinite; }
.hero-scroll:hover span { border-color: var(--text); }
.scrolled .hero-scroll { opacity: 0; pointer-events: none; }
@keyframes fx-bob { 0%, 100% { transform: translateY(-4px) rotate(45deg); } 50% { transform: translateY(4px) rotate(45deg); } }

/* ---------- HM-6 pitch tiles: picture moves to ::before so it can drift on hover ---------- */
.tile { background: none; isolation: isolate; }
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -2; background: var(--img) center / cover;
  transition: transform 1.2s var(--ease);
}
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(5, 7, 13, .92) 100%); }
.tile > * { position: relative; z-index: 1; }
.tile > .fx-scan { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transform: translateY(-100%);
  background: linear-gradient(0deg, var(--accent) 0 2px, rgba(255, 138, 61, .28) 2px, transparent 42px); }
.tile b { transition: transform .4s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover::before { transform: scale(1.07); }
  .tile:hover b, .tile:hover .kicker { transform: translateY(-6px); }
  .tile .kicker { transition: transform .4s var(--ease); }
  .tile:hover .fx-scan { animation: fx-scan-y .9s ease-in-out 1; }
  @keyframes fx-scan-y { 0% { opacity: 1; transform: translateY(-100%); } 100% { opacity: 1; transform: translateY(100%); } }
}

/* ---------- HM-7 trailer ---------- */
.video-play::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  border: 2px solid var(--accent); pointer-events: none; opacity: 0; animation: fx-ring 2.6s ease-out infinite;
}
@keyframes fx-ring { from { transform: scale(1); opacity: .5; } to { transform: scale(1.9); opacity: 0; } }
.video-frame { transition: border-color .3s, box-shadow .3s; }
.video-frame:hover { border-color: rgba(255, 138, 61, .5); box-shadow: 0 0 60px rgba(255, 138, 61, .18); }

/* ---------- HM-8 / MN-3 voice bars ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq b { display: block; width: 3px; height: 100%; border-radius: 1px; background: var(--c, var(--accent-2)); transform-origin: bottom; transform: scaleY(.35); }
.quote figcaption .eq { vertical-align: middle; margin-right: 12px; }
.quote .eq b { animation: fx-eq 1.2s ease-in-out infinite alternate; }
.quote .eq b:nth-child(1) { animation-duration: 1.1s; }
.quote .eq b:nth-child(2) { animation-duration: 1.5s; }
.quote .eq b:nth-child(3) { animation-duration: .9s; }
.quote .eq b:nth-child(4) { animation-duration: 1.3s; }
.quote .eq b:nth-child(5) { animation-duration: 1.0s; }
@keyframes fx-eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }

/* ---------- HM-9 CTA finale ---------- */
.cta-sky { position: absolute; left: 0; right: 0; top: 0; height: 96px; overflow: hidden; pointer-events: none; }
.cta-ship { position: absolute; left: 0; top: 38px; width: 40px; height: 14px; opacity: .5; animation: fx-ship 45s linear infinite; will-change: transform; }
.cta-ship svg { display: block; width: 100%; height: 100%; }
.cta-ship::before { content: ""; position: absolute; right: 100%; top: 6px; width: 110px; height: 2px; background: linear-gradient(90deg, transparent, rgba(78, 201, 255, .7)); }
@keyframes fx-ship { from { transform: translateX(-10vw); } to { transform: translateX(110vw); } }
.crack { display: block; width: min(260px, 70%); height: 18px; margin: -4px auto 16px; overflow: visible; }
.crack polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.crack .crack-line { stroke: rgba(255, 138, 61, .85); stroke-width: 2; }
.crack .crack-glow { stroke: rgba(255, 138, 61, .55); stroke-width: 6; opacity: 0; filter: blur(3px); }
.crack.pre:not(.go) polyline { stroke-dashoffset: 1; }
.crack.go .crack-line { animation: fx-draw 1.4s var(--ease) backwards; }
.crack.go .crack-glow { animation: fx-crack-glow 5s ease-in-out 1.4s infinite; }
@keyframes fx-draw { from { stroke-dashoffset: 1; } }
@keyframes fx-crack-glow { 0%, 100% { opacity: 0; } 50% { opacity: .8; } }
@media (max-width: 560px) { .cta-sky { display: none; } }

/* =====================================================================
   THE GAME
   ===================================================================== */

/* GM-1 lightbox */
html.lb-open { overflow: hidden; padding-right: var(--sbw, 0px); }
html.lb-open .topbar { padding-right: var(--sbw, 0px); }
dialog.lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: hidden; overscroll-behavior: contain;
}
dialog.lb::backdrop { background: rgba(3, 5, 10, .82); transition: opacity .3s; }
dialog.lb[open]::backdrop { animation: fx-fade .25s ease-out; }
dialog.lb.closing::backdrop { opacity: 0; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 60px 12px 76px; touch-action: pan-y; cursor: zoom-out; }
.lb-img { display: block; max-width: none; border-radius: 10px; background: #000; object-fit: contain; box-shadow: 0 20px 80px rgba(0, 0, 0, .6); cursor: default; user-select: none; -webkit-user-drag: none; will-change: transform; }
.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 16px; align-items: flex-end;
  padding: 26px 72px 18px; color: #c3cde2; font-size: 15px; pointer-events: none;
  background: linear-gradient(transparent, rgba(3, 5, 10, .7));
}
.lb-count { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-btn {
  position: absolute; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 15, 28, .82);
  color: var(--text); font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: border-color .2s, background-color .2s;
}
.lb-btn:hover { border-color: var(--accent-2); background: rgba(14, 21, 38, .95); }
.lb-prev { left: 14px; top: 50%; margin-top: -23px; }
.lb-next { right: 14px; top: 50%; margin-top: -23px; }
.lb-close { right: 14px; top: 14px; font-size: 26px; }
dialog.lb[open] .lb-btn, dialog.lb[open] .lb-bar { animation: fx-fade .3s ease-out .15s backwards; }
@media (max-width: 640px) {
  .lb-stage { padding: 64px 8px 84px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prev { left: 12px; } .lb-next { right: 12px; }
  .lb-bar { padding: 26px 70px 22px; justify-content: center; text-align: center; flex-direction: column; align-items: center; gap: 4px; }
}

/* GM-3 card icons come alive on hover */
.card .ico { display: inline-block; position: relative; transition: transform .45s var(--ease); }
.card .ico::before, .card .ico::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; opacity: 0; }
.ico[data-ico="globe"]::after { inset: -8px; background: radial-gradient(circle, rgba(78, 160, 255, .5), transparent 70%); }
.ico[data-ico="mine"]::before { inset: 0; border: 1px solid var(--accent-2); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .ico[data-ico="globe"]::after, .card:focus-within .ico[data-ico="globe"]::after { animation: fx-glow-pulse 2.4s ease-in-out infinite; }
  .card:hover .ico[data-ico="mine"]::before, .card:focus-within .ico[data-ico="mine"]::before { animation: fx-ring-s 2.8s ease-out infinite; }
  .card:hover .ico[data-ico="ship"] { transform: translate(5px, -5px) rotate(-6deg); }
  .card:hover .ico[data-ico="fly"] { animation: fx-sway 3s ease-in-out infinite alternate; }
}
@keyframes fx-glow-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes fx-ring-s { from { transform: scale(.6); opacity: .5; } to { transform: scale(2.2); opacity: 0; } }
@keyframes fx-sway { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }

/* GM-4 the home tile "Mine, smelt, automate" lands on #build: flash it once (inset so overflow clipping cannot hide it) */
.card:target { position: relative; }
.card:target::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: fx-target 1.8s ease-out 1; }
@keyframes fx-target {
  from { box-shadow: inset 0 0 0 2px rgba(255, 138, 61, .85), inset 0 0 34px rgba(255, 138, 61, .4); }
  to { box-shadow: inset 0 0 0 2px rgba(255, 138, 61, 0), inset 0 0 34px rgba(255, 138, 61, 0); }
}

/* =====================================================================
   WORLDS
   ===================================================================== */

/* WD-1 orbs spin: fx.js puts <i class="surf"> inside every .orb; its ::before is a wide strip that slides one tile */
.orb .surf { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; transform: rotate(var(--rot, 0deg)); }
.orb .surf::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 200%;
  background-repeat: repeat-x; background-size: 50% 100%; will-change: transform;
  animation: fx-drift var(--t, 60s) linear infinite;
}
.orb .surf::after {   /* the limb shading is painted again on top, because the strip covers the orb's own inset shadow */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  transform: rotate(calc(var(--rot, 0deg) * -1));
  box-shadow: inset -18px -12px 30px rgba(0, 0, 0, .75);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .15), transparent 50%);
}
.orb { transition: transform .4s var(--ease); }
/* the orb's own pseudo-elements stay above the surface */
.orb.kheron::after, .orb.saelis::after, .orb.kheron::before, .orb.cindral::before, .orb.hesk::before { z-index: 2; }

/* WD-2 per world: a seamless horizontal tile (blobs stay 12% away from the tile edge) */
.orb.tellurin .surf { --t: 48s; background: radial-gradient(circle at 40% 35%, #2f78c4, #0d2c57); }
.orb.tellurin .surf::before {
  background-image:
    radial-gradient(ellipse 10% 7% at 26% 62%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 12% 6% at 70% 30%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 9% 5% at 48% 80%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 14% 16% at 32% 40%, #3e7d4a 0 62%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 8% 8% at 43% 50%, #c9b27a 0 60%, rgba(201, 178, 122, 0) 100%),
    radial-gradient(ellipse 13% 18% at 72% 56%, #3e7d4a 0 62%, rgba(62, 125, 74, 0) 100%),
    radial-gradient(ellipse 7% 6% at 80% 67%, #c9b27a 0 60%, rgba(201, 178, 122, 0) 100%);
}
.orb.kheron .surf { --t: 90s; background: radial-gradient(circle at 35% 35%, #a49b92, #3a3532); }
.orb.kheron .surf::before {
  background-image:
    radial-gradient(circle 7px at 30% 36%, rgba(24, 20, 18, .55) 0 55%, rgba(255, 255, 255, .13) 70% 90%, transparent 100%),
    radial-gradient(circle 5px at 62% 28%, rgba(24, 20, 18, .5) 0 55%, rgba(255, 255, 255, .12) 70% 90%, transparent 100%),
    radial-gradient(circle 9px at 52% 64%, rgba(24, 20, 18, .55) 0 55%, rgba(255, 255, 255, .13) 70% 90%, transparent 100%),
    radial-gradient(circle 4px at 78% 52%, rgba(24, 20, 18, .5) 0 55%, rgba(255, 255, 255, .1) 70% 90%, transparent 100%),
    radial-gradient(circle 4px at 24% 70%, rgba(24, 20, 18, .5) 0 55%, rgba(255, 255, 255, .1) 70% 90%, transparent 100%);
}
.orb.kheron .surf::after { box-shadow: inset -14px -10px 24px rgba(0, 0, 0, .75); }
.orb.cindral .surf { --t: 70s; background: radial-gradient(circle at 35% 30%, #ff9a52, #9c3d17 60%, #4a1708); }
.orb.cindral .surf::before {
  background-image:
    radial-gradient(ellipse 26% 3% at 40% 28%, rgba(70, 22, 8, .5), rgba(70, 22, 8, 0) 100%),
    radial-gradient(ellipse 20% 2.5% at 62% 46%, rgba(255, 190, 120, .3), rgba(255, 190, 120, 0) 100%),
    radial-gradient(ellipse 28% 3.5% at 36% 62%, rgba(70, 22, 8, .5), rgba(70, 22, 8, 0) 100%),
    radial-gradient(ellipse 18% 2.5% at 66% 78%, rgba(70, 22, 8, .45), rgba(70, 22, 8, 0) 100%),
    radial-gradient(ellipse 22% 3% at 44% 14%, rgba(255, 190, 120, .25), rgba(255, 190, 120, 0) 100%);
}
.orb.cindral::before {   /* dust shimmer */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 40% 35%, rgba(255, 200, 140, .55), transparent 65%);
  animation: fx-haze 8s ease-in-out infinite alternate;
}
@keyframes fx-haze { from { opacity: 0; } to { opacity: .35; } }
.orb.hesk .surf { --t: 110s; background: radial-gradient(circle at 35% 30%, #ffffff, #b9dcef 45%, #4e7b99); }
.orb.hesk .surf::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%234a7a99' stroke-opacity='.55' stroke-width='.9'%3E%3Cpath d='M18 30 L34 38 L46 33 L60 44'/%3E%3Cpath d='M46 33 L52 18'/%3E%3Cpath d='M28 72 L44 62 L58 70 L76 60'/%3E%3Cpath d='M58 70 L62 84'/%3E%3Cpath d='M70 26 L83 36'/%3E%3C/g%3E%3C/svg%3E");
}
.orb.hesk .surf::after { box-shadow: inset -16px -10px 26px rgba(0, 0, 0, .6); }
.orb.hesk::before {   /* slow specular shimmer */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .75), transparent 42%);
  animation: fx-shimmer 6s ease-in-out infinite;
}
@keyframes fx-shimmer { 0%, 100% { opacity: 0; } 50% { opacity: .55; } }
.orb.orvane .surf { --t: 14s; --rot: -8deg; background: #a06f45; }
.orb.orvane .surf::before {   /* exactly horizontal bands: the storm ovals are what travels */
  background-image:
    radial-gradient(ellipse 14% 6% at 54% 60%, #b5482a 0 50%, #e8a57c 72%, rgba(232, 165, 124, 0) 100%),
    radial-gradient(ellipse 7% 3% at 26% 36%, rgba(255, 240, 220, .75), rgba(255, 240, 220, 0) 100%),
    radial-gradient(ellipse 8% 3% at 76% 78%, rgba(255, 240, 220, .6), rgba(255, 240, 220, 0) 100%),
    repeating-linear-gradient(180deg, #c79a64 0 9px, #8d5c35 9px 15px, #e3c28f 15px 22px, #a06f45 22px 30px);
}
.orb.saelis .surf { --t: 22s; --rot: -12deg; background: #9aabc2; }
.orb.saelis .surf::before {
  background-image:
    radial-gradient(ellipse 10% 4% at 38% 54%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 8% 3% at 70% 30%, rgba(90, 110, 140, .5), rgba(90, 110, 140, 0) 100%),
    repeating-linear-gradient(180deg, #b9c7d8 0 8px, #7f92ad 8px 14px, #d8e0ea 14px 22px);
}
.orb.veyra .surf { --t: 120s; background: radial-gradient(circle, #fffbe6 0 30%, #ffd36b 55%, #ff8a3d); }
.orb.veyra .surf::before {   /* warm granulation streaks */
  background-image:
    radial-gradient(ellipse 22% 3% at 30% 32%, rgba(255, 130, 40, .45), rgba(255, 130, 40, 0) 100%),
    radial-gradient(ellipse 18% 2.5% at 64% 48%, rgba(255, 245, 200, .5), rgba(255, 245, 200, 0) 100%),
    radial-gradient(ellipse 24% 3% at 40% 66%, rgba(255, 130, 40, .4), rgba(255, 130, 40, 0) 100%),
    radial-gradient(ellipse 16% 2.5% at 68% 80%, rgba(255, 245, 200, .45), rgba(255, 245, 200, 0) 100%),
    radial-gradient(ellipse 20% 2.5% at 46% 16%, rgba(255, 130, 40, .4), rgba(255, 130, 40, 0) 100%);
}
.orb.veyra .surf::after { box-shadow: inset 0 0 22px rgba(255, 138, 61, .35); background: none; }
.orb.veyra::before {   /* WD-3 corona pulse, behind the sun */
  content: ""; position: absolute; inset: -70%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 90, .35), transparent 62%);
  animation: fx-corona 6s ease-in-out infinite; will-change: transform, opacity;
}
@keyframes fx-corona { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.12); opacity: 1; } }

/* WD-4 Kheron cracks and sheds */
.orb.kheron::after { animation: fx-flicker 4.8s linear infinite; }
.orb.kheron::before {
  content: ""; position: absolute; left: 70%; top: 26%; width: 5px; height: 5px; border-radius: 50%; background: #8d847b; opacity: 0; pointer-events: none;
  animation: fx-chip 9s linear infinite;
}
@keyframes fx-chip {
  0%, 85% { opacity: 0; transform: translate(0, 0); }
  87% { opacity: 1; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(40px, -30px); }
}

/* WD-5 Saelis's ring tilts a little (the individual `rotate` property replaces the fixed transform) */
@supports (rotate: 1deg) {
  .orb.saelis::after { transform: none; rotate: -14deg; animation: fx-ring-tilt 14s ease-in-out infinite alternate; }
  @keyframes fx-ring-tilt { from { rotate: -14deg; opacity: .85; } to { rotate: -10deg; opacity: 1; } }
}

/* WD-6 banner: slow Ken Burns plus the shadow of a cloud */
.banner img { animation: fx-kb 26s ease-in-out infinite alternate; will-change: transform; }
@keyframes fx-kb { from { transform: scale(1.02) translate(-1.5%, 0); } to { transform: scale(1.1) translate(1.5%, 0); } }
.banner figcaption { z-index: 2; }
.banner::after {
  content: ""; position: absolute; left: 0; top: 8%; width: 60%; height: 74%; z-index: 1; pointer-events: none; opacity: .25;
  background: radial-gradient(ellipse at center, rgba(2, 4, 10, .9), transparent 70%);
  animation: fx-cloud-shadow 40s linear infinite; will-change: transform;
}
@keyframes fx-cloud-shadow { from { transform: translateX(-60%); } to { transform: translateX(120%); } }

/* WD-7 orbit map (built by fx.js; schematic only) */
.orbmap { margin: 0 0 30px; padding: 6px 0 0; position: relative; }
.orbmap svg { display: block; width: 100%; height: auto; overflow: visible; }
.orbmap figcaption { text-align: right; color: var(--muted); font-size: 12px; letter-spacing: .08em; opacity: .75; }
.om-ring { fill: none; stroke: rgba(141, 154, 181, .2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.om-body { animation: fx-om-x var(--p, 40s) cubic-bezier(.37, 0, .63, 1) calc(var(--o, 0s) * -1) infinite alternate,
                      fx-om-y var(--p, 40s) cubic-bezier(.37, 0, .63, 1) calc(var(--p, 40s) / -2 - var(--o, 0s)) infinite alternate; }
@keyframes fx-om-x { from { translate: calc(var(--rx) * -1px) 0; } to { translate: calc(var(--rx) * 1px) 0; } }
@keyframes fx-om-y { from { transform: translateY(calc(var(--ry) * -1px)); } to { transform: translateY(calc(var(--ry) * 1px)); } }
.om-dot { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .25s var(--ease); }
.om-hit { fill: transparent; pointer-events: all; cursor: pointer; }
.om-body.hl > .om-dot, .om-sun.hl { transform: scale(1.9); }
.world.hl { border-color: rgba(78, 201, 255, .6); box-shadow: 0 0 34px -6px rgba(78, 201, 255, .45); }
.world { transition: border-color .25s, box-shadow .25s; }

/* WD-9 orb hover */
@media (hover: hover) and (pointer: fine) { .world:hover .orb { transform: scale(1.06); } }

/* =====================================================================
   SHIP MINDS
   ===================================================================== */

/* MN-1 steps: the number pops */
.step.go::before { animation: fx-pop .5s var(--ease) calc(var(--wd, 0ms) + 160ms) backwards; }

/* MN-2 a colour per core (data-core is set by fx.js from the h3) */
.core { position: relative; overflow: hidden; }
.core[data-core="aria"] { --c: #4ec9ff; --cr: 78, 201, 255; }
.core[data-core="forge"] { --c: #ff8a3d; --cr: 255, 138, 61; }
.core[data-core="tally"] { --c: #ffd36b; --cr: 255, 211, 107; }
.core[data-core="augur"] { --c: #a98bff; --cr: 169, 139, 255; }
.core[data-core="bulwark"] { --c: #5fd39a; --cr: 95, 211, 154; }
.core[data-core="chorus"] { --c: #ff7ad9; --cr: 255, 122, 217; }
.core[data-core="salvo"] { --c: #ff5d5d; --cr: 255, 93, 93; }
.core[data-core="wraith"] { --c: #9fb0d0; --cr: 159, 176, 208; }
.core[data-core="envoy"] { --c: #4fd1c5; --cr: 79, 209, 197; }
.core[data-core="null"] { --c: #b36bff; --cr: 179, 107, 255; }
.core[data-core]:not(.later) { border-left-color: var(--c); }
.core[data-core].later { border-left-color: color-mix(in srgb, var(--c) 45%, #3a4766); }

/* MN-3 voice glyph: four bars, idle at rest, the six first cores breathe slowly */
.core .eq { position: absolute; top: 18px; right: 20px; }
.core .eq b { animation: fx-eq 1.1s ease-in-out infinite alternate; animation-play-state: paused; }
.core .eq b:nth-child(1) { animation-duration: .9s; }
.core .eq b:nth-child(2) { animation-duration: 1.3s; }
.core .eq b:nth-child(3) { animation-duration: 1.1s; }
.core .eq b:nth-child(4) { animation-duration: 1.5s; }
.core:not(.later) .eq b { animation-play-state: running; animation-duration: 2.6s; }
.core:not(.later) .eq b:nth-child(2) { animation-duration: 3.2s; }
.core:not(.later) .eq b:nth-child(3) { animation-duration: 2.9s; }
.core:not(.later) .eq b:nth-child(4) { animation-duration: 3.6s; }
.core:hover .eq b, .core:focus-within .eq b { animation-play-state: running; }

/* MN-5 the six "Offered first" cores wake (inset glow, out of step with each other) */
.core:not(.later)::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 22px var(--c, var(--accent-2)); animation: fx-wake 5.5s ease-in-out infinite; will-change: opacity;
}
.core:not(.later):nth-child(2)::after { animation-delay: -.9s; }
.core:not(.later):nth-child(3)::after { animation-delay: -1.8s; }
.core:not(.later):nth-child(4)::after { animation-delay: -2.7s; }
.core:not(.later):nth-child(5)::after { animation-delay: -3.6s; }
.core:not(.later):nth-child(6)::after { animation-delay: -4.5s; }
@keyframes fx-wake { 0%, 100% { opacity: 0; } 50% { opacity: .3; } }

/* MN-6 the four "Coming later" cores stay dim but power up: a slow scan line */
.core.later::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; transform: translateY(-100%);
  background: linear-gradient(0deg, var(--c, #8d9ab5) 0 1px, transparent 1px); animation: fx-scan-down 6s linear infinite; will-change: transform;
}
@keyframes fx-scan-down { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* MN-7 character beats */
.core[data-core="null"] h3 { text-shadow: 1px 0 rgba(255, 0, 200, .45), -1px 0 rgba(0, 220, 255, .45); animation: fx-glitch 6s steps(1, end) infinite; }
@keyframes fx-glitch {
  0%, 91%, 100% { transform: none; }
  92% { transform: translateX(2px) skewX(-6deg); }
  94% { transform: translateX(-2px) skewX(5deg); }
  96% { transform: translateX(1px) skewX(-2deg); }
  98% { transform: translateX(-1px) skewX(3deg); }
}
.core[data-core="wraith"] > * { transition: opacity .3s; }
@media (hover: hover) and (pointer: fine) { .core[data-core="wraith"]:hover > :not(h3) { opacity: .35; } }
.core[data-core="augur"] .eq b { display: none; }
.core[data-core="augur"] .eq::before, .core[data-core="augur"] .eq::after {
  content: ""; position: absolute; right: 0; top: -2px; width: 22px; height: 22px; border: 1px solid var(--c); border-radius: 50%; opacity: 0;
  animation: fx-echo 3s ease-out infinite;
}
.core[data-core="augur"] .eq::after { animation-delay: 1.5s; }
@keyframes fx-echo { from { transform: scale(.6); opacity: .5; } to { transform: scale(1.6); opacity: 0; } }

/* MN-8 blue-hologram cube beside "It builds with you" */
.step .holo { position: absolute; top: 16px; right: 16px; width: 56px; height: 56px; opacity: .6; pointer-events: none; overflow: visible; }
.holo line { stroke: var(--accent-2); stroke-width: 1.5; stroke-linecap: round; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; animation: fx-edge 4.6s ease-in-out infinite; animation-delay: calc(var(--k) * .17s); }
@keyframes fx-edge { 0% { stroke-dashoffset: 1; } 12% { stroke-dashoffset: 0; } 87% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }

/* =====================================================================
   HERITAGE
   ===================================================================== */
.race { position: relative; }
.race .sigil { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; pointer-events: none; }
.race .sigil::before {
  content: ""; position: absolute; inset: 0; border: 1px dashed var(--c, #8d9ab5); border-radius: 50%; opacity: .6;
  animation: fx-spin 90s linear infinite; transition: opacity .3s, box-shadow .3s;
}
.race .sigil::after {
  content: ""; position: absolute; inset: 8px; background: var(--c, #8d9ab5); opacity: .5; clip-path: var(--poly, polygon(50% 0, 100% 50%, 50% 100%, 0 50%));
  animation: fx-spin 140s linear infinite reverse; transition: opacity .3s;
}
.race:hover .sigil::before { animation-duration: 6s; opacity: 1; box-shadow: 0 0 12px var(--c, #8d9ab5); }
.race:hover .sigil::after { opacity: .9; }
.race .trait, .race .trait b { transition: border-color .3s, color .3s; }
.race:hover .trait { border-top-color: var(--c, var(--line)); }
.race:hover .trait b { color: var(--c, var(--text)); }
.race .lean .up, .race .lean .dn { display: inline-block; transition: transform .3s var(--ease), text-shadow .3s; }
.race .lean .up { color: #5fd39a; }
.race .lean .dn { color: #ffb35c; }
.race:hover .lean .up { transform: translateY(-2px); text-shadow: 0 0 10px rgba(95, 211, 154, .6); }
.race:hover .lean .dn { transform: translateY(2px); }
.race.go .epithet { animation: fx-fade-6 .6s var(--ease) backwards; }
@keyframes fx-fade-6 { from { opacity: .6; } }

/* HR-5 veil rings behind the intro (clipped so they cannot cause sideways scroll) */
#heritage { overflow: clip; }
#heritage .wrap { position: relative; isolation: isolate; }
#heritage .wrap::before {
  content: ""; position: absolute; z-index: -1; right: -140px; top: -90px; width: 540px; height: 540px; border-radius: 50%; pointer-events: none;
  background:
    conic-gradient(from 20deg, transparent 0 14%, rgba(78, 201, 255, .12) 14% 15%, transparent 15% 46%, rgba(78, 201, 255, .1) 46% 46.8%, transparent 46.8% 78%, rgba(255, 138, 61, .1) 78% 78.7%, transparent 78.7%),
    repeating-radial-gradient(circle, rgba(78, 201, 255, .07) 0 1px, transparent 1px 30px);
  -webkit-mask-image: radial-gradient(circle, transparent 18%, #000 20%, #000 62%, transparent 72%);
  mask-image: radial-gradient(circle, transparent 18%, #000 20%, #000 62%, transparent 72%);
  animation: fx-spin 240s linear infinite; will-change: transform;
}

/* =====================================================================
   ROADMAP: order, not time. Rail and nodes only where the cards sit in three columns.
   ===================================================================== */
.road li::marker { color: var(--accent-2); }
.road .card.go li { animation: fx-rise-sm .45s var(--ease) calc(var(--wd, 0ms) + 220ms + var(--i, 0) * 90ms) backwards; }
.road-ship { display: none; }
@media (min-width: 1000px) {
  .road { position: relative; padding-top: 34px; }
  .road .card { position: relative; }
  .road::before, .road::after { content: ""; position: absolute; top: 5px; height: 2px; transform-origin: 0 50%; pointer-events: none; }
  .road::before { left: calc((100% - 40px) / 6); width: calc((100% - 40px) / 3 + 20px); background: linear-gradient(90deg, rgba(78, 201, 255, .7), rgba(255, 138, 61, .7)); }
  .road::after { left: calc((100% - 40px) / 2 + 20px); width: calc((100% - 40px) / 3 + 20px); background: repeating-linear-gradient(90deg, rgba(78, 201, 255, .35) 0 8px, transparent 8px 16px); }
  .fx .road:not(.in)::before, .fx .road:not(.in)::after { transform: scaleX(0); }
  .fx .road.in::before { animation: fx-rail .8s var(--ease) backwards; }
  .fx .road.in::after { animation: fx-rail .8s var(--ease) .8s backwards; }
  @keyframes fx-rail { from { transform: scaleX(0); } }
  /* nodes sit on the rail above each card */
  .road .card::before {
    content: ""; position: absolute; top: -34px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--accent-2); box-sizing: border-box; pointer-events: none;
  }
  .road .card.now::before { border-color: var(--accent); background: rgba(255, 138, 61, .35); }
  .road .card:nth-child(3)::before { border-color: rgba(78, 201, 255, .45); }
  .road .card.next::before { background: rgba(78, 201, 255, .45); }
  .fx .road:not(.in) .card::before { opacity: 0; transform: scale(.4); }
  .fx .road.in .card::before { animation: fx-node .6s var(--ease) backwards; }
  .fx .road.in .card:nth-child(1)::before { animation-delay: .2s; }
  .fx .road.in .card:nth-child(2)::before { animation-delay: .8s; }
  .fx .road.in .card:nth-child(3)::before { animation-delay: 1.4s; }
  @keyframes fx-node { from { opacity: 0; transform: scale(.4); } 60% { transform: scale(1.35); } }
  /* RM-3 "you are here": a ripple on the free demo node */
  .road .card.next::after {
    content: ""; position: absolute; top: -34px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; box-sizing: border-box;
    border: 1px solid var(--accent-2); pointer-events: none; opacity: 0; animation: fx-ripple 2.4s ease-out infinite;
  }
  @keyframes fx-ripple { from { transform: scale(1); opacity: .6; } to { transform: scale(2.4); opacity: 0; } }
  /* RM-5 a small ship glyph at node 1 that rocks (it does not travel) */
  .road-ship { display: block; position: absolute; top: -56px; left: 50%; width: 22px; height: 22px; margin-left: -11px; pointer-events: none; transform-origin: 50% 70%; animation: fx-rock 5s ease-in-out infinite alternate; }
  @keyframes fx-rock { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
}

/* =====================================================================
   STUDIO (the Team, Art and Crew sections stay hidden until filled; these are selector-only)
   ===================================================================== */
.studio-mark-wrap { display: flex; justify-content: center; margin: 26px 0 0; }
.studio-mark { width: min(480px, 88%); height: auto; animation: fx-float 7s ease-in-out infinite alternate; will-change: transform; }
.studio-mark-wrap.go .studio-mark { animation: fx-float 7s ease-in-out infinite alternate, fx-shine 1.6s var(--ease) .5s backwards; }
@keyframes fx-float { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@supports ((-webkit-mask-image: linear-gradient(#000, #000)) or (mask-image: linear-gradient(#000, #000))) {
  @keyframes fx-shine {
    from { -webkit-mask-image: linear-gradient(105deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); mask-image: linear-gradient(105deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); -webkit-mask-size: 250% 100%; mask-size: 250% 100%; -webkit-mask-position: 150% 0; mask-position: 150% 0; }
    to { -webkit-mask-image: linear-gradient(105deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); mask-image: linear-gradient(105deg, #000 40%, rgba(0, 0, 0, .35) 50%, #000 60%); -webkit-mask-size: 250% 100%; mask-size: 250% 100%; -webkit-mask-position: -50% 0; mask-position: -50% 0; }
  }
}
.person { position: relative; }
.artgrid figcaption { transition: transform .35s var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .person::after { content: ""; position: absolute; left: 22px; top: 22px; width: 80px; height: 80px; border: 2px dashed var(--accent); border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .person:hover::after { opacity: 1; animation: fx-spin 6s linear infinite; }
  .artgrid figure:hover figcaption { transform: translateY(-6px); }
}

/* =====================================================================
   Phones (390 px and 320 px)
   ===================================================================== */
/* v3 layout bugs at 320 px (a 320 px minimum column is wider than the 280 px page; the bar overflows): fixed here, not in site.css */
.cores, .races { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
@media (max-width: 360px) {
  .nav .btn { display: none; }
  .nav-open .nav .btn { display: block; }
}
@media (max-width: 860px) {
  .hero-moon { width: 34px; height: 34px; left: -17px; top: -17px; }
  .hero-orbit { --ax: 110px; --ay: 26px; right: 22%; top: 14%; }
  @media (max-width: 560px) { .hero-orbit { --ax: 56px; --ay: 22px; right: 16%; } }
  .hero-glow { left: -30%; width: 110%; }
  .orbmap figcaption { text-align: center; }
}
@media (max-width: 560px) {
  .hero-planet { width: 130vw; right: -35vw; bottom: -30%; }
  .hp-cloud { display: none; }
  .hero::before { background: linear-gradient(0deg, rgba(5, 7, 13, .5), rgba(5, 7, 13, .22) 75%); }
}

/* =====================================================================
   Reduced motion: content simply visible, nothing moves (the stars draw one still frame)
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx .reveal { opacity: 1 !important; transform: none !important; }
  .nebula { animation: none; }
  .fx .crack.pre polyline { stroke-dashoffset: 0 !important; }
  .fx-rule::before { transform: scaleX(1) !important; }
  .fx .road::before, .fx .road::after { transform: none !important; }
  .fx .road .card::before { opacity: 1 !important; transform: none !important; }
  .fx .reveal .w, .w { opacity: 1 !important; }
  .holo line { stroke-dashoffset: 0 !important; }
  .cta-sky { display: none; }
  .core .eq b { transform: scaleY(.6); }
}

@media print {
  .reveal, .reveal .w { opacity: 1 !important; transform: none !important; }
  .nebula, .totop, .progress, .hero-sky, .cta-sky, .hero-scroll { display: none !important; }
}

/* high-contrast / forced colours: the decorations simply do not draw */
@media (forced-colors: active) {
  .nebula, .hero-sky, .cta-sky, .orbmap, .race .sigil, .core .eq, .holo, .crack { display: none !important; }
  .orb .surf { display: none; }
}
