/* ============================================================
   AMBRYX OBSCURA — site design system ("Porten till Gläntan", fas A)
   One register: sumi-e + flowing magic (design.md §2).
   Warm light, dark world — never cold, never clinical, never horror.
   Typography: Cormorant SC (wordmark) · Cinzel (display) · Inter (body).
   ============================================================ */

:root {
  /* world palette (design.md §3 + ui/GameBoard.css) */
  --ink:      #080c14;
  --ink-2:    #0b1018;
  --ink-3:    #0e1420;
  --divider:  #1a2235;
  --text:     #c8d8ea;
  --text-dim: #93a4b8;
  --cream:    #f3e6c2;
  --gold:     #d4a843;
  --amber:    #e0913f;
  --oxblood:  #6b2737;
  --bronze-1: #6e5a2e;
  --bronze-2: #b9923f;

  /* class accents — identical to the game's tokens */
  --aldric:      #7eb8e8;
  --aldric-dark: #091828;
  --eidara:      #5aaa5a;
  --eidara-dark: #0f2d10;
  --harald:      #caa153;
  --harald-dark: #2a1608;
  --ruby:        #c0392b;

  --font-display: 'Cinzel', 'Georgia', serif;
  --font-wordmark: 'Cormorant SC', 'Cinzel', serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius: 8px;
  --nav-h: 64px;
  --max-w: 1180px;

  /* ornate ring recipe (design.md §5c) */
  --ring-ornate:
    0 0 0 2px #0a0f18,
    0 0 0 4px var(--bronze-1),
    0 0 0 6px var(--bronze-2),
    0 0 0 8px #0a0f18,
    0 10px 40px rgba(0,0,0,.6);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--cream); }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* paper-grain over everything — sumi-e ground */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); color: var(--cream); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
p { text-wrap: pretty; }
.kicker {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.section-title { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: .06em; }
.lede { font-size: 18px; color: var(--text); max-width: 62ch; }
.dim { color: var(--text-dim); }

/* thin gold rule with a diamond — recurring divider motif */
.rule {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0;
  border: 0;
}
.rule::before, .rule::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--bronze-2), transparent);
}
.rule span {
  width: 8px; height: 8px; background: var(--gold);
  transform: rotate(45deg); box-shadow: 0 0 10px rgba(212,168,67,.8);
}

/* ---------- layout ---------- */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
section { position: relative; }
.section-pad { padding: 110px 0; }

/* ---------- nav ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s ease, border-color .4s ease, backdrop-filter .4s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(8, 12, 20, .82);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--divider);
}
.site-nav .wrap {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.nav-brand {
  font-family: var(--font-wordmark);
  font-size: 21px; font-weight: 700;
  letter-spacing: .22em;
  color: var(--cream);
  white-space: nowrap;
}
.nav-brand:hover { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--text);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--bronze-2); }
.nav-play {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: #1a1206 !important;
  background: linear-gradient(180deg, #e8bd5c, var(--bronze-2));
  padding: 9px 22px !important;
  /* same emerald cut as the Amberstone PLAY, scaled down */
  clip-path: polygon(
    9px 0, calc(100% - 9px) 0, 100% 9px,
    100% calc(100% - 9px), calc(100% - 9px) 100%,
    9px 100%, 0 calc(100% - 9px), 0 9px);
  border-bottom: none !important;
  box-shadow: inset 0 1px 0 rgba(255,240,200,.55), inset 0 -1px 0 rgba(46,18,2,.4);
  filter: drop-shadow(0 0 9px rgba(212,168,67,.4));
  transition: filter .25s, transform .25s;
}
.nav-play:hover { color: #000 !important; filter: drop-shadow(0 0 14px rgba(224,145,63,.65)); transform: translateY(-1px); }

/* burger */
.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 40px; height: 40px; padding: 8px;
}
.nav-toggle span {
  display: block; height: 2px; margin: 5px 0;
  background: var(--cream); border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(8, 12, 20, .97);
    border-bottom: 1px solid var(--divider);
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav-links.open { max-height: 440px; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: 16px; border-bottom: 1px solid var(--divider); }
  .nav-links .nav-play { margin: 14px auto 18px; display: inline-block; width: auto; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: -4%;
  z-index: -3;
  background-position: center 62%;
  background-size: cover;
  background-repeat: no-repeat;
}
html.anim .hero-bg { animation: glade-drift 46s ease-in-out infinite alternate; }
@keyframes glade-drift {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.06) translateY(-1.4%); }
}
/* vignette + warm pooled light + an ink wash pooling behind the text */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 58% 60% at 50% 46%, rgba(5,8,14,.62), transparent 72%),
    radial-gradient(ellipse 62% 46% at 50% 66%, rgba(224,145,63,.14), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 34%, rgba(4,6,10,.9) 100%),
    linear-gradient(180deg, rgba(4,6,10,.66), rgba(4,6,10,.18) 30%, rgba(4,6,10,.12) 62%, var(--ink) 98%);
}
.hero-inner { padding: 120px 24px 90px; max-width: 900px; }

