/* ============================================================
   EVERSIM PORTAL — god-tier landing
   Design tokens + layout + typography. No frameworks.
   ============================================================ */

:root {
  /* palette */
  --c-void: #05060B;
  --c-ink: #0B0E1A;
  --c-ink-2: #11142A;
  --c-plasma: #7A5BFF;
  --c-aqua: #3CE0FF;
  --c-gold: #F7C56B;
  --c-white: #F4F5FB;
  --c-muted: rgba(244,245,251,0.56);
  --c-line: rgba(244,245,251,0.10);

  /* gradients */
  --g-aurora: radial-gradient(120% 80% at 20% 0%, rgba(122,91,255,.45), transparent 60%),
              radial-gradient(80% 80% at 100% 100%, rgba(60,224,255,.30), transparent 60%);
  --g-plasma-aqua: linear-gradient(135deg, var(--c-plasma) 0%, var(--c-aqua) 100%);

  /* typography */
  --f-display: "Unbounded", "Syne", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* easings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);

  /* sizing */
  --container: 1440px;
  --pad-x: clamp(1.25rem, 4vw, 4rem);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--c-void);
  color: var(--c-white);
  font-family: var(--f-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: auto;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  cursor: none;
  background:
    radial-gradient(60% 50% at 50% 10%, rgba(122,91,255,.18), transparent 70%),
    radial-gradient(50% 50% at 80% 90%, rgba(60,224,255,.10), transparent 70%),
    var(--c-void);
}

body.no-cursor-fx { cursor: auto; }

