/* ==========================================================================
   KAPI STUDIOS — "Tempestade" design system
   Storm night, volt yellow, electric blue. Heavy upright type, no italics.
   Lightning strikes, loot chests burst open as the visitor scrolls.
   ========================================================================== */

@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #ffcf3a;
}

:root {
  /* Void: storm night (blue-black, never neutral grey) */
  --void-950: #0a0610;
  --void-900: #120a1c;
  --void-850: #180e25;
  --void-800: #20132f;
  --void-700: #2e1d44;
  --void-600: #45305f;

  /* Ice: cool white for text */
  --ice-50: #fff8ec;
  --ice-100: #f3e9d8;
  --ice-300: #c9b8a3;

  /* Energy */
  --volt: #ffcf3a;
  --volt-hot: #fff2b0;
  --volt-deep: #e0a21c;
  --volt-shadow: #7a4f06;
  --arc: #c4a3ff;
  --arc-deep: #7c4dff;
  --plasma: #a855f7;
  --ember: #ff4d2e;

  /* Rarity: the game's own table (client/js/data/rarityColors.js) */
  --r-common: #94a3b8;
  --r-uncommon: #22c55e;
  --r-rare: #3b82f6;
  --r-epic: #a855f7;
  --r-legendary: #f59e0b;
  --r-mythic: #ef4444;

  /* Semantic */
  --bg: var(--void-900);
  --text: var(--ice-100);
  --text-soft: rgba(243, 233, 216, 0.74);
  --text-faint: rgba(243, 233, 216, 0.56);
  --hairline: rgba(232, 196, 140, 0.14);
  --hairline-strong: rgba(232, 196, 140, 0.28);

  /* Type */
  --font-display: 'Pixelify Sans', 'Archivo', 'Arial Black', Impact, sans-serif;   /* the logo's pixel letters */
  --font-body: 'Archivo', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --fs-mono: 0.7rem;
  --fs-body: 1.0625rem;
  --fs-lead: clamp(1.08rem, 0.95rem + 0.45vw, 1.3rem);
  --fs-display-md: clamp(2rem, 1.1rem + 3.2vw, 4.2rem);
  --fs-display-lg: clamp(2.4rem, 1.1rem + 4.4vw, 5.6rem);

  /* Space */
  --gutter: clamp(1.25rem, 0.6rem + 3.2vw, 4rem);
  --section: clamp(5.5rem, 3.5rem + 8vw, 10.5rem);

  /* Surfaces */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-plate:
    inset 0 0 0 1px rgba(232, 196, 140, 0.1),
    inset 0 1px 0 rgba(255, 236, 200, 0.12),
    0 50px 90px -40px rgba(0, 0, 0, 0.85),
    0 0 70px -30px rgba(196, 163, 255, 0.35);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-snap: cubic-bezier(0.2, 1.5, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--void-950);
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(90% 60% at 88% 0%, rgba(124, 77, 255, 0.16), transparent 62%),
    radial-gradient(70% 50% at 0% 22%, rgba(168, 85, 247, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
ul, ol { list-style: none; }

/* No italics anywhere: emphasis is colour and weight */
em, i, cite, blockquote { font-style: normal; }
em { color: var(--volt); }

::selection { background: var(--volt); color: var(--void-950); }

:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 4px;
  border-radius: 4px;
}

.sr-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 1001;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--volt);
  color: var(--void-950);
  font-weight: 800;
  text-decoration: none;
  transition: top 0.3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ---------- Type primitives ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.display-md,
.display-lg,
.hero-title,
.footer-invite {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 100%;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  line-height: 0.94;
  color: var(--ice-50);
  text-wrap: balance;
}
.display-md { font-size: var(--fs-display-md); }
.display-lg { font-size: var(--fs-display-lg); }

/* ---------- Grain (kept very low, cold) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.8  0 0 0 0 0.86  0 0 0 0 1  0 0 0 1.1 -0.2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Effects canvas: bolts, loot, sparks ---------- */
.fx {
  position: fixed;
  inset: 0;
  z-index: 990;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Page-load curtain ---------- */
.loader { display: none; }
.js:not(.reduced) .loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--void-950);
  transition: opacity 0.25s linear 0.12s, visibility 0s linear 0.4s;
}
.loader-inner {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  transition: transform 0.3s var(--ease-in-out), opacity 0.2s linear;
}
.loader-mark {
  width: 72px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 22px rgba(255, 207, 58, 0.55));
  animation: loaderCharge 0.5s steps(2, jump-none) infinite;
}
.loader-bar {
  width: 180px;
  height: 6px;
  border-radius: 2px;
  background: var(--void-700);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--volt-deep), var(--volt), var(--volt-hot));
  box-shadow: 0 0 14px var(--volt);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}
.loader-line {
  display: flex;
  gap: 1.2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.loader-count { min-width: 3ch; text-align: right; color: var(--volt); }
@keyframes loaderCharge {
  0% { filter: drop-shadow(0 0 14px rgba(255, 207, 58, 0.4)); transform: translate(0, 0); }
  100% { filter: drop-shadow(0 0 30px rgba(255, 207, 58, 0.8)); transform: translate(1px, -1px); }
}
.js body.is-loaded .loader { opacity: 0; visibility: hidden; pointer-events: none; }
.js body.is-loaded .loader-inner { transform: scale(1.6); opacity: 0; }

/* ---------- Cursor ---------- */
.cursor { display: none; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor [role="button"] { cursor: none; }
.has-cursor .cursor {
  display: block;
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 999;
  pointer-events: none;
}
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  will-change: transform;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--volt);
  box-shadow: 0 0 12px var(--volt);
  transform-origin: 50% 50%;
  rotate: 45deg;
  transition: opacity 0.2s;
}
.cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  display: grid;
  place-items: center;
}
.cursor-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1.5px solid rgba(196, 163, 255, 0.6);
  transform: rotate(45deg) scale(var(--ring-scale, 0.7));
  transition: transform 0.35s var(--ease-spring), background 0.25s, border-color 0.25s, border-radius 0.3s;
}
.cursor-label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--void-950);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.3s var(--ease-spring);
  white-space: nowrap;
}
.cursor[data-state='link'] .cursor-ring { --ring-scale: 1.05; }
.cursor[data-state='link'] .cursor-ring::before { border-color: var(--volt); background: rgba(255, 207, 58, 0.1); }
.cursor[data-state='play'] .cursor-ring,
.cursor[data-state='open'] .cursor-ring { --ring-scale: 1.75; }
.cursor[data-state='play'] .cursor-ring::before,
.cursor[data-state='open'] .cursor-ring::before { background: var(--volt); border-color: transparent; border-radius: 50%; }
.cursor[data-state='play'] .cursor-label,
.cursor[data-state='open'] .cursor-label { opacity: 1; transform: scale(1); }
.cursor[data-state='play'] .cursor-dot,
.cursor[data-state='open'] .cursor-dot { opacity: 0; }
.cursor.is-down .cursor-ring::before { transform: rotate(45deg) scale(calc(var(--ring-scale, 0.7) * 0.78)); }
.cursor.is-hidden { opacity: 0; }