.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 700;
  font-size: clamp(44px, 9vw, 108px);
  letter-spacing: .18em;
  margin: 0;
  color: var(--cream);
  text-shadow: 0 2px 24px rgba(0,0,0,.85), 0 0 60px rgba(224,145,63,.25);
}
.wordmark .line2 { display: block; font-size: .62em; letter-spacing: .42em; color: var(--gold); margin-top: 2px; }
.hero-tag {
  font-family: var(--font-display);
  font-size: clamp(15px, 2vw, 20px);
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--text);
  margin: 26px 0 8px;
  text-shadow: 0 1px 10px rgba(0,0,0,.9);
}
.hero-sub { color: var(--text); max-width: 54ch; margin: 0 auto 44px; text-shadow: 0 1px 8px rgba(0,0,0,.9); }

/* staggered load reveal */
html.anim .rise { opacity: 0; transform: translateY(18px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
html.anim .rise-1 { animation-delay: .1s; }
html.anim .rise-2 { animation-delay: .3s; }
html.anim .rise-3 { animation-delay: .5s; }
html.anim .rise-4 { animation-delay: .7s; }
html.anim .rise-5 { animation-delay: .95s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* the PLAY seal — an Amberstone, the rarest gem of Ambryx, set into a
   carved rune-tile: a squared, rounded-corner amber panel inside a
   bronze frame (a hanko-seal silhouette, not a ring). Subsurface fire
   low in the stone, trapped soul-flecks + dark inclusions, corner
   rivets marking the frame, text carved into the tile. */
.play-orb {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: clamp(184px, 30vw, 216px); height: 92px;
  border-radius: 22px;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: .3em; text-indent: .3em;
  color: #3a1c04;
  /* engraved: light catches the lower lip of the carving */
  text-shadow: 0 1px 0 rgba(255,236,180,.55), 0 -1px 1px rgba(46,18,2,.65);
  background: linear-gradient(180deg, #d8b055 0%, var(--bronze-2) 22%, #7a622f 55%, var(--bronze-1) 68%, #3d3118 100%);
  box-shadow: 0 0 60px rgba(224,145,63,.35), 0 16px 44px rgba(0,0,0,.55);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, color .3s, filter .8s ease;
}
/* the stone — amber panel set inside the frame, corners echoing the tile */
.play-orb::before {
  content: '';
  position: absolute; inset: 7px; z-index: -2;
  border-radius: 15px;
  background:
    /* facet step — light along the top edge, shade along the bottom */
    linear-gradient(180deg, rgba(255,236,180,.5) 0, rgba(255,236,180,0) 12px,
                    transparent calc(100% - 16px), rgba(46,18,2,.55) 100%),
    /* glossy specular sweep across the table */
    linear-gradient(115deg, rgba(255,255,255,0) 22%, rgba(255,255,255,.34) 34%, rgba(255,255,255,0) 48%),
    /* dark inclusions — old things the amber closed around */
    radial-gradient(circle at 18% 74%, rgba(56,24,5,.5) 0 2.4px, transparent 3.6px),
    radial-gradient(circle at 82% 68%, rgba(56,24,5,.42) 0 1.9px, transparent 3px),
    radial-gradient(circle at 68% 26%, rgba(70,32,8,.38) 0 1.7px, transparent 2.8px),
    /* soul-flecks — small warm lights, trapped */
    radial-gradient(circle at 11% 30%, rgba(255,243,205,.95) 0 1.6px, transparent 2.8px),
    radial-gradient(circle at 88% 38%, rgba(255,226,153,.85) 0 1.4px, transparent 2.5px),
    radial-gradient(circle at 26% 58%, rgba(255,232,172,.7) 0 1.2px, transparent 2.3px),
    radial-gradient(circle at 76% 80%, rgba(255,238,190,.6) 0 1px, transparent 2px),
    /* subsurface fire, glowing low in the stone */
    radial-gradient(ellipse 76% 90% at 50% 105%, rgba(255,168,58,.9), rgba(255,168,58,0) 62%),
    /* the amber body itself */
    linear-gradient(180deg, #ffd98f 0%, #f2a94b 34%, #d97f22 62%, #9a4a10 88%, #5c2a06 100%);
  pointer-events: none;
}
/* corner rivets — four soul-flecks marking the frame, like a wax-seal border */
.play-orb::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  border-radius: 22px;
  background:
    radial-gradient(circle 2.4px at 14px 14px, rgba(255,238,190,.9), rgba(255,238,190,0) 70%),
    radial-gradient(circle 2.4px at calc(100% - 14px) 14px, rgba(255,238,190,.9), rgba(255,238,190,0) 70%),
    radial-gradient(circle 2.4px at 14px calc(100% - 14px), rgba(255,238,190,.9), rgba(255,238,190,0) 70%),
    radial-gradient(circle 2.4px at calc(100% - 14px) calc(100% - 14px), rgba(255,238,190,.9), rgba(255,238,190,0) 70%);
  box-shadow: inset 0 0 0 1px rgba(46,18,2,.5);
  pointer-events: none;
}
html.anim .play-orb { animation: stone-breathe 3.6s ease-in-out infinite; }
@keyframes stone-breathe {
  0%, 100% { box-shadow: 0 0 46px rgba(224,145,63,.30), 0 16px 44px rgba(0,0,0,.55); }
  50%      { box-shadow: 0 0 82px rgba(224,145,63,.58), 0 16px 44px rgba(0,0,0,.55); }
}
/* the stone itself never changes on hover — the dusk behind it warms instead
   (Simon 2026-07-03: no whole-button light-up; a little more glow in the background) */
.play-orb:hover, .play-orb:focus-visible {
  animation: none;
  box-shadow: 0 0 96px rgba(224,145,63,.6), 0 16px 44px rgba(0,0,0,.55);
}
.play-orb:focus-visible { outline: 2px solid var(--cream); outline-offset: 6px; }
.play-note { margin-top: 26px; font-size: 13px; letter-spacing: .12em; color: var(--text-dim); text-transform: uppercase; }
.play-note b { color: var(--gold); font-weight: 600; }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim); font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue::after {
  content: ''; width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--gold), transparent);
}
html.anim .scroll-cue { animation: cue-fade 2.6s ease-in-out infinite; }
@keyframes cue-fade { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- fireflies ---------- */
.firefly-field { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.ff {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9b0 0%, rgba(224,145,63,.85) 40%, transparent 72%);
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(255,220,140,.9));
}
html.anim .ff {
  animation:
    ff-drift var(--d) ease-in-out var(--delay) infinite alternate,
    ff-glow calc(var(--d) / 3) ease-in-out var(--delay) infinite;
}
html:not(.anim) .ff { opacity: .5; }
@keyframes ff-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--dx), var(--dy)); }
}
@keyframes ff-glow {
  0%, 100% { opacity: .08; }
  50%      { opacity: var(--o); }
}

