:root {
  color-scheme: dark;
  --bg-0: #070814;
  --bg-1: #0d1020;
  --bg-2: #14182a;
  --panel: rgba(17, 22, 40, 0.86);
  --panel-strong: #161d34;
  --border-soft: rgba(180, 196, 255, 0.18);
  --text-primary: #f4f6fb;
  --text-secondary: #c9d0e3;
  --text-muted: #8f98b3;
  --accent-cyan: #5de3ff;
  --accent-magenta: #ff4fd8;
  --accent-amber: #ffb84a;
  --accent-green: #89ff8c;
  --danger-red: #ff5e73;
  --glow-cyan: rgba(93, 227, 255, 0.28);
  --glow-magenta: rgba(255, 79, 216, 0.22);
  --shadow-deep: 0 28px 90px rgba(0, 0, 0, 0.38);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --max: 1320px;
  --display: "Arial Black", "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pixel: "Lucida Console", "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 80% 8%, rgba(255, 79, 216, 0.16), transparent 28rem),
    radial-gradient(circle at 16% 32%, rgba(93, 227, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, #070814 0%, #11082e 48%, #070814 100%);
  color: var(--text-primary);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 227, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 11px, 128px 100%;
  opacity: 0.7;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button,
a {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent-amber);
  outline-offset: 4px;
}

.scanlines,
.noise {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  pointer-events: none;
}

.scanlines {
  z-index: 50;
  background-image: url("assets/overlays/overlay-scanlines.png");
  background-size: 720px;
  mix-blend-mode: soft-light;
  opacity: 0.07;
}

.noise {
  z-index: 49;
  background-image: url("assets/overlays/overlay-noise-soft.png");
  background-size: 560px;
  opacity: 0.09;
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  width: min(calc(100% - 32px), var(--max));
  min-height: 74px;
  margin: 18px auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(203, 216, 255, 0.48);
  border-radius: 24px;
  background: linear-gradient(180deg, #111729 0%, #0a0d1b 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  transition: min-height 180ms ease, transform 180ms ease;
}

.site-header.is-tight {
  min-height: 62px;
}

.brand,
.site-nav,
.header-actions,
.hero__actions,
.chip-list,
.mobile-location-list,
.site-footer nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-family: var(--display);
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-nav {
  justify-content: center;
  gap: clamp(14px, 4vw, 58px);
  min-width: 0;
  max-width: 100%;
  color: var(--text-secondary);
  font-family: var(--pixel);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a,
.site-footer a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent-cyan);
}

.header-actions {
  justify-content: flex-end;
  gap: 10px;
}

.status-chip,
.chip-list li {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.055);
  color: var(--accent-amber);
  font-family: var(--pixel);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-chip {
  padding: 10px 14px;
  color: var(--accent-green);
  background: rgba(137, 255, 140, 0.08);
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 13px 20px;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  border-color: transparent;
  background: var(--accent-cyan);
  color: var(--bg-0);
  box-shadow: 0 0 28px rgba(93, 227, 255, 0.24);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.055);
}

.button--small {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 0.78rem;
}

