:root {
  --acid: #c7ff00;
  --acid-bright: #d8ff3f;
  --ink: #050704;
  --panel: rgba(5, 7, 4, 0.78);
  --border: rgba(199, 255, 0, 0.72);
  --display: "Courier New", "Lucida Console", monospace;
  --headline: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--acid);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--acid-bright);
  outline-offset: 5px;
}

.stage {
  position: relative;
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr) 58px;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(5, 7, 4, 0.14), rgba(5, 7, 4, 0.48)),
    url("assets/signal-field.webp") center / cover no-repeat,
    var(--ink);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 70% 50%, rgba(199, 255, 0, 0.12), transparent 32%),
    linear-gradient(90deg, transparent 49.88%, rgba(199, 255, 0, 0.08) 50%, transparent 50.12%);
  pointer-events: none;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  border: clamp(8px, 0.7vw, 14px) solid var(--acid);
  box-shadow: inset 0 0 60px rgba(199, 255, 0, 0.13);
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0.15;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(199, 255, 0, 0.16) 4px,
    transparent 5px
  );
  animation: scan-drift 9s linear infinite;
}

.cursor-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: 340px;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 255, 0, 0.14), transparent 66%);
  filter: blur(12px);
  pointer-events: none;
  will-change: left, top;
}

.topbar {
  position: relative;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  width: min(100% - clamp(44px, 6vw, 116px), 1780px);
  margin-inline: auto;
  border-bottom: 1px solid rgba(199, 255, 0, 0.42);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.75rem;
  color: var(--acid);
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(199, 255, 0, 0.55));
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(199, 255, 0, 0.5);
  background: rgba(5, 7, 4, 0.68);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 14px var(--acid);
  animation: status-pulse 1.8s steps(2, end) infinite;
}

.top-links {
  display: flex;
  justify-self: end;
  gap: 1.35rem;
}

.top-links a {
  position: relative;
  padding-block: 0.3rem;
  text-decoration: none;
}

.top-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.top-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(500px, 1.05fr) minmax(520px, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 100px);
  width: min(100% - clamp(72px, 8vw, 154px), 1780px);
  min-height: 0;
  margin-inline: auto;
  padding-block: clamp(28px, 3vh, 50px);
}

.hero-copy {
  position: relative;
  z-index: 3;
  min-width: 0;
  align-self: center;
  max-width: 890px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 clamp(18px, 2.2vh, 28px);
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--border);
  background: rgba(5, 7, 4, 0.82);
  font-size: clamp(0.75rem, 0.72vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.11em;
}

h1 {
  margin: 0;
  color: var(--acid);
  font-family: var(--headline);
  font-size: clamp(4.8rem, 6.3vw, 7.6rem);
  font-weight: 900;
  line-height: 0.77;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-shadow: 6px 6px 0 var(--ink), 0 0 34px rgba(199, 255, 0, 0.2);
}

h1 span {
  display: inline-block;
  color: var(--ink);
  -webkit-text-stroke: 2px var(--acid);
  transform: skewX(-5deg);
}

.lore {
  max-width: 700px;
  margin: clamp(24px, 3.2vh, 38px) 0 0;
  padding: 1rem 1.1rem 1rem 1.25rem;
  border-left: 5px solid var(--acid);
  background: linear-gradient(90deg, rgba(5, 7, 4, 0.94), rgba(5, 7, 4, 0.5));
  color: #efffc1;
  font-size: clamp(1rem, 0.96vw, 1.18rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(22px, 3vh, 34px);
}

.action {
  position: relative;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 1.35rem;
  padding: 0.82rem 1.1rem;
  overflow: hidden;
  border: 2px solid var(--acid);
  background: rgba(5, 7, 4, 0.88);
  color: var(--acid);
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(199, 255, 0, 0.28);
  transition: color 160ms ease, background 160ms ease, translate 160ms ease, box-shadow 160ms ease;
}

.action:hover {
  translate: -2px -2px;
  background: var(--acid);
  color: var(--ink);
  box-shadow: 7px 7px 0 rgba(199, 255, 0, 0.42);
}

.action--solid {
  background: var(--acid);
  color: var(--ink);
}

.action--solid:hover {
  background: var(--acid-bright);
}

.action--ca {
  min-width: 186px;
}

.action--ca strong {
  font-size: 1.02rem;
}

.copy-icon {
  transition: rotate 180ms ease;
}

.action--ca:hover .copy-icon {
  rotate: 90deg;
}

.character-zone {
  position: relative;
  display: grid;
  min-width: 0;
  height: min(78vh, 810px);
  min-height: 620px;
  place-items: center;
  perspective: 1100px;
}

.character {
  position: relative;
  z-index: 4;
  display: grid;
  width: min(35vw, 620px);
  min-width: 430px;
  aspect-ratio: 1;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform;
}

.character img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(14px 18px 0 rgba(199, 255, 0, 0.25))
    drop-shadow(0 0 24px rgba(199, 255, 0, 0.34));
  animation: phone-float 3.7s ease-in-out infinite;
  user-select: none;
}

.character:hover img {
  animation-duration: 1.25s;
}

.character.is-ringing img {
  animation: ring 530ms steps(2, end) 2;
}

.character__shadow {
  position: absolute;
  right: 20%;
  bottom: 8%;
  left: 20%;
  z-index: 0;
  height: 10%;
  border-radius: 50%;
  background: rgba(199, 255, 0, 0.44);
  filter: blur(18px);
  animation: shadow-breathe 3.7s ease-in-out infinite;
}

.character__pulse {
  position: absolute;
  inset: 18%;
  z-index: 1;
  border: 3px solid rgba(199, 255, 0, 0.55);
  border-radius: 50%;
  opacity: 0;
}

