:root {
  --bg: #040b1c;
  --navy: #081f48;
  --sky: #9ab7ec;
  --maroon: #9b1d5f;
  --ink: #eef3fc;
  --muted: rgba(226, 235, 252, 0.68);
  --line: rgba(154, 183, 236, 0.2);
  --glass: rgba(8, 31, 72, 0.38);
  --p: 0;
  --pad: clamp(20px, 6vw, 96px);
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 100%, #0b2a5e 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(1, 3, 10, 0.55) 100%),
    linear-gradient(to right, rgba(2, 6, 16, 0.55), transparent 55%);
}

a { color: inherit; text-decoration: none; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px var(--pad);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 48px; width: auto; filter: drop-shadow(0 0 14px rgba(154, 183, 236, 0.35)); }

.telemetry { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-align: right; color: var(--muted); }
.tele-row { display: flex; gap: 10px; justify-content: flex-end; align-items: baseline; }
.tele-k { opacity: 0.55; }
.tele-row b { font-weight: 500; color: var(--ink); min-width: 7ch; display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }
.tele-u { opacity: 0.55; }

/* ---------- altitude gauge ---------- */
.gauge {
  position: fixed;
  right: var(--pad);
  top: 50%;
  height: 44vh;
  transform: translateY(-50%);
  z-index: 9;
  width: 60px;
  pointer-events: none;
}
.gauge-line { position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.gauge-fill { position: absolute; left: 0; bottom: 0; width: 1px; height: calc(var(--p) * 100%); background: linear-gradient(to top, transparent, var(--sky)); }
.gauge-dot {
  position: absolute; left: -3px; bottom: calc(var(--p) * 100%);
  width: 7px; height: 7px; margin-bottom: -3px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px 3px rgba(154, 183, 236, 0.8);
}
.gauge-label {
  position: absolute; right: 14px; bottom: var(--at); transform: translateY(50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--muted); opacity: 0.7;
}

/* ---------- panels ---------- */
main { position: relative; z-index: 2; }

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--pad);
}

.copy { max-width: 640px; }
.copy.wide { max-width: 980px; }
.copy.center { margin: 0 auto; text-align: center; max-width: 760px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0 0 22px;
}

.display {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.5rem, 6.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.55);
}
.display em {
  font-style: normal;
  font-weight: 500;
  background: linear-gradient(100deg, #ffffff 10%, var(--sky) 60%, #d6a4c2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 26px 0 0;
  max-width: 34em;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--muted);
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.6);
}
.center .lede { margin-left: auto; margin-right: auto; }

.actions { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.center .actions { justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.btn.primary { background: #f4f8ff; color: var(--navy); box-shadow: 0 0 0 0 rgba(154, 183, 236, 0.5); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 40px -6px rgba(154, 183, 236, 0.75); }
.btn.ghost { border: 1px solid var(--line); background: rgba(8, 31, 72, 0.25); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.ghost:hover { border-color: var(--sky); background: rgba(8, 31, 72, 0.5); }
.btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(to bottom, var(--sky), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- sign in message ---------- */
.toast {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 20;
  max-width: min(92vw, 420px); padding: 14px 20px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(8, 31, 72, 0.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px; text-align: center; color: var(--ink);
}
.toast[hidden] { display: none; }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 2;
  display: flex; justify-content: flex-end; gap: 24px; flex-wrap: wrap;
  padding: 28px var(--pad) 36px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted);
  background: linear-gradient(to top, rgba(2, 5, 12, 0.7), transparent);
}
.foot .fine { opacity: 0.7; }

/* ---------- reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 1s ease var(--d, 0s), transform 1s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s), filter 1s ease var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .gauge { display: none; }
}

@media (max-width: 760px) {
  .panel { padding-top: 96px; }
  .hero, #orbit, #thinking, #between, #living, #moving, #ground { justify-content: flex-end; padding-bottom: 11vh; }
  .scroll-cue { display: none; }
  .hero .actions { margin-top: 28px; }
  .btn { padding: 14px 22px; }
  .telemetry { font-size: 10px; }
  .brand img { height: 30px; }
  .display { font-size: clamp(2.1rem, 10vw, 3.2rem); }
  .lede { margin-top: 18px; }
  .eyebrow { margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .scroll-cue i { animation: none; }
}