::selection { background: var(--c-plasma); color: var(--c-white); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

/* ---------- Global stage ---------- */

#bg-canvas, #fx-canvas, #era-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#era-canvas { z-index: 1; opacity: 1.0; filter: blur(0.4px) saturate(1.0) brightness(1.0); }
#fx-canvas  { z-index: 2; mix-blend-mode: screen; opacity: 0.12; }

.noise-overlay {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  opacity: .25;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 .35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.06; mix-blend-mode: overlay;
}

.scanlines {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .08;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- Cursor ---------- */
.cursor-ring, .cursor-dot {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-ring {
  width: 42px; height: 42px;
  border: 1px solid rgba(244,245,251,.7);
  border-radius: 50%;
  mix-blend-mode: difference;
  transition: width .35s var(--ease-out-expo), height .35s var(--ease-out-expo),
              background .25s ease, border-color .25s ease;
}
.cursor-dot {
  width: 6px; height: 6px; background: var(--c-white); border-radius: 50%;
  mix-blend-mode: difference;
}
.cursor-ring.is-hover {
  width: 86px; height: 86px;
  background: rgba(122,91,255,.18);
  border-color: var(--c-aqua);
}
.cursor-ring.is-press { transform: translate(-50%,-50%) scale(.7); }
@media (hover: none) { .cursor-ring, .cursor-dot { display: none; } body { cursor: auto; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(50% 50% at 50% 50%, #0a0c1e 0%, #05060B 70%);
  display: grid; place-items: center;
  transition: opacity .9s var(--ease-out-expo), visibility .9s;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader .pre-inner {
  display: grid; gap: 1.5rem; place-items: center; text-align: center; padding: 2rem;
}
.preloader .pre-orb {
  width: clamp(160px, 22vw, 260px); height: clamp(160px, 22vw, 260px); position: relative;
}
.preloader canvas { width: 100%; height: 100%; display: block; }
.preloader .pre-kicker {
  font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.3em;
  font-size: .72rem; color: var(--c-muted); margin: 0;
}
.preloader h1 {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0; letter-spacing: -0.02em;
  background: var(--g-plasma-aqua); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.preloader .pre-wave { width: min(380px, 70vw); height: 28px; opacity: .9; }
.preloader .pre-percent {
  font-family: var(--f-mono); font-size: .85rem; letter-spacing: 0.2em; color: var(--c-white);
}

/* ---------- Top nav ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad-x);
  mix-blend-mode: difference; color: var(--c-white);
}
.topbar .brand {
  font-family: var(--f-display); font-weight: 800; letter-spacing: 0.18em; font-size: .95rem;
}
.topbar nav { display: flex; gap: 1.6rem; }
.topbar nav a {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.85); position: relative; padding: .3rem 0;
}
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out-expo);
}
.topbar nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.topbar .sound-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.5); color: inherit;
  padding: .55rem .9rem; border-radius: 999px; font-family: var(--f-mono); font-size: .7rem;
  letter-spacing: .15em; text-transform: uppercase;
}
@media (max-width: 820px) { .topbar nav { display: none; } }

/* topbar tools cluster (era-walk + sound) */
.topbar-tools { display: flex; align-items: center; gap: .55rem; flex-wrap: nowrap; }

@media (max-width: 720px) {
  .topbar-tools { gap: .3rem; }
  .topbar-tools .fog-label,
  .topbar-tools .ewt-label,
  .topbar-tools .snd-label,
  .topbar-tools .fx-label { display: none; }
  .topbar-tools .fog-toggle,
  .topbar-tools .era-walk-toggle,
  .topbar-tools .sound-toggle,
  .topbar-tools .fx-toggle {
    padding: .35rem .55rem; gap: .35rem;
  }
  .topbar { padding: .65rem .9rem; }
  .topbar .brand { font-size: .8rem; }
}
@media (max-width: 420px) {
  .topbar { padding: .55rem .65rem; gap: .35rem; }
  .topbar .brand em { display: none; }
}

.sound-toggle { display: inline-flex; align-items: center; gap: .55rem; }
.sound-toggle .snd-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-toggle .snd-bars i {
  display: inline-block; width: 2px; height: 4px; background: currentColor; border-radius: 1px;
  transition: height .3s var(--ease-out-expo);
}
.sound-toggle.is-on .snd-bars i:nth-child(1) { animation: sndBar 0.7s ease-in-out infinite; }
.sound-toggle.is-on .snd-bars i:nth-child(2) { animation: sndBar 0.9s ease-in-out infinite -.2s; }
.sound-toggle.is-on .snd-bars i:nth-child(3) { animation: sndBar 1.1s ease-in-out infinite -.4s; }
.sound-toggle.is-on .snd-bars i:nth-child(4) { animation: sndBar 0.8s ease-in-out infinite -.1s; }
@keyframes sndBar { 0%,100% { height: 4px; } 50% { height: 12px; } }
.sound-toggle.is-on { color: var(--c-aqua); border-color: var(--c-aqua); }
.sound-toggle[data-style="ambient"].is-on { color: #b9e7ff; border-color: rgba(185,231,255,.55); }
.sound-toggle[data-style="synth"].is-on   { color: #ff8af0; border-color: rgba(255,138,240,.55); }
.sound-toggle[data-style="tribal"].is-on  { color: #ffcd6b; border-color: rgba(255,205,107,.55); }

/* era-walk toggle */
.era-walk-toggle {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem .5rem .6rem;
  background: rgba(11,14,26,.6);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  color: var(--c-white);
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer;
  transition: all .35s var(--ease-out-expo);
  backdrop-filter: blur(8px);
}
.era-walk-toggle .ewt-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-plasma), var(--c-aqua));
  box-shadow: 0 0 12px rgba(60,224,255,.7), inset 0 0 6px rgba(255,255,255,.3);
  position: relative;
}
.era-walk-toggle .ewt-orb::after {
  content:""; position:absolute; inset:-4px; border-radius:50%;
  border: 1px solid rgba(60,224,255,.4);
  animation: ewtPulse 2s var(--ease-out-expo) infinite;
}
@keyframes ewtPulse { 0%,100% { transform: scale(.7); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }
.era-walk-toggle .ewt-state { color: var(--c-aqua); }
.era-walk-toggle.is-off { color: var(--c-muted); border-color: rgba(255,255,255,.2); }
.era-walk-toggle.is-off .ewt-orb { background: rgba(255,255,255,.2); box-shadow: none; }
.era-walk-toggle.is-off .ewt-orb::after { animation: none; }
.era-walk-toggle.is-off .ewt-state { color: var(--c-muted); }
@media (max-width: 720px) { .era-walk-toggle .ewt-label { display: none; } }

/* fog palette toggle */
.fog-toggle {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .5rem .9rem .5rem .6rem;
  background: rgba(11,14,26,.6);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: var(--c-white);
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer;
  transition: all .35s var(--ease-out-expo);
  backdrop-filter: blur(8px);
  --fog-a: #555; --fog-b: #888; --fog-c: #ccc;
}
.fog-toggle:hover { border-color: rgba(255,255,255,.55); transform: translateY(-1px); }
.fog-toggle .fog-orb {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--fog-c) 0%, var(--fog-b) 45%, var(--fog-a) 100%);
  box-shadow: 0 0 14px var(--fog-b), inset 0 0 6px rgba(255,255,255,.25);
  position: relative;
}
.fog-toggle .fog-orb::after {
  content:""; position: absolute; inset:-3px; border-radius:50%;
  border: 1px dashed var(--fog-c);
  opacity: .4; animation: fogSpin 8s linear infinite;
}
@keyframes fogSpin { to { transform: rotate(360deg); } }
.fog-toggle .fog-name { color: var(--fog-c); font-weight: 600; letter-spacing: .2em; }
@media (max-width: 720px) { .fog-toggle .fog-label { display: none; } }

/* FX toggle button (opens FX settings drawer) */
.fx-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border-radius: 999px;
  background: rgba(11,14,26,.6);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--c-white);
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: all .35s var(--ease-out-expo);
}
.fx-toggle:hover, .fx-toggle[aria-expanded="true"] {
  border-color: var(--c-aqua); color: var(--c-aqua); transform: translateY(-1px);
}
.fx-toggle .fx-icon {
  display: inline-block; width: 14px; height: 14px; line-height: 14px;
  text-align: center; font-size: 14px;
  text-shadow: 0 0 8px currentColor;
  animation: fxPulse 2.4s ease-in-out infinite;
}
@keyframes fxPulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

/* FX drawer */
.fx-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 92vw); z-index: 60;
  background: rgba(8,10,20,.86);
  backdrop-filter: blur(18px) saturate(140%);
  border-left: 1px solid var(--c-line);
  display: flex; flex-direction: column; gap: 1.2rem;
  padding: 1.4rem 1.4rem 2rem;
  transform: translateX(100%);
  transition: transform .45s var(--ease-out-expo);
  box-shadow: -30px 0 80px rgba(0,0,0,.55);
}
.fx-panel:not([hidden]) { display: flex; }
.fx-panel.is-open { transform: translateX(0); }
.fx-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: .8rem; border-bottom: 1px solid var(--c-line);
}
.fx-panel-head h3 {
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .25em;
  text-transform: uppercase; color: var(--c-aqua); margin: 0;
}
.fx-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid var(--c-line);
  color: var(--c-white); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s ease;
}
.fx-close:hover { border-color: var(--c-aqua); color: var(--c-aqua); }
.fx-row { display: grid; gap: .35rem; }
.fx-row label {
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--c-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.fx-row output {
  font-family: var(--f-mono); font-size: .68rem; color: var(--c-white);
}
.fx-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(36,224,255,.55));
  outline: none; cursor: pointer;
}
.fx-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-aqua);
  box-shadow: 0 0 12px rgba(36,224,255,.7);
  border: 2px solid #0b0e1a;
}
.fx-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-aqua); box-shadow: 0 0 12px rgba(36,224,255,.7);
  border: 2px solid #0b0e1a;
}
.fx-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--c-line);
}
.fx-reset {
  background: transparent; border: 1px solid var(--c-line);
  color: var(--c-white); padding: .5rem .9rem; border-radius: 999px;
  font-family: var(--f-mono); font-size: .65rem; letter-spacing: .2em;
  text-transform: uppercase; cursor: pointer;
  transition: all .25s ease;
}
.fx-reset:hover { border-color: var(--c-gold); color: var(--c-gold); }
.fx-hint {
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--c-muted);
}

