:root {
  --void: #04040d;
  --panel: #0b1126;
  --panel-hi: #121c3d;
  --border: #253b6e;
  --cyan: #46e6ff;
  --gold: #ffe12d;
  --crimson: #ff4d6a;
  --green: #52f094;
  --text: #eef3ff;
  --muted: #93a6ce;
  --font-display: "Silkscreen", "Courier New", monospace;
  --font-body: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--void);
  color: var(--text);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 75% 15%, rgba(70, 230, 255, 0.08), transparent 42%),
    radial-gradient(circle at 18% 45%, rgba(255, 225, 45, 0.05), transparent 40%),
    var(--void);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

.starfield-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 14% 22%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 36% 68%, rgba(70, 230, 255, 0.5), transparent),
    radial-gradient(1px 1px at 62% 31%, rgba(255, 225, 45, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 84% 74%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 91% 18%, rgba(70, 230, 255, 0.4), transparent),
    radial-gradient(1px 1px at 8% 82%, rgba(255, 77, 106, 0.4), transparent);
  background-size: 320px 320px;
}

.container {
  width: min(1240px, calc(100% - 2.25rem));
  margin-inline: auto;
}

.cyan { color: var(--cyan); }
.gold { color: var(--gold); }
.crimson { color: var(--crimson); }
.green { color: var(--green); }

/* Pixel Sprites */
.pixel-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.sprite-ship {
  display: inline-block;
  flex-shrink: 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Source sprite sheets are 48x16 (3 horizontal 16x16 frames; frame 1 = level flight) */
.sprite-vanguard { background-image: url("assets/sprites/skin_vanguard_sheet.png"); }
.sprite-crimson { background-image: url("assets/sprites/skin_crimson_striker_sheet.png"); }
.sprite-cobalt { background-image: url("assets/sprites/skin_cobalt_phantom_sheet.png"); }
.sprite-solaris { background-image: url("assets/sprites/skin_solaris_prime_sheet.png"); }
.sprite-emerald { background-image: url("assets/sprites/skin_emerald_viper_sheet.png"); }
.sprite-obsidian { background-image: url("assets/sprites/skin_obsidian_dread_sheet.png"); }

.sprite-sm {
  width: 28px;
  height: 28px;
  background-size: 84px 28px;
  background-position: -28px 0;
}

.sprite-md {
  width: 48px;
  height: 48px;
  background-size: 144px 48px;
  background-position: -48px 0;
}

.sprite-lg {
  width: 64px;
  height: 64px;
  background-size: 192px 64px;
  background-position: -64px 0;
}

/* Top Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(4, 4, 13, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(37, 59, 110, 0.7);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--cyan);
}

.topbar-ctas {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.pill-btn:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
}

.pill-ios {
  border-color: rgba(70, 230, 255, 0.55);
}

.pill-android {
  border-color: rgba(255, 225, 45, 0.55);
  color: var(--gold);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 2.5rem;
  padding: 2.8rem 0 3.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cyan);
  background: rgba(70, 230, 255, 0.08);
  border: 1px solid rgba(70, 230, 255, 0.3);
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.1vw, 3.45rem);
  line-height: 1.08;
  margin: 1rem 0 1.1rem;
  letter-spacing: 0.02em;
}

.lead {
  color: #cdd8f2;
  font-size: 1.08rem;
  max-width: 58ch;
  margin: 0 0 1.65rem;
}

.store-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.store-cta-group.centered {
  justify-content: center;
}

.store-btn {
  display: inline-flex;
  flex-direction: column;
  padding: 0.72rem 1.3rem;
  border-radius: 10px;
  text-decoration: none;
  border: 1.5px solid var(--cyan);
  background: linear-gradient(180deg, #10254b, #081229);
  color: var(--text);
  min-width: 196px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(70, 230, 255, 0.18);
}

.store-play {
  border-color: var(--gold);
  background: linear-gradient(180deg, #272009, #120e04);
}

.store-play:hover {
  box-shadow: 0 10px 26px rgba(255, 225, 45, 0.18);
}

.store-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.store-title {
  font-weight: 700;
  font-size: 1.03rem;
}

.store-play .store-title {
  color: var(--gold);
}

.promise-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.3rem;
}

.promise-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(11, 17, 38, 0.85);
  border: 1px solid rgba(37, 59, 110, 0.8);
  font-size: 0.84rem;
  color: #cfd9f2;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.demo-scope-card {
  border: 1px solid var(--border);
  background: rgba(11, 17, 38, 0.92);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.scope-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: #d6e0f7;
}

.scope-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  color: #03151d;
  background: var(--cyan);
}

.gold-badge {
  background: var(--gold);
  color: #1c1502;
}

/* Interactive Cabinet Viewport */
.hero-cabinet-wrap {
  display: flex;
  justify-content: center;
}

.cabinet-bezel {
  width: 100%;
  max-width: 500px;
  background: linear-gradient(180deg, #101937, #070b1a);
  border: 2px solid var(--cyan);
  border-radius: 16px;
  padding: 0.75rem;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.75),
    0 0 40px rgba(70, 230, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cabinet-bezel:fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  padding: 1rem;
  justify-content: center;
  align-items: center;
}

.cabinet-bezel:fullscreen .canvas-stage {
  height: calc(100vh - 110px);
  width: auto;
  max-width: 100%;
}

.cabinet-marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.marquee-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.cab-tool-btn {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(255, 225, 45, 0.08);
  border: 1px solid rgba(255, 225, 45, 0.5);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
}

.cab-tool-btn:hover {
  background: rgba(255, 225, 45, 0.18);
}

.canvas-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 860;
  background: #04040d;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(70, 230, 255, 0.35);
}

#astroswarm-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

.attract-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at center, rgba(11, 20, 48, 0.92), rgba(4, 4, 13, 0.98));
  z-index: 5;
}

