/* ============================================================
   PurpleInk — THE INK ENGINE
   Ink intro + game-grade 3D foundry. Day/night theming.
   Fonts unified with purpleink.dev (Geist Sans / Geist Mono).
   ============================================================ */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geist-var.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/geist-mono-var.woff2") format("woff2");
}

/* ---------- theme tokens ---------- */
:root {
  --display: "Geist", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Geist", "Aptos", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}
body[data-theme="day"] {
  --void: #e9e6f7;
  --night: #dcd7f0;
  --panel: rgba(255, 255, 255, 0.62);
  --signal: #6b4dff;
  --signal-deep: #cfc6f2;
  --signal-hot: #4b2fd1;
  --acid: #4d8f12;
  --ice: #18122f;
  --muted: #5d5a7c;
  --line: rgba(60, 40, 120, 0.18);
  --line-soft: rgba(60, 40, 120, 0.1);
  --glass: rgba(244, 242, 251, 0.72);
  --ink-drip: #241547;
}
body[data-theme="night"] {
  --void: #04050a;
  --night: #0a0c18;
  --panel: rgba(9, 11, 22, 0.58);
  --signal: #7b5cff;
  --signal-deep: #2a1b66;
  --signal-hot: #b797ff;
  --acid: #c5ff73;
  --ice: #eceaff;
  --muted: #9698b8;
  --line: rgba(196, 186, 255, 0.16);
  --line-soft: rgba(196, 186, 255, 0.09);
  --glass: rgba(7, 8, 17, 0.86);
  --ink-drip: #150d2e;
}
/* factory chrome drops brand-purple for industrial brass */
body[data-state="factory"][data-theme="day"] {
  --signal: #b07f2a;
  --signal-deep: #e3d3ae;
  --signal-hot: #8a5f14;
  --line: rgba(110, 85, 35, 0.2);
  --line-soft: rgba(110, 85, 35, 0.1);
}
body[data-state="factory"][data-theme="night"] {
  --signal: #dfa63e;
  --signal-deep: #4a3512;
  --signal-hot: #f0c778;
  --line: rgba(230, 200, 140, 0.16);
  --line-soft: rgba(230, 200, 140, 0.09);
}

* { box-sizing: border-box; }
html { background: var(--void); }
html, body { height: 100%; }
body {
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  color: var(--ice);
  background: var(--void);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.7s ease, color 0.7s ease;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border: 1px solid var(--acid);
  color: var(--void);
  background: var(--acid);
  font: 700 12px/1 var(--mono);
  text-decoration: none;
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

#stage-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
body[data-state="factory"] #stage-canvas { opacity: 1; pointer-events: auto; }
.grain {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.92'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* ---------- boot sequence ---------- */
.boot {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--void);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s ease;
}
.boot.done { opacity: 0; }
.boot-inner { display: grid; justify-items: center; gap: 16px; }
.boot-label {
  margin: 0;
  color: var(--signal-hot);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.32em;
}
.boot-sep { margin: 0 10px; color: var(--acid); opacity: 0.7; }
.boot-bar {
  width: min(300px, 62vw);
  height: 3px;
  overflow: hidden;
  background: var(--line);
}
.boot-bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--signal), var(--acid));
  box-shadow: 0 0 14px var(--signal);
}
.boot-pct {
  margin: 0;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.22em;
  font-variant-numeric: tabular-nums;
}

/* ---------- HUD frame ---------- */
.hud-frame { position: fixed; z-index: 4; inset: 0; pointer-events: none; }
.hud-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid var(--line);
  transition: border-color 0.7s ease;
}
.hud-tl { top: 14px; left: 14px; border-top-width: 1px; border-left-width: 1px; }
.hud-tr { top: 14px; right: 14px; border-top-width: 1px; border-right-width: 1px; }
.hud-bl { bottom: 14px; left: 14px; border-bottom-width: 1px; border-left-width: 1px; }
.hud-br { bottom: 14px; right: 14px; border-bottom-width: 1px; border-right-width: 1px; }
.hud-corner::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--acid);
  box-shadow: 0 0 9px var(--acid);
}
.hud-tl::after { top: -2px; left: -2px; }
.hud-tr::after { top: -2px; right: -2px; }
.hud-bl::after { bottom: -2px; left: -2px; }
.hud-br::after { bottom: -2px; right: -2px; }