/* FX color section */
.fx-section {
  display: grid; gap: .55rem;
  padding-top: .9rem; border-top: 1px solid var(--c-line);
}
.fx-section-title {
  font-family: var(--f-mono); font-size: .65rem; letter-spacing: .25em;
  text-transform: uppercase; color: var(--c-aqua);
}
.fx-colors {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
}
.fx-color {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .4rem .55rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--c-line); border-radius: .5rem;
  cursor: pointer;
}
.fx-color span {
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-muted);
}
.fx-color input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 22px; border: 0; background: transparent;
  cursor: pointer; padding: 0;
}
.fx-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.fx-color input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
}
.fx-color input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
}

/* FX presets list */
.fx-presets {
  display: flex; flex-wrap: wrap; gap: .4rem; min-height: 0;
}
.fx-preset {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .55rem .35rem .7rem; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--c-line);
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--c-white);
  cursor: pointer; transition: all .25s ease;
}
.fx-preset:hover { border-color: var(--c-aqua); color: var(--c-aqua); }
.fx-preset .x {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--c-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; cursor: pointer;
}
.fx-preset .x:hover { background: rgba(255,80,80,.35); color: #fff; }
.fx-preset-empty {
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .12em;
  color: var(--c-muted); padding: .25rem 0;
}
.fx-preset-row { display: flex; gap: .4rem; }
.fx-preset-row input[type="text"] {
  flex: 1; min-width: 0;
  padding: .45rem .7rem; border-radius: 999px;
  background: rgba(5,6,11,.6); border: 1px solid var(--c-line);
  color: var(--c-white); font-family: var(--f-mono); font-size: .65rem;
  letter-spacing: .1em; outline: none;
}
.fx-preset-row input[type="text"]:focus { border-color: var(--c-aqua); }
.fx-save {
  background: var(--c-aqua); border: 0; color: var(--c-void);
  padding: .45rem .9rem; border-radius: 999px;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 700; cursor: pointer;
  transition: filter .2s ease;
}
.fx-save:hover { filter: brightness(1.15); }

/* Hero scrim — управляется FX-панелью через --fx-scrim (0..1) */
.hero { --fx-scrim: 0; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 30% 45%, rgba(5,6,14,.85) 0%, rgba(5,6,14,.55) 35%, rgba(5,6,14,0) 70%);
  opacity: var(--fx-scrim);
  transition: opacity .4s ease;
}

/* body — era-walk active state: subtle hint that runtime is "live" */
body.era-walk-on::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 49;
  background: linear-gradient(90deg, transparent, var(--c-aqua), transparent);
  animation: ewLine 4s linear infinite; pointer-events: none;
}
@keyframes ewLine { 0% { transform: translateX(-30%); } 100% { transform: translateX(130%); } }

