/* ============================================================
   AETHERDOME — shared site theme
   One design system for the whole onboarding portal, matched to
   the in-game visual overhaul: Cinzel display type, bronze painted
   frames (the game's own modal_frame.png as border-image), warm
   parchment-on-ink palette. No per-page theme drift.
   ============================================================ */

@font-face {
  font-family: 'Cinzel';
  src: url('/assets/fonts/Cinzel.ttf') format('truetype');
  font-weight: 400 900;
  font-display: swap;
}
/* Readable body serif to sit under Cinzel for long copy. */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  color-scheme: dark;

  /* --- palette (from the game's PaintedButtons / bronze-gate art) --- */
  --ink:        #0B0A07;   /* warm near-black page field */
  --ink-2:      #12100B;   /* raised field */
  --panel:      #1A140C;   /* parchment-dark panel fill */
  --panel-2:    #221A0F;   /* hover / inset */
  --line:       rgba(201,162,75,0.22); /* hairline bronze */

  --parchment:  #EBDBB3;   /* primary text */
  --parchment-dim: #C9BB99;
  --muted:      #A2916E;   /* warm muted (replaces old cold grays) */

  --gold:       #D8AE5C;   /* primary accent */
  --gold-bright:#F2C879;   /* highlight */
  --bronze:     #AD945C;
  --bronze-deep:#6E5A2E;
  --ember:      #E8912F;   /* the glowing-seam ember from the gate art */

  --danger:     #C4443A;

  --maxw: 1180px;
  --frame-slice: 52;
  --radius: 10px;

  --shadow-lift: 0 10px 40px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(232,145,47,0.10), transparent 60%),
    linear-gradient(180deg, #0D0B07 0%, var(--ink) 40%);
  background-attachment: fixed;
  color: var(--parchment);
  min-height: 100vh;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .display, .brand, .btn, nav a, .kicker, th {
  font-family: 'Cinzel', 'Times New Roman', serif;
  letter-spacing: 0.04em;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 4vw; }
.section { padding: 5rem 0; }
.section-lead { max-width: 640px; color: var(--parchment-dim); margin: 0.6rem 0 2.6rem; }

.kicker {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ember); margin-bottom: 0.7rem;
}
.accent { color: var(--gold); }
h2.display { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 700; color: var(--parchment); }
h2.display .accent { color: var(--gold); }

/* ============================================================
   NAV  (rendered by site.js into <div id="nav-root">)
   ============================================================ */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding: 0.9rem 4vw;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(11,10,7,0.96) 0%, rgba(11,10,7,0.72) 72%, rgba(11,10,7,0) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topnav.scrolled { border-bottom-color: var(--line); }
.topnav .brand {
  font-weight: 900; letter-spacing: 0.2em; font-size: 1.05rem; color: var(--parchment);
}
.topnav .brand .accent { color: var(--gold); }
.topnav nav { display: flex; gap: 0.4rem; align-items: center; }
.topnav nav a {
  color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em;
  padding: 0.45rem 0.7rem; border-radius: 5px; transition: color .12s, background .12s;
  text-transform: uppercase;
}
.topnav nav a:hover, .topnav nav a.active { color: var(--parchment); background: rgba(216,174,92,0.08); }
.nav-toggle { display: none; }

/* ============================================================
   BUTTONS  (bronze/gold — the game's "primary" paint, never red)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.8rem; border-radius: 8px; border: 1px solid var(--bronze-deep);
  font-size: 0.98rem; font-weight: 700; letter-spacing: 0.08em; cursor: pointer;
  transition: transform .1s, box-shadow .15s, filter .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 45%, #B98A34 100%);
  color: #2A1D08; border-color: #7A5E22;
  box-shadow: 0 6px 22px rgba(216,174,92,0.28), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px rgba(216,174,92,0.42); }
.btn-ghost {
  background: rgba(26,20,12,0.7); color: var(--parchment); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.nav .btn-primary { padding: 0.5rem 1.15rem; font-size: 0.82rem; }

/* ============================================================
   FRAMED PANEL  (the game's own bronze modal frame, 9-sliced)
   ============================================================ */
.framed {
  position: relative;
  background:
    linear-gradient(180deg, rgba(34,26,15,0.94), rgba(16,12,7,0.96));
  border: 22px solid transparent;
  border-image: url('/assets/frames/modal_frame.png') 52 fill stretch;
  border-image-outset: 0;
}
/* Lighter hairline card for dense grids where the full frame is too heavy. */
.card {
  background: linear-gradient(180deg, var(--panel), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; transition: border-color .15s, transform .1s, box-shadow .15s;
}
.card:hover { border-color: rgba(216,174,92,0.5); box-shadow: var(--shadow-lift); }
.card h3 { color: var(--gold); font-size: 1.15rem; margin-bottom: 0.5rem; }

.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 92vh; width: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 7rem 4vw 4rem; overflow: hidden; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url('/assets/menu_backdrop.png') center 30% / cover no-repeat;
  filter: brightness(0.5) contrast(1.05);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center 40%, transparent 0%, rgba(11,10,7,0.35) 55%, rgba(11,10,7,0.92) 100%),
    linear-gradient(180deg, rgba(11,10,7,0.55) 0%, transparent 30%, var(--ink) 100%);
}
.hero h1 {
  font-size: clamp(3rem, 9vw, 6.4rem); font-weight: 900; letter-spacing: 0.16em;
  color: var(--parchment); line-height: 0.98;
  text-shadow: 0 4px 30px rgba(0,0,0,0.85), 0 0 60px rgba(232,145,47,0.22);
}
.hero h1 .accent { color: var(--gold); }
.hero .tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem); color: var(--parchment-dim);
  font-style: italic; letter-spacing: 0.04em; max-width: 640px; margin: 1rem auto 1.4rem;
}
.hero .meta {
  display: inline-flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center;
  font-size: 0.82rem; letter-spacing: 0.08em; color: var(--muted);
  padding: 0.5rem 1.2rem; margin-bottom: 2rem; border-radius: 999px;
  background: rgba(11,10,7,0.55); border: 1px solid var(--line);
}
.hero .meta strong { color: var(--gold); font-weight: 700; font-family: 'Cinzel', serif; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   STAT STRIP / LADDER / TABLES
   ============================================================ */
.stat-row { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .n { font-family: 'Cinzel', serif; font-size: 2.4rem; font-weight: 700; color: var(--gold); }
.stat .l { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

table.ladder { width: 100%; border-collapse: collapse; }
table.ladder th { text-align: left; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
table.ladder td { padding: 0.55rem 0.6rem; border-bottom: 1px solid rgba(201,162,75,0.10); }
table.ladder td.rank { color: var(--gold); font-family: 'Cinzel', serif; width: 3rem; }
table.ladder td.rating { text-align: right; color: var(--parchment-dim); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 4rem; margin-top: 2rem; color: var(--muted); }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 2rem 3rem; justify-content: space-between; }
.site-footer a { color: var(--muted); font-size: 0.9rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.site-footer .legal { margin-top: 1.6rem; font-size: 0.78rem; color: #6a5f47; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .topnav nav { display: none; position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 4vw 1rem;
    background: rgba(11,10,7,0.98); border-bottom: 1px solid var(--line); }
  .topnav nav.open { display: flex; }
  .topnav nav a { padding: 0.8rem 0.6rem; }
  .nav-toggle { display: inline-flex; background: none; border: 1px solid var(--line);
    color: var(--parchment); border-radius: 6px; padding: 0.4rem 0.7rem; cursor: pointer; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  body { font-size: 17px; }
}
