:root {
  --bg: #0a0420;
  --bg-2: #140838;
  --ink: #f3ecff;
  --ink-dim: #b9a9e0;
  --cyan: #3fe6ff;
  --pink: #ff3fa8;
  --gold: #ffc35a;
  --line: rgba(63, 230, 255, 0.25);
  --radius: 10px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); }
h1, h2, h3, .btn, .nav a, .tag {
  font-family: "Teko", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
h2 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; margin: 0 0 0.6em; }
h3 { font-size: 1.6rem; line-height: 1.1; margin: 0 0 0.3em; color: var(--gold); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 4, 32, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.nav img { height: 28px; width: auto; }
.nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-size: 1.25rem; }
.nav a:hover { color: var(--cyan); }
@media (max-width: 640px) { .nav ul li.hide-sm { display: none; } }

/* Hero */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex; align-items: flex-end;
  background: url("img/hero.jpg") 70% center / cover no-repeat var(--bg-2);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,4,32,0) 35%, rgba(10,4,32,0.85) 78%, var(--bg) 100%),
              linear-gradient(90deg, rgba(10,4,32,0.7) 0%, rgba(10,4,32,0) 60%);
}
.hero .wrap { position: relative; z-index: 1; padding-bottom: 56px; }
.hero .logo { width: min(640px, 100%); margin-left: -8px; }
.hero .pitch { font-size: clamp(1.1rem, 2.4vw, 1.4rem); max-width: 36em; margin: 12px 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px 6px;
  font-size: 1.5rem; line-height: 1;
  border-radius: var(--radius);
  text-decoration: none; color: var(--bg);
  background: linear-gradient(180deg, var(--cyan), #22a8ff);
  box-shadow: 0 0 24px rgba(63, 230, 255, 0.45);
  border: 0; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn.alt { background: transparent; color: var(--ink); border: 2px solid var(--pink); box-shadow: 0 0 18px rgba(255, 63, 168, 0.35); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.soon { color: var(--ink-dim); font-size: 0.95rem; }

/* Sections */
section { padding: 72px 0; }
section.alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%); }
.lead { font-size: 1.2rem; color: var(--ink-dim); max-width: 42em; margin-top: -0.2em; }

.features { display: grid; gap: 40px; margin-top: 40px; }
.feature { display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr; }
.feature img { border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 820px) {
  .feature { grid-template-columns: 1.25fr 1fr; gap: 40px; }
  .features .feature:nth-child(even) { grid-template-columns: 1fr 1.25fr; }
  .features .feature:nth-child(even) > img, .features .feature:nth-child(even) > figure { order: 2; }
}
.feature p { margin: 0; color: var(--ink-dim); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { font-size: 1.1rem; padding: 4px 12px 1px; border: 1px solid var(--line); border-radius: 999px; color: var(--cyan); }

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.04); }

.signup { text-align: center; }
.signup .cta { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--ink-dim); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

/* Press kit */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { font-family: "Teko", sans-serif; text-transform: uppercase; font-size: 1.25rem; color: var(--gold); }
.facts dd { margin: 0; }
.todo { color: var(--pink); font-style: italic; }
.press-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .press-grid { grid-template-columns: 1fr 1.6fr; } }
.downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 0 0; } .facts dd { margin-bottom: 10px; } }

/* Gallery viewer (lightbox.js) */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 2, 18, 0.92);
  padding: 56px 16px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(1600px, 100%); max-height: 100%;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(63, 230, 255, 0.25); cursor: default;
}
.lightbox button {
  position: absolute; border: 0; background: rgba(20, 8, 56, 0.8); color: var(--ink);
  font: 600 2rem/1 "Teko", sans-serif; width: 48px; height: 48px; border-radius: 999px; cursor: pointer;
}
.lightbox button:hover { color: var(--cyan); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } }

/* Media figures: a still image now, an animated loop when media/<name>.webm|mp4 exists (media.js) */
figure.media { margin: 0; }
figure.media img, figure.media video {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2);
}

/* Build section (roguelike loop) */
.build-hero { margin-top: 32px; align-items: start; }
@media (min-width: 820px) { .build-hero { grid-template-columns: 1.3fr 1fr; } }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--pink);
  font: 600 1.4rem/30px "Teko", sans-serif; text-align: center; color: var(--pink);
}
.steps h3 { font-size: 1.35rem; margin: 0 0 2px; }
.steps p { margin: 0; color: var(--ink-dim); font-size: 0.97rem; }
.parts-title { margin: 40px 0 0; font-family: "Teko", sans-serif; text-transform: uppercase; font-size: 1.4rem; color: var(--gold); letter-spacing: 0.04em; }
.parts .tag { color: var(--ink); border-color: rgba(255, 63, 168, 0.4); }

/* Damage section: a loop with the key points, then a strip of stills */
.damage-hero { margin-top: 32px; align-items: start; }
@media (min-width: 820px) { .damage-hero { grid-template-columns: 1.3fr 1fr; } }
.damage-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.damage-points li { padding-left: 16px; border-left: 3px solid var(--pink); }
.damage-points h3 { font-size: 1.35rem; margin: 0 0 2px; }
.damage-points p { margin: 0; color: var(--ink-dim); font-size: 0.97rem; }
.damage-grid { display: grid; gap: 20px; margin-top: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .damage-grid { grid-template-columns: repeat(3, 1fr); } }
.damage-grid figure { margin: 0; }
.damage-grid img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2);
}
.damage-grid figcaption { margin-top: 8px; color: var(--ink-dim); font-size: 0.9rem; }

/* Hero background loop (media.js, data-bg-loop): sits over the still, under the gradient and the text */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 70% center;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-video.ready { opacity: 1; }