/* ---------- Buttons: chunky, pressable ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.8rem 0.8rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: translate 0.1s var(--ease-out), box-shadow 0.15s var(--ease-out), background 0.3s, color 0.3s, filter 0.3s;
  will-change: transform;
}
.btn:active { translate: 0 4px; }
.btn-text { position: relative; display: inline-block; overflow: hidden; line-height: 1.3; }
.btn-text .roll {
  display: inline-block;
  text-shadow: 0 1.3em currentColor;
  transition: transform 0.35s var(--ease-snap);
}
.btn:hover .btn-text .roll,
.btn:focus-visible .btn-text .roll { transform: translateY(-1.3em); }

.btn-icon {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 4px;
  overflow: hidden;
  transition: background 0.3s;
}
.btn-icon svg { transition: transform 0.35s var(--ease-snap); }
.btn:hover .btn-icon svg { transform: translateX(4px) scale(1.15); }

.btn-primary {
  background: linear-gradient(180deg, var(--volt-hot) 0%, var(--volt) 42%, var(--volt-deep) 130%);
  color: #171100;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 5px 0 var(--volt-shadow),
    0 16px 36px -8px rgba(255, 207, 58, 0.55);
}
.btn-primary .btn-icon { background: #171100; color: var(--volt); }
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 5px 0 var(--volt-shadow),
    0 0 0 3px rgba(255, 207, 58, 0.22),
    0 22px 50px -8px rgba(255, 207, 58, 0.8);
}
.btn-primary:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 0 var(--volt-shadow), 0 6px 16px -6px rgba(255, 207, 58, 0.6);
}

.btn-ink {
  background: var(--void-800);
  color: var(--ice-50);
  box-shadow: inset 0 0 0 1.5px var(--arc), 0 5px 0 #0c2a45, 0 16px 36px -10px rgba(196, 163, 255, 0.5);
}
.btn-ink .btn-icon { background: var(--arc); color: var(--void-950); }
.btn-ink:hover { background: var(--void-700); }
.btn-ink:active { box-shadow: inset 0 0 0 1.5px var(--arc), 0 1px 0 #0c2a45; }

.btn-quiet { padding: 0.5rem 1rem 0.5rem 0.5rem; color: var(--text); }
.play-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--hairline-strong);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.3s var(--ease-spring);
}
.play-disc::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  border: 1.5px solid var(--arc);
  opacity: 0;
  animation: discPulse 2.2s var(--ease-out) infinite;
}
.btn-quiet:hover .play-disc { background: var(--arc); border-color: var(--arc); color: var(--void-950); transform: scale(1.08); }
@keyframes discPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.btn-sm { padding: 0.6rem 1rem; font-size: 0.8rem; }
.btn-sm.btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 3px 0 var(--volt-shadow), 0 10px 24px -8px rgba(255, 207, 58, 0.55); }
.btn-sm:active { translate: 0 2px; }

.live-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: livePulse 1.8s var(--ease-out) infinite;
  flex: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
}

.link-underline {
  position: relative;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 2px;
  color: var(--arc);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  transition: background-size 0.4s var(--ease-out), color 0.3s;
}
.link-underline:hover { color: var(--volt); background-size: 0% 2px; background-position: 100% 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem var(--gutter);
  transition: transform 0.45s var(--ease-out), opacity 0.4s;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 6, 16, 0.92), rgba(10, 6, 16, 0.6) 70%, transparent);
  pointer-events: none;
}
.site-header.is-hidden { transform: translateY(-120%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  justify-self: start;
}
.brand-mark { width: 33px; height: 44px; image-rendering: pixelated; transition: transform 0.35s var(--ease-spring), filter 0.3s; }
.brand-type { width: auto; height: 22px; image-rendering: pixelated; }
.brand-type-short { display: none; }
.brand:hover .brand-mark { transform: scale(1.12) rotate(-6deg); filter: drop-shadow(0 0 12px rgba(255, 207, 58, 0.7)); }
.brand-sub {
  align-self: flex-end;
  padding-bottom: 1px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--volt);
}

.main-nav { display: flex; gap: 0.1rem; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-stretch: 105%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--volt);
  box-shadow: 0 0 10px var(--volt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.3s var(--ease-snap);
}
.nav-num { font-family: var(--font-mono); font-size: 0.58rem; font-weight: 500; letter-spacing: 0.08em; color: var(--text-faint); transition: color 0.2s; }
.nav-link:hover { color: var(--ice-50); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ice-50); }
.nav-link.is-active .nav-num { color: var(--volt); }
.nav-link-mobile-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 0.9rem; justify-self: end; }

/* Loot meter: one segment per chest opened */
.loot-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(32, 19, 47, 0.8);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: box-shadow 0.3s, background 0.3s;
}
.meter-icon { width: 18px; height: 16px; color: var(--volt); flex: none; }
.meter-segs { display: flex; gap: 3px; }
.meter-segs i {
  display: block;
  width: 11px;
  height: 14px;
  border-radius: 2px;
  background: var(--void-600);
  transition: background 0.2s, box-shadow 0.3s;
}
.meter-segs i.is-on {
  background: var(--c, var(--volt));
  box-shadow: 0 0 10px var(--c, var(--volt));
  animation: segPop 0.5s var(--ease-snap);
}
@keyframes segPop {
  0% { transform: scale(0.3); filter: brightness(3); }
  45% { transform: scale(1.7); filter: brightness(2); }
  100% { transform: scale(1); filter: none; }
}
.meter-count { min-width: 3ch; color: var(--ice-100); font-weight: 700; letter-spacing: 0.08em; }
.loot-meter.is-bump { animation: meterBump 0.4s var(--ease-snap); }
@keyframes meterBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.loot-meter.is-complete {
  background: rgba(255, 207, 58, 0.12);
  box-shadow: inset 0 0 0 1.5px var(--volt), 0 0 26px -4px rgba(255, 207, 58, 0.7);
}
.loot-meter.is-complete .meter-count { color: var(--volt); }
.site-header.is-charged .btn-primary { animation: charged 1.4s ease-in-out infinite; }
@keyframes charged {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18) drop-shadow(0 0 14px rgba(255, 207, 58, 0.8)); }
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong);
  background: rgba(32, 19, 47, 0.8);
}
.nav-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--ice-50);
  transition: transform 0.35s var(--ease-spring), top 0.25s var(--ease-out);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded='true'] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Loot chest ---------- */
.chest {
  --r: var(--r-legendary);
  position: relative;
  display: block;
  width: var(--chest-w, 120px);
  aspect-ratio: 200 / 180;
  flex: none;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.chest[data-rarity='common'] { --r: var(--r-common); }
.chest[data-rarity='uncommon'] { --r: var(--r-uncommon); }
.chest[data-rarity='rare'] { --r: var(--r-rare); }
.chest[data-rarity='epic'] { --r: var(--r-epic); }
.chest[data-rarity='legendary'] { --r: var(--r-legendary); }
.chest[data-rarity='mythic'] { --r: var(--r-mythic); }
.chest::before {
  /* ground glow in the rarity colour */
  content: '';
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 56%;
  width: 190%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.55);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--r) 55%, transparent), transparent);
  opacity: 0.35;
  transition: opacity 0.4s, transform 0.6s var(--ease-spring);
  pointer-events: none;
}
.chest-svg { position: relative; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.6)); }
.chest-lid {
  transform-box: view-box;
  transform-origin: 22px 96px;
  transition: transform 0.5s var(--ease-snap);
}
.chest-glow { opacity: 0; transition: opacity 0.2s; }
.chest-beam {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 46%;
  width: 78%;
  height: 330%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: 50% 100%;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--r) 60%, #fff) 0%,
    color-mix(in srgb, var(--r) 55%, transparent) 22%,
    color-mix(in srgb, var(--r) 18%, transparent) 60%,
    transparent 100%);
  clip-path: polygon(22% 100%, 78% 100%, 100% 0, 0 0);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}