/* current era badge — appears bottom-left when era-walk on */
.era-badge {
  position: fixed; left: 1.4rem; bottom: 1.6rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .65rem 1rem .65rem .7rem;
  background: rgba(11,14,26,.7); backdrop-filter: blur(12px);
  border: 1px solid var(--c-line); border-radius: 999px;
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--c-white);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s var(--ease-out-expo), border-color .8s ease, box-shadow .8s ease;
  pointer-events: none;
}
body.era-walk-on .era-badge { opacity: 1; transform: none; }
.era-badge .eb-orb {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--era-tint-a, #7A5BFF), var(--era-tint-b, #3CE0FF));
  box-shadow: 0 0 12px var(--era-tint-a, #7A5BFF);
  transition: background .8s ease, box-shadow .8s ease;
}
.era-badge em { font-style: normal; color: var(--c-muted); font-size: .62rem; letter-spacing: .25em; }

/* ---------- Layout primitives ---------- */
.section {
  position: relative; z-index: 4;
  padding: clamp(5rem, 12vh, 9rem) var(--pad-x);
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
}
.section--pin { min-height: 100vh; }
.container { max-width: var(--container); margin: 0 auto; width: 100%; }

.kicker {
  font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.32em;
  font-size: .72rem; color: var(--c-muted); margin: 0 0 1.2rem;
  display: inline-flex; align-items: center; gap: .8rem;
}
.kicker::before {
  content: ""; width: 28px; height: 1px; background: var(--c-aqua); display: inline-block;
}

h1, h2, h3 { font-family: var(--f-display); font-weight: 800; margin: 0; letter-spacing: -0.04em; line-height: .95; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
h1 { font-size: clamp(2.4rem, 5.6vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 4.4rem); }
h3 { font-size: clamp(1.4rem, 2.2vw, 2.2rem); }
p { line-height: 1.55; color: var(--c-muted); font-size: clamp(1rem, 1.05vw, 1.1rem); margin: 0; }
.lead { font-size: clamp(1.05rem, 1.3vw, 1.35rem); color: rgba(244,245,251,.82); max-width: 56ch; }

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--c-white); --bd: rgba(244,245,251,.4);
  display: inline-flex; align-items: center; gap: .8rem;
  padding: .95rem 1.5rem; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  border-radius: 999px; position: relative; overflow: hidden;
  transition: color .35s ease, border-color .35s ease, transform .35s var(--ease-out-expo);
}
.btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--g-plasma-aqua); opacity: 0; transition: opacity .4s ease;
}
.btn span { position: relative; z-index: 1; }
.btn:hover::before { opacity: 1; }
.btn:hover { color: var(--c-void); border-color: transparent; }
.btn.solid { background: var(--c-white); color: var(--c-void); border-color: transparent; }
.btn.solid:hover { color: var(--c-void); }
.btn .arrow { width: 14px; height: 14px; position: relative; z-index: 1; }

/* ---------- HERO ---------- */
.hero { padding-top: clamp(6rem, 14vh, 10rem); position: relative; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr; align-items: end; max-width: var(--container); margin: 0 auto; width: 100%; position: relative; z-index: 1; }
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(2.8rem, 6.4vw, 7rem);
  letter-spacing: -0.05em;
}
/* universal split-text reveal */
[data-split] .word { display: inline-block; overflow: hidden; vertical-align: top; white-space: nowrap; }
[data-split] .char { display: inline-block; transform: translateY(105%); opacity: 0;
  transition: transform .9s var(--ease-out-expo), opacity .9s ease; }
[data-split].is-in .char,
.is-in [data-split] .char,
.hero.is-in [data-split] .char { transform: translateY(0); opacity: 1; }
.hero h1 .accent {
  background: var(--g-plasma-aqua); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}

.hero .hero-meta { display: flex; gap: 2.2rem; flex-wrap: wrap; margin-top: 2.4rem; }
.hero .hero-meta div { display: grid; gap: .25rem; }
.hero .hero-meta strong { font-family: var(--f-display); font-size: 1.6rem; }
.hero .hero-meta span { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--c-muted); }

.hero-terminal {
  border: 1px solid var(--c-line);
  background: linear-gradient(180deg, rgba(11,14,26,.7), rgba(11,14,26,.4));
  border-radius: 14px; padding: 1.4rem; font-family: var(--f-mono); font-size: .82rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.hero-terminal .term-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; color: var(--c-muted); font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; }
