/* Marchbird: the one stylesheet for every page.
   Colours come from the game's HUD (navy #0d1a40, royal blue, gold trim). Every colour is a token on :root;
   dark mode redefines the tokens (system setting, or data-theme="dark" on <html>). */

:root {
  color-scheme: light;

  /* page */
  --bg: #f4f6fc;
  --bg-soft: #e8edfa;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --line: #d9e0f2;
  --ink: #0d1a40;
  --ink-2: #3c4870;
  --ink-3: #5f6b93;
  --link: #1f4fd1;
  --link-hover: #0d1a40;
  --shadow-a: rgba(13, 26, 64, 0.06);
  --shadow-b: rgba(13, 26, 64, 0.10);

  /* brand */
  --navy: #0d1a40;
  --navy-deep: #08112b;
  --blue: #2f7bff;
  --blue-royal: #2453d6;
  --gold: #ffd23f;
  --gold-deep: #f0b400;
  --gold-ink: #3a2208;
  --white: #ffffff;

  /* the wordmark and the marching-bird mark (body, ink, gold) */
  --wm-a: var(--navy);
  --wm-b: var(--blue-royal);
  --bird: var(--blue);
  --bird-gold: var(--gold-deep);

  /* blue hero bands (the same in both themes: they're the game's backdrop) */
  --hero-from: #3a7cff;
  --hero-mid: #2453d6;
  --hero-to: #142f86;
  --on-hero: #ffffff;
  --on-hero-2: #dde6ff;
  --hero-glass: rgba(255, 255, 255, 0.14);
  --hero-glass-line: rgba(255, 255, 255, 0.28);
  --hero-text-shadow: rgba(8, 17, 43, 0.45);
  --crowd-r0: rgba(8, 17, 43, 0.14);
  --crowd-r1: rgba(8, 17, 43, 0.24);
  --crowd-r2: rgba(8, 17, 43, 0.40);
  --crowd-r3: rgba(8, 17, 43, 0.56);
  --crowd-r4: rgba(8, 17, 43, 0.76);

  /* chips */
  --chip-bg: var(--navy);
  --chip-ink: var(--white);
  --chip-dot: var(--gold);
  --chip-ring: rgba(255, 210, 63, 0.28);

  /* footer */
  --footer-bg: var(--navy);
  --footer-ink: #c9d3f2;
  --footer-ink-2: #8e9bc6;
  --footer-link: #ffffff;
  --footer-line: rgba(255, 255, 255, 0.12);

  --focus: #ffb000;
  --mark: rgba(255, 210, 63, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1230;
    --bg-soft: #101b42;
    --surface: #121d47;
    --surface-2: #16234f;
    --line: #27366c;
    --ink: #eef2ff;
    --ink-2: #bcc6e8;
    --ink-3: #93a0cf;
    --link: #9dbaff;
    --link-hover: #ffffff;
    --shadow-a: rgba(0, 0, 0, 0.25);
    --shadow-b: rgba(0, 0, 0, 0.35);
    --wm-a: #ffffff;
    --wm-b: var(--gold);
    --bird: #5b95ff;
    --bird-gold: var(--gold);
    --chip-bg: var(--gold);
    --chip-ink: var(--gold-ink);
    --chip-dot: var(--navy);
    --chip-ring: rgba(13, 26, 64, 0.18);
    --footer-bg: var(--navy-deep);
    --mark: rgba(255, 210, 63, 0.25);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1230;
  --bg-soft: #101b42;
  --surface: #121d47;
  --surface-2: #16234f;
  --line: #27366c;
  --ink: #eef2ff;
  --ink-2: #bcc6e8;
  --ink-3: #93a0cf;
  --link: #9dbaff;
  --link-hover: #ffffff;
  --shadow-a: rgba(0, 0, 0, 0.25);
  --shadow-b: rgba(0, 0, 0, 0.35);
  --wm-a: #ffffff;
  --wm-b: var(--gold);
  --bird: #5b95ff;
  --bird-gold: var(--gold);
  --chip-bg: var(--gold);
  --chip-ink: var(--gold-ink);
  --chip-dot: var(--navy);
  --chip-ring: rgba(13, 26, 64, 0.18);
  --footer-bg: var(--navy-deep);
  --mark: rgba(255, 210, 63, 0.25);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-weight: 400; letter-spacing: 0.01em; line-height: 1.1; margin: 0; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, 960px); margin-inline: auto; }
