:root {
  --bg: #080604;
  --ivory: #ece1cb;
  --ivory-soft: rgba(236, 225, 203, 0.68);
  --ivory-faint: rgba(236, 225, 203, 0.38);
  --brass: #c99a5b;
  --brass-bright: #e8bd80;
  --amber: #e6a257;
  --line: rgba(201, 154, 91, 0.24);
  --line-soft: rgba(236, 225, 203, 0.11);
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --serif: "Cormorant Garamond", "Bodoni MT", "Didot", Georgia, serif;
  --display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --han: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  color: var(--ivory);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
}

::selection {
  color: #160e07;
  background: var(--brass-bright);
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 42%, #171008 0%, #090604 48%, #050302 100%);
}

.scene-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: grab;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  contain: paint;
  background: radial-gradient(ellipse at 50% 42%, #24170d 0%, #100a06 48%, #070403 100%);
}

.scene-canvas:active {
  cursor: grabbing;
}

.is-hovering-specimen .scene-canvas {
  cursor: pointer;
}

.scene-vignette,
.scene-grade,
.film-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Keep overlays over the live WebGL canvas source-over and blur-free.
   Extra compositor surfaces add real cost and can flash on weak GPUs. */
.scene-vignette {
  z-index: 3;
  background:
    radial-gradient(116% 88% at 50% 42%, transparent 32%, rgba(5, 3, 2, 0.22) 67%, rgba(4, 2, 1, 0.7) 100%),
    linear-gradient(180deg, rgba(4, 3, 2, 0.6) 0%, transparent 19%, transparent 58%, rgba(4, 2, 1, 0.7) 100%);
}

.scene-grade {
  z-index: 3;
  background:
    radial-gradient(42% 48% at 50% 46%, rgba(157, 85, 33, 0.08), transparent 74%),
    linear-gradient(112deg, rgba(139, 78, 32, 0.035), transparent 45%, rgba(55, 88, 82, 0.025));
}

.film-grain {
  z-index: 4;
  opacity: 0.042;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.62'/%3E%3C/svg%3E");
  background-size: 190px 190px;
}

.frame {
  position: absolute;
  inset: 20px;
  z-index: 6;
  border: 1px solid rgba(201, 154, 91, 0.13);
  pointer-events: none;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(236, 225, 203, 0.045);
}

.frame-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: rgba(218, 173, 109, 0.66);
  border-style: solid;
}

.frame-corner::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border: 1px solid rgba(218, 173, 109, 0.72);
  border-radius: 50%;
  background: #100b06;
}

.frame-corner--tl {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.frame-corner--tl::after {
  top: 7px;
  left: 7px;
}

.frame-corner--tr {
  top: -1px;
  right: -1px;
  border-width: 1px 1px 0 0;
}

.frame-corner--tr::after {
  top: 7px;
  right: 7px;
}

.frame-corner--bl {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 1px 1px;
}

.frame-corner--bl::after {
  bottom: 7px;
  left: 7px;
}

.frame-corner--br {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.frame-corner--br::after {
  right: 7px;
  bottom: 7px;
}

.frame-notch {
  position: absolute;
  left: 50%;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(218, 173, 109, 0.7);
  background: #0b0805;
  transform: translateX(-50%) rotate(45deg);
}

.frame-notch--top {
  top: -3px;
}

.frame-notch--bottom {
  bottom: -3px;
}

/* Masthead */
.masthead {
  position: absolute;
  top: 42px;
  left: 54px;
  right: 54px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 1.2s ease 0.2s, transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s;
}

.is-ready .masthead {
  opacity: 1;
  transform: translateY(0);
}

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

.brand-seal {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1;
  opacity: 0.9;
  animation: seal-turn 90s linear infinite;
}

.brand-seal-core {
  fill: var(--brass);
  stroke: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.brand-name {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.23em;
  color: var(--ivory);
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.045em;
  color: var(--ivory-faint);
  white-space: nowrap;
}

.plate-mark {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 2px;
}

.plate-line {
  display: block;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 154, 91, 0.42));
}

.plate-line:last-child {
  background: linear-gradient(90deg, rgba(201, 154, 91, 0.42), transparent);
}

.plate-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.plate-copy span {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.22em;
  color: var(--ivory-faint);
}

.plate-copy strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--brass-bright);
}

