/* ============================================================================
   ELDER REALM — marketing site design system
   Dark-fantasy, gold, cinematic. Shared by every page.
   ========================================================================== */

:root {
  /* palette */
  --ink:        #0b0910;
  --ink-2:      #110d18;
  --panel:      #171120;
  --panel-2:    #1e1729;
  --line:       #2c2438;
  --line-gold:  rgba(202,162,74,0.28);
  --gold:       #caa24a;
  --gold-lt:    #e6cf8f;
  --gold-deep:  #9c7a2f;
  --parch:      #ece6d6;
  --text:       #d8d2e4;
  --muted:      #9a8fb0;
  --muted-2:    #6f6684;
  --crimson:    #9a2f33;
  --crimson-lt: #c8484c;
  --arcane:     #7d5cc0;
  --arcane-lt:  #a78be6;
  --emerald:    #3f9e6e;

  /* type */
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body:    "Spectral", "EB Garamond", Georgia, serif;
  --sans:    ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  /* metrics */
  --maxw: 1180px;
  --nav-h: 68px;
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --shadow: 0 24px 60px rgba(0,0,0,0.55);
  --glow: 0 0 28px rgba(202,162,74,0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ambient backdrop: deep radial glow + faint grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 700px at 50% -10%, rgba(202,162,74,0.10), transparent 60%),
    radial-gradient(900px 600px at 85% 12%, rgba(125,92,192,0.08), transparent 55%),
    radial-gradient(700px 500px at 8% 80%, rgba(154,47,51,0.06), transparent 60%),
    linear-gradient(180deg, #0b0910, #08060c 60%, #0b0910);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: 0.035; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; color: var(--parch); margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
p  { margin: 0 0 1.1em; color: var(--text); }
a  { color: var(--gold-lt); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }
strong { color: var(--parch); font-weight: 600; }
.gold { color: var(--gold); }
.parch { color: var(--parch); }
.muted { color: var(--muted); }
.eyebrow {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 1rem; display: inline-block;
}
.gold-text {
  background: linear-gradient(180deg, var(--gold-lt), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.1rem, 1.7vw, 1.4rem); color: var(--parch); opacity: 0.92; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 10vw, 132px) 0; position: relative; }
.section--tight { padding: clamp(44px, 6vw, 80px) 0; }
.center { text-align: center; }
.narrow { max-width: 760px; margin-inline: auto; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ornamental divider */
.rule { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 28px; color: var(--gold); }
.rule::before, .rule::after { content: ""; height: 1px; width: min(160px, 22vw); background: linear-gradient(90deg, transparent, var(--line-gold), transparent); }
.rule svg { width: 22px; height: 22px; opacity: 0.9; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-lt), var(--gold) 60%, var(--gold-deep));
  color: #20180a; box-shadow: var(--glow);
}
.btn-gold:hover { color: #20180a; box-shadow: 0 0 38px rgba(202,162,74,0.45); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-gold); color: var(--gold-lt); background: rgba(202,162,74,0.04); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(202,162,74,0.10); }
.btn-lg { padding: 16px 34px; font-size: 1.02rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(8,6,12,0.86), rgba(8,6,12,0.5));
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(8,6,12,0.94); }
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 1.18rem; color: var(--parch); letter-spacing: 0.06em; }
.brand .sigil { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-family: var(--sans); font-size: 0.92rem; }
.nav-links a { color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.nav-links a:hover, .nav-links a.active { color: var(--parch); }
.nav-toggle { display: none; background: none; border: 0; color: var(--parch); cursor: pointer; }
@media (max-width: 860px) {
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0; padding: 8px 0 16px;
    background: rgba(10,8,14,0.98); border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .3s; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 24px; width: 100%; }
  .nav-links .btn { margin: 10px 24px; justify-content: center; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 18%, transparent 30%, rgba(8,6,12,0.62) 78%, var(--ink) 100%),
    linear-gradient(180deg, rgba(8,6,12,0.55), rgba(8,6,12,0.30) 38%, rgba(8,6,12,0.86) 92%, var(--ink));
}
.hero-inner { padding: calc(var(--nav-h) + 4vh) 0 8vh; }
.hero h1 { margin-bottom: 0.2em; text-shadow: 0 4px 40px rgba(0,0,0,0.6); }
.hero .lead { max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-scroll { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--muted); font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; opacity: 0.8; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,8px);} }