/* ---------- scroll reveal ---------- */
html.anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
html.anim .reveal.in { opacity: 1; transform: none; }
html.anim .reveal-2.in { transition-delay: .12s; }
html.anim .reveal-3.in { transition-delay: .24s; }

/* ---------- world band (home) ---------- */
.band-world { background: linear-gradient(180deg, var(--ink), var(--ink-2)); }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; } }

.framed-art {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--ring-ornate);
}
.framed-art img { width: 100%; height: 100%; object-fit: cover; }
.framed-art::after {
  content: ''; position: absolute; inset: 0;
  box-shadow: inset 0 0 80px rgba(4,6,10,.75);
  pointer-events: none;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 25px);
  color: var(--gold);
  border-left: 2px solid var(--bronze-2);
  padding-left: 22px;
  margin: 34px 0 0;
  line-height: 1.5;
}
.pull-quote cite { display: block; font-family: var(--font-body); font-style: normal; font-size: 13px; color: var(--text-dim); margin-top: 10px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- characters (home gallery + world) ---------- */
.band-souls { background: var(--ink-2); }
.soul-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 54px; }
@media (max-width: 980px) { .soul-grid { grid-template-columns: 1fr; max-width: 430px; margin-left: auto; margin-right: auto; } }

.soul-card {
  --accent: var(--gold);
  --accent-rgb: 212, 168, 67;
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink-3);
  border: 1px solid var(--divider);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s;
}
.soul-card.aldric { --accent: var(--aldric); --accent-rgb: 126, 184, 232; }
.soul-card.eidara { --accent: var(--eidara); --accent-rgb: 90, 170, 90; }
.soul-card.harald { --accent: var(--harald); --accent-rgb: 202, 161, 83; }
.soul-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 44px rgba(var(--accent-rgb), .25);
}
.soul-art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.soul-art img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.soul-card:hover .soul-art img { transform: scale(1.05); }
.soul-art::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 10%, rgba(var(--accent-rgb), .16), transparent 60%),
    linear-gradient(180deg, transparent 55%, var(--ink-3) 100%);
}
.soul-body { padding: 6px 26px 28px; text-align: center; }
.soul-name { font-size: 24px; letter-spacing: .1em; color: var(--cream); margin-bottom: 2px; }
.soul-class {
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.soul-quote { font-style: italic; color: var(--text); min-height: 3.2em; margin: 0 0 14px; }
.soul-style { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; }
.soul-more {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
  color: var(--accent);
}
.soul-card:hover .soul-more { color: var(--cream); }

/* ---------- the cards (home showcase) ---------- */
.band-cards {
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(224,145,63,.07), transparent 70%),
    var(--ink);
  overflow: hidden;
}
.card-fan {
  display: flex; justify-content: center; align-items: flex-end;
  margin-top: 70px;
  padding-bottom: 30px;
  min-height: 380px;
}
.card-fan .ao-card { margin: 0 -26px; transition: transform .45s cubic-bezier(.2,.7,.2,1), z-index 0s; }
.card-fan .ao-card:nth-child(1) { transform: rotate(-12deg) translateY(34px); }
.card-fan .ao-card:nth-child(2) { transform: rotate(-7deg)  translateY(14px); }
.card-fan .ao-card:nth-child(3) { transform: rotate(-2deg); }
.card-fan .ao-card:nth-child(4) { transform: rotate(2deg); }
.card-fan .ao-card:nth-child(5) { transform: rotate(7deg)  translateY(14px); }
.card-fan .ao-card:nth-child(6) { transform: rotate(12deg) translateY(34px); }
.card-fan .ao-card:hover { transform: rotate(0deg) translateY(-24px) scale(1.12); z-index: 5; }
@media (max-width: 900px) {
  .card-fan { flex-wrap: wrap; gap: 26px; min-height: 0; }
  .card-fan .ao-card, .card-fan .ao-card:hover { margin: 0; transform: none; }
}

