:root {
  color-scheme: dark;
  --black: #030407;
  --charcoal: #090d13;
  --panel: rgba(9, 14, 24, 0.72);
  --panel-strong: rgba(8, 13, 22, 0.9);
  --text: #f6f8ff;
  --muted: #a4b1c3;
  --dim: #6f7d91;
  --cyan: #66edff;
  --blue: #4b84ff;
  --violet: #ad70ff;
  --magenta: #ff5fb7;
  --amber: #ffd06e;
  --green: #70f5a7;
  --red: #ff5c7c;
  --line: rgba(168, 218, 255, 0.17);
  --line-hot: rgba(102, 237, 255, 0.46);
  --max: 1180px;
  --tight: min(var(--max), calc(100% - 34px));
  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;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(102, 237, 255, 0.08), transparent 28%),
    linear-gradient(225deg, rgba(255, 95, 183, 0.07), transparent 26%),
    linear-gradient(180deg, #05070c 0%, #080d13 48%, #020306 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.22;
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(102, 237, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(102, 237, 255, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
  animation: grid-slide 30s linear infinite;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#skyfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(transparent 50%, rgba(0, 0, 0, 0.18) 50%),
    linear-gradient(90deg, rgba(255, 95, 183, 0.035), rgba(102, 237, 255, 0.035));
  background-size: 100% 4px, 100% 100%;
  opacity: 0.22;
}

.nav-shell,
main,
.footer {
  position: relative;
  z-index: 2;
}

.nav-shell {
  width: var(--tight);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 237, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(102, 237, 255, 0.2), rgba(255, 95, 183, 0.08)),
    rgba(3, 5, 10, 0.9);
  color: #eefdff;
  font-weight: 950;
  box-shadow:
    0 0 24px rgba(102, 237, 255, 0.22),
    inset 0 0 18px rgba(102, 237, 255, 0.12);
}

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.brand-mode {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-shell nav {
  display: flex;
  gap: 20px;
  color: #c7d3e3;
  font-size: 14px;
}

.nav-shell nav a {
  opacity: 0.78;
  transition: color 180ms ease, opacity 180ms ease;
}

.nav-shell nav a:hover {
  color: var(--cyan);
  opacity: 1;
}

.nav-cta,
.action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(168, 218, 255, 0.22);
  border-radius: 8px;
  background: rgba(10, 16, 27, 0.72);
  color: #eef6ff;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-cta::before,
.action::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%);
  transition: transform 450ms ease;
}

.nav-cta:hover,
.action:hover {
  transform: translateY(-2px);
  border-color: rgba(102, 237, 255, 0.62);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
}

.nav-cta:hover::before,
.action:hover::before {
  transform: translateX(120%);
}

.action.primary {
  border-color: rgba(102, 237, 255, 0.66);
  background:
    linear-gradient(135deg, rgba(102, 237, 255, 0.95), rgba(75, 132, 255, 0.94) 54%, rgba(255, 95, 183, 0.78));
  color: #02060c;
  box-shadow:
    0 24px 70px rgba(75, 132, 255, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.hero-stage {
  width: var(--tight);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 62px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(410px, 0.9fr);
  gap: 60px;
  align-items: center;
}

.hero-copy {
  position: relative;
}

.signal-label {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  color: #adf5ff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.signal-label::before {
  content: "";
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 15px rgba(102, 237, 255, 0.85);
}

.hero-copy h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(48px, 6.5vw, 92px);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-lede {
  max-width: 660px;
  margin: 28px 0 0;
  color: #bdcce1;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.guardian-hud {
  position: relative;
  min-height: 610px;
  padding: 22px;
  border: 1px solid rgba(168, 218, 255, 0.17);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(12, 20, 33, 0.74), rgba(3, 6, 12, 0.58)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 34px 100%, 0 calc(100% - 34px));
}

.guardian-hud::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(102, 237, 255, 0.08);
  clip-path: inherit;
  pointer-events: none;
}

.guardian-hud::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    conic-gradient(from 0deg, transparent, rgba(102, 237, 255, 0.12), transparent 22%, rgba(255, 95, 183, 0.12), transparent 42%);
  animation: spin-slow 18s linear infinite;
  opacity: 0.8;
}

