:root {
  color-scheme: dark;
  --ink: #06070a;
  --panel: rgba(10, 12, 17, 0.72);
  --white: #f4f7ff;
  --muted: #8a91a3;
  --line: rgba(177, 193, 232, 0.18);
  --cyan: #63f6ff;
  --blue: #6587ff;
  --violet: #b46cff;
  --gold: #efce82;
  --mx: 0;
  --my: 0;
  --spot-x: 50%;
  --spot-y: 50%;
  font-family: "SFMono-Regular", "Roboto Mono", "Cascadia Code", Menlo, Consolas, monospace;
  background: var(--ink);
  color: var(--white);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at var(--spot-x) var(--spot-y), rgba(101, 135, 255, 0.1), transparent 27rem),
    radial-gradient(circle at 78% 25%, rgba(180, 108, 255, 0.08), transparent 30rem),
    linear-gradient(145deg, #050609 0%, #080b12 48%, #040507 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(133, 156, 209, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 156, 209, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  transform: perspective(800px) rotateX(calc(var(--my) * -0.45deg)) rotateY(calc(var(--mx) * 0.45deg)) scale(1.08);
  transform-origin: center;
}

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

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}

#signal-field {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.032;
  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='.8'/%3E%3C/svg%3E");
}

.scanline {
  position: fixed;
  top: -14vh;
  left: 0;
  z-index: 19;
  width: 100%;
  height: 13vh;
  pointer-events: none;
  opacity: 0.45;
  background: linear-gradient(to bottom, transparent, rgba(99, 246, 255, 0.055), transparent);
  animation: scan 9s linear infinite;
}

.shell {
  width: min(1400px, calc(100% - 64px));
  min-height: 100svh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 0 max(22px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: clamp(20px, 3vh, 38px);
}

.topbar,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

.topbar {
  min-height: 44px;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
}

.identity-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.6);
  background: rgba(99, 246, 255, 0.05);
  color: var(--cyan);
  clip-path: polygon(0 0, 78% 0, 100% 22%, 100% 100%, 22% 100%, 0 78%);
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(99, 246, 255, 0.08), 0 0 16px rgba(99, 246, 255, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero {
  min-height: min(620px, 68vh);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.75fr);
  align-items: center;
  gap: clamp(30px, 6vw, 100px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  transform: translate3d(calc(var(--mx) * -1.2px), calc(var(--my) * -0.7px), 0);
  transition: transform 180ms ease-out;
}

.eyebrow {
  width: min(100%, 620px);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cyan);
  letter-spacing: 0.16em;
  font-size: clamp(9px, 1vw, 12px);
  font-weight: 800;
}

h1 {
  position: relative;
  margin: 0;
  line-height: 0.76;
  letter-spacing: -0.075em;
  font-family: Inter, "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(78px, 12vw, 188px);
  font-weight: 950;
  text-transform: uppercase;
}

.name-line {
  display: block;
  text-shadow: 0 0 46px rgba(101, 135, 255, 0.1);
}

.name-line.outline {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 247, 255, 0.72);
  text-stroke: 1.5px rgba(244, 247, 255, 0.72);
  transform: translateX(0.03em);
}

h1::after {
  position: absolute;
  inset: 0;
  content: attr(data-text);
  display: none;
  color: var(--cyan);
  opacity: 0.65;
  mix-blend-mode: screen;
  clip-path: inset(41% 0 42% 0);
  transform: translateX(4px);
}

body.is-glitching h1::after {
  display: block;
  animation: glitch 420ms steps(2, end) 1;
}

