:root {
  color-scheme: dark;
  --bg: #030302;
  --panel: rgba(9, 8, 6, 0.88);
  --ink: #f0e5d2;
  --muted: rgba(204, 188, 160, 0.58);
  --faint: rgba(150, 127, 97, 0.34);
  --line: rgba(126, 101, 73, 0.16);
  --line-strong: rgba(174, 139, 97, 0.28);
  --red: #d4482f;
  --amber: #9f7145;
  --cream: #f0e5d2;
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.78, 0.2, 1);
  --ring: 628.319;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-touch-callout: none;
}

button,
a {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent;
}

button {
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  -webkit-touch-callout: none;
}

a {
  text-decoration: none;
}

::selection {
  color: var(--ink);
  background: rgba(212, 72, 47, 0.36);
}

.atmos,
.atmos > div {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.atmos {
  z-index: 12;
}

.atmos__grain {
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 27% 23%, rgba(240, 229, 210, 0.46) 0 1px, transparent 1px),
    radial-gradient(circle at 74% 57%, rgba(212, 72, 47, 0.42) 0 1px, transparent 1px),
    radial-gradient(circle at 48% 82%, rgba(150, 127, 97, 0.22) 0 1px, transparent 1px);
  background-size: 8px 8px, 13px 13px, 19px 19px;
  mix-blend-mode: screen;
  transition: opacity 900ms var(--ease);
}

.atmos__scan {
  opacity: 0.2;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 7px,
    rgba(204, 188, 160, 0.038) 8px,
    transparent 9px
  );
  animation: scanDrift 8s var(--ease) infinite;
}

.atmos__burn--red {
  background:
    radial-gradient(ellipse at 16% 48%, rgba(212, 72, 47, 0.18), transparent 38%),
    linear-gradient(90deg, transparent 0 28%, rgba(212, 72, 47, 0.075) 29%, transparent 31% 100%);
}

.atmos__burn--amber {
  background: radial-gradient(ellipse at 82% 70%, rgba(159, 113, 69, 0.11), transparent 42%);
}

[data-holding="true"] .atmos__grain {
  opacity: 0.065;
}

[data-explored="1"] .atmos__grain { opacity: 0.13; }
[data-explored="2"] .atmos__grain { opacity: 0.11; }
[data-explored="3"] .atmos__grain { opacity: 0.085; }
[data-explored="4"] .atmos__grain { opacity: 0.065; }
[data-explored="5"] .atmos__grain { opacity: 0.045; }
[data-explored="6"] .atmos__grain { opacity: 0.025; }

[data-explored="4"] .atmos__scan { opacity: 0.11; }
[data-explored="6"] .atmos__scan { opacity: 0.045; }