.hud-top,
.core-wrap,
.xp-track,
.quick-stats {
  position: relative;
  z-index: 1;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hud-top strong {
  color: var(--amber);
  font-size: 24px;
  letter-spacing: 0;
  text-transform: none;
}

.core-wrap {
  min-height: 386px;
  display: grid;
  place-items: center;
}

.core-rings {
  position: absolute;
  width: min(380px, 84%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.core-rings span {
  position: absolute;
  inset: var(--inset, 0);
  border: 1px solid rgba(102, 237, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(102, 237, 255, 0.11);
  animation: pulse-ring 4s ease-in-out infinite;
}

.core-rings span:nth-child(1) {
  --inset: 0;
}

.core-rings span:nth-child(2) {
  --inset: 16%;
  border-color: rgba(255, 95, 183, 0.22);
  animation-delay: -1.2s;
}

.core-rings span:nth-child(3) {
  --inset: 31%;
  border-color: rgba(255, 208, 110, 0.26);
  animation-delay: -2.4s;
}

.core {
  position: relative;
  width: min(218px, 54vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(102, 237, 255, 0.16), rgba(255, 95, 183, 0.08)),
    #040910;
  border: 1px solid rgba(102, 237, 255, 0.34);
  box-shadow:
    0 0 66px rgba(102, 237, 255, 0.26),
    inset 0 0 54px rgba(102, 237, 255, 0.12);
  animation: core-breathe 5.4s ease-in-out infinite;
}

.core span {
  display: block;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.core strong {
  display: block;
  margin-top: 8px;
  padding: 0 26px;
  font-size: 30px;
  line-height: 0.98;
  text-wrap: balance;
}

.xp-track {
  padding: 18px;
  border: 1px solid rgba(168, 218, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.xp-track div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.xp-track strong {
  color: #fff2ba;
}

.xp-track i {
  display: block;
  height: 10px;
  border: 1px solid rgba(102, 237, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.xp-track i::before {
  content: "";
  display: block;
  width: 88%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--magenta));
  box-shadow: 0 0 18px rgba(102, 237, 255, 0.5);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.quick-stats div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(168, 218, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.quick-stats strong {
  display: block;
  font-size: 32px;
  line-height: 1;
}

.quick-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.route-readout {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border: 1px solid rgba(255, 95, 183, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 95, 183, 0.1), rgba(102, 237, 255, 0.08)),
    rgba(0, 0, 0, 0.28);
  color: #e4edf8;
}

.route-readout strong {
  color: var(--cyan);
}

.mission-strip,
.arena,
.reset-theater,
.download-zone,
.final-call {
  width: var(--tight);
  margin: 0 auto;
}

.mission-strip {
  padding: 82px 0;
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 42px;
  align-items: center;
}

.section-copy h2,
.arena-copy h2,
.reset-message h2,
.download-copy h2 {
  margin: 0;
  font-size: clamp(36px, 5.7vw, 76px);
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

.section-copy p:not(.signal-label),
.arena-copy p,
.reset-message p:not(.signal-label),
.download-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.mission-board {
  display: grid;
  gap: 14px;
}

.mission {
  position: relative;
  min-height: 164px;
  padding: 22px 22px 20px 74px;
  border: 1px solid rgba(168, 218, 255, 0.15);
  border-radius: 8px;
  background: rgba(6, 10, 18, 0.64);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mission::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(102, 237, 255, 0.6), transparent);
}

.mission:hover,
.mission.active {
  transform: translateX(-6px);
  border-color: rgba(102, 237, 255, 0.4);
  background: rgba(11, 19, 33, 0.78);
}

.mission-index {
  position: absolute;
  left: 17px;
  top: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(102, 237, 255, 0.36);
  border-radius: 50%;
  color: var(--cyan);
  font-weight: 950;
}

.mission h3 {
  margin: 0 0 9px;
  font-size: 26px;
  line-height: 1;
}

.mission p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
}

.mission b {
  display: inline-flex;
  margin-top: 14px;
  color: var(--amber);
}

.arena {
  padding: 86px 0 72px;
}

.arena-copy {
  max-width: 760px;
  margin-bottom: 30px;
}

.system-deck {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr 0.92fr;
  grid-auto-rows: minmax(210px, auto);
  gap: 14px;
}

.system-card {
  position: relative;
  min-height: 220px;
  padding: 24px;
  border: 1px solid rgba(168, 218, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 56%),
    rgba(5, 9, 16, 0.72);
  overflow: hidden;
}

.system-card::after {
  content: "";
  position: absolute;
  inset: auto 24px 0 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--magenta), transparent);
  opacity: 0.56;
}

.system-card.tall {
  grid-row: span 2;
  min-height: 454px;
}

.system-card.wide {
  grid-column: span 2;
}

.system-card span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.system-card h3 {
  margin: 22px 0 12px;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 0.94;
}

.system-card p {
  color: var(--muted);
  line-height: 1.58;
}

.meter {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 32px;
  height: 13px;
  border: 1px solid rgba(102, 237, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.meter i {
  display: block;
  width: var(--value);
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--blue));
}

.event-line {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid rgba(168, 218, 255, 0.11);
}

.event-line time {
  color: var(--amber);
  font-size: 12px;
  font-weight: 950;
}

.event-line p {
  margin: 0;
}

.reset-theater {
  padding: 78px 0;
}

.reset-screen {
  position: relative;
  min-height: 650px;
  display: grid;
  grid-template-columns: 1fr 310px;
  grid-template-rows: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(168, 218, 255, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(8, 13, 22, 0.86), rgba(2, 4, 8, 0.76)),
    repeating-linear-gradient(90deg, rgba(102, 237, 255, 0.045) 0 1px, transparent 1px 28px);
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}

.reset-bg-lines {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(102, 237, 255, 0.13) 42% 43%, transparent 43% 100%),
    linear-gradient(300deg, transparent 0 58%, rgba(255, 95, 183, 0.1) 58% 59%, transparent 59% 100%);
  animation: theater-lines 8s ease-in-out infinite alternate;
}

.reset-message,
.breath-core,
.reset-actions {
  position: relative;
  z-index: 1;
}

.reset-message p:not(.signal-label) {
  max-width: 690px;
}

.breath-core {
  justify-self: center;
  width: min(290px, 72vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(102, 237, 255, 0.36);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(102, 237, 255, 0.14), rgba(255, 95, 183, 0.08)),
    #04070c;
  box-shadow:
    0 0 70px rgba(102, 237, 255, 0.22),
    inset 0 0 60px rgba(102, 237, 255, 0.12);
  animation: core-breathe 5.6s ease-in-out infinite;
}

.breath-core span {
  display: block;
  font-size: 82px;
  line-height: 0.85;
  font-weight: 950;
}

.breath-core small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reset-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reset-actions span {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(168, 218, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #dce9f8;
  font-size: 14px;
  font-weight: 900;
}

.download-zone {
  padding: 78px 0 42px;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 34px;
  align-items: center;
}

.download-terminal {
  padding: 24px;
  border: 1px solid rgba(102, 237, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(102, 237, 255, 0.08), rgba(255, 95, 183, 0.045)),
    rgba(2, 5, 10, 0.78);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.terminal-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.terminal-top strong {
  color: var(--green);
}

.download-terminal .action {
  width: 100%;
}

.download-terminal dl {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
}

.download-terminal dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(168, 218, 255, 0.11);
}

.download-terminal dt,
.download-terminal dd {
  margin: 0;
}

.download-terminal dt {
  color: var(--muted);
}

.download-terminal dd {
  color: var(--text);
  font-weight: 900;
}

.download-terminal p {
  margin: 16px 0 0;
  color: #e5c987;
  font-size: 13px;
  line-height: 1.5;
}

.final-call {
  padding: 68px 0;
  text-align: center;
}

.final-call p {
  margin: 0 auto;
  max-width: 840px;
  font-size: clamp(25px, 4vw, 48px);
  line-height: 1.04;
  font-weight: 950;
  text-wrap: balance;
}

.footer {
  width: var(--tight);
  margin: 0 auto;
  padding: 30px 0 46px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(168, 218, 255, 0.13);
  color: var(--muted);
  font-size: 14px;
}

@keyframes grid-slide {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 88px 88px, 88px 88px;
  }
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-ring {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.64;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes core-breathe {
  0%,
  100% {
    transform: scale(0.98);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes theater-lines {
  from {
    transform: translateX(-22px);
  }
  to {
    transform: translateX(22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

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

  .hero-stage,
  .mission-strip,
  .download-zone {
    grid-template-columns: 1fr;
  }

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

  .guardian-hud {
    min-height: 560px;
  }

  .system-deck {
    grid-template-columns: 1fr 1fr;
  }

  .system-card.tall,
  .system-card.wide {
    grid-column: auto;
    grid-row: auto;
    min-height: 240px;
  }

  .reset-screen {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  :root {
    --tight: min(var(--max), calc(100% - 24px));
  }

  .nav-shell {
    min-height: 68px;
  }

  .brand-mode,
  .nav-cta {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(44px, 14vw, 66px);
  }

  .hero-actions .action {
    width: 100%;
  }

  .guardian-hud {
    min-height: 520px;
    padding: 16px;
  }

  .quick-stats,
  .system-deck,
  .reset-actions {
    grid-template-columns: 1fr;
  }

  .mission {
    padding-left: 64px;
  }

  .mission::before {
    left: 42px;
  }

  .mission-index {
    width: 36px;
    height: 36px;
    left: 13px;
  }

  .mission-strip,
  .arena,
  .reset-theater,
  .download-zone,
  .final-call {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .reset-screen {
    min-height: 620px;
    padding: 20px;
  }

  .breath-core span {
    font-size: 64px;
  }

  .footer {
    flex-direction: column;
  }
}