.js:not(.reduced) .chest:not(.is-open) .chest-svg { animation: chestRattle 3.4s ease-in-out infinite; }
@keyframes chestRattle {
  0%, 82%, 100% { transform: none; }
  85% { transform: rotate(-4deg) translateY(-2px); }
  88% { transform: rotate(4deg); }
  91% { transform: rotate(-3deg) translateY(-1px); }
  94% { transform: rotate(2deg); }
}
.chest:hover::before { opacity: 0.6; }
.chest.is-open::before { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
.chest.is-open .chest-lid { transform: translate(-6px, -22px) rotate(-26deg); }
.chest.is-open .chest-glow { opacity: 1; }
.chest.is-open .chest-beam { animation: beamIn 0.7s var(--ease-out) forwards, beamPulse 2.6s ease-in-out 0.7s infinite; }
.chest.is-open .chest-svg { animation: chestPop 0.55s var(--ease-snap); }
.chest.is-burst .chest-svg { animation: chestPop 0.45s var(--ease-snap); }
@keyframes chestPop {
  0% { transform: scale(1, 1); }
  22% { transform: scale(1.22, 0.78) translateY(8%); }
  55% { transform: scale(0.9, 1.14) translateY(-10%); }
  100% { transform: none; }
}
@keyframes beamIn {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0); }
  30% { opacity: 1; transform: translateX(-50%) scaleY(1.08); }
  100% { opacity: 0.55; transform: translateX(-50%) scaleY(1); }
}
@keyframes beamPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.32; }
}
.reduced .chest-beam { opacity: 0.4; transform: translateX(-50%) scaleY(1); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: clamp(5.25rem, 4.5rem + 2vw, 6.75rem);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* storm sky: a cold cloud bank lit from behind */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(46% 42% at 76% 34%, rgba(196, 163, 255, 0.2), transparent 70%),
    radial-gradient(40% 34% at 70% 62%, rgba(245, 158, 11, 0.14), transparent 70%),
    radial-gradient(50% 50% at 12% 78%, rgba(168, 85, 247, 0.14), transparent 70%),
    linear-gradient(180deg, var(--void-950), var(--void-900) 55%, var(--void-850));
}
.hero::after {
  /* rain-slant hatch, barely there */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(102deg, rgba(160, 190, 255, 0.045) 0 1px, transparent 1px 14px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  pointer-events: none;
}
.sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-meta-row {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 var(--gutter);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--hairline);
}
.hero-issue span { color: var(--volt); margin-right: 0.8rem; }
.hero-clock { display: inline-flex; align-items: center; gap: 0.55rem; }
#clock-time { color: var(--ice-50); }
#clock-mood { color: var(--arc); }

.hero-stage {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  padding: clamp(1.5rem, 3.2vw, 3.25rem) var(--gutter) clamp(2rem, 3.5vw, 3.5rem);
}
.hero-stage.is-shake { animation: shake 0.3s linear; }
@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-5px, 3px); }
  35% { transform: translate(5px, -3px); }
  55% { transform: translate(-3px, -2px); }
  75% { transform: translate(2px, 2px); }
}

.hero-title {
  grid-column: 1 / 9;
  grid-row: 1;
  position: relative;
  z-index: 4;
  font-size: clamp(2.6rem, 6.5vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  pointer-events: none;
  text-wrap: nowrap;
}
.hero-title .line { display: block; }
.hero-title .line > span { display: inline-block; transform-origin: 0 60%; text-shadow: 0 6px 30px rgba(10, 6, 16, 0.9); }
.hero-title .line-volt > span {
  color: var(--volt);
  text-shadow: 0 0 34px rgba(255, 207, 58, 0.55), 0 6px 30px rgba(10, 6, 16, 0.9);
}

.hero-copy {
  grid-column: 1 / 7;
  grid-row: 2;
  position: relative;
  z-index: 6;
  align-self: start;
  padding-top: clamp(1.25rem, 2vw, 2rem);
}
.hero-lead {
  max-width: 40ch;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-soft);
  text-wrap: pretty;
}
.hero-lead strong { color: var(--ice-50); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 1.7rem; }
.hero-cta .btn-primary { padding: 1rem 0.9rem 1rem 1.6rem; font-size: 1.05rem; }
.hero-cta .btn-primary .btn-icon { width: 2.5rem; height: 2.5rem; }
.hero-hint { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem; }
.hero-hint svg { width: 12px; height: 12px; color: var(--volt); flex: none; }

/* Arena: the boss over its hoard */
.hero-arena {
  grid-column: 7 / 13;
  grid-row: 1 / 3;
  position: relative;
  z-index: 2;
  align-self: stretch;
  min-height: clamp(420px, 40vw, 640px);
  will-change: transform;
}
.arena-ring {
  position: absolute;
  left: 58%;
  bottom: 1%;
  width: 84%;
  aspect-ratio: 3.2 / 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(196, 163, 255, 0.16), rgba(196, 163, 255, 0.05) 60%, transparent);
  box-shadow: inset 0 0 0 1.5px rgba(196, 163, 255, 0.3), 0 0 60px rgba(196, 163, 255, 0.2);
}
.arena-ring::before,
.arena-ring::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 207, 58, 0.4);
  animation: spin 26s linear infinite;
}
.arena-ring::after { inset: -8%; border-color: rgba(196, 163, 255, 0.22); animation-duration: 40s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.plate-dragon {
  position: absolute;
  z-index: 3;
  top: -15%;
  left: -16%;
  width: 104%;
  cursor: pointer;
  outline: none;
}
.plate-dragon-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 560 / 480;
  transform-origin: 62% 48%;
  filter: drop-shadow(0 40px 36px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 34px rgba(255, 84, 46, 0.4));
  animation: dragonGlide 5.5s ease-in-out infinite;
}
@keyframes dragonGlide {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg) scale(1); }
  50% { transform: translate3d(-10px, -18px, 0) rotate(1.5deg) scale(1.02); }
}
.boss-chip {
  position: absolute;
  z-index: 5;
  right: 0;
  top: 4%;
  width: min(54%, 260px);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  padding: 0.7rem 0.85rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(18, 10, 28, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 46, 0.4), 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: left;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.boss-chip:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: inset 0 0 0 1.5px var(--ember), 0 0 30px -6px rgba(255, 77, 46, 0.7);
}
.boss-chip-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
}
.boss-chip-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  font-stretch: 105%;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boss-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 2px;
  background: rgba(243, 233, 216, 0.12);
  overflow: hidden;
}
.boss-bar span {
  display: block;
  height: 100%;
  width: 82%;
  background: linear-gradient(90deg, #e2402f, #ff9a5a);
  box-shadow: 0 0 12px rgba(255, 90, 58, 0.8);
  animation: bossHp 6s var(--ease-in-out) infinite;
}
@keyframes bossHp {
  0%, 100% { width: 82%; }
  40% { width: 61%; }
  60% { width: 64%; }
}
.chest-hero {
  --chest-w: clamp(150px, 15vw, 230px);
  position: absolute;
  z-index: 6;
  left: 66%;
  bottom: 7%;
  margin-left: calc(var(--chest-w) * -0.5);
}
.arena-caption {
  position: absolute;
  z-index: 6;
  left: 0;
  bottom: 0;
}

.scroll-cue {
  position: absolute;
  right: calc(var(--gutter) - 0.4rem);
  bottom: 2.25rem;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 1rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.cue-line {
  position: relative;
  width: 2px;
  height: 64px;
  background: var(--hairline);
  overflow: hidden;
}
.cue-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--volt);
  box-shadow: 0 0 8px var(--volt);
  animation: cueDrip 1.5s var(--ease-in-out) infinite;
}
@keyframes cueDrip {
  0% { transform: translateY(100%); }
  50% { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}

/* Marquee: hazard-tape ticker */
.marquee {
  position: relative;
  z-index: 3;
  overflow: hidden;
  background: var(--volt);
  color: #151000;
  box-shadow: 0 0 60px -10px rgba(255, 207, 58, 0.55);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-group { display: flex; align-items: center; flex: none; transform: skewX(var(--skew, 0deg)); }
.marquee-group li {
  padding: 0.85rem 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 0.9rem + 1.2vw, 2rem);
  font-weight: 900;
  font-stretch: 110%;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee-group em {
  color: transparent;
  -webkit-text-stroke: 1.5px #151000;
}
.marquee-group li svg { width: 0.8em; height: 0.8em; color: #151000; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section label (with its chest) ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 108px;
  margin-bottom: clamp(2rem, 4vw, 4rem);
}
.section-label .mono:first-child {
  padding: 0.3rem 0.55rem;
  border-radius: 3px;
  background: var(--volt);
  color: var(--void-950);
  font-weight: 700;
}
.section-label .mono:nth-child(3) { color: var(--ice-100); }
.label-rule { flex: 0 0 clamp(3rem, 8vw, 7rem); height: 2px; background: linear-gradient(90deg, var(--volt), transparent); }
.section-label .chest { --chest-w: clamp(84px, 9vw, 120px); margin-left: auto; }

/* ---------- WORLD ---------- */
.world { position: relative; isolation: isolate; padding: var(--section) var(--gutter) calc(var(--section) * 0.45); }

.manifesto {
  max-width: 21ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 3.9vw, 5rem);
  font-weight: 800;
  font-stretch: 92%;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ice-50);
  text-wrap: balance;
}
.manifesto .w { display: inline; transition: opacity 0.2s linear, color 0.3s; }
.js .manifesto .w { opacity: 0.16; }
.inline-clip {
  position: relative;
  display: inline-block;
  width: 2.2em;
  height: 0.8em;
  margin: 0 0.1em;
  vertical-align: -0.04em;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--volt), 0 0 30px -4px rgba(255, 207, 58, 0.6);
  transition: transform 0.4s var(--ease-spring), width 0.4s var(--ease-spring);
}
.inline-clip video { width: 100%; height: 100%; object-fit: cover; }
.inline-clip:hover { transform: scale(1.08); width: 2.6em; }

