/* Aetherfall website — one stylesheet, no build step.
 *
 * Palette follows the game's visual direction (GDD Ch 10 §8): brass,
 * copper and oilskin on near-black; Aether-blue is safe, sanctioned light
 * (links, primary actions); Aether-green is corruption (warnings, the
 * Wastelands). Dark only, by design. */

:root {
  --ink-0: #07080a;      /* deepest */
  --ink-1: #0b0d10;      /* page */
  --ink-2: #12151a;      /* raised */
  --ink-3: #1a1e25;      /* card */
  --line: #2a2f38;
  --line-brass: #5b4529;

  --text: #e6e0d4;       /* parchment */
  --text-dim: #a8a194;
  --text-faint: #7a7469;

  --brass: #c89b5a;
  --brass-bright: #e6be7e;
  --copper: #b06a43;
  --aether: #6cc7ee;     /* lamp-light */
  --aether-bright: #b9ecff;
  --blight: #8fd14f;     /* corruption */
  --blood: #d0614f;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 4px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ink-1);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108, 199, 238, .10), transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(143, 209, 79, .06), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.65 var(--serif);
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; }

a { color: var(--aether); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--aether-bright); }
:focus-visible { outline: 2px solid var(--aether); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
strong { color: #f3ecdf; }
hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-brass), transparent); margin: 3rem 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink-3); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Small-caps label above headings */
.eyebrow {
  display: inline-block;
  font: 600 .78rem/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1rem;
}
.lede { font-size: 1.2rem; color: var(--text-dim); max-width: 46rem; }
.dim { color: var(--text-dim); }
.blight { color: var(--blight); }
.aether { color: var(--aether); }

/* ------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 16, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font: 600 1.25rem/1 var(--serif); letter-spacing: .12em; text-transform: uppercase; }
.brand:hover { color: var(--brass-bright); }
.site-nav { display: flex; align-items: center; gap: 1.6rem; font: 500 .95rem/1 var(--sans); }
.site-nav a { color: var(--text-dim); text-decoration: none; padding: .4rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brass); }
.nav-account { display: flex; align-items: center; gap: 1.2rem; padding-left: 1.4rem; border-left: 1px solid var(--line); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 44px; height: 40px; cursor: pointer; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 18px; height: 2px; background: var(--text); margin: 0 auto; position: relative; content: ""; }
.nav-toggle .bars::before { position: absolute; top: -6px; }
.nav-toggle .bars::after { position: absolute; top: 6px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-1); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { box-shadow: none; color: var(--brass-bright); }
  .nav-account { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: 0; }
  .nav-account .btn { margin-top: 1rem; text-align: center; }
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-block;
  font: 600 .95rem/1 var(--sans);
  letter-spacing: .04em;
  padding: .9rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--brass);
  background: linear-gradient(180deg, #d9ae6c, #a97b3e);
  color: #1a120a !important;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 6px 24px -10px rgba(200, 155, 90, .6);
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-small { padding: .55rem .95rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--brass-bright) !important; box-shadow: none; }
.btn-ghost:hover { background: rgba(200, 155, 90, .08); filter: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: clamp(5rem, 14vw, 10rem) 0 clamp(4rem, 10vw, 7rem);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero::before { /* the lamp's halo */
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 38%; width: min(900px, 140vw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(108,199,238,.20) 0%, rgba(108,199,238,.06) 35%, transparent 65%);
  animation: flicker 7s ease-in-out infinite;
}
.hero::after { /* fog at the hem */
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 40%;
  background: linear-gradient(180deg, transparent, var(--ink-1));
}
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .82; } 45% { opacity: .95; } 47% { opacity: .78; } 60% { opacity: .93; } }
.hero-lamp { display: block; width: 84px; margin: 0 auto 1.5rem; filter: drop-shadow(0 0 24px rgba(108,199,238,.55)); }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6rem); letter-spacing: .14em; text-transform: uppercase; margin-bottom: .25em; color: #f4efe4; text-shadow: 0 2px 30px rgba(108,199,238,.25); }
.hero .tagline { font-style: italic; font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--brass-bright); margin-bottom: 1.5rem; }
.hero .lede { margin: 0 auto 2.2rem; }
.hero .btn-row { justify-content: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 .75rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--blight); border: 1px solid rgba(143,209,79,.35); background: rgba(143,209,79,.06);
  padding: .45rem .8rem; border-radius: 999px; margin-bottom: 2rem;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blight); box-shadow: 0 0 8px var(--blight); }