.masthead-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  padding-top: 3px;
}

.masthead-year {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--ivory-faint);
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.19em;
  color: var(--brass-bright);
}

.live-status i,
.telemetry-live i {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e7ad64;
  box-shadow: 0 0 7px rgba(231, 173, 100, 0.95);
  animation: signal-pulse 2.8s ease-in-out infinite;
}

.side-inscription {
  position: absolute;
  left: 35px;
  top: 31%;
  z-index: 7;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.32em;
  color: rgba(236, 225, 203, 0.25);
  opacity: 0;
  transition: opacity 1.6s ease 0.8s;
}

.is-ready .side-inscription {
  opacity: 1;
}

/* Telemetry */
.telemetry {
  position: absolute;
  top: 25%;
  right: 56px;
  z-index: 8;
  width: 258px;
  padding: 18px 15px 17px 22px;
  border: 1px solid rgba(201, 154, 91, 0.15);
  border-left-color: rgba(201, 154, 91, 0.34);
  background: linear-gradient(90deg, rgba(8, 6, 4, 0.76), rgba(8, 6, 4, 0.3));
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translate3d(12px, 0, 0);
  transition: opacity 1.1s ease 0.45s, transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.45s;
}

.is-ready .telemetry {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.telemetry::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  z-index: 2;
  width: 6px;
  height: 6px;
  border: 1px solid var(--brass);
  transform: rotate(45deg);
  background: #0b0805;
}

.telemetry::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 0;
  border: 1px solid rgba(236, 225, 203, 0.04);
  pointer-events: none;
}

.telemetry > * {
  position: relative;
  z-index: 1;
}

.telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--ivory-soft);
}

.telemetry-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brass);
  font-size: 7px;
  letter-spacing: 0.16em;
}

.beat-readout {
  padding-top: 18px;
}

.micro-label {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.19em;
  color: var(--ivory-faint);
}

.beat-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 4px;
}

.beat-value b {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 55px;
  line-height: 0.94;
  letter-spacing: -0.035em;
  color: #f1e5cf;
  text-shadow: 0 0 32px rgba(230, 162, 87, 0.2);
  font-variant-numeric: tabular-nums;
}

.beat-value span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--brass);
}

.beat-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  margin-top: 7px;
  opacity: 0.55;
}

.beat-wave i {
  width: 1px;
  height: 4px;
  background: linear-gradient(to top, rgba(201, 154, 91, 0.2), var(--brass-bright));
  transform-origin: bottom;
  animation: beat-wave 1.4s ease-in-out infinite alternate;
}

.beat-wave i:nth-child(2n) {
  animation-duration: 1.1s;
}

.beat-wave i:nth-child(3n) {
  animation-duration: 0.9s;
  animation-delay: -0.4s;
}

.beat-wave i:nth-child(4n) {
  animation-duration: 1.7s;
  animation-delay: -0.7s;
}

.telemetry-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 15px;
}

.telemetry-divider span {
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.telemetry-divider i {
  display: block;
  width: 4px;
  height: 4px;
  border: 1px solid rgba(201, 154, 91, 0.62);
  transform: rotate(45deg);
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  color: var(--ivory-soft);
}

.meter-head .meter-value {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ivory-soft);
  font-variant-numeric: tabular-nums;
}

.meter-head .meter-value small {
  margin-left: 1px;
  font-size: 6px;
  color: var(--brass);
}

.meter-track {
  position: relative;
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(201, 154, 91, 0.16);
  background: rgba(236, 225, 203, 0.045);
}