.character.is-ringing .character__pulse {
  animation: ring-pulse 850ms ease-out;
}

.orbit {
  position: absolute;
  z-index: 0;
  width: min(46vw, 760px);
  aspect-ratio: 1;
  border: 1px dashed rgba(199, 255, 0, 0.54);
  border-radius: 50%;
  animation: orbit-spin 28s linear infinite;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--acid);
  box-shadow: 0 0 18px var(--acid);
}

.orbit::before {
  top: 12%;
  left: 12%;
}

.orbit::after {
  right: 8%;
  bottom: 20%;
}

.orbit--two {
  width: min(38vw, 630px);
  border-style: solid;
  border-color: rgba(199, 255, 0, 0.18);
  animation-direction: reverse;
  animation-duration: 19s;
}

.signal-tag {
  position: absolute;
  z-index: 6;
  display: grid;
  min-width: 128px;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--acid);
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--acid);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.signal-tag strong {
  font-size: 1.35rem;
}

.signal-tag--top {
  top: 10%;
  left: 6%;
  rotate: -4deg;
}

.signal-tag--side {
  right: 3%;
  bottom: 20%;
  rotate: 4deg;
}

.speech {
  position: absolute;
  top: 17%;
  right: 1%;
  z-index: 7;
  width: min(260px, 34%);
  padding: 0.9rem 1rem;
  border: 2px solid var(--acid);
  background: var(--acid);
  color: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 82%, 22% 82%, 12% 100%, 14% 82%, 0 82%);
  rotate: 2deg;
  font-size: 0.82rem;
  line-height: 1.25;
}

.speech__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.speech.is-updating strong {
  animation: message-blink 260ms steps(2, end) 2;
}

.tap-hint {
  position: absolute;
  bottom: 5%;
  left: 12%;
  z-index: 6;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  animation: hint-jump 1.3s steps(2, end) infinite;
}

.ticker {
  position: relative;
  z-index: 9;
  overflow: hidden;
  border-top: 2px solid var(--acid);
  background: var(--acid);
  color: var(--ink);
  font-family: var(--headline);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.ticker__track {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 1.6rem;
  height: 100%;
  padding-left: 1.6rem;
  animation: ticker 24s linear infinite;
}

.ticker b {
  font-family: var(--display);
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 82px;
  z-index: 30;
  padding: 1rem 1.2rem;
  border: 2px solid var(--ink);
  background: var(--acid);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 7px 7px 0 rgba(199, 255, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 1rem;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.12em;
  transition: opacity 320ms ease, visibility 320ms ease;
}

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

.boot-screen__bar {
  width: min(72vw, 360px);
  height: 18px;
  border: 3px solid var(--ink);
}

.boot-screen__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  animation: boot 720ms steps(8, end) forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.reveal--delay-1 {
  transition-delay: 90ms;
}

.reveal--delay-2 {
  transition-delay: 180ms;
}

.reveal--delay-3 {
  transition-delay: 270ms;
}

@keyframes boot {
  to { width: 100%; }
}

@keyframes scan-drift {
  to { background-position-y: 60px; }
}

@keyframes status-pulse {
  50% { opacity: 0.3; }
}

@keyframes phone-float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-18px) rotate(1.5deg); }
}

@keyframes shadow-breathe {
  0%, 100% { scale: 0.82; opacity: 0.32; }
  50% { scale: 1.08; opacity: 0.5; }
}

@keyframes ring {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-16px) rotate(-4deg); }
  40% { transform: translateX(16px) rotate(4deg); }
  60% { transform: translateX(-11px) rotate(-3deg); }
  80% { transform: translateX(11px) rotate(3deg); }
}

@keyframes ring-pulse {
  0% { opacity: 0.8; scale: 0.7; }
  100% { opacity: 0; scale: 1.6; }
}

@keyframes orbit-spin {
  to { transform: rotate(1turn); }
}

@keyframes message-blink {
  50% { opacity: 0; }
}

@keyframes hint-jump {
  50% { transform: translate(-4px, -4px); }
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

@media (max-width: 1180px) {
  .stage {
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .system-status {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }

  .hero-copy {
    max-width: 820px;
  }

  .character-zone {
    height: 760px;
  }

  .character {
    width: min(72vw, 620px);
  }

  .orbit {
    width: min(86vw, 760px);
  }

  .orbit--two {
    width: min(72vw, 630px);
  }
}

@media (max-width: 700px) {
  .stage {
    grid-template-rows: 72px auto 50px;
  }

  .topbar {
    width: calc(100% - 44px);
    gap: 1rem;
  }

  .brand span {
    display: none;
  }

  .top-links {
    gap: 0.75rem;
    font-size: 0.66rem;
  }

  .hero {
    width: calc(100% - 48px);
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(3.4rem, 16.5vw, 5.5rem);
  }

  .lore {
    font-size: 1rem;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action {
    width: 100%;
  }

  .character-zone {
    height: 610px;
    min-height: 610px;
  }

  .character {
    width: min(92vw, 500px);
    max-width: 100%;
    min-width: 0;
  }

  .character img {
    filter:
      drop-shadow(7px 10px 0 rgba(199, 255, 0, 0.22))
      drop-shadow(0 0 18px rgba(199, 255, 0, 0.28));
  }

  .signal-tag--top {
    top: 13%;
    left: 0;
  }

  .signal-tag--side {
    right: 8px;
    bottom: 18%;
  }

  .speech {
    top: 21%;
    right: 0;
    width: 42%;
    font-size: 0.68rem;
  }

  .tap-hint {
    bottom: 3%;
    left: 4%;
  }

  .toast {
    right: 18px;
    bottom: 70px;
    left: 18px;
    text-align: center;
  }
}

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

  .cursor-glow {
    display: none;
  }
}
