/* ORBIT H01 — 深夜轨道实验室视觉系统 */
:root {
  --navy-950: #050a14;
  --navy-900: #07101f;
  --navy-850: #0a1626;
  --navy-700: #122540;
  --ink: #dfe8f4;
  --ink-dim: #8fa3bd;
  --ink-faint: #5d7290;
  --cyan: #58d5e8;
  --cyan-deep: #1f8fa8;
  --gold: #e8b864;
  --line: rgba(120, 160, 200, 0.14);
  --line-strong: rgba(140, 190, 230, 0.28);
  --panel: rgba(9, 18, 33, 0.72);
  --font-display: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  --pad: clamp(20px, 3.2vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--navy-950);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(88, 213, 232, 0.28); }

button { font: inherit; color: inherit; }

/* ---------- Background layers ---------- */
#bg-orbit {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(31, 143, 168, 0.16), transparent 58%),
    radial-gradient(90% 70% at 12% 92%, rgba(18, 37, 64, 0.55), transparent 60%),
    linear-gradient(178deg, #07101f 0%, #050a14 46%, #04070f 100%);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: glowDrift 26s ease-in-out infinite alternate;
}
.bg-glow--cyan {
  width: 46vw; height: 46vw;
  right: 4vw; top: -8vw;
  background: radial-gradient(circle, rgba(88, 213, 232, 0.2), transparent 68%);
}
.bg-glow--gold {
  width: 26vw; height: 26vw;
  left: 30vw; bottom: 4vw;
  background: radial-gradient(circle, rgba(232, 184, 100, 0.13), transparent 70%);
  animation-duration: 34s;
  animation-delay: -9s;
}
@keyframes glowDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2.4vw, 1.6vw, 0) scale(1.08); }
}

.bg-grid {
  position: absolute; inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(120, 165, 210, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 165, 210, 0.05) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 88%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 88%);
}