.meter-track i {
  display: block;
  width: 58%;
  height: 100%;
  background: linear-gradient(90deg, #735027, #c99556 52%, #f0c582);
  box-shadow: 0 0 12px rgba(233, 172, 94, 0.32);
  transition: width 0.35s ease;
}

.meter-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(8, 6, 4, 0.55) 9px 10px);
  pointer-events: none;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.06em;
  color: rgba(236, 225, 203, 0.26);
}

.telemetry-list {
  margin: 15px 0 0;
}

.telemetry-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(236, 225, 203, 0.07);
}

.telemetry-list dt {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--ivory-faint);
}

.telemetry-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ivory-soft);
  font-variant-numeric: tabular-nums;
}

.telemetry-list dd small {
  margin-left: 1px;
  font-size: 7px;
  color: var(--brass);
}

.telemetry-list dd.material-value {
  font-size: 7.5px;
  letter-spacing: 0.11em;
  color: var(--brass);
}

.telemetry-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.13em;
  color: var(--brass-bright);
}

.state-pill i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--brass-bright);
  box-shadow: 0 0 5px rgba(232, 189, 128, 0.8);
}

.stir-tally {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.1em;
  color: var(--ivory-faint);
}

.stir-tally b {
  font-weight: 400;
  color: var(--ivory-soft);
}

/* Hero title */
.hero {
  position: absolute;
  left: 58px;
  bottom: 57px;
  z-index: 9;
  width: min(470px, 39vw);
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.3s ease 0.55s, transform 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) 0.55s;
}

.is-ready .hero {
  opacity: 1;
  transform: translateY(0);
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.2em;
}

.hero-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(201, 154, 91, 0.4);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--brass-bright);
}

.hero-kicker-line {
  width: 27px;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 154, 91, 0.7), rgba(201, 154, 91, 0.1));
}

.hero h1 {
  margin: 17px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 7.2vw, 112px);
  line-height: 0.7;
  letter-spacing: 0.015em;
  color: var(--ivory);
  text-transform: uppercase;
  text-shadow: 0 9px 60px rgba(0, 0, 0, 0.55);
}

.hero h1 span,
.hero h1 em {
  display: block;
}

.hero h1 em {
  margin-top: 0.17em;
  margin-left: 0.55em;
  font-weight: 300;
  font-style: italic;
  color: #e2b779;
  letter-spacing: 0.035em;
}

.hero-cn {
  margin-top: 23px;
  font-family: var(--han);
  font-size: 10px;
  letter-spacing: 0.29em;
  color: var(--ivory-soft);
}

.hero-cn span {
  margin: 0 0.35em;
  color: var(--brass);
}

.hero-desc {
  margin: 13px 0 18px;
  font-family: var(--han);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.055em;
  color: rgba(236, 225, 203, 0.48);
}

.hero-specs {
  display: flex;
  gap: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ivory-soft);
}

.hero-specs > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.hero-specs small {
  font-family: var(--han);
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--ivory-faint);
}

/* Specimen cue */
.specimen-cue {
  position: absolute;
  left: 50%;
  bottom: 51px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 11px;
  border: 1px solid rgba(201, 154, 91, 0.16);
  background: linear-gradient(90deg, rgba(12, 8, 5, 0.72), rgba(12, 8, 5, 0.36));
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease 0.9s;
}

.is-ready .specimen-cue {
  opacity: 1;
}

.specimen-cue.is-dismissed {
  opacity: 0 !important;
}

.cue-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201, 154, 91, 0.42);
  border-radius: 50%;
}

.cue-orbit::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(201, 154, 91, 0.16);
  border-radius: 50%;
}

.cue-orbit i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass-bright);
  box-shadow: 0 0 8px rgba(232, 189, 128, 0.75);
  animation: cue-pulse 2.2s ease-in-out infinite;
}

.cue-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cue-copy b {
  font-family: var(--han);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--ivory-soft);
}