.statement {
  margin-top: clamp(28px, 4vh, 48px);
  padding-left: 18px;
  border-left: 2px solid var(--violet);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(16px, 2vw, 28px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.statement p {
  margin: 0;
}

.statement p:last-child {
  color: var(--gold);
}

.subcopy {
  max-width: 540px;
  margin: 19px 0 0 20px;
  color: var(--muted);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.6;
}

.signal-stage {
  position: relative;
  width: min(39vw, 520px);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  transform: translate3d(calc(var(--mx) * 1.8px), calc(var(--my) * 1.2px), 0) rotateX(calc(var(--my) * -0.3deg)) rotateY(calc(var(--mx) * 0.3deg));
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
}

.signal-stage::before,
.signal-stage::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.signal-stage::before {
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(101, 135, 255, 0.14), rgba(180, 108, 255, 0.035) 48%, transparent 71%);
  filter: blur(10px);
  animation: breathe 4.8s ease-in-out infinite;
}

.signal-stage::after {
  width: 104%;
  height: 104%;
  border: 1px solid rgba(99, 246, 255, 0.09);
  box-shadow: inset 0 0 80px rgba(101, 135, 255, 0.04);
}

.orbit {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit::after {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(99, 246, 255, 0.95);
}

.orbit-one {
  width: 88%;
  height: 88%;
  border: 1px dashed rgba(99, 246, 255, 0.27);
  animation: rotate 22s linear infinite;
}

.orbit-two {
  width: 68%;
  height: 68%;
  border: 1px solid rgba(180, 108, 255, 0.32);
  transform: rotateX(66deg) rotateZ(23deg);
  animation: orbit-two 13s linear infinite reverse;
}

.orbit-two::after {
  background: var(--violet);
  box-shadow: 0 0 18px rgba(180, 108, 255, 0.95);
}

.orbit-three {
  width: 52%;
  height: 52%;
  border: 1px dotted rgba(239, 206, 130, 0.36);
  transform: rotateY(62deg) rotateZ(-18deg);
  animation: orbit-three 9s linear infinite;
}

.orbit-three::after {
  background: var(--gold);
  box-shadow: 0 0 18px rgba(239, 206, 130, 0.95);
}

.signal-core {
  position: relative;
  z-index: 3;
  width: 33%;
  aspect-ratio: 1;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(99, 246, 255, 0.58);
  border-radius: 50%;
  background: rgba(5, 7, 12, 0.78);
  color: var(--white);
  box-shadow:
    0 0 0 10px rgba(99, 246, 255, 0.025),
    0 0 52px rgba(101, 135, 255, 0.24),
    inset 0 0 35px rgba(99, 246, 255, 0.08);
  cursor: pointer;
  isolation: isolate;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.signal-core::before,
.signal-core::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.signal-core::before {
  inset: 11%;
  border: 1px solid rgba(244, 247, 255, 0.14);
  border-radius: 50%;
}

.signal-core::after {
  inset: -28%;
  border-radius: 50%;
  background: conic-gradient(from 90deg, transparent, rgba(99, 246, 255, 0.25), transparent 23%, rgba(180, 108, 255, 0.2), transparent 62%, rgba(239, 206, 130, 0.18), transparent);
  mask: radial-gradient(circle, transparent 61%, black 63%);
  animation: rotate 7s linear infinite;
}

.signal-core:hover {
  transform: scale(1.08);
  border-color: var(--cyan);
  box-shadow:
    0 0 0 14px rgba(99, 246, 255, 0.035),
    0 0 80px rgba(99, 246, 255, 0.28),
    inset 0 0 48px rgba(99, 246, 255, 0.13);
}

.signal-core:active {
  transform: scale(0.96);
}

.core-halo {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: rgba(99, 246, 255, 0.18);
  filter: blur(18px);
  animation: pulse 2s ease-in-out infinite;
}

.core-center {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.core-glyph {
  font-family: Inter, "Arial Black", sans-serif;
  font-size: clamp(27px, 4vw, 51px);
  font-weight: 950;
  letter-spacing: -0.08em;
}

.core-command {
  color: var(--cyan);
  font-size: clamp(7px, 0.7vw, 10px);
  font-weight: 900;
  letter-spacing: 0.18em;
}

.coordinate {
  position: absolute;
  color: rgba(138, 145, 163, 0.7);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.coordinate-a { top: 8%; left: 22%; }
.coordinate-b { right: 3%; bottom: 36%; }
.coordinate-c { bottom: 9%; left: 23%; }

.console {
  display: grid;
  grid-template-columns: 190px minmax(200px, 1fr);
  align-items: center;
  gap: 11px 24px;
  padding: 13px 17px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.67);
  backdrop-filter: blur(14px);
}

.console-head {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.progress-track {
  height: 2px;
  background: rgba(244, 247, 255, 0.1);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--gold));
  box-shadow: 0 0 12px var(--cyan);
  transition: width 600ms cubic-bezier(0.25, 0.75, 0.2, 1);
}

.console-output {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c9cfdf;
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt {
  color: var(--cyan);
  font-weight: 900;
}

.terminal-caret {
  width: 6px;
  height: 13px;
  flex: 0 0 auto;
  background: var(--cyan);
  animation: blink 1s steps(2, end) infinite;
}

.telemetry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.telemetry article {
  min-width: 0;
  padding: clamp(14px, 2vw, 22px) clamp(12px, 2.2vw, 28px);
  display: grid;
  gap: 7px;
}

.telemetry article + article {
  border-left: 1px solid var(--line);
}

.telemetry-label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.telemetry strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe4f3;
  font-size: clamp(9px, 1vw, 12px);
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  color: #5f6574;
  font-size: 8px;
}

.unlock {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 30;
  width: min(510px, calc(100vw - 36px));
  padding: 28px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(99, 246, 255, 0.5);
  background: rgba(5, 7, 12, 0.93);
  box-shadow: 0 0 120px rgba(101, 135, 255, 0.3), inset 0 0 50px rgba(99, 246, 255, 0.04);
  backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -45%) scale(0.94);
  transition: opacity 300ms ease, transform 400ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.unlock.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.unlock::before {
  position: absolute;
  inset: 8px;
  content: "";
  border: 1px solid rgba(244, 247, 255, 0.08);
  pointer-events: none;
}

.unlock-code {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.unlock strong {
  font-family: Inter, "Arial Black", sans-serif;
  font-size: clamp(24px, 5vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.unlock span:last-child {
  color: var(--muted);
  font-size: 11px;
}

body.is-decoding .signal-core {
  animation: core-hit 620ms ease;
}

body.is-unlocked .signal-stage::before {
  background: radial-gradient(circle, rgba(99, 246, 255, 0.27), rgba(180, 108, 255, 0.08) 50%, transparent 73%);
}

@keyframes scan {
  to { transform: translateY(128vh); }
}

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

@keyframes orbit-two {
  to { transform: rotateX(66deg) rotateZ(383deg); }
}

@keyframes orbit-three {
  to { transform: rotateY(62deg) rotateZ(342deg); }
}

@keyframes pulse {
  50% { opacity: 0.45; transform: scale(0.78); }
}

@keyframes breathe {
  50% { transform: scale(1.13); opacity: 0.7; }
}

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

@keyframes core-hit {
  0% { filter: brightness(1); }
  36% { filter: brightness(2.4); transform: scale(0.91); }
  100% { filter: brightness(1); }
}

@keyframes glitch {
  0% { transform: translate(4px, 0); }
  25% { transform: translate(-7px, 2px); }
  50% { transform: translate(8px, -2px); }
  75% { transform: translate(-3px, 1px); }
  100% { transform: translate(0); }
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 34px, 720px);
    gap: 20px;
  }

  .hero {
    min-height: 0;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .hero-copy {
    padding-top: clamp(18px, 7vh, 58px);
  }

  .signal-stage {
    width: min(82vw, 420px);
    margin-top: -24px;
  }

  .console {
    grid-template-columns: 1fr;
  }

  .console-head {
    grid-column: 1;
    grid-row: auto;
  }

  .console-output {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  body::before {
    background-size: 36px 36px;
  }

  .shell {
    width: calc(100% - 28px);
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .topbar {
    font-size: 9px;
  }

  .system-state span:last-child {
    display: none;
  }

  .hero-copy {
    padding-top: 8vh;
  }

  .eyebrow {
    margin-bottom: 13px;
    font-size: 8px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(63px, 21vw, 88px);
    letter-spacing: -0.085em;
  }

  .statement {
    margin-top: 26px;
    font-size: clamp(14px, 4.4vw, 19px);
  }

  .subcopy {
    margin-top: 14px;
    font-size: 13px;
  }

  .signal-stage {
    width: min(92vw, 360px);
    margin-top: -18px;
    margin-bottom: -12px;
  }

  .console {
    padding: 12px;
  }

  .telemetry article {
    padding: 13px 9px;
  }

  .telemetry-label {
    font-size: 7px;
  }

  .telemetry strong {
    font-size: 7.5px;
    letter-spacing: 0.045em;
  }

  footer span:last-child {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .shell {
    gap: 14px;
  }

  .hero {
    min-height: 470px;
  }

  .signal-stage {
    width: min(34vw, 450px);
  }

  .statement {
    margin-top: 24px;
  }
}

@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;
  }

  #signal-field,
  .scanline {
    display: none;
  }
}