.wrap-narrow { width: min(100% - 32px, 720px); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--navy); color: var(--white); padding: 8px 14px; border-radius: 10px; font-weight: 800; text-decoration: none;
}
.skip:focus { top: 12px; color: var(--white); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- header and wordmark ---------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 9px; min-width: 0;
  font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-size: 22px; line-height: 1; letter-spacing: 0.015em;
  color: var(--wm-a); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--wm-a); }
.brand .g { color: var(--wm-b); }
.mark { width: 30px; height: 30px; flex: none; }
.mark .body { fill: var(--bird); }
.mark .gold { fill: var(--bird-gold); }
.mark .ink { fill: var(--wm-a); }
.mark .inks { stroke: var(--wm-a); fill: none; stroke-linecap: round; stroke-linejoin: round; }

.nav { display: flex; gap: 2px; }
.nav a {
  color: var(--ink-2); font-weight: 800; font-size: 15px; text-decoration: none;
  padding: 8px 10px; border-radius: 10px;
}
.nav a:hover { color: var(--ink); background: var(--bg-soft); }
.nav a[aria-current="page"] { color: var(--link); }

/* ---------- home hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, var(--hero-from) 0%, var(--hero-mid) 48%, var(--hero-to) 100%);
  color: var(--on-hero);
  border-bottom: 5px solid var(--gold);
  padding-top: 48px;
}
.hero-grid { display: grid; gap: 28px; align-items: end; }
.hero-text { padding-bottom: 0; }
.hero h1 {
  font-size: clamp(40px, 10.5vw, 68px); line-height: 1.02;
  text-shadow: 0 3px 0 var(--hero-text-shadow);
  max-width: 13ch;
}
.hero h1 .gold { color: var(--gold); display: block; }
.hero .lede { font-size: 19px; line-height: 1.55; color: var(--on-hero-2); max-width: 36ch; margin: 18px 0 0; font-weight: 600; }
.phalanx { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
.phalanx .r0 { fill: var(--crowd-r0); }
.phalanx .r1 { fill: var(--crowd-r1); }
.phalanx .r2 { fill: var(--crowd-r2); }
.phalanx .r3 { fill: var(--crowd-r3); }
.phalanx .r4 { fill: var(--crowd-r4); }
.phalanx .lead { fill: var(--gold); }
@media (min-width: 820px) {
  .hero { padding-top: 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; }
  .hero-text { padding-bottom: 64px; }
  .phalanx { margin: 0 0 0 auto; }
}

/* ---------- sections ---------- */

.section { padding: 48px 0 8px; }
.section-title { font-size: clamp(28px, 6.5vw, 36px); margin-bottom: 18px; }
.eyebrow { font-weight: 800; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }

/* ---------- game cards (home) ---------- */

.games { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.game-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 16px; align-items: center;
  grid-template-areas: "icon title" "text text" "chip chip";
  padding: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 2px var(--shadow-a), 0 10px 28px var(--shadow-b);
  color: inherit; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.game-card:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 1px 2px var(--shadow-a), 0 16px 36px var(--shadow-b); }
.game-card .icon { grid-area: icon; width: 72px; height: 72px; border-radius: 22%; box-shadow: 0 4px 12px var(--shadow-b); }
.game-card h3 { grid-area: title; font-size: 28px; color: var(--ink); }
.game-card p { grid-area: text; margin: 10px 0 12px; color: var(--ink-2); font-size: 17px; line-height: 1.5; }
.game-card .chip { grid-area: chip; justify-self: start; }
.game-card .peek { display: none; grid-area: peek; }

