:root {
  --green: #69ff91;
  --green-soft: #39d66c;
  --cyan: #99f7ff;
  --bg: #010608;
  --mx: 0px;
  --my: 0px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: #fff;
  overflow: hidden;
}

body {
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button { font: inherit; }

.hero {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  background: #010608;
  overflow: hidden;
}

.hero__art {
  position: absolute;
  inset: -24px;
  z-index: -7;
  transform: translate3d(var(--mx), var(--my), 0) scale(1.035);
  background-image:
    linear-gradient(90deg,
      rgba(1, 6, 8, .99) 0%,
      rgba(1, 6, 8, .97) 32%,
      rgba(1, 6, 8, .86) 43%,
      rgba(1, 6, 8, .26) 59%,
      rgba(1, 6, 8, .02) 76%),
    url("assets/arcade-crt-bg.webp");
  background-size: cover;
  background-position: center;
  filter: contrast(1.08) saturate(.9) brightness(.84);
  transition: transform .25s ease-out;
  will-change: transform;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -6;
  background:
    radial-gradient(circle at 73% 56%, rgba(47, 255, 111, .09), transparent 23%),
    linear-gradient(90deg, rgba(0, 10, 13, .5), transparent 55%);
  pointer-events: none;
}

.identity {
  position: absolute;
  left: clamp(28px, 6.2vw, 120px);
  top: 50%;
  width: min(48vw, 820px);
  transform: translateY(-48%);
  z-index: 5;
  text-shadow: 0 0 18px rgba(83, 255, 137, .22);
}

.signal {
  margin-bottom: clamp(16px, 2.1vh, 28px);
  color: rgba(105, 255, 145, .56);
  font-size: clamp(10px, .82vw, 14px);
  letter-spacing: .28em;
}

.logo {
  position: relative;
  display: inline-block;
  margin: 0;
  color: #eafcff;
  font-size: clamp(58px, 8.1vw, 156px);
  line-height: .88;
  letter-spacing: -.075em;
  font-weight: 900;
  filter: drop-shadow(0 0 8px rgba(113, 243, 255, .48));
  animation: logoFlicker 7s infinite steps(1);
}

.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  overflow: hidden;
}

.logo::before {
  color: #25ff88;
  transform: translate(2px, 0);
  clip-path: inset(0 0 58% 0);
  animation: glitchTop 4.8s infinite steps(1);
}

.logo::after {
  color: #52e9ff;
  transform: translate(-2px, 0);
  clip-path: inset(57% 0 0 0);
  animation: glitchBottom 5.7s infinite steps(1);
}

.categories {
  display: grid;
  gap: clamp(8px, 1.1vh, 16px);
  margin-top: clamp(28px, 4.2vh, 56px);
  color: var(--green);
  font-size: clamp(15px, 1.72vw, 31px);
  line-height: 1;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.categories span {
  width: max-content;
  max-width: 100%;
  text-shadow:
    0 0 4px rgba(105, 255, 145, .8),
    0 0 15px rgba(51, 227, 102, .27);
  animation: phosphor 4s infinite alternate;
}

.categories span:nth-child(2) { animation-delay: -.7s; }
.categories span:nth-child(3) { animation-delay: -1.4s; }

.start {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(36px, 6.2vh, 84px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .19em;
  font-weight: 700;
  font-size: clamp(13px, 1.05vw, 18px);
  text-shadow: 0 0 12px rgba(105, 255, 145, .65);
}

.start::before {
  content: "";
  width: 42px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  transition: width .25s ease;
}

.start:hover::before,
.start:focus-visible::before { width: 72px; }

.start:focus-visible {
  outline: 1px dashed var(--green);
  outline-offset: 10px;
}

.start__arrow {
  display: inline-block;
  font-size: 23px;
  animation: arrowPulse 1.45s ease-in-out infinite;
}

.microcopy {
  margin: 18px 0 0 61px;
  color: rgba(153, 247, 255, .34);
  font-size: clamp(9px, .66vw, 12px);
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: opacity .25s ease;
}

.screen-hotspot {
  position: absolute;
  z-index: 7;
  left: 68.7%;
  top: 27.5%;
  width: 23.2%;
  height: 33.5%;
  border: 0;
  border-radius: 14%;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.screen-hotspot:focus-visible {
  outline: 2px dashed rgba(105, 255, 145, .75);
  outline-offset: 7px;
}

.screen-message {
  position: absolute;
  z-index: 8;
  left: 68.7%;
  top: 27.5%;
  width: 23.2%;
  height: 33.5%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--green);
  border-radius: 14%;
  background:
    repeating-linear-gradient(0deg, rgba(75,255,124,.045) 0 1px, transparent 1px 4px),
    radial-gradient(circle, rgba(20, 88, 44, .34), rgba(1, 13, 8, .74) 70%);
  box-shadow: inset 0 0 65px rgba(56, 255, 111, .17);
  opacity: 0;
  pointer-events: none;
  transform: scale(.96);
  transition: opacity .16s ease, transform .16s ease;
  text-align: center;
  text-shadow: 0 0 12px currentColor;
}

.screen-message.is-active {
  opacity: .94;
  transform: scale(1);
  animation: screenWake .4s steps(2), screenJitter 2.3s .4s infinite steps(1);
}

.screen-message__small {
  font-size: clamp(8px, .75vw, 14px);
  letter-spacing: .2em;
}

.screen-message strong {
  font-size: clamp(20px, 2.7vw, 52px);
  letter-spacing: .1em;
}

.pixel-invader {
  margin-top: 4px;
  font-size: clamp(10px, 1vw, 18px);
  line-height: .7;
}

.status {
  position: absolute;
  right: 24px;
  bottom: 17px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(121, 250, 255, .24);
  font-size: 9px;
  letter-spacing: .16em;
}

.status__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 1.1s infinite steps(1);
}

.particles,
.vignette,
.scanlines,
.noise,
.glitch-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particles { z-index: -5; opacity: .32; }

.vignette {
  z-index: 15;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.5) 78%, rgba(0,0,0,.9) 112%);
  mix-blend-mode: multiply;
}

