:root {
  color-scheme: dark;
  --ink: #f8f4ff;
  --paper: #160f36;
  --paper-soft: #110d28;
  --coral: #ff624f;
  --blue: #36d7ff;
  --violet: #b895ff;
  --line: rgba(248, 244, 255, .25);
}

* { box-sizing: border-box; }

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

body {
  color: var(--ink);
  font-family: "Arial Narrow", "Avenir Next Condensed", "Roboto Condensed", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 520px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(184,149,255,.3), transparent 50%),
    linear-gradient(135deg, #160f36 0%, #30165c 48%, #063c56 100%);
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.masthead {
  position: absolute;
  z-index: 5;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.home,
.icon-button {
  pointer-events: auto;
}

.home {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
  text-decoration: none;
  text-transform: uppercase;
}

.home-mark {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 5px 0 0 var(--coral), inset -5px 0 0 var(--blue);
}

.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(13, 9, 37, .48);
  color: var(--ink);
  font: 700 18px/1 Georgia, serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.icon-button[aria-pressed="true"] {
  color: var(--violet);
  background: rgba(255,255,255,.14);
}

.hud {
  position: absolute;
  z-index: 4;
  top: clamp(76px, 10vh, 112px);
  left: 50%;
  width: min(640px, calc(100vw - 40px));
  text-align: center;
  transform: translateX(-50%);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}

.movement,
.eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.instruction {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(27px, 3.4vw, 48px);
  font-weight: 820;
  letter-spacing: -.05em;
  line-height: 1;
}

.sub-instruction {
  margin: 9px 0 0;
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 650;
  letter-spacing: .025em;
  opacity: .76;
}

.progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
}

.progress-dot {
  width: 20px;
  height: 3px;
  background: rgba(248,244,255,.22);
  transition: width .4s ease, background .4s ease;
}

.progress-dot.is-current { width: 38px; background: var(--ink); box-shadow: 0 0 12px rgba(255,255,255,.55); }
.progress-dot.is-done { background: var(--violet); }

.controls {
  position: absolute;
  z-index: 5;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  transition: opacity .4s ease;
}

.touch-hint,
.keyboard-hint {
  margin: 0;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .62;
}

.keyboard-hint {
  display: flex;
  justify-self: center;
  gap: 10px;
}

.keyboard-hint span {
  min-width: 88px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  background: rgba(255,255,255,.08);
}

.text-button {
  justify-self: end;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: 800 11px/1 system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.text-button[aria-pressed="true"] { color: var(--violet); }

.intro,
.ending {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 84px 24px 38px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 52%, rgba(184,149,255,.31), transparent 28%),
    rgba(12, 8, 35, .72);
  backdrop-filter: blur(15px) saturate(1.12);
  transition: opacity .7s ease, visibility .7s ease;
}

.intro.is-hidden,
.ending:not(.is-visible) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro[hidden] { display: none; }

.intro h2,
.ending h2 {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(62px, 10vw, 140px);
  font-weight: 900;
  letter-spacing: -.09em;
  line-height: .76;
}

.intro-copy {
  width: min(520px, 88vw);
  margin: 28px auto 22px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(15px, 1.7vw, 19px);
  font-weight: 620;
  line-height: 1.45;
}

.start-button {
  min-width: 210px;
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-soft);
  font: 800 11px/1 system-ui, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease;
}

.start-button:hover { transform: translateY(-2px); background: #d9ccff; }
.start-button span { margin-left: 14px; font-size: 16px; }

.privacy {
  margin: 13px 0 0;
  font-size: 10px;
  letter-spacing: .09em;
  opacity: .55;
}

.intro-orbit {
  position: absolute;
  width: min(72vw, 780px);
  aspect-ratio: 1;
  border: 1px solid rgba(248,244,255,.22);
  border-radius: 50%;
  pointer-events: none;
  animation: orbitTurn 24s linear infinite;
}

.intro-orbit::before,
.intro-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.intro-orbit::before { inset: 17%; border: 1px solid rgba(248,244,255,.14); }
.intro-orbit::after { inset: 49%; background: var(--violet); box-shadow: 0 0 48px 22px rgba(184,149,255,.38); }

.intro-orbit i {
  position: absolute;
  top: 48%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.intro-orbit i:first-child { left: -13px; background: var(--coral); }
.intro-orbit i:last-child { right: -13px; background: var(--blue); }

.interlude {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.interlude.is-visible { opacity: 1; }
.interlude.is-final {
  background:
    radial-gradient(circle at 50% 52%, rgba(255,255,255,.94) 0 7%, rgba(184,149,255,.75) 18%, rgba(54,215,255,.35) 42%, transparent 70%);
  mix-blend-mode: screen;
}
.interlude p {
  max-width: 580px;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(28px, 4.8vw, 62px);
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: .98;
  text-align: center;
}

.ending {
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,.28), transparent 17%),
    linear-gradient(132deg, rgba(255,98,79,.86), rgba(121,56,199,.9) 48%, rgba(6,177,224,.86));
  backdrop-filter: blur(4px) saturate(1.25);
}
.ending::before,
.ending::after {
  content: "";
  position: absolute;
  inset: -30%;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 48%;
  transform: rotate(24deg);
}
.ending::after { inset: -12%; transform: rotate(-19deg); }
.ending > * { position: relative; z-index: 1; }
.ending h2 { font-size: clamp(68px, 12vw, 160px); line-height: .8; }
.ending > p:not(.eyebrow) { margin: 26px 0; font: 650 17px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; }
.ending .replay { align-self: center; justify-self: auto; }

.experience:not(.is-playing) .hud,
.experience:not(.is-playing) .controls,
.experience.is-ending .hud,
.experience.is-ending .controls { opacity: 0; pointer-events: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

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

@media (hover: none), (pointer: coarse) {
  .keyboard-hint { display: none; }
  .controls { grid-template-columns: 1fr auto; }
  .touch-hint { align-self: center; }
}

@media (hover: hover) and (pointer: fine) {
  .touch-hint { visibility: hidden; }
}

@media (max-width: 640px) {
  .experience { min-height: 460px; }
  .masthead { top: max(8px, env(safe-area-inset-top)); }
  .home span:last-child { display: none; }
  .hud { top: 66px; }
  .sub-instruction { max-width: 290px; margin-inline: auto; }
  .controls { bottom: max(10px, env(safe-area-inset-bottom)); }
  .intro { padding-top: 70px; }
  .intro h2 { font-size: clamp(58px, 20vw, 92px); }
  .intro-copy { margin-top: 22px; }
  .intro-orbit { width: 112vw; }
}

@media (max-height: 620px) {
  .hud { top: 62px; }
  .sub-instruction { display: none; }
  .intro-copy { margin-block: 16px; font-size: 15px; }
  .privacy { display: none; }
  .intro h2 { font-size: clamp(52px, 13vh, 80px); line-height: .78; }
}

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