/* ---------- ornate card frame (.ao-card) ---------- */
.ao-card {
  --cw: 196px;
  position: relative;
  width: var(--cw);
  flex: 0 0 var(--cw);
  border-radius: 12px;
  background: linear-gradient(180deg, #171d2c, #0d1220);
  box-shadow:
    0 0 0 1px #05070c,
    0 0 0 3px var(--bronze-1),
    0 0 0 4px #05070c,
    0 14px 40px rgba(0,0,0,.65);
  padding: 10px 10px 30px;
  font-size: 12px;
}
.ao-card.legendary {
  box-shadow:
    0 0 0 1px #05070c,
    0 0 0 3px var(--bronze-2),
    0 0 0 4px #05070c,
    0 0 26px rgba(212,168,67,.35),
    0 14px 40px rgba(0,0,0,.65);
}
.ao-card.rare {
  box-shadow:
    0 0 0 1px #05070c,
    0 0 0 3px #3d6a9e,
    0 0 0 4px #05070c,
    0 14px 40px rgba(0,0,0,.65);
}
.ao-art {
  border-radius: 7px;
  overflow: hidden;
  aspect-ratio: 274 / 330;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.7);
}
.ao-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.ao-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .04em;
  line-height: 1.25;
  text-align: center;
  color: var(--cream);
  background: linear-gradient(180deg, #232b3e, #10141f);
  border: 1px solid #05070c;
  border-radius: 6px;
  padding: 5px 8px;
  margin: -14px 4px 8px;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  min-height: 42px;
  overflow: hidden;
}
.ao-text {
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  min-height: 3.1em;
  padding: 0 4px;
}
/* gems overlap the frame corners (card anatomy, CLAUDE.md v2.12) */
.ao-gem {
  position: absolute;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  box-shadow: 0 0 0 2px #05070c, 0 4px 12px rgba(0,0,0,.7);
}
.ao-cost { top: -12px; left: -12px; background: radial-gradient(circle at 35% 30%, #7db4ea, #2456a0 70%); }
.ao-atk  { bottom: -12px; left: -12px; background: radial-gradient(circle at 35% 30%, #f5b565, #b35a10 70%); }
.ao-hp   { bottom: -12px; right: -12px; background: radial-gradient(circle at 35% 30%, #ef7b64, #8e2318 70%); }
.ao-dura { bottom: -12px; right: -12px; background: radial-gradient(circle at 35% 30%, #cfd8e6, #5a6880 70%); }

/* ---------- duel steps (home) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 54px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--ink-3);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 34px 30px;
  position: relative;
}
.step::before {
  content: attr(data-n);
  position: absolute; top: -18px; left: 26px;
  font-family: var(--font-display);
  font-size: 15px; font-weight: 800;
  color: var(--gold);
  background: var(--ink);
  border: 1px solid var(--bronze-2);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(212,168,67,.3);
}
.step h3 { font-size: 18px; letter-spacing: .08em; margin: 8px 0 10px; }
.step p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- CTA band ---------- */
.band-cta {
  text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(224,145,63,.14), transparent 70%),
    var(--ink-2);
  border-top: 1px solid var(--divider);
}
.band-cta .section-title { margin-bottom: 16px; }

/* ---------- page hero (subpages) ---------- */
.page-hero {
  position: relative;
  min-height: 46vh;
  display: flex; align-items: flex-end;
  padding: 160px 0 60px;
  isolation: isolate;
  overflow: hidden;
}
.page-hero .hero-bg { z-index: -2; }
.page-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(4,6,10,.7), rgba(4,6,10,.35) 45%, var(--ink) 96%);
}
.page-hero h1 { font-size: clamp(34px, 5.4vw, 58px); letter-spacing: .08em; }

/* ---------- world page ---------- */
.lore-block { max-width: 720px; margin: 0 auto; }
.lore-block p { color: var(--text); }
.lore-block .first::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em; line-height: .85;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--amber);
}
.band-fireflies {
  position: relative;
  text-align: center;
  padding: 150px 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 55%, rgba(224,145,63,.1), transparent 70%),
    linear-gradient(180deg, var(--ink) 0%, #0a0e18 50%, var(--ink) 100%);
  overflow: hidden;
}
.band-fireflies .firefly-field { z-index: 0; }
.band-fireflies .wrap { position: relative; z-index: 1; }
.whisper {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.2vw, 34px);
  color: var(--cream);
  max-width: 22ch;
  margin: 0 auto;
  line-height: 1.5;
}
.whisper em { color: var(--amber); font-style: normal; }

.stone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; }
@media (max-width: 900px) { .stone-grid { grid-template-columns: 1fr; } }
.stone {
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--ink-3);
  padding: 32px 28px;
  text-align: center;
}
.stone .gem {
  width: 22px; height: 22px;
  margin: 0 auto 18px;
  transform: rotate(45deg);
  border-radius: 4px;
}
.stone.emerald .gem { background: var(--eidara); box-shadow: 0 0 22px rgba(90,170,90,.7); }
.stone.sapphire .gem { background: var(--aldric); box-shadow: 0 0 22px rgba(126,184,232,.7); }
.stone.amberstone .gem { background: var(--amber); box-shadow: 0 0 22px rgba(224,145,63,.7); }
.stone h3 { font-size: 17px; letter-spacing: .18em; text-transform: uppercase; }
.stone p { font-size: 14px; color: var(--text-dim); margin: 0; }