.world-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  margin-top: clamp(4rem, 8vw, 8rem);
}
.world-film { grid-column: 1 / 9; }
.film-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-plate);
  background: var(--void-800);
  transition: transform 0.5s var(--ease-spring), box-shadow 0.4s;
}
.film-frame:hover {
  transform: scale(1.015);
  box-shadow: inset 0 0 0 2px var(--volt), 0 50px 90px -40px rgba(0, 0, 0, 0.85), 0 0 70px -20px rgba(255, 207, 58, 0.55);
}
.film-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--film-zoom, 1.06));
  transition: transform 0.9s var(--ease-out);
}
.film-frame:hover video { --film-zoom: 1.0; }
.film-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 100px rgba(10, 6, 16, 0.6), inset 0 0 0 1px rgba(232, 196, 140, 0.14);
  pointer-events: none;
}
.film-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 6, 16, 0.72);
  box-shadow: inset 0 0 0 1px var(--hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ice-50);
}
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px var(--ember); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.world-film figcaption { margin-top: 0.9rem; }

/* Loot cards */
.marginalia {
  grid-column: 9 / 13;
  display: grid;
  align-content: end;
  gap: 0.9rem;
}
.marginalia li {
  --c: var(--r-uncommon);
  position: relative;
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, var(--void-800)), var(--void-850));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent), inset 0 3px 0 var(--c);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.marginalia li:nth-child(2) { --c: var(--r-rare); }
.marginalia li:nth-child(3) { --c: var(--r-epic); }
.marginalia li:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1.5px var(--c), inset 0 3px 0 var(--c), 0 20px 40px -18px var(--c);
}
.note-num { position: absolute; top: 1.15rem; right: 1.1rem; color: var(--c); }
.marginalia h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  font-stretch: 105%;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0.45rem;
  padding-right: 2rem;
  color: var(--ice-50);
}
.marginalia p { font-size: 0.95rem; color: var(--text-soft); line-height: 1.5; }

/* Index */
.index { position: relative; margin-top: clamp(6rem, 11vw, 11rem); }
.index-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.index-head h2 { max-width: 14ch; }
.index-list { border-bottom: 1px solid var(--hairline); }
.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 30ch) 6rem;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.1rem, 2vw, 1.8rem) 0;
  border-top: 1px solid var(--hairline);
  transition: opacity 0.3s var(--ease-out);
}
.index-row::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--volt);
  box-shadow: 0 0 12px var(--volt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.45s var(--ease-out);
}
.row-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 0.9rem + 3vw, 3.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ice-50);
  transition: transform 0.4s var(--ease-spring), color 0.25s, text-shadow 0.25s;
}
.row-title em { color: var(--arc); }
.row-desc { font-size: 0.95rem; color: var(--text-soft); line-height: 1.5; }
.row-tag {
  justify-self: end;
  padding: 0.25rem 0.55rem;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}
.index-list:hover .index-row.reveal:not(:hover) { opacity: 0.35; }
.index-row:hover::after { transform: scaleX(1); }
.index-row:hover .row-title { transform: translateX(1.2rem); color: var(--volt); text-shadow: 0 0 30px rgba(255, 207, 58, 0.45); }
.index-row:hover .row-title em { color: var(--volt); }
.index-row:hover .row-num { color: var(--volt); }
.index-row:hover .row-tag { color: var(--void-950); background: var(--volt); box-shadow: none; }

.index-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: clamp(200px, 18vw, 280px);
  aspect-ratio: 4 / 5;
  margin: calc(clamp(200px, 18vw, 280px) * -0.625) 0 0 calc(clamp(200px, 18vw, 280px) * -0.5);
  pointer-events: none;
  will-change: transform;
}
.preview-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(75% 65% at 50% 45%, rgba(196, 163, 255, 0.24), transparent 72%),
    linear-gradient(180deg, #121a34, #0a0e1c);
  box-shadow: inset 0 0 0 2px var(--volt), 0 40px 80px -30px rgba(0, 0, 0, 0.85), 0 0 50px -10px rgba(255, 207, 58, 0.5);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.4s var(--ease-snap), opacity 0.2s var(--ease-out);
}
.index-preview.is-active .preview-inner { transform: scale(1); opacity: 1; }
#index-preview-canvas { width: 100%; height: 100%; display: block; }

/* ---------- BESTIARY ---------- */
.bestiary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: var(--section) var(--gutter);
  background: linear-gradient(180deg, var(--bg) 0, #080c1c 16%, #070a18 84%, var(--bg) 100%);
}
.bestiary-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 26% at 82% 64%, rgba(255, 77, 46, 0.14), transparent 70%),
    radial-gradient(34% 24% at 10% 30%, rgba(196, 163, 255, 0.12), transparent 70%),
    linear-gradient(rgba(120, 160, 255, 0.06) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(120, 160, 255, 0.06) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}
.bestiary-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: end;
}
.bestiary-head h2 { grid-column: 1 / 9; max-width: 14ch; }
.bestiary-head h2 em { color: var(--ember); text-shadow: 0 0 40px rgba(255, 77, 46, 0.5); }
.bestiary-intro {
  grid-column: 9 / 13;
  max-width: 36ch;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* Annotated screenshot */
.field-shot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  align-items: end;
  margin-top: clamp(3.5rem, 6vw, 6rem);
}
.shot-frame { grid-column: 1 / 10; position: relative; transition: transform 0.5s var(--ease-spring); }
.shot-frame:hover { transform: scale(1.01); }
.shot-frame img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: #1b2433;
  box-shadow:
    0 0 0 1px rgba(232, 196, 140, 0.2),
    0 0 0 8px rgba(24, 14, 37, 0.95),
    0 0 0 9.5px rgba(196, 163, 255, 0.35),
    0 60px 110px -40px rgba(0, 0, 0, 0.9),
    0 0 90px -20px rgba(196, 163, 255, 0.35);
}
.shot-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 80px rgba(10, 6, 16, 0.5);
  pointer-events: none;
}
.shot-tag {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(10, 6, 16, 0.78);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ice-50);
  white-space: nowrap;
}
.pin {
  position: absolute;
  z-index: 2;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}
