/* ============================================================
   AGI · 构建记录
   Art direction: obsidian chamber, cold instrument light, warm
   gold only where a human decision has been made.
   ============================================================ */

:root {
  --ink: #04060b;
  --ink-2: #070b14;
  --text: #e9eefb;
  --dim: #8b96ad;
  --faint: rgba(233, 238, 251, 0.42);
  --line: rgba(170, 195, 255, 0.14);
  --line-soft: rgba(170, 195, 255, 0.07);
  --blue: #5677ff;
  --blue-deep: #2b3fa8;
  --ice: #bfe0ff;
  --gold: #ffcf8a;
  --gold-deep: #d99b4e;
  --danger: #ff6b6b;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --pad: clamp(18px, 3.2vw, 46px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overscroll-behavior: none; }

#app { position: fixed; inset: 0; }

#scene { position: absolute; inset: 0; }
#scene canvas { display: block; width: 100%; height: 100%; }

#ui, .intro, .finale, .loader { position: absolute; inset: 0; }

#ui {
  pointer-events: none;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.8s var(--ease);
}
#ui button, #ui input, #ui a, #ui .rail, #ui .inspector, #ui .calibrate { pointer-events: auto; }
#ui.ui-hidden { opacity: 0; }
#ui.ui-hidden .rail, #ui.ui-hidden .inspector, #ui.ui-hidden .calibrate { pointer-events: none; }

/* ------------------------------------------------------------ top bar */

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.4vw, 30px) var(--pad);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: rgba(233, 238, 251, 0.92);
}

.brand-rule {
  width: 1px; height: 13px;
  background: var(--line);
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--faint);
  text-transform: uppercase;
  white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 18px; }

.ghost-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255, 207, 138, 0.62);
  border: 1px solid rgba(255, 207, 138, 0.22);
  border-radius: 999px;
  padding: 5px 9px 4px;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.35s var(--ease);
}
.icon-btn:hover { color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--ice); }

.sound-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.sound-bars i {
  display: block; width: 1.5px; height: 3px;
  background: currentColor;
  border-radius: 1px;
  transition: height 0.3s var(--ease);
}
.icon-btn[aria-pressed="true"] .sound-bars i:nth-child(1) { height: 4px; animation: eq 1.6s infinite ease-in-out; }
.icon-btn[aria-pressed="true"] .sound-bars i:nth-child(2) { height: 9px; animation: eq 1.6s infinite ease-in-out 0.2s; }
.icon-btn[aria-pressed="true"] .sound-bars i:nth-child(3) { height: 6px; animation: eq 1.6s infinite ease-in-out 0.4s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1); } }

.hide-glyph {
  width: 9px; height: 9px;
  border: 1px solid currentColor;
  border-radius: 1px;
  box-shadow: inset 0 0 0 2px var(--ink);
}

/* ------------------------------------------------------------ telemetry */

.telemetry {
  position: absolute;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  width: 186px;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.telemetry.is-on { opacity: 1; }
.telemetry.is-dimmed { opacity: 0; }

.tele-line { height: 1px; background: var(--line); margin-bottom: 14px; }

.telemetry dl { margin: 0; display: grid; gap: 11px; }
.tele-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tele-row dt {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  white-space: nowrap;
}
.tele-row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(233, 238, 251, 0.9);
  white-space: nowrap;
}
.tele-row dd em {
  font-style: normal;
  font-size: 9px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.tele-note {
  margin-top: 15px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(139, 150, 173, 0.5);
}

/* ------------------------------------------------------------ act copy */

.act-info {
  position: absolute;
  left: var(--pad);
  bottom: clamp(112px, 15vh, 150px);
  max-width: 470px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.act-info.is-on { opacity: 1; transform: none; }

.act-index {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--faint);
  display: flex; align-items: center; gap: 6px;
}
.act-index span:first-child { color: var(--ice); }
.act-slash { opacity: 0.4; }

.act-zh {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.5vw, 44px);
  letter-spacing: 0.08em;
  line-height: 1;
  color: #f2f6ff;
  text-shadow: 0 0 40px rgba(86, 119, 255, 0.25);
}

.act-en {
  margin-top: 11px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: rgba(191, 224, 255, 0.55);
}

.act-desc {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.035em;
  color: rgba(233, 238, 251, 0.6);
  max-width: 30em;
}

.act-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 0;
  padding: 0;
}
.act-chips li {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(191, 224, 255, 0.62);
  border: 1px solid rgba(170, 195, 255, 0.13);
  border-radius: 2px;
  padding: 4px 7px 3px;
  background: rgba(10, 16, 30, 0.35);
}