/* ---------- character pages ---------- */
.char-hero {
  position: relative;
  min-height: 92svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 120px 0 60px;
  isolation: isolate;
  overflow: hidden;
}
@media (max-width: 940px) {
  .char-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 100px; text-align: center; }
}
.char-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 80% at 28% 50%, rgba(var(--char-rgb), .13), transparent 65%),
    radial-gradient(ellipse 100% 100% at 50% 0%, var(--char-deep), transparent 90%),
    var(--ink);
}
.char-art { position: relative; display: flex; justify-content: center; }
.char-art img {
  max-height: 76vh;
  width: auto; max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.7)) drop-shadow(0 0 60px rgba(var(--char-rgb), .18));
}
@media (max-width: 940px) { .char-art img { max-height: 52vh; } }
.char-intro .kicker { color: var(--char); }
.char-name { font-size: clamp(38px, 5vw, 60px); letter-spacing: .06em; margin-bottom: 4px; }
.char-class {
  font-family: var(--font-display);
  letter-spacing: .34em; text-transform: uppercase;
  font-size: 14px;
  color: var(--char);
  margin: 0 0 26px;
}
.char-greeting {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 27px);
  color: var(--cream);
  font-style: italic;
  margin: 0 0 26px;
  line-height: 1.45;
}
.char-style { color: var(--text-dim); max-width: 52ch; }
@media (max-width: 940px) { .char-style { margin-inline: auto; } }

