:root {
  --bg: #0c0d10;
  --bg-2: #13151a;
  --ink: #f3f1ec;
  --muted: #a4a8b1;
  --faint: #6b707a;
  --line: rgba(255, 255, 255, 0.09);
  --amber: #ffb020;
  --amber-2: #ffc95a;
  --ember: #ff6a3d;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --max: 1200px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
h1, h2, h3 { margin: 0; }

.wrap { width: min(var(--max), calc(100% - var(--pad) * 2)); margin: 0 auto; }

/* Header */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem var(--pad);
  padding-top: max(1rem, env(safe-area-inset-top));
  transition: background-color 0.25s ease, border-color 0.25s ease, padding 0.25s ease;
  border-bottom: 1px solid transparent;
}
.top.is-solid {
  background: rgba(12, 13, 16, 0.82);
  border-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  padding-block: 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand img { border-radius: 9px; }
.nav { display: flex; gap: 0.3rem; margin-left: auto; }
.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.93rem;
  color: rgba(243, 241, 236, 0.78);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.langs { display: flex; gap: 0.15rem; }
.langs button {
  border: 0;
  background: transparent;
  color: var(--faint);
  font: 700 0.8rem var(--font);
  letter-spacing: 0.08em;
  padding: 0.4rem 0.45rem;
  cursor: pointer;
}
.langs button[aria-pressed="true"] { color: var(--amber); }

/* Hero */
.hero {
  position: relative;
  min-height: max(100svh, 640px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 45%;
  z-index: -2;
  transform: scale(1.04);
  animation: hero-in 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 10, 16, 0.86) 0%, rgba(8, 10, 16, 0.55) 38%, rgba(8, 10, 16, 0) 68%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.55) 0%, rgba(8, 10, 16, 0) 22%, rgba(8, 10, 16, 0) 62%, var(--bg) 100%);
}
.hero-body {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
  padding: 7rem 0 6rem;
}
.eyebrow, .label {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}
.hero-logo {
  position: relative;
  animation: rise 1.1s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-logo__stage {
  position: relative;
  display: block;
  width: clamp(280px, 42vw, 640px);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}
.hero-logo__poster,
.hero-logo__canvas {
  display: block;
  width: 100%;
  height: auto;
}
.hero-logo__stage.is-live .hero-logo__poster { visibility: hidden; position: absolute; inset: 0; width: 100%; height: auto; }
.hero-logo__stage.is-live .hero-logo__canvas { display: block; }
.hero-line {
  margin: 1.1rem 0 0;
  max-width: 36rem;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
  animation: rise 1.1s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
  animation: rise 1.1s 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.2rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease;
}
.btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.btn:active { transform: scale(0.97); }
.btn-amber {
  background: var(--amber);
  color: #1d1406;
  box-shadow: 0 10px 34px rgba(255, 176, 32, 0.32), inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}
.btn-amber:hover { background: var(--amber-2); box-shadow: 0 14px 40px rgba(255, 176, 32, 0.42); }
.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.18); }
.btn-soon {
  color: rgba(243, 241, 236, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  cursor: default;
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ink);
  animation: cue 1.8s ease-in-out infinite;
}

/* Sections */
section { position: relative; }
.section-title {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.game { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem); }
.poster {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
  aspect-ratio: 16 / 8;
  background: var(--bg-2);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  isolation: isolate;
}
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(8, 10, 16, 0.92) 0%, rgba(8, 10, 16, 0.5) 38%, rgba(8, 10, 16, 0) 65%);
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.poster:hover img { transform: scale(1.035); }
.poster-body {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(1.4rem, 3.6vw, 3rem);
  display: grid;
  gap: 0.9rem;
  justify-items: start;
}
.poster h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.poster p { margin: 0; max-width: 34rem; color: rgba(243, 241, 236, 0.82); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  font-weight: 600;
}
.poster-go {
  margin-top: 0.3rem;
  font-weight: 700;
  color: var(--amber);
}
.poster-go::after { content: "\00a0→"; display: inline-block; transition: transform 0.2s ease; }
.poster:hover .poster-go::after { transform: translateX(4px); }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: clamp(1.6rem, 3vw, 2.4rem) 0 0;
  border-top: 1px solid var(--line);
}
.facts div { padding: 1.4rem 1.2rem 0 0; }
.facts dt {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--amber);
  letter-spacing: -0.03em;
}
.facts dd { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.98rem; }