.machine {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(30px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(30px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 47%, rgba(212, 72, 47, 0.085), transparent 23rem),
    radial-gradient(circle at 50% 76%, rgba(159, 113, 69, 0.038), transparent 28rem),
    linear-gradient(145deg, #020201 0%, #0a0806 48%, #030302 100%);
}

.machine__top {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 46px;
  padding: 10px 12px 10px 48px;
  border: 1px solid rgba(126, 101, 73, 0.2);
  border-radius: 999px;
  background:
    radial-gradient(circle at 88% 50%, rgba(212, 72, 47, 0.13), transparent 10rem),
    rgba(5, 4, 3, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(240, 229, 210, 0.045),
    inset 0 0 0 1px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.machine-id,
.machine-state,
.listen-link,
.status-rail,
.node,
.gate-instruction,
.preboot,
.panel,
.mini-action,
.recover-hold,
.finale,
.finale-action {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.machine-id,
.machine-state {
  display: flex;
  gap: 12px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.machine-id span:first-child,
.machine-state span:first-child {
  color: var(--ink);
}

.machine-state {
  justify-content: center;
  opacity: 0.56;
}

.listen-link {
  justify-self: end;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 27px;
  border-radius: 999px;
  border: 1px solid rgba(212, 72, 47, 0.2);
  background:
    radial-gradient(circle, rgba(212, 72, 47, 0.28) 0 1px, transparent 1.5px),
    rgba(212, 72, 47, 0.11);
  background-size: 13px 13px, auto;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.14em;
  transition: transform 420ms var(--ease), background-color 420ms var(--ease), opacity 420ms var(--ease);
}

.listen-link:hover {
  transform: translateY(-1px);
  background: rgba(174, 139, 97, 0.08);
}

[data-state="gate"] .listen-link {
  opacity: 0.28;
  pointer-events: none;
}

[data-state="preboot"] .machine {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
}

.machine {
  transition: opacity 760ms var(--ease), transform 760ms var(--ease);
}

.console {
  position: relative;
  min-height: 0;
  overflow: hidden;
  margin-top: 46px;
  border: 1px solid rgba(126, 101, 73, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 52%, rgba(212, 72, 47, 0.105), transparent 31%),
    radial-gradient(circle at 50% 71%, rgba(159, 113, 69, 0.052), transparent 48%),
    linear-gradient(180deg, rgba(8, 7, 5, 0.9), rgba(3, 3, 2, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(240, 229, 210, 0.05),
    inset 0 0 130px rgba(0, 0, 0, 0.8),
    0 18px 70px rgba(0, 0, 0, 0.28);
}

.console::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, transparent 0 49.9%, rgba(174, 139, 97, 0.085) 50%, transparent 50.1%),
    linear-gradient(180deg, transparent 0 49.9%, rgba(174, 139, 97, 0.065) 50%, transparent 50.1%),
    repeating-linear-gradient(90deg, rgba(126, 101, 73, 0.045) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(126, 101, 73, 0.035) 0 1px, transparent 1px 48px);
  pointer-events: none;
}

.console::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.35;
  background:
    linear-gradient(90deg, transparent 0 17%, rgba(212, 72, 47, 0.16) 17.4%, transparent 18.5% 100%),
    linear-gradient(90deg, transparent 0 72%, rgba(212, 72, 47, 0.095) 72.4%, transparent 73.5% 100%),
    repeating-linear-gradient(180deg, transparent 0 89px, rgba(212, 72, 47, 0.1) 90px, transparent 93px);
  mix-blend-mode: screen;
  animation: dataTear 9s steps(1, end) infinite;
}

#signal-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.console__glass {
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(126, 101, 73, 0.16);
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.28),
    inset 0 0 90px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.status-rail {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 8px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.status-rail strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.status-rail--left {
  top: 30px;
  left: 30px;
}

.status-rail--right {
  right: 30px;
  bottom: 30px;
  justify-items: end;
  text-align: right;
}

.core {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  transform: translateY(5.5%);
}

.core__rings {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.core__rings span {
  position: absolute;
  width: min(48vw, 430px);
  aspect-ratio: 1;
  border: 1px solid rgba(126, 101, 73, 0.18);
  border-radius: 50%;
  animation: ringPulse 5.4s var(--ease) infinite;
}

.core__rings span:nth-child(2) {
  width: min(62vw, 560px);
  border-color: rgba(212, 72, 47, 0.18);
  animation-delay: -1.6s;
}

.core__rings span:nth-child(3) {
  width: min(76vw, 690px);
  border-style: dashed;
  border-color: rgba(159, 113, 69, 0.16);
  animation-delay: -3.1s;
}

.core-node {
  position: relative;
  z-index: 4;
  width: clamp(250px, 31vw, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 229, 210, 0.06), transparent 31%),
    radial-gradient(circle at 50% 50%, rgba(212, 72, 47, 0.13), rgba(8, 7, 5, 0.48) 58%, rgba(4, 4, 3, 0.9));
  color: var(--ink);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  transition: transform 520ms var(--ease), filter 520ms var(--ease);
}

.core-node:hover {
  transform: scale(1.018);
}

.core-node:active,
.core-node.is-holding {
  transform: scale(0.985);
}

[data-state="sigmap"] .core-node,
[data-state="panel"] .core-node,
[data-state="finale"] .core-node {
  cursor: default;
  pointer-events: none;
}

.core-node:focus-visible,
.node:focus-visible,
.panel__close:focus-visible,
.recover-hold:focus-visible,
.mini-action:focus-visible,
.finale-action:focus-visible,
.finale-hold-button:focus-visible,
.listen-link:focus-visible {
  outline: 2px solid rgba(212, 72, 47, 0.82);
  outline-offset: 4px;
}

@media (hover: none), (pointer: coarse) {
  *,
  *::before,
  *::after {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
  }

  *:focus,
  *:focus-visible,
  *:active {
    outline: 0 !important;
    box-shadow: none;
  }

  ::selection {
    background: transparent;
  }
}

@supports (-webkit-touch-callout: none) {
  html,
  body,
  body * {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }

  body *:focus,
  body *:focus-visible,
  body *:active {
    outline: none !important;
    box-shadow: none !important;
  }

  ::selection {
    background: transparent !important;
  }
}

.core-node__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.core-node__track,
.core-node__fill {
  fill: none;
  stroke-width: 1.8;
}

.core-node__track {
  stroke: rgba(126, 101, 73, 0.2);
}

.core-node__fill {
  stroke: var(--red);
  stroke-linecap: round;
  stroke-dasharray: var(--ring);
  stroke-dashoffset: var(--ring);
  filter: drop-shadow(0 0 12px rgba(212, 72, 47, 0.38));
}

.core-node__content {
  width: 68%;
  min-height: 68%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 11px;
  border: 1px solid rgba(126, 101, 73, 0.2);
  border-radius: 50%;
  background: rgba(5, 5, 4, 0.58);
  text-align: center;
  box-shadow:
    inset 0 0 34px rgba(0, 0, 0, 0.5),
    0 0 42px rgba(212, 72, 47, 0.08);
}

.core-node__content span,
.core-node__content strong {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.core-node__content span {
  max-width: 18ch;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.14em;
}

.core-node__content strong {
  max-width: 15ch;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.17em;
}

.gate-instruction {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 5;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.2em;
  transform: translateX(-50%);
  transition: opacity 500ms var(--ease);
}

.gate-instruction::after {
  content: "";
  display: block;
  width: 136px;
  height: 6px;
  margin: 24px auto 0;
  background:
    radial-gradient(circle, var(--red) 0 2px, transparent 2.5px) 0 0 / 24px 6px repeat-x;
  opacity: 0.7;
}

[data-state="sigmap"] .gate-instruction,
[data-state="panel"] .gate-instruction,
[data-state="finale"] .gate-instruction {
  opacity: 0;
}

.preboot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(28px, 6vw, 72px);
  background:
    radial-gradient(circle at 50% 54%, rgba(212, 72, 47, 0.07), transparent 24rem),
    radial-gradient(circle at 18% 18%, rgba(159, 113, 69, 0.04), transparent 18rem),
    linear-gradient(180deg, #010101 0%, #050403 52%, #020201 100%);
  opacity: 1;
  pointer-events: auto;
  transition: opacity 620ms var(--ease), filter 620ms var(--ease);
}

[data-state="gate"] .preboot,
[data-state="sigmap"] .preboot,
[data-state="panel"] .preboot,
[data-state="finale"] .preboot,
.preboot.is-complete {
  opacity: 0;
  pointer-events: none;
  filter: brightness(1.45) contrast(1.18);
}

.preboot__texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(240, 229, 210, 0.28) 0 1px, transparent 1.4px) 0 0 / 11px 11px,
    repeating-linear-gradient(180deg, transparent 0 7px, rgba(126, 101, 73, 0.042) 8px, transparent 9px),
    linear-gradient(90deg, transparent 0 21%, rgba(212, 72, 47, 0.08) 21.4%, transparent 22.6% 100%);
  mix-blend-mode: screen;
  opacity: 0.32;
  animation: bootTear 7.2s steps(1, end) infinite;
}

.preboot__panel {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: min(640px, 82dvh);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(126, 101, 73, 0.12);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(7, 6, 5, 0.38), rgba(2, 2, 1, 0.16)),
    radial-gradient(circle at 20% 12%, rgba(212, 72, 47, 0.055), transparent 14rem);
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.42),
    0 34px 120px rgba(0, 0, 0, 0.34);
}

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

.preboot__panel::before {
  inset: 18px;
  border: 1px solid rgba(126, 101, 73, 0.075);
}

.preboot__panel::after {
  left: 0;
  right: 0;
  top: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 72, 47, 0.32), transparent);
  opacity: 0;
  animation: prebootTear 5.4s steps(1, end) infinite;
}

