:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0c1117;
  --text: #edf5f2;
  --soft: #a7b2af;
  --muted: #64716e;
  --cyan: #72f2d1;
  --violet: #a78bfa;
  --line: rgba(237, 245, 242, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(114, 242, 209, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, rgba(114, 242, 209, 0.1), transparent 21rem),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(237, 245, 242, 0.05), transparent);
  opacity: 0.35;
  transform: translateX(-100%);
  animation: scan 7s linear infinite;
}

button {
  font: inherit;
}

.signal-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 20px 72px;
}

.stage {
  width: min(760px, 100%);
  text-align: center;
}

.eyebrow,
.pair,
.fragment,
footer,
.sound {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.eyebrow {
  margin: 0 0 28px;
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.signal-field {
  width: min(360px, 82vw);
  aspect-ratio: 1.65;
  margin: 0 auto 28px;
  position: relative;
}

.orbit {
  position: absolute;
  inset: 30px 24px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(114, 242, 209, 0.22);
  transform: rotate(25deg);
  transition: transform 700ms ease, box-shadow 700ms ease;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.orbit::before {
  left: 10%;
  top: 27%;
}

.orbit::after {
  right: 18%;
  bottom: 16%;
  opacity: 0.5;
}

.orbit-zyt {
  border-color: var(--violet);
  box-shadow: 0 0 28px rgba(167, 139, 250, 0.2);
  transform: rotate(-25deg);
}

.orbit-zyt::before,
.orbit-zyt::after {
  background: var(--violet);
  box-shadow: 0 0 18px var(--violet);
}

.core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid rgba(237, 245, 242, 0.2);
  border-radius: 50%;
  background: rgba(12, 17, 23, 0.75);
  cursor: pointer;
  touch-action: manipulation;
  transform: translate(-50%, -50%);
}

.core span {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--text);
  box-shadow:
    0 0 24px rgba(114, 242, 209, 0.45),
    0 0 38px rgba(167, 139, 250, 0.28);
  opacity: 0.75;
  transition: transform 300ms ease, opacity 300ms ease;
}

.butterfly {
  position: absolute;
  inset: 42px 76px;
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 700ms ease, transform 900ms ease;
}

.butterfly i,
.butterfly b {
  position: absolute;
  display: block;
}

.butterfly i {
  width: 80px;
  height: 104px;
  top: 7px;
  border: 1px solid;
  border-radius: 80% 18% 80% 22%;
  filter: drop-shadow(0 0 18px currentColor);
}

.butterfly i:first-child {
  right: 50%;
  color: var(--cyan);
  transform: rotate(-28deg);
}

.butterfly i:nth-child(2) {
  left: 50%;
  color: var(--violet);
  transform: scaleX(-1) rotate(-28deg);
}

.butterfly b {
  left: calc(50% - 1px);
  top: 26px;
  width: 2px;
  height: 92px;
  background: rgba(237, 245, 242, 0.78);
  box-shadow: 0 0 16px rgba(237, 245, 242, 0.45);
}

.pair {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
}

.mark {
  min-width: 64px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(12, 17, 23, 0.55);
  padding: 10px 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.mark:hover,
.mark:focus-visible {
  outline: none;
  border-color: currentColor;
  transform: translateY(-1px);
}

.mark-lsb {
  color: var(--cyan);
}

.mark-zyt {
  color: var(--violet);
}

.divider {
  color: var(--muted);
}

h1 {
  max-width: 760px;
  margin: 28px auto 18px;
  font-size: clamp(2.35rem, 7.2vw, 5.7rem);
  line-height: 0.98;
  font-weight: 620;
}

.lede {
  max-width: 520px;
  margin: 0 auto;
  color: var(--soft);
  line-height: 1.9;
}

.fragments {
  display: grid;
  gap: 10px;
  width: min(460px, 100%);
  margin: 30px auto 0;
}

.fragment {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease, color 420ms ease;
}

.secret {
  max-width: 560px;
  margin: 32px auto 0;
  color: var(--text);
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.sound {
  position: fixed;
  right: 20px;
  top: 18px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(12, 17, 23, 0.62);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

footer {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  color: #6f7b79;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.signal-page[data-stage="1"] .orbit-lsb {
  transform: rotate(11deg);
}

.signal-page[data-stage="1"] [data-fragment="0"],
.signal-page[data-stage="2"] [data-fragment="0"],
.signal-page[data-stage="2"] [data-fragment="1"],
.signal-page[data-stage="3"] .fragment {
  opacity: 1;
  transform: translateY(0);
  color: var(--soft);
}

.signal-page[data-stage="2"] .orbit-zyt {
  transform: rotate(-11deg);
}

.signal-page[data-stage="3"] .orbit {
  transform: rotate(0deg);
  box-shadow: 0 0 44px rgba(114, 242, 209, 0.28);
}

.signal-page[data-stage="3"] .orbit-zyt {
  box-shadow: 0 0 44px rgba(167, 139, 250, 0.26);
}

.signal-page[data-unlocked="true"] .orbit,
.signal-page[data-unlocked="true"] .core {
  opacity: 0;
}

.signal-page[data-unlocked="true"] .butterfly,
.signal-page[data-unlocked="true"] .secret {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.signal-page[data-unlocked="true"] h1 {
  color: rgba(237, 245, 242, 0.62);
}

.signal-page[data-holding="true"] .core span {
  opacity: 1;
  transform: scale(1.45);
}

@keyframes scan {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 560px) {
  body {
    overflow-y: auto;
  }

  .signal-page {
    align-items: start;
    padding-top: 46px;
  }

  .signal-field {
    margin-bottom: 22px;
  }

  .butterfly {
    inset: 34px 42px;
  }

  h1 {
    margin-top: 22px;
  }

  footer {
    position: static;
    padding: 0 20px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