.act-info.swap .act-zh,
.act-info.swap .act-desc,
.act-info.swap .act-chips,
.act-info.swap .act-en { opacity: 0; transform: translateY(6px); }
.act-zh, .act-desc, .act-chips, .act-en { transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }

/* ------------------------------------------------------------ rail */

.rail {
  position: absolute;
  left: 50%;
  bottom: clamp(52px, 7vh, 72px);
  transform: translateX(-50%);
  width: min(620px, 46vw);
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.rail.is-on { opacity: 1; }

.rail-track {
  position: relative;
  height: 1px;
  background: rgba(170, 195, 255, 0.14);
  overflow: hidden;
}
.rail-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(86, 119, 255, 0.2), var(--ice));
  box-shadow: 0 0 10px rgba(140, 180, 255, 0.7);
  transition: width 0.18s linear;
}

.rail-items {
  list-style: none;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
}
.rail-items li { flex: 1; }

.rail-items button {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 11px 0 0;
  cursor: pointer;
  text-align: left;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  transition: color 0.4s var(--ease);
}
.rail-items li:last-child button { text-align: right; }
.rail-items li:nth-child(odd) button { text-align: center; }
.rail-items button:hover { color: var(--text); }
.rail-items button::before {
  content: "";
  display: block;
  width: 1px; height: 7px;
  margin: 0 auto 0 0;
  background: currentColor;
  opacity: 0.35;
  transition: opacity 0.4s var(--ease), height 0.4s var(--ease);
}
.rail-items li:last-child button::before { margin: 0 0 0 auto; }
.rail-items li:nth-child(odd) button::before { margin: 0 auto; }
.rail-items button.is-active { color: var(--ice); }
.rail-items button.is-active::before { opacity: 1; height: 11px; box-shadow: 0 0 8px rgba(191, 224, 255, 0.8); }
.rail-items button.is-done { color: rgba(191, 224, 255, 0.5); }
.rail-items button .rail-label {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  opacity: 0;
  height: 0;
  transition: opacity 0.4s var(--ease), height 0.4s var(--ease);
  color: rgba(233, 238, 251, 0.65);
  letter-spacing: 0.12em;
  font-family: var(--sans);
}
.rail-items button.is-active .rail-label { opacity: 1; height: 13px; }

/* ------------------------------------------------------------ transport + hint */

.transport {
  position: absolute;
  right: var(--pad);
  bottom: clamp(44px, 6vh, 62px);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.transport.is-on { opacity: 1; }

.play-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(170, 195, 255, 0.22);
  background: rgba(8, 13, 24, 0.5);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  backdrop-filter: blur(6px);
}
.play-btn:hover { border-color: rgba(191, 224, 255, 0.55); background: rgba(20, 28, 50, 0.6); }

.play-glyph {
  width: 8px; height: 9px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  margin-left: 1px;
}
.play-btn.is-paused .play-glyph {
  width: 0; height: 0;
  border-left: 9px solid currentColor;
  border-right: 0;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
  margin-left: 2px;
}

.timecode {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tc-sep { margin: 0 4px; opacity: 0.4; }

.hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: rgba(139, 150, 173, 0.42);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hint.is-on { opacity: 1; }
.hint kbd {
  font-family: var(--mono);
  font-size: 8.5px;
  border: 1px solid rgba(170, 195, 255, 0.18);
  border-radius: 2px;
  padding: 1px 4px;
  margin: 0 1px;
  color: rgba(233, 238, 251, 0.6);
}

/* ------------------------------------------------------------ chapter sweep */

.sweep {
  position: absolute;
  left: 0;
  top: 46%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(191, 224, 255, 0.75), transparent);
  opacity: 0;
  transform: scaleX(0.2);
  pointer-events: none;
  filter: blur(0.4px);
}
.sweep.is-on {
  animation: sweep 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sweep {
  0% { opacity: 0; transform: scaleX(0.15) translateX(-40%); }
  35% { opacity: 0.55; }
  100% { opacity: 0; transform: scaleX(1.15) translateX(6%); }
}

/* ------------------------------------------------------------ inspector */

.inspector {
  position: absolute;
  right: var(--pad);
  top: 104px;
  width: 320px;
  padding: 22px 22px 20px;
  background: linear-gradient(160deg, rgba(14, 21, 38, 0.82), rgba(7, 11, 20, 0.86));
  border: 1px solid rgba(170, 195, 255, 0.14);
  border-radius: 3px;
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: panel-in 0.5s var(--ease);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }

.insp-close {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px;
  background: none; border: 0;
  color: var(--faint);
  font-size: 11px;
  cursor: pointer;
}
.insp-close:hover { color: var(--text); }

.insp-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: rgba(255, 207, 138, 0.7);
}
.insp-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.04em;
  margin: 10px 0 0;
}
.insp-body {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.85;
  color: rgba(233, 238, 251, 0.6);
}
.insp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.insp-metrics div { display: grid; gap: 4px; }
.insp-metrics dt {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
}
.insp-metrics dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(233, 238, 251, 0.86);
}