.section-shell {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

.hero {
  min-height: calc(100svh - 110px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(26px, 5vw, 72px);
  padding: clamp(72px, 10vw, 132px) 0 clamp(46px, 7vw, 88px);
}

.section-kicker,
.section-number,
.boot__eyebrow {
  color: var(--accent-amber);
  font-family: var(--pixel);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.final-cta h2,
.boot h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.88;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 8ch;
  font-size: clamp(4.2rem, 12vw, 11rem);
}

.hero h1::first-line {
  color: var(--text-primary);
}

.hero__lede {
  max-width: 700px;
  margin: 26px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.2rem, 2.25vw, 2.05rem);
  line-height: 1.25;
}

.hero__actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.chip-list {
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.chip-list li {
  padding: 8px 10px;
}

.hero__media {
  min-width: 0;
}

.cartridge-frame {
  position: relative;
  width: min(100%, 560px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 54px);
  border: 1px solid rgba(180, 196, 255, 0.22);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 60% 38%, rgba(255, 79, 216, 0.22), transparent 22rem),
    radial-gradient(circle at 44% 46%, rgba(93, 227, 255, 0.2), transparent 18rem),
    linear-gradient(145deg, #101428, #080a14 62%);
  box-shadow: var(--shadow-deep), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.cartridge-frame img {
  filter: drop-shadow(0 34px 52px rgba(0, 0, 0, 0.58));
  animation: cartridgeFloat 7s ease-in-out infinite;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-top: -34px;
  padding-bottom: clamp(70px, 9vw, 120px);
}

.stat-card,
.profile-card,
.game-card,
.sound-panel,
.artefact-card,
.artefact-inset,
.final-cta__inner {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-deep);
}

.stat-card {
  padding: 22px 18px;
}

.stat-card span,
.profile-card span,
.game-card figcaption,
.artefact-card span {
  display: block;
  color: var(--text-muted);
  font-family: var(--pixel);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  color: var(--text-primary);
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.editorial {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: clamp(28px, 7vw, 92px);
  padding: clamp(70px, 10vw, 126px) 0;
  border-top: 1px solid rgba(180, 196, 255, 0.1);
}

.section-heading {
  max-width: 850px;
  min-width: 0;
}

.section-heading h2,
.final-cta h2 {
  font-size: clamp(2.8rem, 6vw, 7rem);
  overflow-wrap: anywhere;
}

.section-heading p:not(.section-number) {
  max-width: 730px;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  line-height: 1.45;
}

.artefact-inset {
  padding: clamp(18px, 3vw, 36px);
}

.artefact-inset img {
  border-radius: var(--radius-md);
}

.artefact-inset figcaption {
  margin-top: 14px;
  color: var(--text-muted);
  font-family: var(--pixel);
  font-size: 0.72rem;
}

.world,
.profiles,
.gameplay,
.timeline,
.sound,
.archive,
.final-cta {
  padding: clamp(58px, 8vw, 112px) 0;
}

.world-map {
  position: relative;
  overflow: hidden;
  margin-top: 34px;
  border: 1px solid rgba(180, 196, 255, 0.42);
  border-radius: var(--radius-xl);
  background: #080a14;
  box-shadow: var(--shadow-deep);
}

.world-map img {
  width: 100%;
}

.hotspot {
  position: absolute;
  min-width: 42px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--accent-cyan);
  color: #06101d;
  font-family: var(--pixel);
  font-size: 0.65rem;
  box-shadow: 0 0 0 0 rgba(93, 227, 255, 0.5);
  animation: hotspotPulse 2.6s infinite;
}

.hotspot[aria-expanded="true"] {
  background: var(--accent-magenta);
}

.hotspot--forest { left: 13%; top: 54%; }
.hotspot--citadel { right: 20%; top: 27%; }
.hotspot--port { left: 48%; bottom: 27%; background: var(--accent-amber); }
.hotspot--cathedral { right: 10%; bottom: 37%; }
.hotspot--desert { left: 68%; bottom: 18%; background: var(--accent-green); }

.hotspot-card {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: min(320px, calc(100% - 44px));
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(6, 9, 22, 0.92);
}

.hotspot-card strong,
.hotspot-card span {
  display: block;
}

.hotspot-card span {
  margin-top: 6px;
  color: var(--text-secondary);
}

.mobile-location-list {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.mobile-location-list span {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--text-secondary);
  font-family: var(--pixel);
  font-size: 0.68rem;
}

.card-grid {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.card-grid--profiles {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.profile-card {
  padding: 16px;
  transition: transform 180ms ease, border-color 180ms ease;
}

.profile-card:hover,
.game-card:hover,
.artefact-card:hover {
  transform: translateY(-5px);
  border-color: rgba(93, 227, 255, 0.5);
}

.profile-card img,
.game-card img,
.artefact-card img {
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.profile-card span {
  margin-top: 16px;
  color: var(--accent-amber);
}

.profile-card h3 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1;
  text-transform: uppercase;
}

.profile-card p {
  margin: 5px 0 0;
  color: var(--accent-magenta);
  font-family: var(--pixel);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.profile-card small {
  display: block;
  margin-top: 10px;
  color: var(--text-secondary);
}

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

.game-card {
  overflow: hidden;
  margin: 0;
  transition: transform 180ms ease, border-color 180ms ease;
}

.game-card figcaption {
  padding: 16px;
  color: var(--text-primary);
}

.timeline-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 38px 0 0;
  list-style: none;
}

.timeline-list li {
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(22, 29, 52, 0.9), rgba(13, 16, 32, 0.9));
}

.timeline-list time {
  color: var(--accent-amber);
  font-family: var(--pixel);
}

.timeline-list strong {
  display: block;
  margin-top: 18px;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
}

.timeline-list span {
  display: block;
  margin-top: 12px;
  color: var(--text-secondary);
}

.sound {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.sound-panel {
  padding: clamp(20px, 4vw, 42px);
  min-width: 0;
}

.waveform {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.24);
}

.waveform span {
  flex: 1;
  min-width: 10px;
  height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-magenta));
}

.track-list {
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.track-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(180, 196, 255, 0.12);
}

.track-list button {
  min-height: 38px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
}

.track-list button.is-active {
  color: var(--accent-cyan);
}

.track-list span,
.sound-note {
  color: var(--text-muted);
  font-family: var(--pixel);
  font-size: 0.72rem;
}

.artefact-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.artefact-card {
  min-height: 44px;
  padding: 12px;
  color: inherit;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease;
}

.artefact-card span {
  margin-top: 12px;
  color: var(--text-primary);
}

.final-cta__inner {
  display: grid;
  gap: 24px;
  padding: clamp(28px, 7vw, 78px);
  background:
    linear-gradient(120deg, rgba(93, 227, 255, 0.16), transparent 40%),
    linear-gradient(300deg, rgba(255, 79, 216, 0.18), transparent 42%),
    var(--panel-strong);
}

.final-cta h2 {
  max-width: 1050px;
}

.site-footer {
  width: min(calc(100% - 32px), var(--max));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr) auto;
  gap: 24px;
  align-items: center;
  margin: 40px auto 0;
  padding: 30px 0 50px;
  color: var(--text-secondary);
}