@media (min-width: 720px) {
  .game-card {
    grid-template-columns: 120px minmax(0, 1fr) 210px; gap: 0 26px; padding: 24px 28px; align-items: start;
    grid-template-areas: "icon title peek" "icon text peek" "icon chip peek";
    grid-template-rows: auto auto 1fr;
  }
  .game-card .icon { width: 120px; height: 120px; }
  .game-card h3 { font-size: 32px; margin-top: 6px; }
  .game-card p { margin: 6px 0 14px; max-width: 40ch; }
  .game-card .peek { display: block; position: relative; height: 100%; min-height: 120px; }
  .game-card .peek img {
    position: absolute; top: 4px; width: 92px; border-radius: 12px;
    box-shadow: 0 6px 18px var(--shadow-b); border: 2px solid var(--surface);
  }
  .game-card .peek img:first-child { left: 8px; transform: rotate(-7deg); }
  .game-card .peek img:last-child { right: 8px; top: 12px; transform: rotate(6deg); }
}

/* ---------- chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-ink);
  font-weight: 800; font-size: 13px; line-height: 1.3; letter-spacing: 0.01em;
}
.chip::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--chip-dot); box-shadow: 0 0 0 3px var(--chip-ring);
}
.chip-light { background: var(--white); color: var(--navy); }
.chip-light::before { background: var(--gold-deep); box-shadow: 0 0 0 3px var(--chip-ring); }

/* ---------- game page ---------- */

.game-hero {
  background: radial-gradient(120% 100% at 50% 0%, var(--hero-from) 0%, var(--hero-mid) 50%, var(--hero-to) 100%);
  color: var(--on-hero); text-align: center;
  border-bottom: 5px solid var(--gold);
  padding: 36px 0 34px;
}
.game-hero .icon {
  width: 124px; height: 124px; margin: 0 auto 18px; border-radius: 28px;
  box-shadow: 0 0 0 4px var(--hero-glass-line), 0 14px 30px var(--hero-text-shadow);
}
.game-hero h1 { font-size: clamp(42px, 11vw, 64px); text-shadow: 0 3px 0 var(--hero-text-shadow); }
.game-hero .subtitle {
  font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-size: clamp(20px, 5.4vw, 26px); line-height: 1.2;
  color: var(--gold); margin: 8px 0 18px; text-shadow: 0 2px 0 var(--hero-text-shadow);
}
.facts { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.facts li {
  background: var(--hero-glass); border: 1px solid var(--hero-glass-line);
  padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--on-hero);
}

.shots {
  display: flex; gap: 14px; margin: 0 -16px; padding: 6px 16px 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
  scrollbar-width: thin;
}
.shots figure { margin: 0; flex: 0 0 auto; width: min(40vw, 176px); scroll-snap-align: start; }
.shots img {
  width: 100%; aspect-ratio: 600 / 1303; object-fit: cover; border-radius: 18px;
  background: var(--bg-soft); box-shadow: 0 1px 2px var(--shadow-a), 0 8px 22px var(--shadow-b);
}
.shots figcaption { font-size: 14px; font-weight: 700; color: var(--ink-3); text-align: center; margin-top: 8px; line-height: 1.35; }

.cols { display: grid; gap: 8px 40px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1fr; } }

.about h3 { font-size: 22px; margin: 22px 0 10px; }
.about .intro { font-size: 19px; line-height: 1.55; color: var(--ink); max-width: 60ch; }

.ticks { list-style: none; padding: 0; margin: 0 0 8px; }
.ticks li { position: relative; padding-left: 26px; margin: 0 0 10px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px var(--gold-deep);
}

.note {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  color: var(--ink-2); font-size: 16px; margin: 20px 0 0;
}
.note p:last-child { margin-bottom: 0; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tile {
  display: block; padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow-a);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tile:hover { color: var(--ink); border-color: var(--link); transform: translateY(-1px); }
.tile strong { display: block; font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-weight: 400; font-size: 20px; }
.tile span { color: var(--ink-3); font-size: 15px; }

/* ---------- legal and help pages ---------- */

.doc-head { padding: 40px 0 6px; margin-bottom: 18px; }
.doc-head h1 { font-size: clamp(34px, 8.5vw, 46px); }
.doc-head .updated { color: var(--ink-3); font-weight: 700; font-size: 15px; margin: 10px 0 0; }
.doc-head .updated span { white-space: nowrap; }
.crumbs { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--link); }

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 20px 10px; margin: 8px 0 32px;
}
.toc h2 { font-family: "Nunito", system-ui, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin: 0 0 6px; font-size: 16px; break-inside: avoid; }
.toc a { text-decoration: none; font-weight: 700; }
.toc a:hover { text-decoration: underline; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 32px; } }