.attract-overlay.hidden {
  display: none;
}

.attract-nebula {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
  image-rendering: pixelated;
  pointer-events: none;
}

.attract-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  width: 100%;
}

.attract-banner {
  width: min(360px, 88%);
  height: auto;
  image-rendering: pixelated;
}

.attract-sprites {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.float-slow { animation: floatSlow 3.4s ease-in-out infinite; }
.float-mid { animation: floatSlow 2.8s ease-in-out 0.6s infinite; }

.play-wasm-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.45rem;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #332707, #1c1503);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 28px rgba(255, 225, 45, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-wasm-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(255, 225, 45, 0.42);
}

.play-wasm-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.attract-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.wasm-progress {
  width: min(300px, 90%);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wasm-progress.hidden {
  display: none;
}

.wasm-progress-bar {
  height: 7px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.wasm-progress-bar span {
  display: block;
  height: 100%;
  width: 28%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.wasm-status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
}

.cabinet-controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.ctrl-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(4, 4, 13, 0.75);
  border: 1px solid rgba(37, 59, 110, 0.7);
  border-radius: 6px;
  padding: 0.24rem 0.5rem;
}

.ctrl-chip kbd {
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
}

/* Section Headers */
.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin: 0.45rem 0 0.5rem;
  line-height: 1.2;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

/* Asymmetric Feature Bento */
.features {
  padding: 2.5rem 0;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.bento-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bento-wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 1.5rem;
}

.bento-card h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  margin: 0;
  line-height: 1.3;
}

.bento-card p {
  margin: 0;
  color: #cdd8f2;
  font-size: 0.96rem;
}

.pill-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  border: 1px solid currentColor;
}

.pill-tag.cyan { color: var(--cyan); }
.pill-tag.gold { color: var(--gold); }
.pill-tag.crimson { color: var(--crimson); }

.mini-spec {
  margin: 0.3rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-spec code {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* Co-op Mock */
.coop-telemetry-mock {
  background: #060916;
  border: 1.5px solid rgba(70, 230, 255, 0.5);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green);
}

.telemetry-pilots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.pilot-chip {
  background: rgba(16, 26, 56, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.badge-you,
.badge-p2 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.badge-you {
  background: rgba(82, 240, 148, 0.16);
  color: var(--green);
  border: 1px solid var(--green);
}

.badge-p2 {
  background: rgba(70, 230, 255, 0.14);
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.pilot-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
}

.telemetry-sos {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--gold);
  background: rgba(255, 225, 45, 0.08);
  border: 1px solid rgba(255, 225, 45, 0.35);
  border-radius: 8px;
  padding: 0.45rem;
}

/* Boss Lineup & Dialogue */
.boss-lineup {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #060916;
  border-radius: 10px;
  border: 1px solid rgba(255, 77, 106, 0.35);
}

.boss-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--crimson);
}

.dialogue-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #060916;
  border: 1px solid var(--border);
}

.dialogue-bubble .speaker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.dialogue-bubble p {
  font-size: 0.84rem;
  color: #dce5fa;
  margin: 0.15rem 0 0;
}

/* Power Grid */
.power-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: auto;
}

.power-item {
  background: #060916;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #d6e1fa;
}

/* Hangar Grid */
.hangar {
  padding: 2.5rem 0;
}

.hangar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
}

.ship-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.ship-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.ship-card h4 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  margin: 0.2rem 0 0;
}

.unlock-rule {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Architecture Strip */
.architecture {
  padding: 2.2rem 0;
}

.arch-panel {
  background: linear-gradient(135deg, #0b1126, #070b18);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.75rem;
  align-items: center;
}

.arch-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  margin: 0.45rem 0 0.75rem;
  line-height: 1.25;
}

.arch-copy p {
  margin: 0;
  color: #cdd8f2;
  font-size: 0.95rem;
}

.arch-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.metric-cell {
  background: #050814;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.metric-lbl {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Final CTA & Footer */
.final-cta {
  padding: 2.2rem 0 3.5rem;
}

.final-box {
  background: radial-gradient(circle at top, rgba(70, 230, 255, 0.11), rgba(11, 17, 38, 0.96));
  border: 1.5px solid rgba(70, 230, 255, 0.5);
  border-radius: 18px;
  padding: 2.4rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.final-banner {
  width: min(340px, 85%);
  height: auto;
  image-rendering: pixelated;
}

.final-box h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  margin: 0;
}

.final-box p {
  margin: 0 0 0.5rem;
  color: #d2dcf5;
  max-width: 56ch;
}

.site-footer {
  border-top: 1px solid rgba(37, 59, 110, 0.65);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--cyan);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-cabinet-wrap {
    order: 2;
  }

  .hangar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arch-panel,
  .bento-wide {
    grid-template-columns: 1fr;
  }

  .bento-wide {
    grid-column: span 1;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .promise-strip {
    grid-template-columns: 1fr;
  }

  .hangar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .power-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