.nations { padding: clamp(3rem, 6vw, 5rem) 0; }
.nations-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
  margin-bottom: 1.6rem;
}
.nations-head .section-title { margin: 0; }
.sprite-tog {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.sprite-tog__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 0.82rem var(--font);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.sprite-tog__btn.is-on {
  background: var(--amber);
  color: #1d1406;
}
.nation-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.75rem;
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}
.nation { margin: 0; min-width: 0; }
/* Background is the right part of the game's atmos art, where the unit platform is. */
.nation-art {
  position: relative;
  aspect-ratio: 3 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}
.nation-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.nation-art::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.2s ease;
}
/* --l / --t / --s: per-unit framing over the atmos crop (feet on platform, head under red line). */
.unit {
  position: absolute;
  z-index: 1;
  left: var(--l);
  top: var(--t);
  width: calc(102.2% * var(--s, 1));
  aspect-ratio: 320 / 440;
  background-repeat: no-repeat;
  background-size: 3600% 100%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}
.nations.is-static .unit {
  background-size: auto 92%;
  background-position: center bottom;
}
.nation figcaption { display: grid; gap: 0.05rem; padding: 0.55rem 0.1rem 0; }
.nation figcaption b { font-weight: 700; font-size: 0.9rem; }
.nation figcaption span { color: var(--muted); font-size: 0.75rem; }
.nation:hover .nation-art::after { box-shadow: inset 0 0 0 2px var(--amber); }

.studio { padding: clamp(3rem, 7vw, 6rem) 0; }
.studio-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
  padding-top: clamp(2.4rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.studio-text p { margin: 0 0 1rem; color: var(--muted); font-size: 1.08rem; }
.studio-text p:last-child { margin: 0; }

.contact { padding: 0 0 clamp(4rem, 8vw, 7rem); }
.contact-box {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, rgba(255, 176, 32, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 80% at 0% 100%, rgba(255, 106, 61, 0.1), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line);
}
.mail {
  display: block;
  width: fit-content;
  margin-top: 1.4rem;
  font-size: clamp(1.3rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(90deg, var(--amber-2), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-all;
}
.mail:hover { text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 0.2em; }
.contact-note { margin: 1rem 0 0; max-width: 34rem; color: var(--muted); }

.foot { border-top: 1px solid var(--line); padding: 1.8rem 0 max(2rem, env(safe-area-inset-bottom)); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.foot .brand { font-size: 0.82rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.foot nav a:hover { color: var(--ink); }
.copy { margin: 0 0 0 auto; color: var(--faint); font-size: 0.88rem; }

/* Motion */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@keyframes hero-in { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1.04); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(12px); opacity: 0; } }

@media (max-width: 900px) {
  .studio-grid { grid-template-columns: 1fr; }
  .poster { aspect-ratio: auto; }
  .poster img { position: relative; height: auto; aspect-ratio: 16 / 10; }
  .poster::before { background: linear-gradient(0deg, var(--bg-2) 0%, var(--bg-2) 40%, rgba(19, 21, 26, 0) 62%); }
  .poster-body { position: relative; margin-top: -3.2rem; }
  .nation-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 26%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .nation-row::-webkit-scrollbar { display: none; }
  .nation { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .top { gap: 0.8rem; }
  .brand span { display: none; }
  .nav a { padding: 0.4rem 0.6rem; font-size: 0.88rem; }
  .hero { align-items: flex-end; }
  .hero-art { height: 72%; object-position: 80% 30%; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(8, 10, 16, 0.45) 0%, rgba(8, 10, 16, 0) 18%, rgba(8, 10, 16, 0.2) 38%, rgba(8, 10, 16, 0.88) 60%, var(--bg) 72%);
  }
  .hero-body { padding-bottom: 2.4rem; }
  .eyebrow { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
  .hero-logo__stage { width: min(78vw, 340px); }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
  .facts { grid-template-columns: 1fr; }
  .facts div { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .facts dt { min-width: 3.2rem; }
  .nation-row { grid-auto-columns: 38%; }
  .nation figcaption b { font-size: 0.85rem; }
  .nation figcaption span { font-size: 0.7rem; }
  .copy { margin-left: 0; width: 100%; }
  .scroll-cue { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