/* ------------------------------------------------------------ calibrate */

.calibrate {
  position: absolute;
  right: var(--pad);
  bottom: clamp(112px, 15vh, 150px);
  width: 366px;
  padding: 22px 24px 20px;
  background: linear-gradient(165deg, rgba(14, 20, 36, 0.94), rgba(5, 9, 16, 0.96));
  border: 1px solid rgba(255, 207, 138, 0.16);
  border-radius: 3px;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  animation: panel-in 0.7s var(--ease);
}
.cal-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.cal-kicker {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: rgba(255, 207, 138, 0.7);
}
.cal-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: 0.04em;
  margin: 9px 0 0;
}
.cal-readout {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ice);
  border: 1px solid rgba(191, 224, 255, 0.2);
  padding: 5px 7px;
  border-radius: 2px;
  white-space: nowrap;
  margin-top: 2px;
}

.cal-sliders { display: grid; gap: 13px; margin-top: 22px; }
.cal-row {
  display: grid;
  grid-template-columns: 34px 1fr 30px;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: rgba(233, 238, 251, 0.66);
}
.cal-row output {
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  background: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(90deg, rgba(191, 224, 255, 0.55), rgba(170, 195, 255, 0.14));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px; height: 8px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px rgba(191, 224, 255, 0.9);
}
input[type="range"]::-moz-range-track { height: 1px; background: rgba(191, 224, 255, 0.35); }
input[type="range"]::-moz-range-thumb {
  width: 8px; height: 8px; border: 0; border-radius: 50%;
  background: var(--ice); box-shadow: 0 0 10px rgba(191, 224, 255, 0.9);
}

.cal-note {
  margin: 16px 0 0;
  font-size: 10.5px;
  line-height: 1.8;
  color: rgba(233, 238, 251, 0.42);
}

.ignite {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(90deg, rgba(255, 207, 138, 0.1), rgba(255, 207, 138, 0.02));
  border: 1px solid rgba(255, 207, 138, 0.34);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  cursor: pointer;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
}
.ignite:hover {
  background: linear-gradient(90deg, rgba(255, 207, 138, 0.22), rgba(255, 207, 138, 0.05));
  border-color: rgba(255, 207, 138, 0.7);
  color: #ffe4ba;
}

/* ------------------------------------------------------------ intro */

.intro {
  z-index: 20;
  display: flex;
  align-items: center;
  background: radial-gradient(130% 100% at 34% 50%, rgba(4, 6, 11, 0.02) 0%, rgba(4, 6, 11, 0.52) 58%, rgba(4, 6, 11, 0.94) 100%);
  transition: opacity 1.4s var(--ease), visibility 1.4s;
}
.intro.is-out { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-veil {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4, 6, 11, 0.82) 0%, rgba(4, 6, 11, 0.42) 46%, transparent 74%);
}

.intro-inner {
  padding: 0 var(--pad);
  margin-left: clamp(0px, 4vw, 70px);
  max-width: 640px;
}

.intro-kicker {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(191, 224, 255, 0.6);
  opacity: 0;
  animation: rise 1.2s var(--ease) 0.35s forwards;
}
.intro-kicker .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 207, 138, 0.9);
}

.intro-title {
  display: flex;
  gap: 0.02em;
  margin: 26px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(86px, 12vw, 156px);
  line-height: 0.86;
  letter-spacing: 0.03em;
  color: #f4f7ff;
}
.intro-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px);
  filter: blur(10px);
  animation: letter-in 1.6s var(--ease) forwards;
  text-shadow: 0 0 90px rgba(86, 119, 255, 0.35);
}
.intro-title span:nth-child(1) { animation-delay: 0.5s; }
.intro-title span:nth-child(2) { animation-delay: 0.66s; }
.intro-title span:nth-child(3) { animation-delay: 0.82s; }

