:root {
  color-scheme: dark;
  --ink: #080706;
  --soft-ink: #12100e;
  --paper: #f1ece2;
  --rust: #dc5a2f;
  --rust-dark: #75311f;
  --cyan: #74f1f5;
  --muted: #b8afa3;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  color: var(--paper);
  font-family: "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
a { font: inherit; }

button { color: inherit; }

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

#experience {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 520px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 54%, rgba(196, 67, 32, .08), transparent 44%),
    #080706;
}

#experience::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: soft-light;
  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='.94' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

#experience::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,.025) 4px, transparent 5px);
}

.signal-field,
#receiver {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.signal-field {
  z-index: 0;
  object-fit: cover;
  opacity: .38;
  filter: contrast(1.15) brightness(.66) saturate(.72);
  transform: scale(1.035);
  transition: opacity .8s ease, filter .8s ease, transform 1.4s cubic-bezier(.2,.7,.1,1);
}

#receiver {
  z-index: 1;
  display: block;
  cursor: ew-resize;
  touch-action: none;
}

.chrome {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  color: rgba(241,236,226,.6);
  font: 600 10px/1.2 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .11em;
  transition: opacity .7s ease;
}

.station-mark,
.clock,
.downlink {
  position: absolute;
  top: var(--safe-top);
}

.station-mark { left: 24px; }
.clock { left: 50%; transform: translateX(-50%); }
.clock span,
.downlink span { color: var(--rust); }
.downlink { right: 24px; text-align: right; }

.ruler {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  opacity: .48;
  background: repeating-linear-gradient(90deg, rgba(241,236,226,.65) 0 1px, transparent 1px 22px);
}

.ruler::after {
  content: "";
  position: absolute;
  inset: 3px 0 auto;
  border-top: 1px solid rgba(241,236,226,.2);
}

.ruler-a { top: 23%; }
.ruler-b { bottom: 20%; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--rust);
  font: 700 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.intro {
  position: absolute;
  z-index: 10;
  left: clamp(22px, 6vw, 96px);
  bottom: clamp(34px, 8vh, 84px);
  width: min(760px, calc(100vw - 44px));
  transition: opacity .55s ease, transform .75s cubic-bezier(.2,.7,.1,1), visibility .55s;
}

.intro h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(58px, 9.2vw, 148px);
  font-weight: 800;
  line-height: .78;
  letter-spacing: -.075em;
  text-transform: uppercase;
}

.intro h1 span:last-child {
  margin-left: clamp(18px, 11vw, 180px);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--paper);
}

.lede {
  width: min(490px, 84vw);
  margin: clamp(24px, 4vh, 44px) 0 22px clamp(2px, 8vw, 128px);
  color: rgba(241,236,226,.8);
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.45;
}