/* Scan sweep: a slow cold light band crossing the lab */
.bg-gradient::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 42%, rgba(88, 213, 232, 0.05) 50%, transparent 58%);
  background-size: 300% 100%;
  animation: scanSweep 18s linear infinite;
}
@keyframes scanSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 22px var(--pad) 0;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 22px; height: 22px;
  border: 1.5px solid var(--cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 12px rgba(88, 213, 232, 0.35);
}
.brand-mark::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--gold);
  border-radius: 50%;
}
.brand-name {
  font-weight: 600;
  letter-spacing: 0.42em;
  font-size: 13px;
}
.brand-sub {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.16em;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.topnav { display: flex; gap: 28px; }
.topnav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
.topnav a:hover { color: var(--ink); border-bottom-color: var(--cyan); }

.lang {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 4px;
  background: rgba(9, 18, 33, 0.5);
  backdrop-filter: blur(8px);
}
.lang-btn {
  background: none; border: none;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.lang-btn.is-active {
  color: var(--navy-950);
  background: var(--cyan);
  font-weight: 600;
}
.lang-sep { width: 1px; height: 14px; background: var(--line-strong); }

/* ---------- Stage layout ---------- */
.stage {
  position: relative; z-index: 10;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.35fr);
  align-items: center;
  gap: var(--pad);
  min-height: calc(100vh - 80px);
  padding: 24px var(--pad) 40px;
}

.copy { position: relative; }
.copy-inner { max-width: 460px; }

.eyebrow {
  margin: 0 0 22px;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 34px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.headline {
  margin: 0;
  font-weight: 600;
  font-size: clamp(46px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.headline span { display: block; }
.headline-model {
  margin-top: 10px;
  font-size: 0.3em;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: var(--gold);
}

.lede {
  margin: 26px 0 0;
  color: var(--ink-dim);
  font-size: 15px;
  max-width: 40ch;
}

.stat-row {
  list-style: none; margin: 38px 0 0; padding: 0;
  display: flex; gap: clamp(20px, 3vw, 44px);
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.stat-num {
  display: block;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-unit {
  font-size: 0.42em;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.hint {
  margin: 34px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

/* ---------- Viewport ---------- */
.viewport {
  position: relative;
  min-height: clamp(440px, 62vh, 660px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background:
    radial-gradient(90% 100% at 50% 0%, rgba(31, 143, 168, 0.08), transparent 62%),
    linear-gradient(180deg, rgba(10, 22, 38, 0.5), rgba(5, 10, 20, 0.2));
  box-shadow: inset 0 1px 0 rgba(160, 200, 240, 0.05);
}
#scene-host {
  position: absolute; inset: 0;
  cursor: grab;
}
#scene-host:active { cursor: grabbing; }
#scene-host canvas { display: block; width: 100%; height: 100%; }

/* precision corner ticks */
.viewport-frame { position: absolute; inset: 12px; pointer-events: none; }
.frame-tick { position: absolute; background: var(--cyan); opacity: 0.75; }
.frame-tick--t { left: 0; top: 0; width: 26px; height: 1px; }
.frame-tick--r { right: 0; top: 0; width: 1px; height: 26px; }
.frame-tick--b { right: 0; bottom: 0; width: 26px; height: 1px; }
.frame-tick--l { left: 0; bottom: 0; width: 1px; height: 26px; }

.viewport-readout {
  position: absolute; left: 18px; bottom: 14px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  background: rgba(5, 10, 20, 0.6);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  transition: color 0.3s;
}
.viewport.is-exploded .viewport-readout { color: var(--gold); border-color: rgba(232, 184, 100, 0.35); }

/* orbit reticle ring in the viewport corner */
.viewport::after {
  content: "";
  position: absolute; right: 22px; bottom: 22px;
  width: 74px; height: 74px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  pointer-events: none;
  background:
    conic-gradient(from 200deg, transparent 0 78%, rgba(88, 213, 232, 0.5) 78% 82%, transparent 82%),
    radial-gradient(circle, transparent 0 44%, rgba(88, 213, 232, 0.08) 45% 46%, transparent 47%);
  animation: reticleSpin 30s linear infinite;
}
@keyframes reticleSpin { to { transform: rotate(360deg); } }

/* ---------- Instrument console ---------- */
.console {
  position: fixed;
  z-index: 30;
  right: clamp(16px, 2.6vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  width: 214px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(170, 210, 250, 0.06);
  overflow: hidden;
}
.console-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.console-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulseDot 3.2s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.console-body { display: flex; flex-direction: column; padding: 12px 12px 14px; }

.ctl {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 13px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.ctl:last-child { margin-bottom: 0; }
.ctl svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.ctl:hover { background: rgba(88, 213, 232, 0.08); border-color: rgba(88, 213, 232, 0.4); }
.ctl:active { transform: translateY(1px); }
.ctl:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

.ctl-primary.is-active {
  background: rgba(232, 184, 100, 0.12);
  border-color: rgba(232, 184, 100, 0.55);
  color: var(--gold);
}
.ctl-led {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--ink-faint);
  background: transparent;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  flex: none;
}
.ctl-toggle.is-active .ctl-led {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 9px rgba(88, 213, 232, 0.7);
}
.ctl-sep { height: 1px; background: var(--line); margin: 8px 4px; }

/* ---------- Legend ---------- */
.legend {
  position: relative; z-index: 10;
  margin: 0 var(--pad) 0;
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s, padding 0.5s;
}
.legend.is-visible { max-height: 640px; opacity: 1; }

.legend-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.legend-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
  padding-top: 5px;
}
.legend-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.legend-head p { margin: 5px 0 0; font-size: 13px; color: var(--ink-faint); }

.legend-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.legend-list li {
  background: rgba(7, 16, 31, 0.85);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 7px;
}
.legend-swatch {
  width: 26px; height: 4px; border-radius: 2px;
  background: var(--cyan);
  opacity: 0.85;
}
.legend-name { font-size: 14px; font-weight: 600; }
.legend-desc { font-size: 12px; color: var(--ink-faint); line-height: 1.55; }

/* ---------- Details ---------- */
.details {
  position: relative; z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  margin: clamp(48px, 7vh, 88px) var(--pad) 0;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail {
  background: rgba(7, 16, 31, 0.6);
  padding: 30px 26px 34px;
  backdrop-filter: blur(6px);
}
.detail-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan-deep);
  letter-spacing: 0.14em;
}
.detail h3 { margin: 14px 0 10px; font-size: 19px; font-weight: 600; }
.detail p { margin: 0; font-size: 13.5px; color: var(--ink-dim); }

.spec-grid { margin: 16px 0 0; display: grid; gap: 12px; }
.spec-grid div {
  display: flex; justify-content: space-between; gap: 16px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.spec-grid dt { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.04em; }
.spec-grid dd { margin: 0; font-size: 13px; font-weight: 600; font-family: var(--font-mono); }

/* ---------- Footer ---------- */
.foot {
  position: relative; z-index: 10;
  display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
  padding: 26px var(--pad) 40px;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}
.foot-id { font-family: var(--font-mono); }

/* ---------- Entrance ---------- */
.copy-inner > * {
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.copy-inner > *:nth-child(1) { animation-delay: 0.05s; }
.copy-inner > *:nth-child(2) { animation-delay: 0.14s; }
.copy-inner > *:nth-child(3) { animation-delay: 0.24s; }
.copy-inner > *:nth-child(4) { animation-delay: 0.34s; }
.copy-inner > *:nth-child(5) { animation-delay: 0.44s; }
@keyframes riseIn { to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .console {
    position: static;
    transform: none;
    width: auto;
    margin: 0 var(--pad);
  }
  .console-body { flex-direction: row; flex-wrap: wrap; }
  .ctl { width: auto; flex: 1 1 auto; }
  .ctl-sep { display: none; }
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 12px;
  }
  .viewport { order: -1; min-height: 56vh; }
  .copy-inner { max-width: none; }
  .headline { font-size: clamp(40px, 11vw, 62px); }
  .topnav { display: none; }
  .brand-sub { display: none; }
  .lede { max-width: none; }
  .copy-inner > * { animation: none; opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .copy-inner > * { animation: none; opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow, .bg-gradient::after, .viewport::after, .console-dot { animation: none; }
  .copy-inner > * { animation: none; opacity: 1; transform: none; }
  .legend { transition: opacity 0.2s; }
}