/* Page header for inner pages */
.page-head { padding: clamp(3.5rem, 9vw, 6rem) 0 2.5rem; border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.page-head h1 { margin-bottom: .3em; }

/* ------------------------------------------------------------ sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: 2.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.4rem;
}
.card::before { /* brass rule on top */
  content: ""; position: absolute; left: 1.6rem; right: 1.6rem; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.card h3 { color: #f3ecdf; }
.card p:last-child { margin-bottom: 0; }
.card .num { font: 600 .8rem/1 var(--sans); letter-spacing: .2em; color: var(--brass); display: block; margin-bottom: .9rem; }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--line-brass); transform: translateY(-2px); }

/* Brand cards: one accent per Brand, set inline as --accent */
.brand-card { border-top: 2px solid var(--accent, var(--brass)); }
.brand-card::before { display: none; }
.brand-card .role { font: 600 .75rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent, var(--brass)); }
.brand-card h3 { margin: .6rem 0 .5rem; font-size: 1.4rem; }

/* Split: text beside a panel */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* Quote */
.quote { border-left: 2px solid var(--brass); padding: .4rem 0 .4rem 1.4rem; margin: 2rem 0; font-style: italic; font-size: 1.2rem; color: var(--brass-bright); }
.quote cite { display: block; font: normal .85rem/1.4 var(--sans); color: var(--text-faint); margin-top: .6rem; }

/* Definition list used for fact sheets */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1.5rem; margin: 0; }
.facts dt { font: 600 .78rem/1.9 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.facts dd { margin: 0; color: var(--text-dim); }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: .2rem; } .facts dd { margin-bottom: .8rem; } }

/* Lit / Wastes duality strip */
.duality { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.duality > div { padding: 2rem; }
.duality .lit { background: radial-gradient(ellipse at 20% 0%, rgba(108,199,238,.14), transparent 70%), var(--ink-2); }
.duality .wastes { background: radial-gradient(ellipse at 80% 100%, rgba(143,209,79,.12), transparent 70%), var(--ink-0); border-left: 1px solid var(--line); }
.duality .lit h3 { color: var(--aether-bright); }
.duality .wastes h3 { color: var(--blight); }

/* Prose pages (world, combat, news posts) */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; color: var(--brass-bright); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose code { font-size: .88em; background: var(--ink-3); padding: .1em .35em; border-radius: 3px; }
.prose img { border: 1px solid var(--line); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0 0 1.5em; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 .75rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.table-scroll { overflow-x: auto; }

/* --------------------------------------------------------------- forms */
.form-card { max-width: 440px; margin: 0 auto; }
.form-card h1 { font-size: 2rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font: 600 .8rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: .4rem; }
.field input {
  width: 100%; font: 1rem/1.4 var(--sans); color: var(--text);
  background: var(--ink-0); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .85rem;
}
.field input:focus { outline: none; border-color: var(--aether); box-shadow: 0 0 0 3px rgba(108,199,238,.18); }
.field .hint { font: .82rem/1.4 var(--sans); color: var(--text-faint); margin-top: .35rem; }
.form-card .btn { width: 100%; margin-top: .4rem; }
.form-links { font: .9rem/1.6 var(--sans); color: var(--text-dim); margin-top: 1.4rem; text-align: center; }
.notice { font: .92rem/1.5 var(--sans); padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; border: 1px solid; }
.notice[hidden] { display: none; }
.notice.error { color: #f2b3a8; border-color: rgba(208,97,79,.5); background: rgba(208,97,79,.08); }
.notice.ok { color: var(--aether-bright); border-color: rgba(108,199,238,.45); background: rgba(108,199,238,.07); }

/* -------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--ink-0); padding: 2.5rem 0; margin-top: 4rem; font: .9rem/1.6 var(--sans); color: var(--text-faint); }
.footer-row { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: flex; gap: .8rem; align-items: flex-start; }
.footer-brand p { margin: 0; }
.footer-brand strong { font-family: var(--serif); letter-spacing: .1em; text-transform: uppercase; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.footer-nav a { color: var(--text-dim); text-decoration: none; }
.footer-nav a:hover { color: var(--text); }
.footer-note { margin: 0; max-width: 22rem; }