/* per-character accent scope */
.char-aldric { --char: var(--aldric); --char-rgb: 126, 184, 232; --char-deep: #0a1a2c; }
.char-eidara { --char: var(--eidara); --char-rgb: 90, 170, 90;  --char-deep: #0c2010; }
.char-harald { --char: var(--harald); --char-rgb: 202, 161, 83; --char-deep: #241407; }

.char-section { border-top: 1px solid var(--divider); }
.char-section h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: .08em; }
.char-section h2::after {
  content: '';
  display: block;
  width: 64px; height: 2px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--char), transparent);
}
.story-cols { columns: 2; column-gap: 56px; margin-top: 34px; }
@media (max-width: 900px) { .story-cols { columns: 1; } }
.story-cols p { break-inside: avoid; margin-top: 0; }

/* voice lines */
.voice-list { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 22px; }
.voice-list li {
  border-left: 2px solid var(--char);
  padding: 4px 0 4px 22px;
}
.voice-list .cue {
  display: block;
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.voice-list .line {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--cream);
}

/* signature attack plaque */
.sig-plaque {
  display: flex; align-items: center; gap: 28px;
  background: var(--ink-3);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 30px 34px;
  margin-top: 40px;
  max-width: 640px;
}
@media (max-width: 640px) { .sig-plaque { flex-direction: column; text-align: center; } }
.sig-icon {
  flex: 0 0 92px;
  width: 92px; height: 92px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--ring-ornate);
}
.sig-icon img { width: 100%; height: 100%; object-fit: cover; }
.sig-icon.sig-ward {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #4a2418, var(--harald-dark) 75%);
}
.sig-icon.sig-ward .ward-gem {
  width: 30px; height: 30px;
  transform: rotate(45deg);
  border-radius: 5px;
  background: radial-gradient(circle at 35% 30%, #ff8d75, var(--ruby) 65%);
  box-shadow: 0 0 24px rgba(192,57,43,.85);
}
.sig-body h3 { font-size: 20px; letter-spacing: .1em; margin-bottom: 4px; }
.sig-cost { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--char); display: block; margin-bottom: 10px; }
.sig-body p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* card strip on character pages */
.card-strip {
  display: flex; justify-content: center; gap: 44px;
  margin-top: 60px;
  flex-wrap: wrap;
}

/* prev/next character */
.char-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--divider); }
.char-nav a {
  padding: 44px 32px;
  font-family: var(--font-display);
  letter-spacing: .18em; text-transform: uppercase; font-size: 14px;
  color: var(--text);
  transition: background .3s, color .3s;
}
.char-nav a:hover { background: var(--ink-3); color: var(--gold); }
.char-nav a + a { text-align: right; border-left: 1px solid var(--divider); }
.char-nav small { display: block; font-family: var(--font-body); font-size: 11px; letter-spacing: .3em; color: var(--text-dim); margin-bottom: 8px; }

