/* Aether Nations — official site. One small stylesheet, system fonts (no font download, no
   layout shift), dark by design with a light scheme for people who ask for one. */

:root {
  color-scheme: dark light;
  --bg: #0f1219;
  --bg-2: #151a25;
  --panel: #1b2130;
  --panel-2: #232a3c;
  --line: #2c3448;
  --text: #eef1f7;
  --muted: #a9b1c4;
  --water: #4aa3df;
  --earth: #6fa24a;
  --fire: #d9523a;
  --air: #e8b84a;
  --accent: var(--water);
  --focus: #9fd2ff;
  --radius: 16px;
  --wrap: 1120px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, sans-serif;
  --display: ui-serif, 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4ef;
    --bg-2: #ece8df;
    --panel: #ffffff;
    --panel-2: #f1ede4;
    --line: #d9d3c6;
    --text: #1a1d26;
    --muted: #4e5566;
    --focus: #1b64b0;
    /* Element colors darkened so text in them keeps 4.5:1 on the light background. */
    --water: #1f6698;
    --earth: #3f6b22;
    --fire: #a8341f;
    --air: #7d5608;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.6 var(--font); }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--panel); color: var(--text); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Header ─────────────────────────────────────────────── */
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: 0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); background: var(--panel); }
.site-nav .cta { color: #0b0e14; background: #4aa3df; }
.site-nav .cta:hover { color: #0b0e14; background: #6bb8ea; }
@media (max-width: 820px) {
  .site-nav li:not(.keep) { display: none; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border: 0; border-radius: 14px; font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: #4aa3df; color: #0b0e14; }
.btn-primary:hover { background: #6bb8ea; }
.btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--panel-2); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; overflow: clip; padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); background:
  radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, var(--water) 22%, transparent), transparent 70%),
  radial-gradient(50% 50% at 90% 20%, color-mix(in srgb, var(--fire) 18%, transparent), transparent 70%),
  radial-gradient(60% 60% at 70% 100%, color-mix(in srgb, var(--earth) 16%, transparent), transparent 70%),
  radial-gradient(40% 40% at 10% 100%, color-mix(in srgb, var(--air) 14%, transparent), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.eyebrow { display: inline-block; margin-bottom: 14px; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 4.6rem); }
.hero .lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 36ch; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: center; width: 100%; }
.hero-art svg { width: 100%; height: 100%; }
.hero-art .ring { transform-origin: 50% 50%; animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 24px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.facts li::before { content: '◆'; margin-right: 8px; color: var(--air); font-size: 0.7em; vertical-align: 0.15em; }
/* A real screenshot in a phone frame. */
.hero-shot { margin: 0; justify-self: center; width: 320px; max-width: 100%; padding: 10px; border-radius: 36px; background: #0b0e14; border: 2px solid #2c3448; box-shadow: 0 30px 80px rgb(0 0 0 / 0.45), 0 0 0 8px color-mix(in srgb, var(--water) 10%, transparent); rotate: 2deg; }
.hero-shot img { width: 100%; height: auto; border-radius: 26px; }
@media (max-width: 820px) {
  .hero-shot { width: 260px; rotate: 0deg; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 260px; }
}

/* ── Sections ───────────────────────────────────────────── */
.section { padding: clamp(56px, 8vw, 104px) 0; content-visibility: auto; contain-intrinsic-size: auto 900px; }
.section.alt { background: var(--bg-2); }
.section-head { max-width: 64ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.kicker { display: block; margin-bottom: 8px; color: var(--air); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.card { padding: 24px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .num { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 10px; background: var(--panel-2); color: var(--air); font-weight: 800; }

/* Lore: a timeline of four beats */
.timeline { position: relative; display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: beat; }
.timeline li { position: relative; padding: 4px 0 4px 56px; }
.timeline li::before { counter-increment: beat; content: counter(beat, upper-roman); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--air); font: 700 0.95rem var(--display); }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 46px; bottom: -18px; width: 2px; background: var(--line); }
.timeline h3 { font-family: var(--display); font-size: 1.35rem; }
.timeline p { color: var(--muted); max-width: 62ch; }
.lore { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.lore blockquote { margin: 0; padding: 28px; border-radius: var(--radius); background: var(--panel); border-left: 4px solid var(--air); font: italic 1.3rem/1.5 var(--display); }
.lore blockquote footer { margin-top: 12px; color: var(--muted); font: 600 0.95rem var(--font); font-style: normal; }
@media (max-width: 820px) { .lore { grid-template-columns: 1fr; } }

/* Nations */
.nation { --accent: var(--water); border-top: 4px solid var(--accent); }
.nation[data-element='earth'] { --accent: var(--earth); }
.nation[data-element='fire'] { --accent: var(--fire); }
.nation[data-element='air'] { --accent: var(--air); }
.nation .sigil { width: 48px; height: 48px; margin-bottom: 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); display: grid; place-items: center; color: var(--accent); }
.nation .sigil svg { width: 28px; height: 28px; }
.nation .tag { color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.nation ul { margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.95rem; }
.nation li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); }
.nation li strong { color: var(--text); }

/* Gameplay */
.board-demo { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: min(100%, 300px); padding: 10px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.board-demo span { aspect-ratio: 1; border-radius: 4px; background: var(--panel-2); }
.board-demo .s { background: color-mix(in srgb, var(--fire) 45%, var(--panel-2)); }
.board-demo .b { background: color-mix(in srgb, var(--water) 55%, var(--panel-2)); }
.board-demo .w { background: #8b8fa0; }
.board-demo .t { background: var(--air); border-radius: 50%; }
.board-demo .p { background: color-mix(in srgb, var(--fire) 22%, var(--panel-2)); }
.mechanics { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
@media (max-width: 820px) { .mechanics { grid-template-columns: 1fr; } .board-demo { justify-self: center; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }

/* Modes */
.mode .badge { display: inline-block; margin-bottom: 10px; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; background: var(--panel-2); color: var(--muted); }

/* YouTube Playables */
.playables { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: clamp(24px, 4vw, 40px); border-radius: calc(var(--radius) + 8px); background: linear-gradient(135deg, color-mix(in srgb, #ff0033 18%, var(--panel)), var(--panel)); border: 1px solid var(--line); }
.playables .yt { width: 96px; height: 68px; }
.soon { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: #cc0029; color: #fff; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 640px) { .playables { grid-template-columns: 1fr; } }

/* Demo teaser */
.demo-cta { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: center; }
.demo-cta ul { margin: 0 0 24px; padding: 0; list-style: none; }
.demo-cta li { padding: 10px 0 10px 32px; border-bottom: 1px solid var(--line); position: relative; }
.demo-cta li::before { content: '✓'; position: absolute; left: 4px; color: var(--earth); font-weight: 800; }
@media (max-width: 820px) { .demo-cta { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────────── */
.site-foot { padding: 40px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-foot ul { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; }
.site-foot a { color: var(--muted); }

/* ── Forms (demo page) ─────────────────────────────────── */
.form { display: grid; gap: 14px; max-width: 480px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; }
.field input[type='email'] { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.field input[type='email']:invalid:not(:placeholder-shown) { border-color: var(--fire); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; color: var(--muted); }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--water); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { font-size: 0.9rem; color: var(--muted); }
.status { min-height: 1.6em; font-weight: 600; }
.status.error { color: #ff8a73; }
.status.ok { color: var(--earth); }