.cue-copy small {
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.14em;
  color: rgba(236, 225, 203, 0.3);
}

/* Controls */
.control-dock {
  position: absolute;
  right: 56px;
  bottom: 48px;
  z-index: 10;
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 1.2s ease 0.7s, transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.7s;
}

.is-ready .control-dock {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.control-caption {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.17em;
  color: var(--ivory-faint);
}

.control-caption span:last-child {
  color: rgba(201, 154, 91, 0.5);
}

.control-row {
  display: flex;
  gap: 9px;
}

.control-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 145px;
  height: 62px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 154, 91, 0.21);
  outline: none;
  background:
    linear-gradient(135deg, rgba(255, 185, 102, 0.035), transparent 40%),
    linear-gradient(180deg, rgba(31, 23, 15, 0.82), rgba(11, 8, 5, 0.9));
  color: var(--ivory);
  text-align: left;
  box-shadow: inset 0 0 26px rgba(255, 176, 83, 0.018), 0 14px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.control-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 16px;
  background: rgba(232, 189, 128, 0.45);
  transition: height 0.35s ease, background 0.35s ease;
}

.control-button:hover {
  border-color: rgba(232, 189, 128, 0.48);
  box-shadow: inset 0 0 34px rgba(255, 176, 83, 0.04), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.control-button:hover::before {
  height: 28px;
  background: var(--brass-bright);
}

.control-button:focus-visible {
  border-color: var(--brass-bright);
  box-shadow: 0 0 0 2px rgba(232, 189, 128, 0.18);
}

.control-button.is-active {
  border-color: rgba(232, 189, 128, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 185, 102, 0.06), transparent 45%),
    linear-gradient(180deg, rgba(39, 28, 17, 0.88), rgba(12, 8, 5, 0.92));
}

.control-button.is-active .control-icon {
  color: var(--brass-bright);
}

.control-button.is-active::before {
  height: 28px;
  background: var(--brass-bright);
}

.control-button--primary {
  border-color: rgba(201, 154, 91, 0.37);
  background:
    linear-gradient(135deg, rgba(255, 185, 102, 0.09), transparent 45%),
    linear-gradient(180deg, rgba(41, 29, 17, 0.9), rgba(14, 9, 5, 0.94));
}

.control-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--brass);
  transition: color 0.35s ease;
}

.control-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-button--primary .control-icon svg path:first-child {
  fill: rgba(201, 154, 91, 0.12);
}

.control-icon .control-dot {
  fill: currentColor;
  stroke: none;
}

.control-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.control-copy b {
  font-family: var(--han);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ivory);
}

.control-copy small {
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.14em;
  color: var(--ivory-faint);
}

.control-button kbd {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: auto;
  border: 1px solid rgba(236, 225, 203, 0.1);
  background: rgba(236, 225, 203, 0.025);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 400;
  color: rgba(236, 225, 203, 0.36);
}

.stage-note {
  position: absolute;
  bottom: 29px;
  left: 50%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 5.8px;
  letter-spacing: 0.16em;
  color: rgba(236, 225, 203, 0.22);
  opacity: 0;
  transition: opacity 1.2s ease 1s;
}

.is-ready .stage-note {
  opacity: 1;
}

.stage-note i {
  width: 14px;
  height: 1px;
  background: rgba(201, 154, 91, 0.28);
}

.is-dimmed .stage-note {
  opacity: 0.5;
}

/* Loader */
.loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 43%, rgba(91, 55, 26, 0.24), transparent 48%),
    linear-gradient(180deg, #080604, #050302 64%, #080503);
  transition: opacity 1.15s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 1.15s;
}

.loader::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(201, 154, 91, 0.14);
  pointer-events: none;
}

.loader::after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(236, 225, 203, 0.035);
  pointer-events: none;
}

.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  width: min(390px, calc(100vw - 70px));
  text-align: center;
}

