:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(8, 14, 18, 0.78);
  --panel-solid: #0b1116;
  --text: #eef8fb;
  --muted: #aac0c8;
  --cyan: #48d6ff;
  --amber: #f7b955;
  --red: #ff5a4d;
  --green: #6df0a6;
  --line: rgba(180, 228, 242, 0.22);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle at 18% 20%, rgba(72, 214, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, rgba(5, 7, 10, 0) 0%, rgba(5, 7, 10, 0.84) 76%);
  z-index: -2;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.85rem clamp(1rem, 4vw, 3.5rem);
  background: rgba(4, 7, 10, 0.66);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  width: 1.3rem;
  aspect-ratio: 1;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(72, 214, 255, 0.7);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  color: var(--muted);
  font-size: 0.95rem;
}

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

.audio-dock {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  background: rgba(5, 9, 12, 0.84);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 3.3rem;
  height: 2.5rem;
  color: var(--bg);
  background: var(--cyan);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.volume input {
  width: 7rem;
  accent-color: var(--cyan);
}

.hero {
  position: relative;
  min-height: 90vh;
  display: grid;
  align-items: end;
  padding: 8rem clamp(1rem, 5vw, 5rem) 5rem;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, rgba(2, 5, 7, 0.92) 0%, rgba(2, 5, 7, 0.66) 42%, rgba(2, 5, 7, 0.12) 100%),
    url("assets/images/hero-station.jpg");
  background-size: cover;
  background-position: center;
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 8rem;
  content: "";
  background: linear-gradient(180deg, rgba(5, 7, 10, 0), var(--bg));
}

.starfield {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
    radial-gradient(circle, rgba(72, 214, 255, 0.7) 1px, transparent 1px);
  background-position: 0 0, 18px 22px;
  background-size: 88px 88px, 132px 132px;
  animation: drift 26s linear infinite;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 52rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(3.4rem, 8vw, 7.5rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.15rem, 5vw, 4.7rem);
  line-height: 1;
}

h3 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.hero-text {
  max-width: 41rem;
  color: #d9edf2;
  font-size: 1.22rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.05rem;
  border-radius: 6px;
  font-weight: 800;
}

.primary-action {
  color: var(--bg);
  background: var(--cyan);
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.telemetry {
  position: absolute;
  right: clamp(1rem, 4vw, 4rem);
  bottom: 4.5rem;
  z-index: 2;
  display: grid;
  gap: 0.2rem;
  min-width: 10rem;
  padding: 1rem;
  background: rgba(5, 9, 12, 0.76);
  border: 1px solid rgba(255, 90, 77, 0.45);
  border-radius: 8px;
  box-shadow: 0 0 34px rgba(255, 90, 77, 0.2);
}

.telemetry span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.telemetry strong {
  font-size: 2rem;
  color: var(--amber);
}

.story-section,
.lab-section,
.launch-section {
  padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.section-heading {
  max-width: 64rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading.compact {
  margin-bottom: 2rem;
}

.story-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(10.5rem, 1fr));
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
}

.story-beat {
  position: relative;
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.92)),
    var(--image);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.story-beat::before {
  position: absolute;
  inset: 0;
  content: "";
  border-top: 3px solid var(--cyan);
  opacity: 0.74;
}

.story-beat.alert::before {
  border-color: var(--red);
}

.story-beat.final::before {
  border-color: var(--green);
}

.beat-index {
  width: fit-content;
  margin-bottom: 0.7rem;
  padding: 0.3rem 0.45rem;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-weight: 800;
}

.story-beat p {
  color: #d8e5e9;
  line-height: 1.55;
}

.lab-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    #070a0d;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 36rem) minmax(16rem, 28rem);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
}

.gravity-board {
  aspect-ratio: 1;
  padding: clamp(0.65rem, 2vw, 1rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(72, 214, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 214, 255, 0.08) 1px, transparent 1px),
    var(--panel-solid);
  background-size: 16.66% 16.66%;
  box-shadow: var(--shadow);
}

.board-grid {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(72, 214, 255, 0.22);
  border-radius: 6px;
}

.block,
.robot,
.wall,
.target {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: calc(100% / 6 - 0.65rem);
  height: calc(100% / 6 - 0.65rem);
  transition:
    top 520ms cubic-bezier(0.22, 1, 0.36, 1),
    left 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.block {
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 42%),
    var(--amber);
  box-shadow: 0 0 22px rgba(247, 185, 85, 0.38);
}

