/* Khans landing page. Colours follow the game: night teal, felt ivory, gold, the raid's red. */
:root {
  --night: #101c22;
  --panel: #18282f;
  --ivory: #f3ead7;
  --soft: #b9b3a2;
  --gold: #e3b24a;
  --red: #b5402a;
  --red-deep: #8e2f1c;
  --line: rgba(243, 234, 215, 0.14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--ivory); font: 17px/1.6 Rubik, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--gold); }
h1, h2 { font-family: Cinzel, Rubik, serif; font-weight: 700; line-height: 1.15; margin: 0; }
html[lang="mn"] h2 { font-family: Rubik, sans-serif; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: linear-gradient(rgba(16, 28, 34, 0.92), rgba(16, 28, 34, 0)); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); text-decoration: none; font: 900 20px Cinzel, serif; letter-spacing: 0.08em; }
.brand img { border-radius: 9px; }
nav { display: flex; align-items: center; gap: 6px; }
.lang { background: none; border: 1px solid transparent; color: var(--soft); font: 500 14px Rubik, sans-serif; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.lang[aria-pressed="true"] { color: var(--ivory); border-color: var(--line); }

.cta { display: inline-block; background: linear-gradient(var(--red), var(--red-deep)); color: #fff; font: 700 17px Rubik, sans-serif; text-decoration: none;
  padding: 14px 22px; border: 2px solid var(--gold); border-radius: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.cta:hover, .cta:focus-visible { filter: brightness(1.12); }
.cta.small { font-size: 14px; padding: 8px 12px; border-width: 1px; border-radius: 10px; margin-left: 6px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.hero { position: relative; min-height: min(100svh, 980px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(16, 28, 34, 0.25) 0%, rgba(16, 28, 34, 0) 30%, rgba(16, 28, 34, 0.55) 60%, var(--night) 100%); }
.hero-text { position: relative; z-index: 1; width: min(680px, 100%); padding: 0 16px 56px; text-align: center; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-weight: 500; letter-spacing: 0.04em; }
h1 { font-weight: 900; font-size: clamp(64px, 17vw, 132px); letter-spacing: 0.06em; color: var(--gold); text-shadow: 0 4px 0 #6b4a12, 0 10px 30px rgba(0, 0, 0, 0.6); }
.sub { margin: 8px auto 22px; font-size: clamp(18px, 2.6vw, 22px); max-width: 30em; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }

.notify { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; scroll-margin-top: 40vh; }
.notify input { flex: 1 1 240px; min-width: 0; padding: 14px 16px; font: 17px Rubik, sans-serif; color: var(--ivory); background: rgba(16, 28, 34, 0.85);
  border: 2px solid var(--line); border-radius: 14px; }
.notify input::placeholder { color: var(--soft); }
.note { flex-basis: 100%; margin: 2px 0 0; font-size: 14px; color: var(--soft); min-height: 1.6em; }
.note.good { color: #9fd39a; }
.note.bad { color: #f0a08a; }

section { padding: 64px 16px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; max-width: 1160px; margin: 0 auto; }
.pillars article { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pillars img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pillars h2 { font-size: 24px; padding: 18px 20px 0; color: var(--gold); }
.pillars p { margin: 8px 0 0; padding: 0 20px 22px; color: var(--ivory); }

.heroes { text-align: center; background: linear-gradient(var(--night), var(--panel) 30%, var(--night)); }
.heroes h2, .last h2 { font-size: clamp(28px, 5vw, 42px); color: var(--gold); }
.lead { max-width: 36em; margin: 12px auto 28px; color: var(--soft); }
.roster { list-style: none; margin: 0 auto; padding: 4px 16px 16px; display: flex; gap: 14px; overflow-x: auto; max-width: 1160px; scroll-snap-type: x proximity; }
.roster li { flex: 0 0 150px; scroll-snap-align: center; background: var(--night); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 14px; }
.roster img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 10px; background: #22343c; }
.roster b { display: block; margin-top: 10px; font-weight: 700; }
.roster span { display: block; font-size: 14px; color: var(--soft); }

.last { text-align: center; padding-bottom: 88px; }
.last h2 { margin-bottom: 26px; }
footer { border-top: 1px solid var(--line); padding: 26px 16px 40px; text-align: center; color: var(--soft); font-size: 15px; }
footer p { margin: 4px 0; }

@media (min-width: 900px) { .roster { flex-wrap: wrap; justify-content: center; overflow: visible; } }
@media (max-width: 520px) {
  .cta.small { display: none; }
  .notify .cta { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* The story: a 3D steppe (world.js) behind chapters that scroll over it. Without it, the page is still pictures and words. */
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: none; }
body.has-world #world { display: block; }
body.has-world { background: transparent; }
html { background: var(--night); }
body.has-world .still { display: none; }
body.has-world .hero::after { background: linear-gradient(rgba(16, 28, 34, 0.35) 0%, rgba(16, 28, 34, 0) 22%, rgba(16, 28, 34, 0) 55%, rgba(16, 28, 34, 0.6) 100%); }
body.has-world .hero { min-height: 100svh; }
body.has-world footer { background: var(--night); }
.scroll { margin: 26px 0 0; color: var(--soft); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.scroll::after { content: ""; display: block; width: 1px; height: 34px; margin: 8px auto 0; background: linear-gradient(var(--gold), transparent); }
body:not(.has-world) .scroll { display: none; }

.chapter { min-height: 120svh; display: flex; align-items: center; padding: 80px max(16px, 6vw); }
.chapter.right { justify-content: flex-end; }
body:not(.has-world) .chapter { min-height: 0; }
.say { width: min(440px, 100%); padding: 24px 24px 26px; border-radius: 18px; border: 1px solid var(--line);
  background: rgba(16, 28, 34, 0.74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.num { margin: 0 0 6px; font: 700 15px Cinzel, serif; letter-spacing: 0.3em; color: var(--gold); opacity: 0.85; }
.say h2 { font-size: clamp(26px, 4vw, 34px); color: var(--gold); }
.say p { margin: 10px 0 0; }
.say figure { margin: 18px 0 0; }
.say figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.say figcaption { margin-top: 6px; font-size: 13px; color: var(--soft); letter-spacing: 0.06em; text-transform: uppercase; }
.wide { width: 100%; text-align: center; }
.chapter.heroes { background: none; align-items: flex-end; padding-bottom: 12svh; }
body.has-world .chapter.heroes .roster li { background: rgba(16, 28, 34, 0.8); }
.chapter.last { min-height: 100svh; padding-bottom: 88px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
@media (max-width: 700px) { .chapter, .chapter.right { align-items: flex-end; justify-content: center; padding-bottom: 9svh; } }

.deeds { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.deeds li { padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(243, 234, 215, 0.06); border-radius: 0 10px 10px 0; }
.deeds b { display: block; color: var(--gold); }
.deeds span { font-size: 15px; color: var(--ivory); }

/* With the 3D scene, the heroes stand in one row along the bottom, so Subutai is seen above them. */
@media (min-width: 900px) {
  body.has-world .chapter.heroes .roster { flex-wrap: nowrap; justify-content: center; gap: 10px; max-width: none; }
  body.has-world .chapter.heroes .roster li { flex: 0 1 118px; padding: 7px 7px 10px; }
  body.has-world .chapter.heroes .roster span { font-size: 12px; }
  body.has-world .chapter.heroes .wide > h2, body.has-world .chapter.heroes .lead { text-shadow: 0 2px 10px #000; }
}

/* The heroes' heading sits in the sky above the scene, where the crowd can't hide it. */
body.has-world .chapter.heroes { align-items: stretch; }
body.has-world .chapter.heroes { padding-top: 0; }
body.has-world .chapter.heroes .wide { display: flex; flex-direction: column; min-height: 100svh; padding-top: 70px; }
body.has-world .chapter.heroes .roster { margin-top: auto; }

/* Privacy, terms, support and account deletion: plain reading pages in the same colours (built by scripts/legal-build.mjs). */
body.doc .top { position: sticky; top: 0; background: var(--night); border-bottom: 1px solid var(--line); }
.legal { max-width: 760px; margin: 0 auto; padding: 40px 16px 72px; }
.legal h1 { font-size: clamp(30px, 6vw, 44px); letter-spacing: 0.02em; margin: 0 0 20px; text-shadow: none; }
.legal h2 { font: 700 21px Rubik, sans-serif; color: var(--gold); margin: 36px 0 8px; }
.legal h3 { font: 700 17px Rubik, sans-serif; margin: 24px 0 6px; }
.legal p, .legal li { color: #e6dcc8; }
.legal li { margin: 5px 0; }
.legal .table { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; }
.legal table { border-collapse: collapse; font-size: 15px; line-height: 1.45; min-width: 560px; width: 100%; }
.legal th, .legal td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal tr:last-child td { border-bottom: 0; }
.legal th { color: var(--soft); background: var(--panel); font-weight: 500; }
footer a[aria-current="page"] { color: var(--ivory); text-decoration: none; }
.legal { overflow-wrap: break-word; }