.hero-terminal .term-head i { width: 8px; height: 8px; border-radius: 50%; background: rgba(244,245,251,.3); display: inline-block; }
.hero-terminal .term-head i:nth-child(1) { background: #ff5f57; }
.hero-terminal .term-head i:nth-child(2) { background: #febc2e; }
.hero-terminal .term-head i:nth-child(3) { background: #28c840; }
.hero-terminal .line { display: block; padding: .25rem 0; color: rgba(244,245,251,.85); }
.hero-terminal .muted { color: var(--c-muted); }
.hero-terminal .you { color: var(--c-aqua); }
.hero-terminal .ai { color: var(--c-plasma); }
.hero-terminal .world { color: var(--c-gold); }
.hero-terminal .cursor { display: inline-block; width: 8px; height: 1em; background: var(--c-aqua); vertical-align: -.18em; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; gap: 1rem; margin-top: 2.4rem; flex-wrap: wrap; }
.voice-trigger {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: .95rem 1.4rem; border-radius: 999px;
  background: rgba(122,91,255,.14); border: 1px solid rgba(122,91,255,.5);
  color: var(--c-white); font-family: var(--f-mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
}
.voice-trigger .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--c-aqua);
  box-shadow: 0 0 0 0 rgba(60,224,255,.6); animation: pulse 2s var(--ease-out-expo) infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(60,224,255,0); } 100% { box-shadow: 0 0 0 0 rgba(60,224,255,0); } }

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  font-family: var(--f-mono); font-size: .65rem; letter-spacing: .3em; color: var(--c-muted);
  text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.scroll-cue::after {
  content: ""; width: 1px; height: 36px; background: linear-gradient(180deg, var(--c-muted), transparent);
  animation: scrollLine 2s var(--ease-out-expo) infinite;
}
@keyframes scrollLine { 0% { transform: scaleY(.2); transform-origin: top; } 60% { transform: scaleY(1); transform-origin: top; } 60.001% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Concept (pinned split) ---------- */
.concept { min-height: 200vh; position: relative; }
.concept .sticky {
  position: sticky; top: 0; height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  padding: 0 var(--pad-x);
}
@media (max-width: 900px) { .concept .sticky { grid-template-columns: 1fr; } .concept .sticky .canvas-slot { display: none; } }
.concept .copy { max-width: 520px; }
.concept .copy h2 { font-size: clamp(2rem, 4.2vw, 4.2rem); }
.concept .copy p { margin-top: 1.4rem; }
.canvas-slot { width: 100%; aspect-ratio: 1/1; position: relative; }
.canvas-slot canvas { width: 100%; height: 100%; display: block; }

/* ---------- Eras (horizontal scroll) ---------- */
.eras { padding: clamp(4rem,8vh,7rem) 0; min-height: 100vh; overflow: hidden; }
.eras .head { padding: 0 var(--pad-x); display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.eras .h-track {
  display: flex; gap: clamp(1rem, 2vw, 1.8rem); margin-top: 3rem;
  padding: 0 var(--pad-x); will-change: transform;
}
.era-card {
  flex: 0 0 clamp(280px, 28vw, 420px);
  height: clamp(420px, 60vh, 600px);
  border-radius: 18px; overflow: hidden; position: relative;
  border: 1px solid var(--c-line);
  background: var(--c-ink);
  isolation: isolate;
  transition: transform .6s var(--ease-out-expo);
}
.era-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.era-card .era-meta {
  position: absolute; inset: auto 0 0 0; padding: 1.6rem; z-index: 2;
  background: linear-gradient(0deg, rgba(5,6,11,.95) 0%, rgba(5,6,11,0) 100%);
}
.era-card .era-meta .num { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .25em; color: var(--c-aqua); text-transform: uppercase; }
.era-card h3 { margin-top: .4rem; font-size: clamp(1.6rem, 2vw, 2rem); }
.era-card p { margin-top: .6rem; color: rgba(244,245,251,.78); font-size: .95rem; }
.era-card .era-tag { position: absolute; top: 1.2rem; left: 1.2rem; font-family: var(--f-mono); font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--c-gold); z-index: 2; }
.era-card:hover { transform: translateY(-6px); }

/* ---------- Roles grid ---------- */
.roles { min-height: 100vh; }
.roles .head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 2rem; margin-bottom: 3rem; }
.role-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.role-card {
  position: relative; padding: 1.6rem; border: 1px solid var(--c-line); border-radius: 16px;
  background: linear-gradient(160deg, rgba(122,91,255,.08), rgba(60,224,255,.02));
  overflow: hidden; isolation: isolate; min-height: 180px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  transition: transform .5s var(--ease-out-expo);
}
.role-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(122,91,255,.6), transparent 60%);
  transition: opacity .5s ease;
}
.role-card:hover::before { opacity: 1; }
.role-card:hover { transform: translateY(-4px); }
.role-card .role-icon {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--c-aqua);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem;
  background: rgba(60,224,255,.06);
}
.role-card h3 { font-size: 1.3rem; }
.role-card .line { font-family: var(--f-mono); font-size: .72rem; color: var(--c-muted); letter-spacing: .12em; }

/* ---------- Realism slider ---------- */
.realism { min-height: 100vh; }
.realism .stage {
  position: relative; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--c-line); margin-top: 3rem;
}
.realism .stage canvas { width: 100%; height: 100%; display: block; }
.realism .stage .overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 1.6rem; pointer-events: none;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c-white);
}
.realism .slider {
  margin-top: 2rem; display: grid; gap: 1rem;
}
.realism .slider input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--c-plasma), var(--c-aqua), var(--c-gold));
  border-radius: 2px; outline: none;
}
.realism .slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-white); border: 2px solid var(--c-void); cursor: pointer;
  box-shadow: 0 0 24px rgba(60,224,255,.6);
}
.realism .slider input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--c-white); border: 2px solid var(--c-void); cursor: pointer;
}
.realism .slider .labels { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c-muted); }