.robot {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, var(--cyan) 0 12%, transparent 13%),
    radial-gradient(circle at 50% 50%, #edf8fb 0 54%, #7b8b91 55%);
  box-shadow: 0 0 28px rgba(72, 214, 255, 0.48);
}

.wall {
  border-radius: 4px;
  background: #59636a;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.target {
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(109, 240, 166, 0.45);
}

.cell-2-2 {
  --x: calc((100% / 6) * 1 + 0.35rem);
  --y: calc((100% / 6) * 1 + 0.35rem);
}

.cell-4-3 {
  --x: calc((100% / 6) * 3 + 0.35rem);
  --y: calc((100% / 6) * 2 + 0.35rem);
}

.cell-5-5 {
  --x: calc((100% / 6) * 4 + 0.35rem);
  --y: calc((100% / 6) * 4 + 0.35rem);
}

.lab-panel {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.status-row span {
  color: var(--muted);
}

.status-row strong {
  color: var(--cyan);
}

.direction-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.direction-pad button {
  min-height: 3rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.direction-pad button:first-child,
.direction-pad button:last-child {
  grid-column: 2;
}

.direction-pad button:hover,
.direction-pad button.active {
  color: var(--bg);
  background: var(--green);
}

.lab-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.launch-section {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 28rem);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.launch-section p {
  max-width: 48rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

code {
  color: var(--amber);
}

.launch-stats {
  display: grid;
  gap: 0.85rem;
}

.launch-stats span {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.launch-stats a {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(72, 214, 255, 0.1);
}

.launch-stats strong {
  color: var(--cyan);
  font-size: 1.6rem;
}

.store-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 0%, rgba(247, 185, 85, 0.14), transparent 22rem),
    radial-gradient(circle at 8% 18%, rgba(72, 214, 255, 0.18), transparent 24rem),
    var(--bg);
}

.store-hero {
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(18rem, 35rem);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding: 8rem clamp(1rem, 5vw, 5rem) 4rem;
  background-image:
    linear-gradient(90deg, rgba(5, 7, 10, 0.92), rgba(5, 7, 10, 0.48)),
    url("assets/images/spacecraft-window.jpg");
  background-position: center;
  background-size: cover;
}

.store-copy h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 7vw, 6rem);
}

.store-qr-strip {
  display: grid;
  gap: 1rem;
}

.qr-card {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 12, 0.84);
  box-shadow: var(--shadow);
}

.qr-card img {
  width: 100%;
  aspect-ratio: 1;
  padding: 0.45rem;
  border-radius: 6px;
  background: #fff;
}

.qr-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.qr-card a {
  color: var(--cyan);
  font-size: 1.55rem;
  font-weight: 900;
}

.store-showcase {
  display: grid;
  gap: clamp(4rem, 8vw, 7rem);
  padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.store-platform {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.platform-heading h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.phone-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(8rem, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  align-items: end;
}

.phone-row img {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.phone-row img:nth-child(2) {
  transform: translateY(-1.5rem);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-88px, 44px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 3.5rem;
  }

  .brand {
    font-size: 0.9rem;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 88vh;
    padding: 6rem 1rem 4rem;
    background-position: 58% center;
  }

  h1 {
    max-width: 10ch;
    font-size: 4rem;
  }

  .hero-text {
    font-size: 1rem;
  }

  .telemetry {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    min-width: 8rem;
    width: fit-content;
    margin-top: 1rem;
  }

  .telemetry strong {
    font-size: 1.55rem;
  }

  .story-section,
  .lab-section,
  .launch-section {
    padding: 4rem 1rem;
  }

  .story-rail {
    grid-template-columns: repeat(6, minmax(17rem, 82vw));
  }

  .lab-layout,
  .launch-section,
  .store-hero,
  .store-platform {
    grid-template-columns: 1fr;
  }

  .store-hero {
    min-height: auto;
    padding: 6rem 1rem 3rem;
  }

  .store-copy h1 {
    font-size: 3.4rem;
  }

  .qr-card {
    grid-template-columns: 6.5rem 1fr;
  }

  .qr-card a {
    font-size: 1.25rem;
  }

  .store-showcase {
    padding: 4rem 1rem;
  }

  .phone-row {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x proximity;
  }

  .phone-row img {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }

  .phone-row img:nth-child(2) {
    transform: none;
  }

  .audio-dock {
    left: auto;
    right: 1rem;
    bottom: 1rem;
    padding: 0.45rem;
    justify-content: center;
  }

  .volume {
    display: none;
  }
}