/* ---------- stat band ---------- */
.statband { border-block: 1px solid var(--line); background: linear-gradient(180deg, rgba(202,162,74,0.04), transparent); }
.stat { text-align: center; padding: 8px; }
.stat .num { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; }
.stat .lbl { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--r); padding: 28px;
  position: relative; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, var(--line-gold), transparent 40%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .25s; }
.card:hover { transform: translateY(-5px); border-color: var(--line-gold); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card .ico { width: 46px; height: 46px; color: var(--gold); margin-bottom: 14px; }
.card h3 { color: var(--parch); margin-bottom: 0.4em; }
.card p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* feature row (alternating media + text) */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.feature + .feature { margin-top: clamp(48px, 8vw, 110px); }
.feature.rev .feature-media { order: 2; }
.feature-media { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; aspect-ratio: 16/10; background: var(--panel); }
.feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; background: radial-gradient(circle at 50% 40%, rgba(202,162,74,0.08), transparent 70%); }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } .feature.rev .feature-media { order: 0; } }

/* list with gold ticks */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 7px 0 7px 30px; color: var(--text); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 14px; width: 14px; height: 14px;
  background: var(--gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }

/* pill / tag chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { font-family: var(--sans); font-size: 0.82rem; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--muted); }
.chip.gold { border-color: var(--line-gold); color: var(--gold-lt); }

/* quote / banner */
.banner { border: 1px solid var(--line-gold); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(202,162,74,0.07), rgba(202,162,74,0.02)); padding: clamp(28px, 5vw, 56px); }

/* ---------- beta / cta form ---------- */
.cta { text-align: center; }
.beta-form { display: flex; gap: 10px; max-width: 480px; margin: 22px auto 10px; }
.beta-form input { flex: 1; padding: 14px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,0.35); color: var(--parch); font-family: var(--body); font-size: 1rem; }
.beta-form input:focus { outline: none; border-color: var(--gold); box-shadow: var(--glow); }
.beta-msg { min-height: 22px; font-family: var(--sans); font-size: 0.88rem; color: var(--gold-lt); }
@media (max-width: 520px) { .beta-form { flex-direction: column; border-radius: var(--r); } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); padding: 56px 0 40px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer a { display: block; color: var(--muted); font-size: 0.95rem; padding: 5px 0; }
.footer a:hover { color: var(--parch); }
.footer .legal { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: 0.85rem; font-family: var(--sans); }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ember canvas */
#embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.6; }

/* ---------- sub-page hero ---------- */
.subhero { padding: calc(var(--nav-h) + 8vh) 0 clamp(36px, 6vw, 64px); text-align: center; position: relative;
  border-bottom: 1px solid var(--line); background: radial-gradient(900px 440px at 50% -12%, rgba(202,162,74,0.12), transparent 60%); }
.subhero h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); margin-bottom: 0.25em; }
.subhero .lead { max-width: 720px; margin-inline: auto; }

/* big counter grid */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.statgrid .stat { background: var(--ink-2); padding: 26px 14px; margin: 0; }
.statgrid .stat .num { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }

/* labelled definition blocks */
.deflist { display: grid; gap: 14px; }
.def { border-left: 2px solid var(--line-gold); padding: 4px 0 4px 18px; }
.def h4 { font-family: var(--display); color: var(--gold-lt); margin: 0 0 4px; font-size: 1.15rem; }
.def p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* section heading helper */
.shead { text-align: center; max-width: 720px; margin: 0 auto clamp(34px, 5vw, 56px); }

/* races poster showcase */
.poster-frame { max-width: 600px; margin: 0 auto; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-gold); box-shadow: var(--shadow); }
.poster-frame img { width: 100%; display: block; }

/* cinematic landscape shot (product card / map) */
.cardshot { width: 100%; max-width: 940px; margin: 0 auto; display: block; border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }

/* split: a figure beside copy */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.split-fig { display: flex; justify-content: center; }
.split-fig img { width: 100%; max-width: 440px; filter: drop-shadow(0 18px 44px rgba(125,92,192,0.42)); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split-fig { order: -1; } .split-fig img { max-width: 300px; } }

/* race-compendium gallery cards */
.race-card { margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel); transition: transform .25s, border-color .25s, box-shadow .25s; }
.race-card:hover { transform: translateY(-4px); border-color: var(--line-gold); box-shadow: var(--shadow); }
.race-card img { width: 100%; display: block; aspect-ratio: 3/4; object-fit: cover; }
.race-card figcaption { padding: 10px 12px; font-family: var(--display); color: var(--gold-lt); font-size: 0.95rem; text-align: center; }