/* ---------- Voice loop ---------- */
.voice { min-height: 100vh; }
.voice .voice-stage {
  margin-top: 3rem; position: relative; padding: 2rem; border: 1px solid var(--c-line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(11,14,26,.6), rgba(11,14,26,.2));
}
.voice canvas.wave { width: 100%; height: 220px; display: block; }
.voice .commands { display: grid; gap: .6rem; margin-top: 1.4rem; font-family: var(--f-mono); font-size: .9rem; }
.voice .commands span { color: rgba(244,245,251,.7); }
.voice .commands .ghost { color: var(--c-muted); }
.voice .voice-cta { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---------- XR ---------- */
.xr { min-height: 100vh; }
.xr .grid {
  display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; align-items: center; margin-top: 3rem;
}
@media (max-width: 900px) { .xr .grid { grid-template-columns: 1fr; } }
.xr .pov {
  aspect-ratio: 16/10; border-radius: 18px; overflow: hidden; position: relative; border: 1px solid var(--c-line);
}
.xr .pov canvas { width: 100%; height: 100%; display: block; }
.xr .pov::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 80% at 50% 50%, transparent 50%, rgba(5,6,11,.85) 100%);
  pointer-events: none;
}
.xr .pov .hud {
  position: absolute; inset: 0; padding: 1.4rem; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c-aqua);
  pointer-events: none;
}

/* ---------- Tech infographic ---------- */
.tech { min-height: 100vh; }
.tech-pipeline {
  margin-top: 3rem; display: grid; gap: 1.6rem;
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1000px) { .tech-pipeline { grid-template-columns: repeat(2, 1fr); } }
.tech-node {
  padding: 1.4rem; border: 1px solid var(--c-line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
  position: relative;
}
.tech-node .n { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .25em; color: var(--c-aqua); text-transform: uppercase; }
.tech-node h3 { margin-top: .6rem; font-size: 1.3rem; }
.tech-node p { margin-top: .6rem; font-size: .9rem; }

/* ---------- Roadmap ---------- */
.roadmap { min-height: 80vh; }
.roadmap .lane {
  margin-top: 3rem; display: flex; gap: 1.4rem; overflow-x: auto; padding-bottom: 1rem;
  scrollbar-width: thin; scrollbar-color: var(--c-plasma) transparent;
}
.roadmap .lane::-webkit-scrollbar { height: 6px; }
.roadmap .lane::-webkit-scrollbar-thumb { background: var(--c-plasma); border-radius: 4px; }
.roadmap .lane .step {
  flex: 0 0 clamp(240px, 22vw, 320px);
  padding: 1.6rem; border: 1px solid var(--c-line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(122,91,255,.06), transparent);
  position: relative;
}
.roadmap .lane .step .dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--c-aqua); margin-bottom: 1.2rem;
  box-shadow: 0 0 12px var(--c-aqua);
}
.roadmap .lane .step .q { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .25em; color: var(--c-gold); text-transform: uppercase; }
.roadmap .lane .step h3 { margin-top: .4rem; font-size: 1.3rem; }
.roadmap .lane .step p { margin-top: .8rem; font-size: .92rem; }

/* ---------- Manifesto ---------- */
.manifesto { min-height: 100vh; padding-bottom: 6rem; }
.manifesto canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.manifesto .container { position: relative; z-index: 1; }
.manifesto h2 {
  font-size: clamp(2.6rem, 7vw, 7rem); line-height: .9; letter-spacing: -0.05em;
  text-align: center;
}
.manifesto h2 .word { display: inline-block; overflow: hidden; vertical-align: top; white-space: nowrap; }
.manifesto h2 .accent {
  background: var(--g-plasma-aqua); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.manifesto p { text-align: center; max-width: 640px; margin: 1.6rem auto 0; }

.early-form {
  margin: 3rem auto 0; max-width: 640px; display: grid; gap: 1rem;
  padding: 1.8rem; border: 1px solid var(--c-line); border-radius: 20px;
  background: linear-gradient(180deg, rgba(11,14,26,.7), rgba(11,14,26,.4));
  backdrop-filter: blur(14px);
}
.early-form .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.early-form input[type=email] {
  flex: 1; min-width: 220px;
  padding: 1rem 1.2rem; border-radius: 999px; border: 1px solid var(--c-line);
  background: rgba(5,6,11,.6); color: var(--c-white); font-family: var(--f-body); font-size: .95rem;
  outline: none; transition: border-color .3s ease;
}
.early-form input[type=email]:focus { border-color: var(--c-aqua); }
.early-form .chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.early-form .chip {
  padding: .55rem .9rem; border: 1px solid var(--c-line); border-radius: 999px;
  background: transparent; color: var(--c-white); font-family: var(--f-mono); font-size: .7rem;
  letter-spacing: .15em; text-transform: uppercase; transition: all .25s ease;
}
.early-form .chip.is-on { background: var(--c-plasma); border-color: transparent; color: var(--c-void); }

.early-form .ok { color: var(--c-aqua); font-family: var(--f-mono); font-size: .8rem; letter-spacing: .15em; }

/* ---------- Footer ---------- */
.footer {
  padding: 3rem var(--pad-x) 2.5rem; border-top: 1px solid var(--c-line);
  display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c-muted);
  position: relative; z-index: 5;
}
.footer .ascii { white-space: pre; line-height: 1.1; color: var(--c-white); font-size: .55rem; }
.footer a { color: var(--c-muted); transition: color .3s ease; }
.footer a:hover { color: var(--c-aqua); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(8px); transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo), filter 1s var(--ease-out-expo); }
.reveal.is-in { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ---------- Progress bar (scroll) ---------- */
.scroll-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; pointer-events: none; }
.scroll-bar span { display: block; height: 100%; background: var(--g-plasma-aqua); width: 0%; transition: width .12s linear; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  #bg-canvas, #fx-canvas { display: none; }
}