.pin-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 4px;
  background: var(--volt);
  color: var(--void-950);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(255, 207, 58, 0.25), 0 8px 18px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s var(--ease-spring), background 0.2s;
}
.pin-dot::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 5px;
  border: 1.5px solid var(--volt);
  animation: discPulse 2s var(--ease-out) infinite;
}
.pin-label {
  position: absolute;
  left: calc(100% + 0.5rem);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  background: var(--ice-50);
  color: var(--void-950);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateX(-8px) scale(0.94);
  transform-origin: 0 50%;
  transition: opacity 0.2s var(--ease-out), transform 0.3s var(--ease-spring);
  pointer-events: none;
}
.pin[data-pin='5'] .pin-label { left: auto; right: calc(100% + 0.5rem); transform-origin: 100% 50%; transform: translateX(8px) scale(0.94); }
.pin:hover .pin-dot,
.pin.is-active .pin-dot { transform: scale(1.25); background: var(--ice-50); }
.pin:hover .pin-label,
.pin.is-active .pin-label { opacity: 1; transform: none; }

.field-legend { grid-column: 10 / 13; padding-bottom: 0.5rem; }
.legend-list { margin-top: 1.1rem; border-top: 1px solid var(--hairline); }
.legend-list li {
  display: flex;
  gap: 0.9rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-soft);
  transition: color 0.2s, padding 0.3s var(--ease-out), box-shadow 0.3s;
}
.legend-list .mono { color: var(--volt); padding-top: 0.2em; }
.legend-list li.is-active { color: var(--ice-50); padding-left: 0.6rem; box-shadow: inset 3px 0 0 var(--volt); }

/* Monster cards */
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.4vw, 1.4rem);
  margin-top: clamp(4.5rem, 8vw, 8rem);
}
.beast {
  position: relative;
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--glow) 18%, transparent), transparent 72%),
    linear-gradient(180deg, #111a30, #0a0f1f);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--glow) 22%, rgba(232, 196, 140, 0.1)),
    inset 0 3px 0 color-mix(in srgb, var(--glow) 80%, transparent),
    0 50px 90px -50px rgba(0, 0, 0, 0.95);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}
.beast:hover {
  transform: translateY(-8px);
  box-shadow:
    inset 0 0 0 1.5px var(--glow),
    inset 0 3px 0 var(--glow),
    0 60px 100px -50px rgba(0, 0, 0, 0.95),
    0 30px 80px -36px var(--glow);
}
.js .beast.reveal.is-visible { transition: opacity 0.45s var(--ease-out) var(--d, 0s), transform 0.4s var(--ease-spring), box-shadow 0.3s var(--ease-out); }
.js .beast.reveal.is-visible:hover { transform: translateY(-8px); }
.beast-art {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(closest-side at 50% 54%, color-mix(in srgb, var(--glow) 20%, transparent), transparent 78%),
    linear-gradient(rgba(120, 160, 255, 0.06) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(120, 160, 255, 0.06) 1px, transparent 1px) 0 0 / 42px 42px;
  cursor: pointer;
}
.beast-art::after {
  content: '';
  position: absolute;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--glow) 38%, rgba(232, 196, 140, 0.12));
  pointer-events: none;
  animation: spin 30s linear infinite;
  transition: border-color 0.3s;
}
.beast:hover .beast-art::after { border-color: var(--glow); }
.beast-canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55));
  transition: transform 0.4s var(--ease-spring);
}
.beast:hover .beast-canvas { transform: scale(1.06) translateY(-2px); }
.canvas-hint {
  position: absolute;
  z-index: 2;
  right: 1.1rem;
  bottom: 1rem;
  padding: 0.35rem 0.65rem;
  border-radius: 3px;
  background: rgba(10, 6, 16, 0.75);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  color: var(--ice-100);
  pointer-events: none;
}
.beast-body { padding: 0.25rem clamp(1.3rem, 1.9vw, 1.8rem) clamp(1.4rem, 2.1vw, 1.9rem); }
.beast-variants,
.beast-actions,
.hero-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.beast-actions { margin-top: 0.5rem; }
.chip-btn {
  padding: 0.38rem 0.7rem;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(232, 196, 140, 0.24);
  background: rgba(232, 196, 140, 0.05);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.25s var(--ease-spring);
}
.chip-btn:hover { color: var(--ice-50); box-shadow: inset 0 0 0 1px rgba(232, 196, 140, 0.55); transform: translateY(-2px); }
.chip-btn:active { transform: translateY(1px) scale(0.96); }
.chip-btn.is-active {
  background: var(--ice-50);
  color: var(--void-950);
  box-shadow: none;
  font-weight: 700;
}
.chip-btn.chip-action {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glow, var(--accent)) 60%, transparent);
  color: color-mix(in srgb, var(--glow, var(--accent)) 75%, var(--ice-50));
  background: color-mix(in srgb, var(--glow, var(--accent)) 14%, transparent);
}
.chip-btn.chip-action:hover {
  background: color-mix(in srgb, var(--glow, var(--accent)) 32%, transparent);
  color: var(--ice-50);
}
.beast-kind { color: color-mix(in srgb, var(--glow) 72%, var(--ice-50)); }
.beast-name {
  margin: 0.55rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.05rem + 0.8vw, 1.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ice-50);
}
.beast-desc { font-size: 0.95rem; line-height: 1.5; color: var(--text-soft); }
.beast-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.6rem;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}
.beast-stats > div { display: grid; gap: 0.35rem; }
.beast-stats dd { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.threat {
  width: 98px;
  height: 8px;
  margin-top: 0.3rem;
  background: linear-gradient(90deg, var(--glow) 0 calc(var(--lvl) * 20%), rgba(232, 196, 140, 0.16) 0);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 20.5px);
  mask-image: repeating-linear-gradient(90deg, #000 0 16px, transparent 16px 20.5px);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 70%, transparent));
}

/* The boss gets the whole row */
.beast-boss {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  background:
    radial-gradient(60% 90% at 30% 50%, color-mix(in srgb, var(--glow) 22%, transparent), transparent 70%),
    linear-gradient(120deg, #121a30, #0a0f1f 70%);
}
.beast-boss .beast-art {
  aspect-ratio: 16 / 11;
  background:
    linear-gradient(rgba(120, 160, 255, 0.07) 1px, transparent 1px) 0 0 / 52px 52px,
    linear-gradient(90deg, rgba(120, 160, 255, 0.07) 1px, transparent 1px) 0 0 / 52px 52px;
}
.beast-boss .beast-art::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 52%;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--glow) 60%, transparent);
  box-shadow: 0 0 60px color-mix(in srgb, var(--glow) 30%, transparent), inset 0 0 50px color-mix(in srgb, var(--glow) 20%, transparent);
  translate: -50% -50%;
  animation: spin 30s linear infinite;
}
.beast-boss .beast-art::after { display: none; }
.beast-boss .beast-canvas {
  filter: drop-shadow(0 30px 30px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 28px color-mix(in srgb, var(--glow) 40%, transparent));
}
.beast-boss:hover .beast-canvas { transform: scale(1.03); }
.beast-boss .beast-body { padding: clamp(2rem, 3.5vw, 3.5rem) clamp(2rem, 3.5vw, 3.5rem) clamp(2rem, 3.5vw, 3.5rem) 0; }
.beast-boss .beast-name { font-size: clamp(2rem, 1.2rem + 2.4vw, 3.6rem); letter-spacing: -0.025em; }
.beast-boss .beast-desc { font-size: var(--fs-lead); max-width: 34ch; }
.boss-ribbon {
  position: absolute;
  z-index: 2;
  top: 1.2rem;
  left: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  background: var(--ember);
  color: #1a0500;
  font-weight: 700;
}
.boss-ribbon::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a0500;
  animation: blink 1s steps(2) infinite;
}