.site-footer div {
  display: grid;
  gap: 8px;
}

.site-footer strong {
  color: var(--text-primary);
  font-family: var(--display);
  text-transform: uppercase;
}

.site-footer p {
  max-width: 560px;
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-legal {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.motion-toggle {
  min-height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: var(--panel);
  color: var(--text-primary);
}

.motion-toggle[aria-pressed="true"] {
  color: var(--accent-green);
}

.boot {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #02030a;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.boot.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.boot__panel {
  width: 100%;
  max-width: 640px;
  min-width: 0;
  border: 1px solid rgba(93, 227, 255, 0.42);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 6vw, 54px);
  background: linear-gradient(180deg, rgba(13, 16, 32, 0.98), rgba(7, 8, 20, 0.98));
  box-shadow: 0 0 80px rgba(93, 227, 255, 0.12);
}

.boot h1 {
  margin-top: 10px;
  font-size: clamp(2.1rem, 6vw, 4.9rem);
  overflow-wrap: anywhere;
}

.boot__log {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 24px 0;
  color: var(--text-secondary);
  font-family: var(--pixel);
  list-style: none;
  overflow-wrap: anywhere;
}

.boot__hint {
  margin: 14px 0 0;
  color: var(--text-muted);
}

.archive-dialog {
  width: min(calc(100% - 32px), 650px);
  border: 1px solid rgba(180, 196, 255, 0.36);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--bg-1);
  color: var(--text-primary);
  box-shadow: var(--shadow-deep);
}

.archive-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.archive-dialog__body {
  position: relative;
  padding: clamp(24px, 5vw, 48px);
}

.archive-dialog h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.archive-dialog p:not(.section-kicker) {
  color: var(--text-secondary);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 40px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text-primary);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes cartridgeFloat {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-14px) rotate(0.6deg); }
}

@keyframes hotspotPulse {
  0% { box-shadow: 0 0 0 0 rgba(93, 227, 255, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(93, 227, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(93, 227, 255, 0); }
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .hero,
  .editorial,
  .sound {
    grid-template-columns: 1fr;
  }

  .stats,
  .card-grid--profiles,
  .artefact-grid,
  .timeline-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .site-header {
    position: relative;
    top: auto;
    width: min(calc(100% - 20px), var(--max));
    margin-top: 10px;
    align-items: stretch;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    overflow: visible;
    padding-bottom: 4px;
    font-size: 0.68rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .status-chip {
    padding-inline: 10px;
  }

  .section-shell,
  .site-footer {
    width: min(calc(100% - 20px), var(--max));
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.85rem, 15vw, 4.6rem);
    overflow-wrap: anywhere;
  }

  .hero__lede {
    font-size: 1.15rem;
  }

  .button {
    width: 100%;
  }

  .stats,
  .card-grid--profiles,
  .card-grid--gameplay,
  .artefact-grid,
  .timeline-list {
    grid-template-columns: 1fr;
  }

  .world-map {
    overflow: hidden;
  }

  .world-map img {
    width: 100%;
    max-width: 100%;
  }

  .hotspot {
    display: none;
  }

  .hotspot-card {
    position: static;
    width: auto;
    margin: 14px;
  }

  .mobile-location-list {
    display: flex;
  }

  .waveform {
    gap: 6px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    flex-wrap: wrap;
  }
}

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

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

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