.preboot__line,
.preboot__audio-note {
  position: relative;
  z-index: 1;
  margin: 0;
  min-height: 1.55em;
  color: rgba(204, 188, 160, 0.62);
  font-size: clamp(12px, 2vw, 15px);
  letter-spacing: 0.2em;
  line-height: 1.55;
  opacity: 0;
  transform: translate3d(0, 5px, 0);
}

.preboot__line:first-child,
.preboot__line:nth-child(2) {
  color: var(--ink);
  letter-spacing: 0.34em;
}

.preboot__line:nth-child(2) {
  color: var(--faint);
}

.preboot__line.is-visible,
.preboot__audio-note.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}

.preboot__line.is-glitching,
.preboot__audio-note.is-glitching {
  color: var(--ink);
  text-shadow:
    2px 0 rgba(212, 72, 47, 0.42),
    -1px 0 rgba(159, 113, 69, 0.2);
}

.preboot__line--final {
  margin-top: 18px;
  color: var(--ink);
}

.preboot__audio-note {
  margin-top: 8px;
  color: rgba(212, 72, 47, 0.76);
  font-size: clamp(10px, 1.7vw, 12px);
  letter-spacing: 0.18em;
}

.preboot__gap {
  height: 24px;
}

.preboot__wave {
  position: relative;
  z-index: 1;
  width: min(360px, 78vw);
  height: 32px;
  margin-top: 30px;
  overflow: hidden;
  opacity: 0.42;
}