.primary,
.restart {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(241,236,226,.72);
  border-radius: 999px;
  background: rgba(8,7,6,.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary { margin-left: clamp(2px, 8vw, 128px); }
.primary span { color: var(--cyan); margin-left: 12px; }
.primary:hover,
.restart:hover { background: var(--paper); color: var(--ink); }

.source-note {
  margin: 14px 0 0 clamp(2px, 8vw, 128px);
  color: rgba(241,236,226,.45);
  font: 500 10px/1.4 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tuning {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .55s ease, visibility .55s;
}

.mission-header {
  position: absolute;
  top: calc(var(--safe-top) + 52px);
  left: clamp(20px, 4vw, 64px);
  right: clamp(20px, 4vw, 64px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.mission-header h2 {
  margin: 0;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(36px, 5.4vw, 84px);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.stage-count {
  margin: 0;
  color: rgba(241,236,226,.38);
  font: 600 13px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.stage-count span { color: var(--cyan); font-size: 24px; }

.instruction {
  position: absolute;
  left: clamp(20px, 4vw, 64px);
  bottom: calc(var(--safe-bottom) + 58px);
  width: min(400px, calc(100vw - 40px));
  color: rgba(241,236,226,.76);
  font-size: 16px;
  line-height: 1.45;
}

.instruction p { margin: 0 0 9px; }

.input-copy {
  color: var(--rust);
  font: 700 10px/1.4 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.keyboard-copy { display: block; color: rgba(241,236,226,.42); }

.phase-readout {
  position: absolute;
  right: clamp(20px, 4vw, 64px);
  top: 31%;
  display: grid;
  gap: 5px;
  text-align: right;
  font: 600 10px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.phase-readout strong {
  color: var(--paper);
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -.04em;
}

.proximity {
  position: absolute;
  right: clamp(20px, 4vw, 64px);
  bottom: calc(var(--safe-bottom) + 62px);
  width: min(290px, 37vw);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font: 700 9px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .13em;
}

.proximity-track {
  position: relative;
  height: 3px;
  background: rgba(241,236,226,.18);
}

.proximity-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4%;
  background: var(--rust);
  box-shadow: 0 0 12px rgba(220,90,47,.55);
  transition: width .1s linear, background .2s;
}

#proximity-word { color: var(--rust); min-width: 67px; text-align: right; }

.lock-button {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 4px);
  transform: translateX(-50%);
  min-width: 210px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid rgba(241,236,226,.18);
  border-radius: 999px;
  background: rgba(8,7,6,.72);
  color: rgba(241,236,226,.35);
  font: 700 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
  transition: color .2s, border-color .2s, box-shadow .2s, background .2s;
  pointer-events: auto;
}

.lock-button:disabled { cursor: not-allowed; }
.lock-ready { display: none; }

.lock-button:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(9,34,34,.82);
  color: var(--cyan);
  box-shadow: 0 0 30px rgba(116,241,245,.13);
  cursor: pointer;
}

.lock-button:not(:disabled) .lock-idle { display: none; }
.lock-button:not(:disabled) .lock-ready { display: inline; }
.lock-ready b { margin-left: 12px; }

.interstitial {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(8,7,6,.36);
  transition: opacity .25s, visibility .25s;
}

.interstitial p,
.interstitial span {
  margin: 0;
  color: var(--cyan);
  font: 700 10px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.interstitial strong {
  max-width: 780px;
  margin: 18px 0 22px;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(40px, 7vw, 104px);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.finale {
  position: absolute;
  inset: 0;
  z-index: 12;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s ease;
}

.final-kicker,
.finale h2,
.final-facts,
.final-note,
.restart {
  position: absolute;
}

.final-kicker {
  top: calc(var(--safe-top) + 58px);
  left: clamp(20px, 4vw, 64px);
  margin: 0;
  color: var(--cyan);
  font: 700 10px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .2em;
}

.finale h2 {
  top: 12%;
  left: clamp(20px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(48px, 7.8vw, 122px);
  line-height: .8;
  letter-spacing: -.065em;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0,0,0,.86);
}

.finale h2 span:last-child { color: var(--rust); margin-left: clamp(18px, 7vw, 112px); }

.final-facts {
  right: clamp(20px, 4vw, 64px);
  bottom: calc(var(--safe-bottom) + 52px);
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: clamp(18px, 3vw, 54px);
  width: min(690px, 60vw);
}

.final-facts p { margin: 0; }
.final-facts strong,
.final-facts span { display: block; }
.final-facts strong { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; }
.final-facts span { margin-top: 5px; color: rgba(241,236,226,.56); font: 500 10px/1.3 "SFMono-Regular", Consolas, monospace; }

.final-note {
  left: clamp(20px, 4vw, 64px);
  bottom: calc(var(--safe-bottom) + 54px);
  width: min(330px, 28vw);
  margin: 0;
  color: rgba(241,236,226,.72);
  font: 500 13px/1.45 Georgia, serif;
  font-style: italic;
}

.restart {
  left: clamp(20px, 4vw, 64px);
  bottom: var(--safe-bottom);
  transform: translateY(-1px);
  min-height: 44px;
  padding: 0 15px;
  font-size: 10px;
  pointer-events: auto;
}

.about-open {
  position: absolute;
  z-index: 30;
  right: max(15px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border: 1px solid rgba(241,236,226,.28);
  border-radius: 50%;
  background: rgba(8,7,6,.55);
  color: rgba(241,236,226,.7);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

dialog {
  width: min(560px, calc(100vw - 32px));
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(241,236,226,.2);
  background: #14100d;
  color: var(--paper);
  box-shadow: 0 24px 90px rgba(0,0,0,.7);
}

dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
dialog h2 { margin: 0 0 25px; font-size: clamp(34px, 5vw, 58px); line-height: .94; letter-spacing: -.045em; text-transform: uppercase; }
dialog p { color: rgba(241,236,226,.74); line-height: 1.6; }
dialog a { color: var(--cyan); }
.fine-print { font: 500 10px/1.5 "SFMono-Regular", Consolas, monospace; letter-spacing: .05em; text-transform: uppercase; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--paper); font-size: 28px; cursor: pointer; }

body[data-state="tuning"] .intro,
body[data-state="locked"] .intro,
body[data-state="finale"] .intro { opacity: 0; visibility: hidden; transform: translateY(30px); }

body[data-state="tuning"] .tuning { opacity: 1; visibility: visible; }
body[data-state="locked"] .tuning { opacity: .22; visibility: visible; }
body[data-state="locked"] .interstitial { opacity: 1; visibility: visible; }
body[data-state="finale"] .finale { opacity: 1; visibility: visible; }
body[data-state="finale"] .signal-field { opacity: .08; filter: grayscale(1) contrast(1.25) brightness(.45); transform: scale(1); }
body[data-state="finale"] #receiver { cursor: default; }
body[data-state="finale"] .chrome { opacity: 0; }
body[data-state="finale"] #experience::after { opacity: .08; }

@media (max-width: 720px) {
  #experience { min-height: 480px; }
  .station-mark { left: 16px; }
  .downlink { right: 16px; }
  .clock { display: none; }
  .intro { left: 20px; bottom: calc(var(--safe-bottom) + 42px); width: calc(100vw - 40px); }
  .intro h1 { font-size: clamp(54px, 17vw, 82px); line-height: .82; }
  .intro h1 span:last-child { margin-left: 0; }
  .lede { width: 100%; margin: 25px 0 18px; font-size: 15px; }
  .primary,
  .source-note { margin-left: 0; }
  .source-note { max-width: 280px; }
  .mission-header { top: calc(var(--safe-top) + 42px); left: 18px; right: 18px; }
  .mission-header .eyebrow { max-width: 215px; }
  .mission-header h2 { font-size: clamp(38px, 12vw, 58px); }
  .stage-count span { font-size: 20px; }
  .phase-readout { top: 28%; right: 18px; }
  .instruction { left: 18px; bottom: calc(var(--safe-bottom) + 76px); width: calc(100vw - 36px); font-size: 14px; }
  .instruction > p:first-child { max-width: 290px; }
  .proximity { right: 18px; bottom: calc(var(--safe-bottom) + 139px); width: min(210px, 58vw); }
  .lock-button { bottom: calc(var(--safe-bottom) + 10px); min-width: 210px; }
  .about-open { bottom: max(16px, env(safe-area-inset-bottom)); }
  body[data-state="tuning"] .about-open,
  body[data-state="locked"] .about-open { opacity: 0; pointer-events: none; }
  .interstitial strong { font-size: clamp(44px, 15vw, 70px); }
  .final-kicker { top: calc(var(--safe-top) + 45px); left: 18px; }
  .finale h2 { top: 12%; left: 18px; right: 18px; font-size: clamp(44px, 13.5vw, 68px); line-height: .83; }
  .finale h2 span:last-child { margin-left: 0; }
  .final-facts { left: 18px; right: 58px; bottom: calc(var(--safe-bottom) + 68px); width: auto; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
  .final-facts p:nth-child(3) { grid-column: 1 / -1; }
  .final-note { display: none; }
  .restart { left: 18px; bottom: var(--safe-bottom); }
}

@media (max-height: 650px) and (min-width: 721px) {
  .intro { bottom: 24px; }
  .lede { margin-top: 18px; }
  .finale h2 { top: 13%; }
  .final-note,
  .final-facts { bottom: 54px; }
}

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