/* ---------- CLASSES ---------- */
.classes {
  position: relative;
  padding: calc(var(--section) * 0.8) var(--gutter) var(--section);
  background:
    radial-gradient(60% 50% at 80% 40%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    linear-gradient(180deg, transparent 0, var(--void-950) 320px);
  transition: --accent 0.5s var(--ease-out);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}
.classes-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  row-gap: clamp(2.5rem, 4vw, 4rem);
}
.classes-intro { grid-column: 1 / 7; }
.classes-intro h2 { max-width: 13ch; }
.classes-intro em { color: var(--accent); transition: color 0.5s var(--ease-out); }
.classes-intro p { max-width: 40ch; margin-top: 1.5rem; color: var(--text-soft); font-size: var(--fs-lead); }

.class-picker { grid-column: 1 / 7; grid-row: 2; display: grid; align-content: start; }
.class-tab {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.35rem 0;
  text-align: left;
  color: rgba(243, 233, 216, 0.3);
  transition: color 0.25s var(--ease-out);
}
.class-tab .mono { width: 2.5rem; transition: color 0.25s; }
.class-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1rem + 4.6vw, 5.6rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.98;
  transition: transform 0.4s var(--ease-spring), color 0.25s, text-shadow 0.3s;
}
.class-tab::after {
  /* a bolt marks the active class */
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 26px;
  background: var(--accent);
  clip-path: polygon(62% 0, 8% 56%, 44% 56%, 30% 100%, 92% 38%, 54% 38%);
  filter: drop-shadow(0 0 10px var(--accent));
  transform: translateY(-50%) scale(0);
  transition: transform 0.35s var(--ease-snap);
}
.class-tab:hover { color: var(--text-soft); }
.class-tab:hover .class-name { transform: translateX(0.6rem); }
.class-tab.is-active { color: var(--accent); }
.class-tab.is-active .mono { color: transparent; }
.class-tab.is-active::after { transform: translateY(-50%) scale(1); }
.class-tab.is-active .class-name { transform: translateX(1rem); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent); }

.class-stage {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  align-self: center;
  position: relative;
}
.class-panel {
  position: relative;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 60%),
    linear-gradient(180deg, var(--void-800), var(--void-850));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    inset 0 3px 0 var(--accent),
    0 60px 100px -50px rgba(0, 0, 0, 0.9),
    0 0 80px -30px var(--accent);
  overflow: hidden;
}
.class-panel.is-active { animation: panelIn 0.4s var(--ease-snap) both; }
.class-panel.is-active > * { animation: panelChild 0.4s var(--ease-out) both; }
.class-panel.is-active > :nth-child(2) { animation-delay: 0.04s; }
.class-panel.is-active > :nth-child(3) { animation-delay: 0.08s; }
.class-panel.is-active > :nth-child(4) { animation-delay: 0.12s; }
.class-panel.is-active > :nth-child(5) { animation-delay: 0.16s; }
.class-panel.is-active > :nth-child(6) { animation-delay: 0.2s; }
@keyframes panelIn {
  from { opacity: 0; transform: scale(0.92); filter: brightness(2.2); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes panelChild {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.panel-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: clamp(250px, 24vw, 310px);
  margin: -0.5rem 0 1.4rem;
}
.panel-hero::before {
  content: '';
  position: absolute;
  z-index: -2;
  left: 50%;
  bottom: 18%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 36%, transparent), transparent 64%);
  filter: blur(8px);
}
.hero-ring {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 15%;
  width: 72%;
  height: 20%;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 30%, transparent);
}
.hero-ring::after {
  content: '';
  position: absolute;
  inset: -18% -12%;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  animation: ringBreathe 2.6s ease-in-out infinite;
}
@keyframes ringBreathe { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 0.35; } }
.hero-canvas {
  position: relative;
  width: 272px;
  height: 255px;
  max-width: 100%;
  cursor: pointer;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 45%, transparent));
}
.hero-controls { position: relative; z-index: 2; justify-content: center; margin-top: 0.65rem; }
.hero-sparks i {
  position: absolute;
  width: 12px;
  height: 12px;
  background: color-mix(in srgb, var(--accent) 55%, #fff);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkleSpark 1.8s ease-in-out infinite;
}
.hero-sparks i:nth-child(1) { left: 24%; top: 18%; }
.hero-sparks i:nth-child(2) { right: 22%; top: 34%; width: 9px; height: 9px; animation-delay: 0.6s; }
.hero-sparks i:nth-child(3) { left: 30%; bottom: 30%; width: 7px; height: 7px; animation-delay: 1.2s; }
@keyframes twinkleSpark { 0%, 100% { transform: scale(0.4); opacity: 0.2; } 50% { transform: scale(1.3); opacity: 1; } }
.panel-role { color: var(--accent); }
.panel-quote {
  margin: 0.8rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.05rem + 1.3vw, 2.2rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ice-50);
}
.panel-desc { color: var(--text-soft); max-width: 40ch; }
.panel-sig {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 1.6rem 0 1.25rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.panel-sig dd { font-weight: 800; font-size: 1.02rem; text-align: right; color: var(--ice-50); }
.panel-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.panel-tags li {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 70%, var(--ice-50));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ---------- STUDIO ---------- */
.studio {
  position: relative;
  z-index: 3;
  padding: var(--section) var(--gutter);
  background:
    radial-gradient(50% 60% at 22% 62%, rgba(255, 207, 58, 0.1), transparent 70%),
    radial-gradient(60% 60% at 100% 0%, rgba(196, 163, 255, 0.12), transparent 60%),
    var(--void-850);
  border-top: 2px solid var(--volt);
  box-shadow: 0 -30px 80px -30px rgba(255, 207, 58, 0.35);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}
.studio::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(120, 160, 255, 0.05) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(120, 160, 255, 0.05) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(70% 70% at 30% 60%, #000, transparent);
  mask-image: radial-gradient(70% 70% at 30% 60%, #000, transparent);
  pointer-events: none;
}
.studio-layout {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 1.5vw, 1.5rem);
  row-gap: clamp(2.5rem, 5vw, 5rem);
}
.studio-quote {
  grid-column: 1 / 12;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 1rem + 5.4vw, 6.6rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: var(--ice-50);
  text-wrap: balance;
}
.studio-quote em { text-shadow: 0 0 40px rgba(255, 207, 58, 0.5); }
.studio-art { grid-column: 1 / 6; align-self: center; justify-self: center; }
.mark-reactor {
  position: relative;
  display: grid;
  place-items: center;
  width: min(340px, 70vw);
  aspect-ratio: 1;
  cursor: pointer;
  border-radius: 50%;
}
.mark-reactor img {
  position: relative;
  z-index: 2;
  width: 48%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 30px rgba(255, 207, 58, 0.55)) drop-shadow(0 20px 24px rgba(0, 0, 0, 0.6));
  transition: transform 0.35s var(--ease-spring);
  animation: markHum 0.18s steps(2, jump-none) infinite;
}
@keyframes markHum { 0% { translate: 0 0; } 100% { translate: 0.6px -0.6px; } }
.mark-reactor:hover img { transform: scale(1.1) rotate(-4deg); }
.mark-reactor:active img { transform: scale(0.94); }
.reactor-ring {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 207, 58, 0.45);
  animation: spin 18s linear infinite;
}
.reactor-ring.r2 { inset: 16%; border: 1.5px solid rgba(196, 163, 255, 0.35); border-left-color: transparent; border-right-color: transparent; animation-duration: 6s; animation-direction: reverse; }
.reactor-ring.r3 { inset: -6%; border: 1.5px dashed rgba(196, 163, 255, 0.2); animation-duration: 44s; }
.reactor-core {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 207, 58, 0.3), rgba(196, 163, 255, 0.1) 60%, transparent);
  animation: ringBreathe 1.6s ease-in-out infinite;
}