.preboot__wave span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 72, 47, 0.72), rgba(150, 127, 97, 0.2), transparent);
  transform: translateY(-50%);
  animation: prebootWave 2.8s ease-in-out infinite;
}

.preboot__wave span:nth-child(2) {
  opacity: 0.45;
  transform: translateY(-50%) translateY(-7px);
  animation-delay: -0.9s;
}

.preboot__wave span:nth-child(3) {
  opacity: 0.25;
  transform: translateY(-50%) translateY(7px);
  animation-delay: -1.7s;
}

.preboot__bar {
  position: relative;
  z-index: 1;
  width: min(360px, 78vw);
  height: 1px;
  margin-top: 18px;
  background: rgba(126, 101, 73, 0.18);
  overflow: hidden;
}

.preboot__bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: var(--red);
  box-shadow: 0 0 16px rgba(212, 72, 47, 0.38);
  transform-origin: left center;
  animation: prebootBar 4.4s var(--ease) forwards;
}

.preboot-hold {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(360px, 78vw);
  min-height: 50px;
  margin-top: 24px;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid rgba(212, 72, 47, 0.34);
  border-radius: 2px;
  box-sizing: border-box;
  background: rgba(212, 72, 47, 0.055);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.8vw, 12px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform: translate3d(0, 8px, 0);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease), border-color 320ms var(--ease);
}