/* ---------- edge telemetry ---------- */
.telemetry {
  position: fixed;
  z-index: 4;
  top: 50%;
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font: 500 8.5px/1 var(--mono);
  letter-spacing: 0.18em;
  white-space: nowrap;
  pointer-events: none;
  writing-mode: vertical-rl;
}
.telemetry-left { left: 16px; transform: translateY(-50%) rotate(180deg); }
.telemetry-right { right: 16px; transform: translateY(-50%); }
.t-val { color: var(--ice); font-variant-numeric: tabular-nums; }
.t-acid { color: var(--acid); }
.t-tick { width: 22px; height: 1px; background: var(--line); }

/* ---------- header ---------- */
.mission-header {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  padding: 20px clamp(28px, 4vw, 68px);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--void) 0%, transparent 130%);
  transition: background 0.7s ease;
}
.brand { display: inline-flex; width: fit-content; }
.brand img { width: clamp(122px, 10.5vw, 162px); height: auto; transition: filter 0.7s ease; }
/* day theme: tint the white logo official-black without touching the asset */
body[data-theme="day"] .brand img {
  filter: brightness(0) invert(7%);
}
.header-status, .destination-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.16em;
}
.header-status { justify-self: center; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 14px var(--acid);
  animation: blink 2.4s ease-in-out infinite;
}
.destination-link {
  justify-self: end;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  color: var(--ice);
  text-decoration: none;
  background: var(--panel);
  backdrop-filter: blur(6px);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.destination-link:hover { border-color: var(--signal); color: var(--signal-hot); }
.destination-url { color: var(--signal-hot); }

/* ---------- STATE 1: ink intro ---------- */
.intro {
  position: fixed;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(96px, 14vh, 150px) clamp(30px, 7vw, 120px) clamp(120px, 16vh, 170px);
  background:
    radial-gradient(1200px 800px at 78% 108%, rgba(107, 77, 255, 0.2), transparent 60%),
    radial-gradient(900px 620px at 12% -8%, rgba(255, 255, 255, 0.85), transparent 55%),
    linear-gradient(168deg, #f5f3fc 0%, #e3def4 48%, #cdc5ea 100%);
  transition: transform 0.85s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.6s ease;
}
body[data-state="factory"] .intro {
  transform: translateY(-6vh) scale(0.985);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.85s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.45s ease, visibility 0s 0.5s;
}

.hero-copy { max-width: 900px; position: relative; z-index: 1; }

/* ---------- brand ink orb: echoes the purpleink.dev ink blot ---------- */
.ink-orb {
  position: absolute;
  top: 46%;
  right: clamp(16px, 5.5vw, 110px);
  width: clamp(320px, 36vw, 610px);
  aspect-ratio: 1;
  transform: translate3d(calc(var(--px, 0) * 1px), calc(-50% + var(--py, 0) * 1px), 0);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}
.orb-field { position: absolute; inset: 0; filter: blur(32px); }
.orb-blob { position: absolute; border-radius: 50%; will-change: transform; }
.orb-blob.b1 {
  inset: 17%;
  background: radial-gradient(circle at 42% 38%, rgba(59, 27, 148, 0.95), rgba(42, 17, 108, 0.7) 46%, rgba(42, 17, 108, 0) 72%);
  animation: orb-drift-a 17s ease-in-out infinite;
}
.orb-blob.b2 {
  inset: 29% 25% 23% 33%;
  background: radial-gradient(circle at 50% 50%, rgba(112, 82, 255, 0.8), rgba(112, 82, 255, 0) 68%);
  animation: orb-drift-b 13s ease-in-out infinite;
}
.orb-blob.b3 {
  inset: 23% 33% 35% 21%;
  background: radial-gradient(circle at 50% 50%, rgba(26, 11, 78, 0.9), rgba(26, 11, 78, 0) 66%);
  animation: orb-drift-c 21s ease-in-out infinite;
}
.orb-drop {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4b2bb3, #221153 74%);
  filter: blur(4px);
  opacity: 0.85;
  will-change: transform;
}
.orb-drop.d1 { width: 26px; height: 26px; top: 11%; left: 19%; animation: drop-float 9s ease-in-out infinite; }
.orb-drop.d2 { width: 15px; height: 15px; bottom: 17%; right: 11%; animation: drop-float 11s ease-in-out -3s infinite; }
.orb-drop.d3 { width: 10px; height: 10px; top: 29%; right: 3%; animation: drop-float 8s ease-in-out -5.5s infinite; }
/* ripple rings: ink dropped in still water */
.orb-ripple {
  position: absolute;
  inset: 11%;
  border: 1.5px solid rgba(80, 50, 200, 0.4);
  border-radius: 50%;
  transform: scale(0.55);
  opacity: 0;
  animation: orb-ripple 5.4s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.orb-ripple.r2 { animation-delay: 2.7s; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 40px;
  color: var(--signal-hot);
  font: 600 clamp(10px, 0.72vw, 11.5px)/1.4 var(--mono);
  letter-spacing: 0.24em;
}
.eyebrow-mark {
  display: inline-block;
  width: 30px;
  height: 2px;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(107, 77, 255, 0.55);
}
.eyebrow-divider { color: var(--muted); opacity: 0.6; }

/* headline, Geist to match purpleink.dev */
.hero-title {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: -0.015em;
}
.ht-line { display: block; overflow: hidden; padding: 0.08em 0; }
.ht-inner { display: inline-block; will-change: transform; }
.ht-top {
  font-size: clamp(19px, 2.1vw, 35px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ice);
}
.ht-accent {
  margin: 0.04em 0;
  font-size: clamp(46px, 5.4vw, 78px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.ht-accent .ht-inner {
  color: transparent;
  background-image: linear-gradient(100deg, #241547 4%, #4b2fd1 38%, #6b4dff 72%, #8f76ff 110%);
  background-size: 230% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 6px 26px rgba(75, 47, 209, 0.28));
  animation: line-up 1s cubic-bezier(0.16, 0.8, 0.16, 1) 0.24s both, sheen 7s ease-in-out 1.3s infinite;
}
.ht-hollow {
  font-size: clamp(22px, 2.5vw, 41px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: transparent;
  -webkit-text-stroke: 1.1px rgba(24, 18, 47, 0.72);
}
@supports not (-webkit-text-stroke: 1px black) {
  .ht-hollow { color: var(--ice); }
}

/* reveal choreography */
.reveal-item { animation: rise-in 0.9s cubic-bezier(0.2, 0.75, 0.18, 1) both; }
.ht-inner { animation: line-up 1s cubic-bezier(0.16, 0.8, 0.16, 1) both; }
.ht-top .ht-inner { animation-delay: 0.12s; }
.ht-hollow .ht-inner { animation-delay: 0.36s; }
.primary-chinese { animation-delay: 0.48s; }
.translation { animation-delay: 0.56s; }
.cta-row { animation-delay: 0.64s; }

.primary-chinese {
  margin: 44px 0 0;
  color: #241c52;
  font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.7;
}
.translation {
  margin: 14px 0 0;
  max-width: 480px;
  color: var(--muted);
  font: 500 12.5px/1.7 var(--mono);
  letter-spacing: 0.09em;
}

/* ---------- CTA ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  margin-top: 56px;
  perspective: 800px;
}
.portal-button {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  min-width: 300px;
  padding: 16px 22px 16px 17px;
  border: 1px solid rgba(75, 47, 209, 0.35);
  color: var(--ice);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.85), rgba(233, 230, 247, 0.6) 58%);
  box-shadow: inset 0 0 26px rgba(107, 77, 255, 0.08), 0 16px 44px rgba(58, 36, 140, 0.16);
  backdrop-filter: blur(9px);
  cursor: pointer;
  text-align: left;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  transition: transform 0.16s ease-out, border-color 0.25s ease, box-shadow 0.3s ease, background 0.3s ease;
  transform-style: preserve-3d;
}
.portal-button:hover {
  border-color: rgba(75, 47, 209, 0.7);
  box-shadow: inset 0 0 34px rgba(107, 77, 255, 0.14), 0 20px 54px rgba(58, 36, 140, 0.28);
}
.portal-button:active { transform: scale(0.985); }
.portal-glyph { color: var(--signal-hot); transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s; }
.portal-button:hover .portal-glyph { transform: rotate(90deg); color: var(--signal); }
.portal-button-copy { display: grid; gap: 5px; }
.portal-button strong { font-size: 15.5px; font-weight: 600; letter-spacing: 0.05em; }
.portal-button small, .ghost-link small {
  font: 600 8.5px/1 var(--mono);
  letter-spacing: 0.18em;
  color: var(--muted);
}
.portal-button:hover small { color: var(--signal-hot); }
.portal-arrow {
  font: 400 23px/1 var(--display);
  color: var(--signal);
  transition: transform 0.25s ease;
}
.portal-button:hover .portal-arrow { transform: translate(3px, -3px); }

.ghost-link {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 200px;
  padding: 14px 12px;
  color: var(--ice);
  font-size: 14.5px;
  text-decoration: none;
}
.ghost-link::before {
  content: "//";
  position: absolute;
  left: -12px;
  top: 14px;
  color: var(--signal);
  font: 600 12px/1 var(--mono);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ghost-link:hover::before { opacity: 1; }
.ghost-link::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 4px;
  left: 10px;
  height: 1px;
  transform-origin: left;
  background: linear-gradient(90deg, var(--signal-hot), transparent);
  transition: transform 0.3s ease, background 0.3s ease;
}
.ghost-link:hover::after { transform: scaleX(0.4); background: var(--signal); }

/* ---------- scroll hint: translucent ink pulling you down ---------- */
.scroll-hint {
  position: absolute;
  right: 0;
  bottom: clamp(34px, 6vh, 64px);
  left: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--signal-hot);
  pointer-events: none;
}
.hint-text { font: 500 13px/1 var(--body); letter-spacing: 0.3em; }
.hint-sub { font: 600 8.5px/1 var(--mono); letter-spacing: 0.26em; color: var(--muted); }
.ink-blot { position: relative; display: flex; gap: 9px; margin-top: 6px; height: 34px; }
.ink-blot i {
  width: 7px;
  height: 12px;
  border-radius: 50% 50% 60% 60% / 40% 40% 70% 70%;
  background: linear-gradient(180deg, rgba(107, 77, 255, 0.65), rgba(36, 21, 71, 0.9));
  filter: blur(0.4px);
  opacity: 0.85;
  animation: ink-drip 1.8s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}
.ink-blot i:nth-child(2) { animation-delay: 0.28s; }
.ink-blot i:nth-child(3) { animation-delay: 0.56s; }
@keyframes ink-drip {
  0% { transform: translateY(-8px) scaleY(0.7); opacity: 0; }
  35% { opacity: 0.9; }
  70% { transform: translateY(14px) scaleY(1.25); opacity: 0.75; }
  100% { transform: translateY(24px) scaleY(0.6); opacity: 0; }
}

/* ---------- STATE 2: factory chrome ---------- */
.factory-hud { position: fixed; z-index: 2; inset: 0; pointer-events: none; visibility: hidden; }
body[data-state="factory"] .factory-hud { visibility: visible; }

.mission-readout {
  position: absolute;
  right: clamp(26px, 4vw, 64px);
  bottom: clamp(76px, 10vh, 120px);
  width: min(100%, 372px);
  padding: 20px 22px 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  backdrop-filter: blur(12px);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease 0.35s, transform 0.5s ease 0.35s, background 0.7s ease;
  pointer-events: auto;
}
body[data-state="factory"] .mission-readout { opacity: 1; transform: none; }
.readout-head {
  margin: 0 0 12px;
  color: var(--signal-hot);
  font: 600 8.5px/1 var(--mono);
  letter-spacing: 0.26em;
}
.readout-head span { margin: 0 8px; color: var(--acid); opacity: 0.7; }
.readout-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font: 500 9px/1.4 var(--mono);
  letter-spacing: 0.14em;
}
.readout-row strong { color: var(--ice); font-weight: 600; text-align: right; }
.readout-emphasis strong { color: var(--acid); }

.factory-hint {
  position: absolute;
  bottom: clamp(76px, 10vh, 120px);
  left: clamp(26px, 4vw, 64px);
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.2em;
  opacity: 0;
  transition: opacity 0.5s ease 0.5s;
}
body[data-state="factory"] .factory-hint { opacity: 1; }
.factory-hint i { width: 30px; height: 1px; background: var(--line); }

.bottom-message {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(26px, 4vw, 64px);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.2em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease 0.6s;
}
body[data-state="factory"] .bottom-message { opacity: 1; }
.bottom-message i { width: 40px; height: 1px; background: linear-gradient(90deg, var(--signal), transparent); }

/* ---------- pull cords ---------- */
#cord-canvas {
  position: fixed;
  z-index: 8;
  top: 0;
  left: 0;
  width: 100%;
  height: 46vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
}
body[data-state="factory"] #cord-canvas { opacity: 1; }
.cords { position: fixed; z-index: 9; top: 0; right: 0; left: 0; height: 0; }
.cord-handle {
  position: absolute;
  top: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease 0.35s;
  touch-action: none;
}
body[data-state="factory"] .cord-handle { opacity: 1; visibility: visible; }
.cord-handle:active { cursor: grabbing; }
.cord-handle:focus-visible { outline: 2px solid var(--acid); outline-offset: 6px; }
.cord-grip {
  width: 22px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--signal-hot), var(--signal));
  box-shadow: 0 6px 18px rgba(36, 21, 71, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.35);
}
.cord-bulb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 34% 30%, #fff8d9, #ffd75c 58%, #d9a72c);
  box-shadow: 0 0 18px rgba(255, 215, 92, 0.65), 0 6px 14px rgba(36, 21, 71, 0.3);
}
body[data-theme="night"] .cord-bulb {
  background: radial-gradient(circle at 34% 30%, #fff3d0, #ffb35c 58%, #b96a1e);
  box-shadow: 0 0 18px rgba(255, 179, 92, 0.65), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.cord-tag {
  display: grid;
  gap: 3px;
  justify-items: center;
  color: var(--muted);
  font: 600 9px/1.2 var(--body);
  letter-spacing: 0.2em;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  background: var(--panel);
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.cord-tag span { font: 600 6.5px/1 var(--mono); letter-spacing: 0.16em; color: var(--signal-hot); }

/* ---------- ink curtain (state transition wipe) ---------- */
.ink-curtain {
  position: fixed;
  z-index: 60;
  inset: 0;
  transform: translateY(-118%);
  background:
    radial-gradient(1000px 700px at 60% 30%, rgba(107, 77, 255, 0.35), transparent 65%),
    linear-gradient(180deg, #1d1140 0%, #150d2e 100%);
  pointer-events: none;
}
.ink-curtain .ink-drips {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 120px;
  display: block;
}
.ink-drips path { fill: #150d2e; }
.ink-curtain.cover-in { transition: transform 0.62s cubic-bezier(0.65, 0, 0.2, 1); transform: translateY(0); }
.ink-curtain.cover-out { transition: transform 0.78s cubic-bezier(0.65, 0, 0.3, 1); transform: translateY(118%); }

/* ---------- module inspector popup ---------- */
.module-popup {
  position: fixed;
  z-index: 40;
  right: clamp(20px, 4vw, 60px);
  bottom: clamp(90px, 13vh, 140px);
  width: min(420px, calc(100vw - 40px));
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  color: var(--ice);
  background: var(--glass);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(21, 13, 46, 0.35);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  transition: background 0.7s ease;
}
.module-popup[hidden] { display: none; }
.module-popup.show { animation: dialog-in 0.38s cubic-bezier(0.18, 0.9, 0.22, 1) both; }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mp-tag {
  color: var(--acid);
  font: 600 8.5px/1 var(--mono);
  letter-spacing: 0.3em;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  background: var(--panel);
}
.mp-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ice);
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.mp-close:hover { border-color: var(--signal); color: var(--signal-hot); }
.mp-title {
  margin: 0;
  font: 600 clamp(22px, 2.4vw, 30px)/1.15 var(--display);
  letter-spacing: -0.01em;
  color: var(--ice);
}
.mp-sub {
  margin: 8px 0 0;
  color: var(--signal-hot);
  font: 600 11px/1.5 var(--mono);
  letter-spacing: 0.12em;
}
.mp-body { margin-top: 16px; }
.mp-line {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font: 500 14px/1.85 var(--body);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(9px);
  animation: rise-in 0.5s cubic-bezier(0.2, 0.75, 0.18, 1) forwards;
}
.mp-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mp-foot a, .mp-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  color: var(--ice);
  font: 600 9.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-decoration: none;
  background: var(--panel);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.mp-foot a:hover { border-color: var(--signal); color: var(--signal-hot); }

/* ---------- waitlist dialog ---------- */
.waitlist-dialog {
  position: relative;
  width: min(580px, calc(100vw - 32px));
  overflow: hidden;
  padding: clamp(34px, 5vw, 54px);
  border: 1px solid var(--line);
  color: var(--ice);
  background: var(--glass);
  backdrop-filter: blur(20px);
  box-shadow: 0 34px 110px rgba(21, 13, 46, 0.4);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.waitlist-dialog::backdrop { background: rgba(21, 13, 46, 0.5); backdrop-filter: blur(9px); }
.waitlist-dialog[open] { animation: dialog-in 0.4s cubic-bezier(0.18, 0.9, 0.22, 1) both; }
.dialog-close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ice);
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.dialog-close:hover { border-color: var(--signal); color: var(--signal-hot); }
.dialog-copy { position: relative; z-index: 1; max-width: 440px; }
.dialog-copy .eyebrow { margin-bottom: 24px; }
.dialog-copy h2 {
  margin: 0;
  font: 600 clamp(32px, 5.6vw, 46px)/1.08 var(--display);
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: transparent;
  background-image: linear-gradient(100deg, #241547 10%, #4b2fd1 55%, #6b4dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
body[data-theme="night"] .dialog-copy h2 {
  background-image: linear-gradient(100deg, #f2ecff 10%, #b797ff 55%, #7b5cff 100%);
}
.dialog-copy p { margin: 26px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.85; }
.dialog-copy p span { display: block; margin-top: 8px; color: var(--muted); opacity: 0.8; font: 11.5px/1.6 var(--mono); }

form { position: relative; z-index: 1; display: grid; gap: 20px; margin-top: 38px; }
form label { display: grid; gap: 10px; color: var(--muted); font: 600 9px/1 var(--mono); letter-spacing: 0.16em; }
form label b { color: var(--acid); }
form label em { color: var(--muted); opacity: 0.7; font-style: normal; font-weight: 500; }
input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  color: var(--ice);
  background: var(--panel);
  font: 500 15.5px/1.3 var(--body);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder { color: var(--muted); opacity: 0.55; }
input:focus { border-color: var(--signal); box-shadow: 0 0 0 1px rgba(107, 77, 255, 0.25), 0 10px 30px -18px rgba(107, 77, 255, 0.45); }
.honeypot { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }
.submit-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 18px 22px;
  border: 1px solid var(--signal);
  color: #ffffff;
  background: var(--signal);
  cursor: pointer;
  font: 700 11.5px/1 var(--mono);
  letter-spacing: 0.14em;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform 0.18s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--signal-hot);
  box-shadow: 0 14px 40px rgba(75, 47, 209, 0.4);
}
.submit-button:disabled { cursor: not-allowed; opacity: 0.45; }
.form-status { min-height: 20px; margin: -4px 0 0; color: var(--muted); font: 500 12.5px/1.5 var(--body); }
.form-status[data-state="success"] { color: var(--acid); }
.form-status[data-state="error"] { color: #d43d3d; }
body[data-theme="night"] .form-status[data-state="error"] { color: #ff9b9b; }
.privacy-note { margin: 0; color: var(--muted); opacity: 0.75; font-size: 11.5px; line-height: 1.7; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }

/* ---------- keyframes ---------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes line-up { from { opacity: 0; transform: translateY(112%); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheen { 0%, 100% { background-position: 0% 0; } 50% { background-position: 88% 0; } }
@keyframes blink { 50% { opacity: 0.35; box-shadow: 0 0 2px var(--acid); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(22px) scale(0.975); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes orb-drift-a { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(4%, -3%) scale(1.06); } 66% { transform: translate(-3%, 4%) scale(0.96); } }
@keyframes orb-drift-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-9%, 7%) scale(1.12); } }
@keyframes orb-drift-c { 0%, 100% { transform: translate(0, 0) scale(1); } 40% { transform: translate(8%, 6%) scale(0.92); } 72% { transform: translate(-5%, -7%) scale(1.05); } }
@keyframes drop-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-18px) scale(1.14); } }
@keyframes orb-ripple { 0% { transform: scale(0.55); opacity: 0; } 16% { opacity: 0.55; } 100% { transform: scale(1.2); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .telemetry { display: none; }
}
@media (max-width: 900px) {
  .mission-header { grid-template-columns: 1fr auto; min-height: 76px; padding: 16px 24px; }
  .header-status { display: none; }
  .destination-link span:first-child { display: none; }
  .intro { padding: 100px 30px 180px; }
  .hero-copy { max-width: 680px; }
  .ink-orb { width: clamp(240px, 50vw, 420px); right: -7%; top: 42%; opacity: 0.6; }
  .mission-readout { right: 20px; bottom: 92px; width: min(340px, calc(100% - 40px)); }
  .factory-hint { display: none; }
  .bottom-message { overflow: hidden; padding: 12px 24px; }
  .bottom-message span:last-child { display: none; }
  .hud-corner { width: 18px; height: 18px; }
}
@media (max-width: 570px) {
  .mission-header { padding: 14px 18px; }
  .brand img { width: 128px; }
  .destination-url { font-size: 8.5px; }
  .intro { padding: 92px 24px 190px; }
  .ink-orb { right: -22%; top: 36%; opacity: 0.45; }
  .orb-drop, .orb-ripple { display: none; }
  .ht-top { font-size: clamp(15px, 4.6vw, 21px); }
  .ht-accent { font-size: clamp(38px, 11vw, 60px); }
  .ht-hollow { font-size: clamp(17px, 5.4vw, 24px); }
  .primary-chinese { margin-top: 36px; font-size: 17px; }
  .cta-row { display: grid; gap: 12px; margin-top: 44px; }
  .portal-button, .ghost-link { width: 100%; }
  .ghost-link { padding-left: 14px; }
  .mission-readout { right: 14px; bottom: 86px; width: calc(100% - 28px); padding: 16px 18px 8px; }
  .module-popup { right: 14px; bottom: 86px; width: calc(100% - 28px); }
  .waitlist-dialog { padding: 38px 26px 30px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  #stage-canvas, .boot, #cord-canvas, .cords, .ink-curtain { display: none; }
  .reveal-item, .ht-inner { animation: none !important; opacity: 1 !important; transform: none !important; }
  .cta-row { opacity: 1 !important; }
}