@keyframes letter-in { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rise { to { opacity: 1; transform: none; } }

.intro-rule {
  width: 54px; height: 1px;
  margin: 34px 0 0;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.05s forwards;
}

.intro-sub {
  margin: 22px 0 0;
  font-size: 13px;
  letter-spacing: 0.32em;
  color: rgba(233, 238, 251, 0.72);
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.15s forwards;
}

.intro-line {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2.05;
  letter-spacing: 0.06em;
  color: rgba(233, 238, 251, 0.46);
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.3s forwards;
}

.start {
  margin-top: 38px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 13px;
  background: rgba(86, 119, 255, 0.08);
  border: 1px solid rgba(140, 170, 255, 0.34);
  color: #eaf0ff;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.26em;
  cursor: pointer;
  opacity: 0;
  animation: rise 1.4s var(--ease) 1.5s forwards;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.start:hover {
  background: rgba(86, 119, 255, 0.16);
  border-color: rgba(191, 224, 255, 0.7);
  box-shadow: 0 0 40px rgba(86, 119, 255, 0.25);
}
.start-arrow { font-family: var(--mono); font-size: 13px; opacity: 0.8; }

.intro-foot {
  position: absolute;
  left: var(--pad);
  bottom: 26px;
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: rgba(139, 150, 173, 0.38);
  opacity: 0;
  animation: rise 1.6s var(--ease) 1.8s forwards;
}

/* ------------------------------------------------------------ finale */

.finale {
  z-index: 22;
  display: grid;
  place-items: center;
  background: radial-gradient(80% 62% at 50% 44%, rgba(6, 9, 18, 0.5), rgba(4, 6, 11, 0.92) 62%, #04060b 86%);
  opacity: 0;
  transition: opacity 2s var(--ease);
}
.finale.is-on { opacity: 1; }
.finale[hidden] { display: none; }

.finale-inner {
  width: min(720px, 82vw);
  text-align: center;
  padding: 0 20px;
}

.finale-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(255, 207, 138, 0.55);
}

.finale-line {
  margin: 34px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.1vw, 38px);
  line-height: 1.65;
  letter-spacing: 0.06em;
  color: #f0f4ff;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.6s var(--ease), transform 1.6s var(--ease);
}
.finale-line.muted { color: rgba(233, 238, 251, 0.55); margin-top: 12px; font-size: clamp(19px, 2.4vw, 29px); }
.finale-line.is-on { opacity: 1; transform: none; }

.finale-rule {
  width: 1px; height: 46px;
  margin: 40px auto 0;
  background: linear-gradient(var(--gold), transparent);
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.finale-rule.is-on { opacity: 0.8; }

.finale-foot {
  margin: 26px auto 0;
  max-width: 460px;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: rgba(160, 172, 196, 0.55);
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.finale-foot.is-on { opacity: 1; }

.finale-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.finale-actions.is-on { opacity: 1; }

.ghost-btn {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(170, 195, 255, 0.22);
  color: rgba(233, 238, 251, 0.72);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease), background 0.4s var(--ease);
}
.ghost-btn:hover { border-color: rgba(191, 224, 255, 0.55); color: #fff; background: rgba(86, 119, 255, 0.08); }

/* ------------------------------------------------------------ loader + toast */

.loader {
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--ink);
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}
.loader.is-out { opacity: 0; visibility: hidden; }

.loader-inner { width: 190px; text-align: center; }
.loader-mark {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.4em;
  color: rgba(233, 238, 251, 0.7);
  margin-left: 0.4em;
}
.loader-bar {
  height: 1px;
  margin-top: 22px;
  background: rgba(170, 195, 255, 0.14);
  overflow: hidden;
}
.loader-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ice);
  box-shadow: 0 0 8px var(--ice);
  transition: width 0.4s var(--ease);
}
.loader-text {
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(139, 150, 173, 0.6);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translate(-50%, 12px);
  padding: 9px 14px;
  background: rgba(10, 16, 30, 0.86);
  border: 1px solid var(--line);
  color: rgba(233, 238, 251, 0.8);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  z-index: 40;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: var(--ink); color: var(--text);
  font-size: 14px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .telemetry { display: none; }
  .rail { width: min(560px, 54vw); }
}

@media (max-width: 820px) {
  .ghost-tag { display: none; }
  .act-info { bottom: 118px; max-width: 74vw; }
  .act-desc { font-size: 12px; }
  .rail { width: 76vw; bottom: 56px; }
  .transport { right: auto; left: 50%; transform: translateX(-50%); bottom: 12px; }
  .hint { display: none; }
  .inspector, .calibrate { width: min(340px, 84vw); }
  .calibrate { bottom: 150px; }
  .intro-title { font-size: clamp(72px, 22vw, 110px); }
  .intro-line { display: none; }
}

@media (max-height: 720px) {
  .act-desc { display: none; }
  .act-chips { margin-top: 14px; }
  .calibrate { bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-title span, .intro-kicker, .intro-rule, .intro-sub, .intro-line, .start, .intro-foot {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}