.loader-gear {
  width: 55px;
  height: 55px;
  margin: 0 auto 21px;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1;
  opacity: 0.75;
  animation: gear-turn 14s linear infinite;
}

.loader-kicker {
  display: block;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--brass);
}

.loader h2 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.045em;
  color: var(--ivory);
}

.loader h2 em {
  font-style: italic;
  color: var(--brass-bright);
}

.loader p {
  margin: 12px 0 31px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  color: rgba(236, 225, 203, 0.3);
}

.loader-track {
  height: 2px;
  overflow: hidden;
  background: rgba(236, 225, 203, 0.08);
}

.loader-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #846033, #e4b97b);
  box-shadow: 0 0 12px rgba(230, 178, 105, 0.42);
  transition: width 0.25s ease;
}

.loader-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
  color: rgba(236, 225, 203, 0.3);
}

.loader-meta b {
  font-weight: 400;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.loader-corner {
  position: absolute;
  width: 23px;
  height: 23px;
  border-color: rgba(201, 154, 91, 0.43);
  border-style: solid;
}

.loader-corner--tl {
  top: 32px;
  left: 32px;
  border-width: 1px 0 0 1px;
}

.loader-corner--tr {
  top: 32px;
  right: 32px;
  border-width: 1px 1px 0 0;
}

.loader-corner--bl {
  bottom: 32px;
  left: 32px;
  border-width: 0 0 1px 1px;
}

.loader-corner--br {
  right: 32px;
  bottom: 32px;
  border-width: 0 1px 1px 0;
}

/* Context recovery */
.recovery {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 44%, rgba(92, 56, 27, 0.25), transparent 48%),
    linear-gradient(180deg, #080604, #050302 64%, #070403);
  text-align: center;
}

.recovery-inner {
  max-width: 440px;
}

.recovery-kicker {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.26em;
  color: var(--brass);
}

.recovery h2 {
  margin: 16px 0 14px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: var(--ivory);
}

.recovery h2 em {
  display: block;
  font-style: italic;
  color: var(--brass-bright);
}

.recovery p {
  margin: 0;
  font-family: var(--han);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--ivory-faint);
}

.recovery-line {
  display: block;
  width: 170px;
  height: 1px;
  margin: 27px auto 0;
  overflow: hidden;
  background: rgba(201, 154, 91, 0.14);
}

.recovery-line i {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--brass-bright), transparent);
  animation: recovery-sweep 1.6s ease-in-out infinite;
}

/* Error state */
.webgl-error {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-content: center;
  padding: 30px;
  background: #070503;
  text-align: center;
}

.webgl-error h2 {
  margin: 14px 0 10px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 300;
}

.webgl-error p {
  max-width: 390px;
  margin: 0 auto;
  font-family: var(--han);
  font-size: 12px;
  line-height: 2;
  color: var(--ivory-faint);
}

/* Motion */
@keyframes seal-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gear-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes signal-pulse {
  0%,
  100% {
    opacity: 0.45;
    box-shadow: 0 0 4px rgba(231, 173, 100, 0.4);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 9px rgba(231, 173, 100, 0.95);
  }
}

@keyframes beat-wave {
  0% {
    height: 3px;
    opacity: 0.3;
  }
  100% {
    height: 13px;
    opacity: 0.95;
  }
}

@keyframes cue-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes recovery-sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(310%);
  }
}

/* Responsive */
@media (max-width: 1320px) {
  .hero {
    left: 48px;
  }

  .control-dock {
    right: 48px;
  }

  .telemetry {
    right: 48px;
    width: 225px;
  }

  .masthead {
    left: 48px;
    right: 48px;
  }

  .specimen-cue {
    display: none;
  }
}