/* ============================================================
   ERA SWITCHER · COVER ART · PROFESSIONS · LEGENDS  (v2)
   ============================================================ */

/* era-jump pills */
.era-jump {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  padding: 1.4rem var(--pad-x) 0;
}
.era-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem .95rem;
  background: rgba(11,14,26,.55);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  color: var(--c-white);
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: background .35s ease, border-color .35s ease, color .35s ease, transform .35s var(--ease-out-expo);
  backdrop-filter: blur(8px);
}
.era-pill em { font-style: normal; color: var(--c-muted); font-size: .65rem; letter-spacing: .15em; }
.era-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--c-plasma), var(--c-aqua)); box-shadow: 0 0 10px rgba(60,224,255,.5); }
.era-pill:hover { transform: translateY(-2px); border-color: var(--c-aqua); }
.era-pill.is-on {
  background: linear-gradient(135deg, rgba(122,91,255,.85), rgba(60,224,255,.85));
  color: var(--c-void); border-color: transparent;
}
.era-pill.is-on em { color: rgba(5,6,11,.6); }
.era-pill.is-on .dot { background: var(--c-void); box-shadow: none; }
.era-jump-hint { margin-left: auto; font-family: var(--f-mono); font-size: .65rem; letter-spacing: .25em; color: var(--c-muted); text-transform: uppercase; }
@media (max-width: 720px) { .era-jump-hint { display: none; } }

/* highlight active card */
.era-card { transition: transform .6s var(--ease-out-expo), box-shadow .6s ease, border-color .6s ease; }
.era-card.is-active {
  border-color: var(--c-aqua);
  box-shadow: 0 30px 80px -20px rgba(60,224,255,.45), 0 0 0 1px rgba(60,224,255,.4) inset;
  transform: translateY(-8px) scale(1.015);
}
.era-card.is-active .era-cover { opacity: 1; }

/* cover art layer */
.era-card { background: var(--c-ink); }
.era-card canvas { z-index: 0; }
.era-card .era-cover {
  position: absolute; inset: 0; z-index: 1;
  opacity: .78;
  transition: opacity .6s ease, transform .8s var(--ease-out-expo);
  pointer-events: none;
  mix-blend-mode: screen;
}
.era-card .era-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.era-card .era-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 30%, transparent 0%, rgba(5,6,11,.0) 30%, rgba(5,6,11,.65) 100%),
    linear-gradient(0deg, rgba(5,6,11,.95) 0%, rgba(5,6,11,0) 50%);
}
.era-card .era-glyph {
  position: absolute; top: 14%; right: 8%;
  font-size: clamp(56px, 7vw, 96px);
  font-family: var(--f-display); font-weight: 800;
  color: var(--c-white);
  opacity: .22;
  text-shadow: 0 0 24px rgba(255,255,255,.4);
  z-index: 2;
}
.era-card:hover .era-cover { transform: scale(1.04); opacity: .95; }
.era-card .era-meta { z-index: 3; }
.era-card .era-meta .era-foot {
  display: flex; gap: .5rem; margin-top: .9rem;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--c-gold);
}
.era-card .era-meta .era-foot span:nth-child(2) { color: var(--c-muted); }