.preboot.is-ready .preboot-hold {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.preboot-hold.is-holding {
  border-color: rgba(212, 72, 47, 0.7);
}

.preboot-hold__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(212, 72, 47, 0.2);
  pointer-events: none;
  transition: width 80ms linear;
}

.preboot-hold span:last-child {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.orbit {
  position: absolute;
  inset: 0;
  z-index: 6;
  opacity: 0.18;
  pointer-events: none;
  transition: opacity 900ms var(--ease);
}

[data-state="gate"] .orbit {
  opacity: 0;
  pointer-events: none;
}

[data-state="sigmap"] .orbit,
[data-state="panel"] .orbit {
  opacity: 1;
  pointer-events: auto;
}

.node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 14px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 420ms var(--ease), color 420ms var(--ease), opacity 420ms var(--ease);
}

[data-state="gate"] .node {
  cursor: default;
}

.node:hover,
.node.is-active {
  color: var(--ink);
  transform: translate(-50%, -50%) scale(1.08);
}

.node__dot {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: rgba(4, 4, 3, 0.82);
}

.node__dot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.42;
  animation: ping 3.5s var(--ease) infinite;
}

.node.is-recovered {
  color: var(--amber);
}

.node.is-recovered .node__dot {
  background: var(--amber);
  box-shadow: 0 0 18px rgba(159, 113, 69, 0.2);
}

.node.is-recovered .node__dot::after {
  animation: none;
  opacity: 0;
}

.node__num,
.node__meta {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.14em;
}

.node__meta {
  color: var(--faint);
}

.panel,
.finale {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms var(--ease);
}

[data-state="panel"] .panel,
[data-state="finale"] .finale {
  opacity: 1;
  pointer-events: auto;
}

.panel::before,
.finale::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 2, 0.78);
  backdrop-filter: blur(10px);
}

.panel__shell {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 42px));
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(126, 101, 73, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(126, 101, 73, 0.07), rgba(126, 101, 73, 0.015)),
    rgba(8, 7, 5, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(240, 229, 210, 0.045),
    0 36px 100px rgba(0, 0, 0, 0.3);
  transform: translateY(14px) scale(0.98);
  transition: transform 700ms var(--ease);
}

[data-state="panel"] .panel__shell {
  transform: translateY(0) scale(1);
}

.panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(126, 101, 73, 0.055);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.panel__top,
.panel__data {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.panel__top {
  padding-right: 96px;
}

.panel__top span:first-child,
.panel__data span:first-child {
  color: var(--red);
}

.panel h1 {
  margin: 22px 0 0;
  color: var(--ink);
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel__fragment {
  min-height: 3.1em;
  margin: 24px 0 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.4;
}

.corrupted {
  filter: blur(1px) brightness(0.78);
  opacity: 0.55;
}

.corrupted.is-stable {
  filter: none;
  opacity: 1;
}

.panel__fragment.is-glitching {
  color: var(--ink);
  filter: contrast(1.2) brightness(1.08);
  text-shadow:
    1px 0 rgba(212, 72, 47, 0.32),
    -1px 0 rgba(159, 113, 69, 0.2);
}

.panel__data {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.panel__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
}

.recover-hold,
.mini-action {
  position: relative;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid rgba(212, 72, 47, 0.38);
  border-radius: 999px;
  background: rgba(212, 72, 47, 0.075);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.recover-hold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 18px;
  box-sizing: border-box;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
}

.recover-hold__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(212, 72, 47, 0.2);
  pointer-events: none;
  transition: width 80ms linear;
}

.recover-hold span:last-child,
.mini-action {
  position: relative;
  z-index: 1;
}

.core-node *,
.recover-hold *,
.finale-hold-button * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.recover-hold.is-recovered {
  border-color: rgba(159, 113, 69, 0.42);
  background: rgba(159, 113, 69, 0.075);
  pointer-events: none;
}

.mini-action {
  padding: 0 18px;
  border-color: var(--line-strong);
  background: rgba(126, 101, 73, 0.055);
}

.finale__sequence,
.finale__reveal {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  text-align: center;
}

[data-state="finale"][data-final="decoded"] .atmos__grain {
  opacity: 0.018;
}

[data-state="finale"][data-final="decoded"] .atmos__scan {
  opacity: 0.035;
}

.finale__line,
.finale__reveal {
  display: none;
}

.finale__line.is-visible,
.finale__reveal.is-visible {
  display: block;
}

.finale__line {
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: 0.22em;
}

.finale__line.is-glitching {
  color: var(--ink);
  text-shadow:
    1px 0 rgba(212, 72, 47, 0.28),
    -1px 0 rgba(159, 113, 69, 0.18);
}

.finale__line + .finale__line {
  margin-top: 18px;
}

.finale-hold-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  width: min(460px, 100%);
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid rgba(159, 113, 69, 0.42);
  border-radius: 999px;
  box-sizing: border-box;
  background: rgba(159, 113, 69, 0.075);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.finale-hold-button__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(159, 113, 69, 0.22);
  pointer-events: none;
}