/* ---------- arenas / battlegrounds ---------- */
.arena-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 54px;
  align-items: stretch;
}
.arena-card {
  margin: 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-3);
}
.arena-still { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.arena-still img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.arena-card:hover .arena-still img { transform: scale(1.04); }
.arena-still::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8,12,20,.85));
}
.arena-body { padding: 22px 26px 26px; }
.arena-name { font-size: 20px; letter-spacing: .1em; margin: 0 0 6px; }
.arena-tag { color: var(--gold); font-size: 13.5px; font-style: italic; margin: 0 0 10px; }
.arena-desc { color: var(--text-dim); font-size: 14px; margin: 0; }
/* the expansion teaser — a battleground not yet on any map */
.arena-uncharted {
  border: 1px dashed #2a3550;
  background: rgba(14, 20, 32, .5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 44px 30px;
  min-height: 280px;
}
.arena-gem {
  width: 18px; height: 18px;
  transform: rotate(45deg);
  border-radius: 4px;
  background: #1c2436;
  box-shadow: 0 0 18px rgba(224,145,63,.25), inset 0 0 6px rgba(224,145,63,.4);
}
.arena-uncharted .arena-name { color: var(--text-dim); letter-spacing: .34em; }
.arena-uncharted .arena-desc { font-style: italic; max-width: 32ch; }

/* ---------- films page ---------- */
.film-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 54px; }
.film-featured { grid-column: 1 / -1; max-width: 900px; width: 100%; justify-self: center; }
.film-featured .film-still { aspect-ratio: 21 / 9; }
.film-link { position: absolute; inset: 0; z-index: 2; }
@media (max-width: 980px) { .film-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
.film-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--divider);
  background: var(--ink-3);
}
.film-still { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.film-still img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: transform .6s, filter .6s; }
.film-card:hover .film-still img { transform: scale(1.04); filter: saturate(1); }
.film-still::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(8,12,20,.9));
}
.film-ribbon {
  position: absolute; top: 14px; left: 14px;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--cream);
  background: rgba(8,12,20,.85);
  border: 1px solid var(--bronze-2);
  padding: 6px 12px;
  border-radius: 3px;
}
.film-body { padding: 22px 24px 26px; }
.film-body h3 { font-size: 19px; letter-spacing: .08em; margin-bottom: 8px; }
.film-body p { margin: 0; font-size: 14px; color: var(--text-dim); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--divider);
  background: #060910;
  padding: 70px 0 40px;
  position: relative;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-family: var(--font-wordmark); font-size: 24px; letter-spacing: .2em; color: var(--cream); }