.studio-letter { grid-column: 7 / 12; align-self: center; }
.studio-letter > p:not(.signature) {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 1.2rem;
  text-wrap: pretty;
}
.studio-letter strong { color: var(--ice-50); font-weight: 700; }
.signature {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.8rem 0 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
}
.signature img { width: 30px; height: 40px; image-rendering: pixelated; }
.signature > span { display: grid; gap: 0.25rem; }
.sig-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  color: var(--ice-50);
}
.studio-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  padding: var(--section) var(--gutter) 0;
  background: var(--void-950);
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}
.footer-top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: clamp(3rem, 6vw, 6rem);
  border-bottom: 1px solid var(--hairline);
}
.footer-invite { font-size: var(--fs-display-lg); max-width: 12ch; }
.footer-invite em { text-shadow: 0 0 40px rgba(255, 207, 58, 0.5); }
.footer-play { flex: none; display: grid; justify-items: center; gap: 1.1rem; }
.footer-play .chest { --chest-w: clamp(150px, 16vw, 230px); }
.footer-play .btn-primary { padding: 1.05rem 1rem 1.05rem 1.7rem; font-size: 1.1rem; }

.footer-cols {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 2rem;
  padding: 3rem 0;
}
.footer-col ul { margin-top: 1rem; display: grid; gap: 0.5rem; }
.footer-col a {
  text-decoration: none;
  color: var(--text-soft);
  background: linear-gradient(var(--volt), var(--volt)) 0 100% / 0% 2px no-repeat;
  transition: color 0.2s, background-size 0.35s var(--ease-out);
}
.footer-col a:hover { color: var(--ice-50); background-size: 100% 2px; }
.footer-note { justify-self: end; max-width: 30ch; text-align: right; color: var(--text-soft); display: grid; gap: 1rem; }

.footer-wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(6rem, 27vw, 30rem);
  font-weight: 900;
  font-stretch: 118%;
  text-transform: uppercase;
  line-height: 0.74;
  letter-spacing: -0.04em;
  color: var(--void-800);
  user-select: none;
  transform: translateY(10%);
}
.footer-wordmark span {
  display: inline-block;
  cursor: pointer;
  -webkit-text-stroke: 1.5px rgba(232, 196, 140, 0.16);
  transition: transform 0.35s var(--ease-spring), color 0.15s, text-shadow 0.3s;
}
.footer-wordmark span:hover {
  transform: translateY(-8%);
  color: var(--volt);
  text-shadow: 0 0 80px rgba(255, 207, 58, 0.6);
}

/* ---------- Trailer modal ---------- */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  visibility: hidden;
  pointer-events: none;
}
.trailer-modal.is-active { visibility: visible; pointer-events: auto; }
.trailer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 16, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.trailer-modal.is-active .trailer-backdrop { opacity: 1; }
.trailer-dialog {
  position: relative;
  width: min(1100px, 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--void-850);
  box-shadow: inset 0 0 0 2px var(--volt), 0 60px 120px -40px rgba(0, 0, 0, 0.9), 0 0 90px -20px rgba(255, 207, 58, 0.5);
  transform: scale(0.86);
  opacity: 0;
  transition: transform 0.4s var(--ease-snap), opacity 0.2s;
}
.trailer-modal.is-active .trailer-dialog { transform: none; opacity: 1; }
.trailer-video { aspect-ratio: 16 / 9; background: var(--void-950); }
.trailer-video video { width: 100%; height: 100%; object-fit: contain; }
.trailer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1rem 1rem 1.5rem;
}
.trailer-footer p { display: flex; align-items: baseline; gap: 1rem; font-weight: 800; text-transform: uppercase; font-size: 1rem; }
.trailer-actions { display: flex; align-items: center; gap: 0.8rem; }
.trailer-close {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong);
  transition: background 0.2s, color 0.2s, transform 0.3s var(--ease-spring);
}
.trailer-close:hover { background: var(--ice-50); color: var(--void-950); transform: rotate(90deg); }

/* ---------- Reveal choreography: things drop in like loot ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(42px) scale(0.94);
  transition:
    opacity 0.4s var(--ease-out) var(--d, 0s),
    transform 0.6s var(--ease-snap) var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .index-row.reveal.is-visible { transition: opacity 0.3s var(--ease-out), transform 0.6s var(--ease-snap) var(--d, 0s); }
.js .section-label.reveal { transform: translateX(-30px); }
.js .section-label.reveal.is-visible { transform: none; }

/* Hero load choreography: three hits, then the chest */
.js:not(.reduced) .hero-title .line > span { opacity: 0; }
.js:not(.reduced) body.is-loaded .hero-title .line > span { animation: slam 0.42s var(--ease-snap) both; animation-delay: 0.2s; }
.js:not(.reduced) body.is-loaded .hero-title .line:nth-child(2) > span { animation-delay: 0.55s; }
.js:not(.reduced) body.is-loaded .hero-title .line:nth-child(3) > span { animation-delay: 0.9s; }
@keyframes slam {
  0% { opacity: 0; transform: translateY(-0.3em) scale(1.3); filter: blur(10px) brightness(3); }
  55% { opacity: 1; transform: translateY(0.02em) scale(0.985); filter: blur(0) brightness(1.6); }
  100% { opacity: 1; transform: none; filter: none; }
}
.js .plate-dragon { opacity: 0; transform: translate3d(18%, -14%, 0) scale(0.8) rotate(8deg); transition: opacity 0.5s var(--ease-out) 0.3s, transform 1.1s var(--ease-out) 0.3s; }
.js .arena-ring,
.js .chest-hero { opacity: 0; transform: translateY(30px) scale(0.8); transition: opacity 0.4s var(--ease-out) 0.7s, transform 0.6s var(--ease-snap) 0.7s; }
.js .arena-ring { transform: translateX(-50%) scale(0.6); transition-delay: 0.4s; }
.js .boss-chip { opacity: 0; transform: translateY(-14px); transition: opacity 0.4s var(--ease-out) 1s, transform 0.5s var(--ease-spring) 1s; }
.js .hero-copy,
.js .hero-meta-row,
.js .arena-caption,
.js .scroll-cue,
.js .marquee { opacity: 0; transform: translateY(18px); transition: opacity 0.5s var(--ease-out) 1.15s, transform 0.6s var(--ease-out) 1.15s; }
.js .hero-meta-row { transition-delay: 0.15s; }
.js .site-header { opacity: 0; transform: translateY(-30px); }