.finale-hold-button span:last-child {
  position: relative;
  z-index: 1;
}

.finale__reveal h1 {
  position: relative;
  z-index: 3;
  margin: 20px 0 0;
  color: var(--ink);
  font-size: clamp(62px, 14vw, 150px);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 54px rgba(159, 113, 69, 0.1);
}

.finale__reveal h1.is-glitching {
  text-shadow:
    2px 0 rgba(212, 72, 47, 0.34),
    -2px 0 rgba(159, 113, 69, 0.2),
    0 0 54px rgba(159, 113, 69, 0.08);
}

.finale__reveal p {
  position: relative;
  z-index: 3;
  margin: 26px auto 0;
  max-width: 560px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.4;
}

.finale__ledger {
  position: fixed;
  inset: 92px 34px 34px;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: space-between;
  pointer-events: none;
  color: rgba(150, 127, 97, 0.2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.finale__ledger span:nth-child(even) {
  justify-self: end;
  text-align: right;
}

.finale__signal {
  position: relative;
  z-index: 2;
  width: 138px;
  height: 138px;
  margin: 0 auto 10px;
  border: 1px solid rgba(126, 101, 73, 0.2);
  border-radius: 50%;
  box-shadow:
    inset 0 0 34px rgba(159, 113, 69, 0.075),
    0 0 56px rgba(212, 72, 47, 0.11);
}

.finale__signal::before,
.finale__signal::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(159, 113, 69, 0.16);
  border-radius: 50%;
}

.finale__signal::after {
  inset: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--amber);
  border: 0;
  box-shadow: 0 0 24px rgba(159, 113, 69, 0.38);
}

.finale__signal span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(159, 113, 69, 0.72);
  transform: rotate(calc(var(--i) * 60deg)) translateY(-54px);
  animation: collapseSignal 1.8s var(--ease) forwards;
}

.finale__signal span:nth-child(1) { --i: 0; }
.finale__signal span:nth-child(2) { --i: 1; }
.finale__signal span:nth-child(3) { --i: 2; }
.finale__signal span:nth-child(4) { --i: 3; }
.finale__signal span:nth-child(5) { --i: 4; }
.finale__signal span:nth-child(6) { --i: 5; }

.finale__integrity {
  position: relative;
  z-index: 3;
  display: block;
  color: rgba(204, 188, 160, 0.48);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.finale__actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}

.finale__actions.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.finale-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(126, 101, 73, 0.055);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  cursor: pointer;
}

.finale-action--primary {
  background: var(--ink);
  color: var(--bg);
}

@keyframes scanDrift {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.13;
  }
  50% {
    transform: translateY(18px);
    opacity: 0.24;
  }
}