/* ---------- Roles profession marquee ---------- */
.prof-block { margin-top: 4rem; }
.prof-marquee {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line);
  padding: 1.2rem 0; mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.prof-marquee .prof-row {
  display: inline-flex; gap: 1rem; padding-right: 1rem;
  animation: profScroll 80s linear infinite;
  white-space: nowrap;
}
.prof-marquee .prof-row + .prof-row { animation-delay: -40s; }
.prof {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem 1.1rem;
  border: 1px solid var(--c-line); border-radius: 999px;
  background: linear-gradient(140deg, rgba(122,91,255,.08), rgba(60,224,255,.04));
  font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em;
  color: var(--c-white); flex-shrink: 0;
}
.prof i { font-style: normal; color: var(--c-aqua); font-size: .62rem; letter-spacing: .2em; }
@keyframes profScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Legends section ---------- */
.legends { min-height: 100vh; padding-top: clamp(5rem, 12vh, 9rem); }
.legends .head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 2rem; margin-bottom: 3rem; }
.legends h2 .accent {
  background: var(--g-plasma-aqua); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic;
}
.legend-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.legend-card {
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid var(--c-line); border-radius: 22px;
  background: linear-gradient(180deg, rgba(11,14,26,.7), rgba(11,14,26,.35));
  padding: 1.6rem; min-height: 380px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  transition: transform .6s var(--ease-out-expo), border-color .6s ease, box-shadow .6s ease;
}
.legend-card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: radial-gradient(80% 60% at 50% 0%, var(--leg-a, #7A5BFF), transparent 60%);
  opacity: .35; transition: opacity .5s ease;
}
.legend-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(50% 80% at 50% 110%, var(--leg-b, #3CE0FF), transparent 60%);
  opacity: .25;
}
.legend-card:hover { transform: translateY(-6px); border-color: var(--c-aqua); box-shadow: 0 40px 80px -30px rgba(60,224,255,.4); }
.legend-card:hover::before { opacity: .6; }

.legend-portrait {
  width: 116px; height: 116px;
  border-radius: 50%;
  position: relative;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--leg-a, #7A5BFF) 0%, var(--leg-b, #0B0E1A) 80%);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 36px -10px rgba(0,0,0,.7), inset 0 0 24px rgba(255,255,255,.08);
  margin-bottom: .5rem;
  overflow: hidden;
}
.legend-portrait .mono {
  font-family: var(--f-display); font-weight: 800;
  font-size: 2.6rem; letter-spacing: -.04em;
  color: var(--c-white);
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  z-index: 2;
}
.legend-portrait .halo {
  position: absolute; inset: -2px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.22);
  animation: legendSpin 24s linear infinite;
}
.legend-portrait .halo::before, .legend-portrait .halo::after {
  content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-aqua); top: -3px; left: 50%; transform: translateX(-50%);
  box-shadow: 0 0 10px var(--c-aqua);
}
.legend-portrait .halo::after { top: auto; bottom: -3px; background: var(--c-gold); box-shadow: 0 0 10px var(--c-gold); }
@keyframes legendSpin { to { transform: rotate(360deg); } }

.legend-card .legend-era { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .25em; text-transform: uppercase; color: var(--c-gold); }
.legend-card h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); margin-top: .3rem; }
.legend-card .legend-tag { font-family: var(--f-mono); font-size: .65rem; letter-spacing: .15em; color: var(--c-aqua); text-transform: uppercase; }
.legend-card blockquote {
  margin: 0; padding: 0; color: rgba(244,245,251,.78);
  font-style: italic; line-height: 1.5; font-size: .95rem;
}
.legend-card blockquote::before { content: "«"; color: var(--c-aqua); margin-right: .15em; }
.legend-card blockquote::after { content: "»"; color: var(--c-aqua); margin-left: .15em; }

.legend-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.legend-actions button {
  flex: 1; min-width: 90px;
  padding: .7rem .9rem; border-radius: 12px;
  border: 1px solid var(--c-line); background: rgba(5,6,11,.5);
  color: var(--c-white);
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  cursor: pointer; transition: all .3s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.legend-actions button:hover { border-color: transparent; background: var(--g-plasma-aqua); color: var(--c-void); }
.legend-actions .lg-talk::before    { content: "› "; opacity: .7; }
.legend-actions .lg-become::before  { content: "↺ "; opacity: .7; }

.legend-note {
  margin-top: 2.5rem; text-align: center; max-width: 56ch;
  margin-left: auto; margin-right: auto;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; color: var(--c-muted);
}

/* legends collapse — show 4, hide rest */
.legend-grid .legend-card.is-locked { display: none; }
.legend-grid.is-expanded .legend-card.is-locked {
  display: flex;
  animation: legendIn .8s var(--ease-out-expo) both;
}
@keyframes legendIn { from { opacity: 0; transform: translateY(20px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.legend-more-wrap { margin-top: 2rem; display: grid; place-items: center; gap: .8rem; }
.legend-more {
  display: inline-flex; align-items: center; gap: .9rem;
  padding: 1rem 1.6rem; border-radius: 999px;
  background: rgba(11,14,26,.55); color: var(--c-white);
  border: 1px solid var(--c-line);
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; transition: all .35s var(--ease-out-expo);
  position: relative; overflow: hidden;
}
.legend-more::before {
  content:""; position:absolute; inset:0; border-radius:inherit;
  background: var(--g-plasma-aqua); opacity: 0; transition: opacity .4s ease;
}
.legend-more > * { position: relative; z-index: 1; }
.legend-more:hover { color: var(--c-void); border-color: transparent; transform: translateY(-2px); }
.legend-more:hover::before { opacity: 1; }
.legend-more .lm-plus {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--g-plasma-aqua); color: var(--c-void);
  font-family: var(--f-display); font-weight: 800; font-size: 1rem;
  transition: transform .5s var(--ease-out-expo);
}
.legend-more.is-open .lm-plus { transform: rotate(45deg); }
.legend-more em { font-style: normal; color: var(--c-muted); font-size: .65rem; letter-spacing: .25em; }
.legend-more:hover em { color: rgba(5,6,11,.7); }
.legend-more-hint { margin: 0; font-family: var(--f-mono); font-size: .65rem; letter-spacing: .25em; color: var(--c-muted); text-transform: uppercase; }