.footer-tag { color: var(--text-dim); font-size: 14px; margin-top: 12px; max-width: 34ch; }
.site-footer h4 {
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 18px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer ul a { color: var(--text-dim); font-size: 14px; }
.site-footer ul a:hover { color: var(--cream); }
.footer-soon { color: var(--text-dim); font-size: 14px; }
.footer-soon b { color: var(--text); font-weight: 500; }
.footer-legal {
  margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #5c6a7c; font-size: 12.5px;
}

/* ============================================================
   THE GATE — invite-alpha access (all nodes rendered by js/access.js;
   html gets .gate-locked / .gate-open in invite mode)
   ============================================================ */

/* skip link (injected by site.js — sits above nav & paper grain) */
.skip-link {
  position: fixed; top: -60px; left: 14px; z-index: 70;
  background: var(--ink-3); color: var(--cream);
  border: 1px solid var(--bronze-2); border-radius: 6px;
  padding: 10px 18px; font-size: 14px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* nav slot: "The Gate" while locked / "Forge" once unlocked */
.nav-links .nav-gate svg { width: 10px; height: 13px; margin-right: 8px; vertical-align: -2px; opacity: .8; }
.nav-links .nav-forge { color: var(--amber); }
.nav-links .nav-forge:hover { color: var(--cream); border-bottom-color: var(--bronze-2); }

/* the sealed Amberstone — the stone sleeps while the gate is locked */
html.gate-locked .play-orb { filter: saturate(.45) brightness(.82); }
html.gate-locked .play-orb:hover,
html.gate-locked .play-orb:focus-visible { filter: saturate(.8) brightness(.95); }
html.gate-locked .nav-play { filter: saturate(.6) drop-shadow(0 0 9px rgba(212,168,67,.25)); }

/* ---- the gate dialog (native <dialog>, top layer) ---- */
.gate-dialog {
  border: 0; padding: 0; margin: auto;
  background: transparent;
  width: min(460px, calc(100vw - 36px));
  filter: drop-shadow(0 30px 80px rgba(0,0,0,.75)) drop-shadow(0 0 46px rgba(224,145,63,.14));
}
.gate-dialog::backdrop { background: rgba(4, 6, 10, .78); }
body:has(.gate-dialog[open]) { overflow: hidden; }

/* panel: bronze bezel + ink fill, chamfered like the Amberstone's emerald cut */
.gate-panel {
  position: relative;
  padding: 44px 38px 34px;
  text-align: center;
  background: linear-gradient(180deg, #d8b055 0%, var(--bronze-2) 12%, #7a622f 45%, var(--bronze-1) 60%, #3d3118 100%);
  clip-path: polygon(
    16px 0, calc(100% - 16px) 0, 100% 16px,
    100% calc(100% - 16px), calc(100% - 16px) 100%,
    16px 100%, 0 calc(100% - 16px), 0 16px);
}
.gate-panel::before {
  content: '';
  position: absolute; inset: 1px;
  background:
    radial-gradient(ellipse 90% 58% at 50% 0%, rgba(224,145,63,.10), transparent 62%),
    linear-gradient(180deg, var(--ink-3), var(--ink-2));
  clip-path: polygon(
    15px 0, calc(100% - 15px) 0, 100% 15px,
    100% calc(100% - 15px), calc(100% - 15px) 100%,
    15px 100%, 0 calc(100% - 15px), 0 15px);
}
/* the same paper grain the site body wears */
.gate-panel::after {
  content: '';
  position: absolute; inset: 1px; z-index: 2;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
.gate-panel > * { position: relative; z-index: 1; }
@media (max-width: 480px) { .gate-panel { padding: 38px 22px 30px; } }

.gate-close {
  position: absolute; top: 8px; right: 10px; z-index: 3;
  background: none; border: 0; cursor: pointer;
  color: var(--text-dim); font-size: 22px; line-height: 1; padding: 10px;
}
.gate-close:hover { color: var(--cream); }

.gate-title { font-size: 25px; letter-spacing: .07em; margin: 4px 0 10px; }
.gate-body { color: var(--text-dim); font-size: 14.5px; max-width: 40ch; margin: 0 auto; }

.gate-form { margin: 24px auto 0; max-width: 300px; display: grid; gap: 12px; justify-items: center; }
.gate-input {
  width: 100%;
  background: rgba(5, 8, 13, .85);
  border: 1px solid var(--divider); border-radius: 4px;
  color: var(--cream);
  font-family: var(--font-display); font-weight: 600;
  font-size: 15px; letter-spacing: .18em; text-transform: uppercase; text-align: center;
  padding: 13px 12px;
}
.gate-input::placeholder { color: #7d8fa4; }
.gate-error { min-height: 18px; margin: 0; font-size: 13px; color: #e29387; }
html.anim .gate-error.shaking { animation: gate-shake .38s ease-out; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* gold key button — the nav pill's emerald cut */
.gate-key-btn {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: .22em; text-indent: .22em; text-transform: uppercase;
  color: #1a1206;
  background: linear-gradient(180deg, #e8bd5c, var(--bronze-2));
  border: 0; cursor: pointer; padding: 12px 34px;
  clip-path: polygon(
    9px 0, calc(100% - 9px) 0, 100% 9px,
    100% calc(100% - 9px), calc(100% - 9px) 100%,
    9px 100%, 0 calc(100% - 9px), 0 9px);
  box-shadow: inset 0 1px 0 rgba(255,240,200,.55), inset 0 -1px 0 rgba(46,18,2,.4);
  transition: filter .25s, transform .25s;
}
.gate-key-btn:hover, .gate-key-btn:focus-visible { filter: drop-shadow(0 0 10px rgba(224,145,63,.55)); transform: translateY(-1px); }

.gate-foot { margin: 22px 0 0; font-size: 12.5px; color: #7d8fa4; }
.gate-return, .footer-gate {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--gold);
}
.gate-return:hover, .footer-gate:hover { color: var(--cream); }

/* unlocked view: what the key opens */
.gate-rows { display: grid; gap: 10px; margin: 24px 0 4px; text-align: left; }
.gate-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 13px 17px;
  border: 1px solid var(--divider); border-radius: 6px;
  background: rgba(8, 12, 19, .55);
}
a.gate-row { border-color: rgba(185, 146, 63, .4); transition: border-color .2s, background .2s, transform .2s; }
a.gate-row:hover { border-color: var(--bronze-2); background: rgba(18, 24, 35, .7); transform: translateX(2px); }
.gate-row .t { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
a.gate-row:hover .t { color: var(--cream); }
.gate-row .s { font-size: 12.5px; color: var(--text-dim); text-align: right; }
.gate-row.sealed .t { color: #7d8fa4; }
.gate-tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); white-space: nowrap; }

html.anim .gate-panel.opened { animation: gate-bloom .8s ease-out; }
@keyframes gate-bloom {
  0% { transform: scale(.985); }
  40% { transform: scale(1.006); }
  100% { transform: scale(1); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html.anim .rise, html.anim .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  html.anim .hero-bg, html.anim .play-orb, html.anim .scroll-cue, html.anim .ff { animation: none !important; }
  html.anim .ff { opacity: .5; }
  html.anim .gate-error.shaking, html.anim .gate-panel.opened { animation: none !important; }
  html { scroll-behavior: auto; }
}