.scanlines {
  z-index: 16;
  opacity: .36;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.025) 0,
    rgba(255,255,255,.025) 1px,
    rgba(0,0,0,.05) 2px,
    rgba(0,0,0,.05) 4px
  );
  animation: scanDrift 11s linear infinite;
}

.noise {
  z-index: 17;
  opacity: .06;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.65'/%3E%3C/svg%3E");
  animation: noiseShift .22s infinite steps(2);
}

.glitch-flash {
  z-index: 18;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(84,255,147,.16) 12% 13%, transparent 13% 48%, rgba(94,225,255,.16) 48% 49%, transparent 49%),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,.06) 23px 25px);
}

.glitch-flash.is-active { animation: globalGlitch .34s steps(2); }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  color: var(--green);
  transition: opacity .65s ease, visibility .65s ease;
}

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

.boot__inner {
  width: min(92vw, 620px);
  font-size: clamp(12px, 1.2vw, 18px);
  line-height: 1.75;
  letter-spacing: .08em;
  text-shadow: 0 0 10px rgba(105,255,145,.66);
}

.boot__inner p {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  animation: typeLine .3s both steps(24);
}

.boot__inner p:nth-child(2) { animation-delay: .24s; }
.boot__inner p:nth-child(3) { animation-delay: .52s; }
.boot__inner p:nth-child(4) { animation-delay: .86s; }

.boot__ready {
  margin-top: 24px !important;
  animation: typeLine .3s .86s both steps(24), blink .85s 1.2s infinite steps(1) !important;
}

@keyframes typeLine { from { width: 0; } to { width: 100%; } }
@keyframes blink { 50% { opacity: .16; } }
@keyframes arrowPulse { 50% { transform: translateY(8px); opacity: .42; } }
@keyframes scanDrift { to { transform: translateY(8px); } }
@keyframes noiseShift { 0%{transform:translate(0)}25%{transform:translate(2%,-1%)}50%{transform:translate(-1%,2%)}75%{transform:translate(1%,1%)}100%{transform:translate(-2%,-1%)} }
@keyframes phosphor { from { opacity: .82; } to { opacity: 1; } }
@keyframes logoFlicker { 0%,96%,100%{opacity:1} 97%{opacity:.78} 98%{opacity:.96} 99%{opacity:.63} }
@keyframes glitchTop { 0%,87%,100%{transform:translate(2px,0)} 88%{transform:translate(11px,-2px)} 89%{transform:translate(-7px,1px)} 90%{transform:translate(3px,0)} }
@keyframes glitchBottom { 0%,91%,100%{transform:translate(-2px,0)} 92%{transform:translate(-12px,2px)} 93%{transform:translate(8px,-1px)} 94%{transform:translate(-2px,0)} }
@keyframes screenWake { 0%{clip-path:inset(49% 0 49% 0);filter:brightness(4)} 45%{clip-path:inset(0);filter:brightness(2)} 100%{filter:brightness(1)} }
@keyframes screenJitter { 0%,96%,100%{transform:translate(0)} 97%{transform:translate(2px,-1px)} 98%{transform:translate(-2px,1px)} 99%{transform:translate(1px,0)} }
@keyframes globalGlitch { 0%{opacity:0;transform:translateX(0)} 20%{opacity:.85;transform:translateX(8px)} 40%{opacity:.18;transform:translateX(-13px)} 65%{opacity:.6;transform:translateX(4px)} 100%{opacity:0;transform:translateX(0)} }

@media (max-width: 820px) {
  .hero__art {
    inset: -18px;
    background-image:
      linear-gradient(180deg,
        rgba(1,6,8,.96) 0%,
        rgba(1,6,8,.78) 25%,
        rgba(1,6,8,.18) 49%,
        rgba(1,6,8,.12) 72%,
        rgba(1,6,8,.82) 100%),
      url("assets/arcade-crt-bg.webp");
    background-size: auto 104%;
    background-position: 73% center;
    filter: contrast(1.08) saturate(.88) brightness(.68);
  }

  .identity {
    left: 24px;
    right: 24px;
    top: max(42px, env(safe-area-inset-top));
    width: auto;
    transform: none;
    text-align: center;
  }

  .signal { margin-bottom: 12px; }

  .logo {
    font-size: clamp(52px, 17vw, 92px);
    letter-spacing: -.08em;
  }

  .categories {
    justify-items: center;
    gap: 7px;
    margin-top: 18px;
    font-size: clamp(13px, 3.5vw, 18px);
  }

  .start {
    position: fixed;
    left: 50%;
    bottom: max(36px, calc(env(safe-area-inset-bottom) + 22px));
    transform: translateX(-50%);
    margin: 0;
    white-space: nowrap;
    z-index: 20;
  }

  .start::before { display: none; }
  .microcopy { display: none; }

  .screen-hotspot,
  .screen-message {
    left: 47.5%;
    top: 41%;
    width: 46%;
    height: 29%;
  }

  .status { display: none; }
}

@media (max-width: 430px) {
  .hero__art {
    background-size: auto 96%;
    background-position: 72% 58%;
  }

  .identity { top: max(38px, env(safe-area-inset-top)); }
  .signal { font-size: 9px; }
  .categories { font-size: 13px; }

  .screen-hotspot,
  .screen-message {
    left: 46%;
    top: 42%;
    width: 49%;
    height: 28%;
  }
}

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

  .hero__art { transform: none !important; }
}
