:root {
  --ink: #050a19;
  --night: #07142d;
  --blue: #61d9ff;
  --blue-hot: #b9f4ff;
  --amber: #ffbf69;
  --pink: #ff5b91;
  --paper: #eefcff;
  --muted: #95afc9;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

* { box-sizing: border-box; }

html { background: var(--ink); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Space Mono", monospace;
}

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

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(66, 181, 230, .08), transparent 23rem),
    #050a19;
}

.scene {
  position: absolute;
  z-index: -4;
  inset: 0;
  background-image: url("assets/pixel-night.png");
  background-position: center bottom;
  background-size: cover;
  image-rendering: pixelated;
  transform: scale(1.025);
  animation: scene-in 1.8s cubic-bezier(.2,.7,.2,1) both;
}

.vignette {
  position: absolute;
  z-index: -3;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 19, .92) 0%, rgba(3, 7, 19, .68) 36%, rgba(3, 7, 19, .08) 70%),
    linear-gradient(0deg, rgba(3, 7, 19, .74), transparent 42%),
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .4) 100%);
}

.noise, .scanlines, .stars {
  position: fixed;
  pointer-events: none;
  inset: 0;
}

.noise {
  z-index: 20;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.scanlines {
  z-index: 19;
  opacity: .13;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .36) 3px 4px);
  mix-blend-mode: multiply;
}

.stars { z-index: -2; overflow: hidden; }

.shooting-star {
  position: absolute;
  width: 5rem;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--blue-hot));
  filter: drop-shadow(0 0 5px var(--blue));
  transform: rotate(-24deg);
  animation: shoot 1.1s linear forwards;
}

.nav, .footer {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2rem clamp(1.25rem, 4vw, 4.5rem);
  letter-spacing: .12em;
}

.brand {
  display: flex;
  gap: .65rem;
  align-items: center;
  color: var(--paper);
  text-decoration: none;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(.75rem, 1.3vw, 1rem);
  text-shadow: 3px 3px 0 rgba(25, 96, 129, .65);
}

.brand span span, .brand__spark { color: var(--blue); }
.brand__spark { font-size: 1.35em; animation: twinkle 2.4s steps(2) infinite; }

.status {
  display: flex;
  gap: .55rem;
  align-items: center;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 700;
}

.status i {
  width: 7px;
  height: 7px;
  background: #70f0a1;
  box-shadow: 0 0 10px #70f0a1;
  animation: blink 1.7s steps(2) infinite;
}

.content {
  z-index: 2;
  align-self: center;
  width: min(780px, 100%);
  margin-top: -1vh;
  padding: 2rem clamp(1.25rem, 4vw, 4.5rem) 4rem;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: clamp(.65rem, 1vw, .8rem);
  font-weight: 700;
  letter-spacing: .2em;
  animation: rise .7s .2s both;
}

.eyebrow span { color: var(--amber); }

h1 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(2rem, 5.2vw, 5.25rem);
  line-height: 1.28;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 5px 5px 0 #09284c, 0 0 32px rgba(93, 211, 255, .08);
  animation: rise .8s .35s both;
}

h1 span {
  color: var(--blue-hot);
  text-shadow: 5px 5px 0 #12587b, 0 0 24px rgba(97, 217, 255, .3);
}

.lead {
  margin: 1.8rem 0 2rem;
  color: #b9cadb;
  font-size: clamp(.8rem, 1.2vw, 1rem);
  line-height: 1.9;
  animation: rise .8s .5s both;
}

.start-button {
  position: relative;
  display: inline-flex;
  gap: .8rem;
  align-items: center;
  border: 0;
  padding: 1rem 1.25rem;
  color: #06111e;
  background: var(--blue-hot);
  box-shadow: 5px 5px 0 #155875, inset -3px -3px 0 rgba(10, 95, 126, .28);
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: .69rem;
  transition: transform .15s, box-shadow .15s, background .2s;
  animation: rise .8s .65s both;
}

.start-button::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(185, 244, 255, .36);
}

.start-button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 #155875; background: #fff; }
.start-button:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #155875; }
.start-button:focus-visible { outline: 3px solid var(--amber); outline-offset: 8px; }
.start-button__icon { color: #116182; animation: blink 1s steps(2) infinite; }

.loader {
  width: min(390px, 100%);
  margin-top: 2.5rem;
  animation: rise .8s .8s both;
}

.loader__label {
  display: flex;
  justify-content: space-between;
  margin-bottom: .65rem;
  color: #7795b0;
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.loader__track {
  height: 8px;
  border: 2px solid rgba(123, 178, 209, .25);
  padding: 1px;
}

.loader__track span {
  display: block;
  width: 64%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--blue) 0 7px, transparent 7px 10px);
  filter: drop-shadow(0 0 5px rgba(97, 217, 255, .7));
  animation: load 5s steps(12) infinite alternate;
}

.footer {
  align-self: end;
  color: #617a91;
  font-size: .53rem;
  font-weight: 700;
}

.footer b { color: var(--pink); }
.hint { display: flex; align-items: center; gap: .25rem; }
kbd { border: 1px solid #42627c; padding: .22rem .32rem; color: #7f9bb3; font: inherit; }

.toast {
  position: fixed;
  z-index: 30;
  right: clamp(1rem, 3vw, 3rem);
  bottom: 2rem;
  display: flex;
  gap: .9rem;
  align-items: center;
  max-width: calc(100vw - 2rem);
  border: 2px solid var(--amber);
  padding: .85rem 1rem;
  color: var(--paper);
  background: rgba(5, 10, 25, .96);
  box-shadow: 6px 6px 0 rgba(255, 191, 105, .2);
  transform: translateY(8rem);
  opacity: 0;
  transition: transform .45s steps(5), opacity .2s;
}

.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast > span { color: var(--amber); font-size: 1.4rem; }
.toast strong, .toast small { display: block; }
.toast strong { color: var(--amber); font-family: "Press Start 2P", monospace; font-size: .55rem; }
.toast small { margin-top: .4rem; color: var(--muted); font-size: .68rem; }

.hero.is-started .scene { filter: saturate(1.2) brightness(1.08); }
.hero.is-started h1 { animation: glitch .35s steps(2); }
.hero.is-started .loader__track span { width: 100%; background-color: #70f0a1; animation: none; }

@keyframes scene-in { from { opacity: 0; transform: scale(1.08); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes twinkle { 50% { transform: scale(.65) rotate(45deg); opacity: .5; } }
@keyframes load { from { width: 12%; } to { width: 82%; } }
@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(-24deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(36vw, 18vw) rotate(-24deg); }
}
@keyframes glitch {
  25% { transform: translateX(-4px); text-shadow: 5px 5px 0 var(--pink); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); text-shadow: -5px 2px 0 var(--blue); }
}

@media (max-width: 720px) {
  .scene { background-position: 64% bottom; }
  .vignette { background: linear-gradient(90deg, rgba(3, 7, 19, .9), rgba(3, 7, 19, .3)), linear-gradient(0deg, rgba(3, 7, 19, .82), transparent 65%); }
  .nav { padding-top: 1.35rem; }
  .status { font-size: .5rem; }
  .content { align-self: end; padding-bottom: 2.5rem; }
  h1 { font-size: clamp(1.65rem, 8.5vw, 2.7rem); }
  .lead br { display: none; }
  .footer { padding-top: 1rem; padding-bottom: 1.25rem; }
  .footer .hint { display: none; }
}

@media (max-width: 430px) {
  .status { display: none; }
  .content { padding-top: 5rem; }
  .footer { gap: 1rem; align-items: flex-end; }
  .footer > span:last-child { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .shooting-star { display: none; }
}