.prose { padding-bottom: 24px; }
.prose h2 { font-size: 26px; margin: 44px 0 12px; scroll-margin-top: 16px; }
.prose h3 { font-family: "Nunito", system-ui, sans-serif; font-weight: 800; font-size: 18px; letter-spacing: 0; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.68; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: 0 0 6px; }
.prose a { overflow-wrap: anywhere; }
.prose .anchor { margin-left: 8px; color: var(--ink-3); text-decoration: none; font-size: 0.8em; opacity: 0; transition: opacity 0.15s; }
.prose h2:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose h2:target { background: var(--mark); border-radius: 6px; }
@media (hover: none) { .prose .anchor { display: none; } }

.summary {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gold);
  border-radius: 14px; padding: 16px 20px 6px; margin: 20px 0 0;
}
.summary ul { margin-top: 0; }

.partner { border-top: 1px solid var(--line); padding-top: 4px; }
.partner + .partner { margin-top: 8px; }

.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 18px; margin: 0 0 10px;
}
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  font-weight: 800; color: var(--ink); padding: 14px 28px 14px 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-size: 24px; color: var(--link);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > :not(summary) { margin-top: 0; }
.faq details[open] { padding-bottom: 4px; }

.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin: 0 0 24px;
}
.contact-card .mail { font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-size: clamp(19px, 5.4vw, 24px); text-decoration: none; overflow-wrap: anywhere; }

.list-links, .prose .list-links { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.prose .list-links li { margin: 0; }
.list-links a { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.list-links a:hover { border-color: var(--link); color: var(--ink); }
.list-links img { width: 52px; height: 52px; border-radius: 22%; flex: none; }
.list-links strong { display: block; font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-weight: 400; font-size: 20px; }
.list-links span { color: var(--ink-3); font-size: 15px; }

/* ---------- 404 ---------- */

.lost { text-align: center; padding: 64px 0 24px; }
.lost .mark { width: 96px; height: 96px; margin: 0 auto 14px; display: block; }
.lost h1 { font-size: clamp(40px, 10vw, 60px); }
.lost p { color: var(--ink-2); margin: 12px auto 22px; max-width: 34ch; }
.button {
  display: inline-block; background: var(--gold); color: var(--gold-ink); text-decoration: none;
  font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-size: 20px; padding: 10px 22px; border-radius: 14px;
  box-shadow: 0 4px 0 var(--gold-deep);
}
.button:hover { color: var(--gold-ink); transform: translateY(1px); box-shadow: 0 3px 0 var(--gold-deep); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 64px; background: var(--footer-bg); color: var(--footer-ink);
  border-top: 5px solid var(--gold); padding: 36px 0 32px; font-size: 15px; line-height: 1.55;
}
.site-footer a { color: var(--footer-link); text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { color: var(--white); font-size: 20px; }
.site-footer .brand .g { color: var(--gold); }
.site-footer .mark .body { fill: var(--blue); }
.site-footer .mark .gold { fill: var(--gold); }
.site-footer .mark .ink { fill: var(--white); }
.site-footer .mark .inks { stroke: var(--white); }
.site-footer h2 { font-family: "Nunito", system-ui, sans-serif; font-weight: 800; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--footer-ink-2); margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .tag { margin: 10px 0 0; max-width: 32ch; }
.footer-legal { border-top: 1px solid var(--footer-line); margin-top: 28px; padding-top: 18px; color: var(--footer-ink-2); font-size: 14px; }
.footer-legal p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media (min-width: 640px) {
  html { scroll-behavior: smooth; }
}