@media (max-width: 1120px) {
  .side-inscription {
    display: none;
  }

  .masthead {
    top: 34px;
    left: 38px;
    right: 38px;
  }

  .telemetry {
    top: 24%;
    right: 38px;
    width: 205px;
  }

  .hero {
    left: 38px;
    bottom: 44px;
    width: 380px;
  }

  .hero-desc {
    display: none;
  }

  .hero-specs {
    margin-top: 15px;
  }

  .control-dock {
    right: 38px;
    bottom: 40px;
  }

  .control-button {
    min-width: 126px;
    height: 56px;
    padding: 0 10px;
  }

  .control-copy b {
    font-size: 10px;
  }

  .control-copy small {
    font-size: 6px;
  }

  .control-icon {
    width: 23px;
    height: 23px;
  }

  .control-button kbd {
    display: none;
  }

  .stage-note {
    display: none;
  }

  .brand-seal {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 11px;
  }
}

@media (max-width: 860px) {
  .frame {
    inset: 12px;
  }

  .frame::before {
    inset: 5px;
  }

  .masthead {
    top: 26px;
    left: 26px;
    right: 26px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .brand-sub {
    display: none;
  }

  .plate-mark {
    display: none;
  }

  .masthead-meta {
    gap: 5px;
  }

  .masthead-year {
    display: none;
  }

  .live-status {
    font-size: 7px;
  }

  .telemetry {
    display: none;
  }

  .hero {
    left: 26px;
    bottom: max(126px, calc(env(safe-area-inset-bottom) + 118px));
    width: calc(100% - 52px);
  }

  .hero-kicker {
    font-size: 6.5px;
    letter-spacing: 0.15em;
  }

  .hero-number {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .hero h1 {
    margin-top: 13px;
    font-size: clamp(55px, 11.5vw, 88px);
  }

  .hero h1 em {
    margin-left: 0.35em;
  }

  .hero-cn {
    margin-top: 18px;
    font-size: 9px;
    letter-spacing: 0.21em;
  }

  .hero-specs {
    display: none;
  }

  .hero-desc {
    display: none;
  }

  .control-dock {
    right: 26px;
    bottom: max(26px, env(safe-area-inset-bottom));
    left: 26px;
  }

  .control-caption {
    margin-bottom: 7px;
  }

  .control-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .control-button {
    justify-content: center;
    min-width: 0;
    height: 56px;
    padding: 0 8px;
  }

  .control-button kbd {
    display: none;
  }

  .control-copy {
    gap: 2px;
  }

  .control-copy b {
    letter-spacing: 0.1em;
  }

  .control-copy small {
    font-size: 5.5px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 540px) {
  .brand {
    gap: 10px;
  }

  .brand-seal {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 9.5px;
    letter-spacing: 0.17em;
  }

  .live-status {
    font-size: 6px;
    letter-spacing: 0.11em;
  }

  .hero {
    bottom: max(116px, calc(env(safe-area-inset-bottom) + 108px));
  }

  .hero h1 {
    font-size: clamp(48px, 15vw, 68px);
    line-height: 0.73;
  }

  .hero-cn {
    margin-top: 17px;
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .hero-kicker > span:last-child {
    font-size: 5.6px;
    letter-spacing: 0.1em;
  }

  .control-caption {
    display: none;
  }

  .control-button {
    flex-direction: column;
    gap: 4px;
    height: 60px;
    padding: 7px 4px;
  }

  .control-icon {
    width: 22px;
    height: 22px;
  }

  .control-copy {
    text-align: center;
  }

  .control-copy b {
    font-size: 9.5px;
  }

  .control-copy small {
    display: none;
  }

  .loader h2 {
    font-size: 33px;
  }

  .loader p {
    font-size: 5.8px;
  }

  .frame-corner {
    width: 25px;
    height: 25px;
  }

  .frame-corner--tl::after,
  .frame-corner--tr::after,
  .frame-corner--bl::after,
  .frame-corner--br::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-seal,
  .loader-gear,
  .beat-wave i,
  .cue-orbit i,
  .live-status i,
  .telemetry-live i {
    animation: none;
  }
}