body.is-loaded .plate-dragon,
body.is-loaded .boss-chip,
body.is-loaded .chest-hero { opacity: 1; transform: none; }
body.is-loaded .arena-ring { opacity: 1; transform: translateX(-50%); }
body.is-loaded .hero-copy,
body.is-loaded .hero-meta-row,
body.is-loaded .arena-caption,
body.is-loaded .scroll-cue,
body.is-loaded .marquee { opacity: 1; transform: none; }
body.is-loaded .boss-chip:hover { transform: translateY(-3px) scale(1.03); transition-delay: 0s; }
body.is-loaded .site-header { opacity: 1; transform: none; transition: transform 0.5s var(--ease-out) 0.1s, opacity 0.4s 0.1s; }
body.is-loaded .site-header.is-hidden { transform: translateY(-120%); transition-delay: 0s; }

/* ---------- Scene videos: gameplay that plays behind the dark stretches ---------- */
.scene { position: relative; }
.scene-bg {
  --fade: 22vh;
  --shade: linear-gradient(rgba(18, 10, 28, 0.66), rgba(18, 10, 28, 0.66));
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  overflow: clip;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade)), transparent 100%);
}
.scene-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.scene-pin video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 50% 40%;
}
.scene-pin::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 85% at 50% 50%, transparent 35%, rgba(18, 10, 28, 0.66) 100%),
    var(--shade);
}

.scene-intro .scene-bg {
  top: calc(var(--section) * -1);
  bottom: -16vh;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
}
.scene-bg-left {
  --shade: linear-gradient(90deg, rgba(18, 10, 28, 0.93) 0, rgba(18, 10, 28, 0.82) 45%, rgba(18, 10, 28, 0.62) 100%);
}
.index.scene .scene-bg {
  top: -18vh;
  bottom: -14vh;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  --shade: linear-gradient(rgba(18, 10, 28, 0.76), rgba(18, 10, 28, 0.76));
}
.scene-bestiary .scene-bg {
  top: calc(var(--section) * -1);
  bottom: -34vh;
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  --shade: linear-gradient(rgba(7, 10, 24, 0.68), rgba(7, 10, 24, 0.68));
}
.scene-bg-classes {
  --shade:
    radial-gradient(60% 50% at 80% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(rgba(10, 6, 16, 0.82), rgba(10, 6, 16, 0.82));
}
.scene-bg-footer {
  --shade: linear-gradient(rgba(10, 6, 16, 0.7), rgba(10, 6, 16, 0.7));
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22vh, #000 48%, transparent 88%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22vh, #000 48%, transparent 88%);
}

@supports (animation-timeline: view()) {
  .scene-bg { view-timeline: --scene block; }
  .scene-pin video {
    animation: scene-drift linear both;
    animation-timeline: --scene;
  }
}
@keyframes scene-drift {
  from { transform: scale(1.14); }
  to { transform: scale(1); }
}
.reduced .scene-pin video { animation: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .site-header { grid-template-columns: 1fr auto; }
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    padding: 6rem var(--gutter) 3rem;
    background: rgba(10, 6, 16, 0.97);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.45s var(--ease-in-out);
    visibility: hidden;
  }
  .main-nav.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
  .nav-link {
    padding: 0.3rem 0;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 9vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ice-50);
  }
  .nav-link::after { display: none; }
  .nav-link.is-active { color: var(--volt); }
  .nav-link-mobile-cta { display: inline-flex; color: var(--volt); }
}

@media (max-width: 1100px) {
  .hero-title { grid-column: 1 / 10; }
  .hero-arena { grid-column: 7 / 13; }
  .hero-copy { grid-column: 1 / 7; }
  .world-film { grid-column: 1 / 8; }
  .marginalia { grid-column: 8 / 13; }
  .index-row { grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 26ch); }
  .row-tag { display: none; }
  .class-stage { grid-column: 7 / 13; }
  .bestiary-head h2 { grid-column: 1 / 8; }
  .bestiary-intro { grid-column: 8 / 13; }
  .shot-frame { grid-column: 1 / 9; }
  .field-legend { grid-column: 9 / 13; }
  .beast-boss { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .scene-bg { --fade: 14vh; }
  .scene-bg-left { --shade: linear-gradient(rgba(18, 10, 28, 0.78), rgba(18, 10, 28, 0.78)); }

  .header-actions .btn { display: none; }

  .hero-meta-row { flex-direction: column; gap: 0.4rem; }
  .hero-stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .hero-title { grid-column: 1; grid-row: 1; font-size: clamp(2.3rem, 11.2vw, 6rem); }
  .hero-arena { grid-column: 1; grid-row: 2; min-height: 0; aspect-ratio: 10 / 9; margin-top: -1rem; }
  .plate-dragon { top: -12%; left: -12%; width: 104%; }
  .boss-chip { top: 2%; right: 0; width: auto; min-width: 9.5rem; max-width: none; }
  .boss-chip-name { font-size: 0.82rem; overflow: visible; }
  .chest-hero { --chest-w: clamp(110px, 30vw, 180px); bottom: 4%; left: 70%; }
  .hero-copy { grid-column: 1; grid-row: 3; padding-top: 1.25rem; }
  .scroll-cue { display: none; }
  .arena-caption { display: none; }

  .section-label { min-height: 88px; }
  .world-layout { grid-template-columns: 1fr; row-gap: 2rem; }
  .world-film, .marginalia { grid-column: 1 / -1; }
  .index-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .index-row { grid-template-columns: 2.5rem minmax(0, 1fr); row-gap: 0.5rem; }
  .row-desc { grid-column: 2; }
  .index-preview { display: none; }

  .bestiary-head { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .bestiary-head h2, .bestiary-intro { grid-column: 1 / -1; }
  .field-shot { grid-template-columns: 1fr; row-gap: 2rem; }
  .shot-frame, .field-legend { grid-column: 1 / -1; }
  .pin-dot { width: 1.4rem; height: 1.4rem; font-size: 0.62rem; }
  .pin-label { display: none; }
  .shot-tag { display: none; }
  .legend-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
  .beast { grid-column: 1 / -1; }
  .beast-boss { grid-template-columns: 1fr; }
  .beast-boss .beast-body { padding: 0 1.5rem 2rem; }

  .classes-layout { grid-template-columns: 1fr; grid-template-rows: none; }
  .classes-intro, .class-picker, .class-stage { grid-column: 1 / -1; grid-row: auto; }
  .class-picker { grid-auto-flow: column; overflow-x: auto; gap: 1.5rem; scrollbar-width: none; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
  .class-picker::-webkit-scrollbar { display: none; }
  .class-tab { gap: 0.5rem; }
  .class-tab .mono { width: auto; }
  .class-tab::after { display: none; }
  .class-tab.is-active .mono { color: var(--accent); }
  .class-tab.is-active .class-name, .class-tab:hover .class-name { transform: none; }
  .class-name { font-size: clamp(1.9rem, 8vw, 3rem); }

  .studio-quote, .studio-art, .studio-letter { grid-column: 1 / -1; }
  .mark-reactor { width: min(260px, 64vw); }

  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-play { justify-items: start; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-note { grid-column: 1 / -1; justify-self: start; text-align: left; }
}

@media (max-width: 520px) {
  .hero-issue { display: none; }
  .brand-sub { display: none; }
  .brand-type-full { display: none; }
  .brand-type-short { display: block; }
  .loot-meter { padding: 0.4rem 0.5rem; gap: 0.4rem; }
  .meter-segs i { width: 8px; }
  .legend-list { grid-template-columns: 1fr; }
  .hero-cta .btn-primary { width: 100%; justify-content: space-between; }
  .trailer-footer { flex-direction: column; align-items: stretch; }
  .trailer-footer p { flex-direction: column; gap: 0.3rem; }
  .trailer-actions { justify-content: space-between; }
}

@media (hover: none) {
  .index-head .mono { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
  .js .manifesto .w { opacity: 1; }
}