@keyframes dataTear {
  0%,
  62%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.28;
  }
  63% {
    transform: translate3d(-2%, 0.5%, 0);
    opacity: 0.52;
  }
  64% {
    transform: translate3d(1.4%, -0.3%, 0);
    opacity: 0.16;
  }
  81% {
    transform: translate3d(0.8%, 0, 0);
    opacity: 0.43;
  }
  82% {
    transform: translate3d(0, 0, 0);
    opacity: 0.26;
  }
}

@keyframes bootTear {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 0 0);
  }
  33% {
    transform: translate3d(1.2%, -0.2%, 0);
    clip-path: inset(12% 0 22% 0);
  }
  66% {
    transform: translate3d(-0.8%, 0.3%, 0);
    clip-path: inset(42% 0 18% 0);
  }
}

@keyframes prebootTear {
  0%,
  76%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scaleX(1);
  }
  77% {
    opacity: 0.8;
    transform: translate3d(-3%, 0, 0) scaleX(1.08);
  }
  78% {
    opacity: 0.15;
    transform: translate3d(2%, 0, 0) scaleX(0.94);
  }
}

@keyframes prebootWave {
  0%,
  100% {
    opacity: 0.26;
    clip-path: inset(0 64% 0 0);
  }
  42% {
    opacity: 0.72;
    clip-path: inset(0 12% 0 8%);
  }
  68% {
    opacity: 0.38;
    clip-path: inset(0 0 0 42%);
  }
}

@keyframes prebootBar {
  0%,
  12% {
    transform: scaleX(0.04);
  }
  58% {
    transform: scaleX(0.62);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(0.985);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.035);
    opacity: 0.74;
  }
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.42;
  }
  100% {
    transform: scale(3.6);
    opacity: 0;
  }
}

@keyframes collapseSignal {
  0% {
    opacity: 0.24;
    transform: rotate(calc(var(--i) * 60deg)) translateY(-54px) scale(0.82);
  }
  100% {
    opacity: 0.78;
    transform: rotate(calc(var(--i) * 60deg)) translateY(-18px) scale(1);
  }
}

@media (max-width: 820px), (max-height: 640px) {
  html,
  body {
    overflow: auto;
  }

  .machine {
    position: relative;
    min-height: 100dvh;
  }

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

  .machine-state {
    display: none;
  }

  .machine-id span:nth-child(3) {
    display: none;
  }

  .console {
    min-height: 720px;
    margin-top: 18px;
  }

  .status-rail--left {
    top: 20px;
    left: 20px;
  }

  .status-rail--right {
    right: 20px;
    bottom: 20px;
  }

  .core-node {
    width: clamp(205px, 58vw, 275px);
  }

  .core__rings span {
    width: min(78vw, 410px);
  }

  .core__rings span:nth-child(2) {
    width: min(94vw, 520px);
  }

  .core__rings span:nth-child(3) {
    width: min(112vw, 620px);
  }

  .node {
    padding: 12px;
  }

  .panel__actions,
  .finale__actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .mini-action,
  .finale-action {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .machine {
    padding: 10px;
  }

  .machine__top {
    padding: 9px 10px 9px 18px;
  }

  .machine-id {
    gap: 9px;
    font-size: 9px;
  }

  .console {
    min-height: 680px;
    margin-top: 12px;
  }

  .status-rail {
    font-size: 9px;
  }

  .status-rail strong {
    font-size: 12px;
  }

  .gate-instruction {
    width: 90%;
    text-align: center;
  }

  .panel__shell {
    width: min(100% - 20px, 520px);
    padding: 22px 18px;
  }

  .panel__top {
    padding-right: 82px;
  }

  .finale__ledger {
    position: absolute;
    inset: 22px 18px;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    opacity: 0.38;
    font-size: 8px;
  }

  .finale__ledger span:nth-child(even) {
    justify-self: start;
    text-align: left;
  }

  .finale__signal {
    width: 112px;
    height: 112px;
    margin-top: 44px;
  }
}

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