@import url("/fonts/source-han-serif-sc/fonts.css");

:root {
  color-scheme: dark;
  font-family: "Source Han Serif SC", serif;
  background: #020611;
  color: #f7f2de;
  --panel: rgba(5, 13, 31, 0.68);
  --panel-strong: rgba(6, 15, 35, 0.88);
  --line: rgba(150, 192, 255, 0.2);
  --muted: #91a6c6;
  --accent: #ffd36b;
  --cyan: #7edcff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body { background: radial-gradient(circle at 45% 45%, #0a1c49 0, #020611 65%); }

button, input { font: inherit; }

button { color: inherit; }

#app { position: relative; isolation: isolate; }

#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(11, 27, 60, 0.72), var(--panel));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.hero-copy { position: absolute; top: clamp(22px, 3vw, 44px); left: clamp(22px, 4vw, 58px); pointer-events: none; }

.experience-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  color: rgba(218, 230, 250, .58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  pointer-events: auto;
}

.experience-nav a { color: inherit; text-decoration: none; }
.experience-nav a:hover { color: #fff0ba; }
.experience-nav span { color: rgba(126, 220, 255, .72); }

.eyebrow, .kicker { font-size: 10px; font-weight: 800; letter-spacing: 0.18em; color: var(--cyan); }

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1;
  letter-spacing: 0.12em;
  color: #fff0ba;
  text-shadow: 0 0 28px rgba(255, 205, 96, 0.16);
}

.source-credit {
  margin: 10px 0 0;
  color: rgba(145, 166, 198, .66);
  font-size: 9px;
  letter-spacing: .06em;
}

.lede { max-width: 360px; margin: 14px 0 0; color: #9bacc8; font-size: clamp(12px, 1.1vw, 15px); letter-spacing: .04em; }

.system-status {
  position: absolute;
  top: 26px;
  right: 28px;
  min-width: 174px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #a8b9d5;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.system-status > div { display: flex; align-items: center; gap: 8px; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #74f5b5; box-shadow: 0 0 14px #74f5b5; }

.controls { position: absolute; top: 92px; right: 28px; width: min(258px, calc(100vw - 40px)); padding: 15px; border-radius: 19px; }

.controls__heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.controls__heading > div { display: grid; gap: 4px; }
.controls__heading strong { font-size: 17px; }

.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.04); cursor: pointer; }
.icon-button:hover { background: rgba(126, 220, 255, 0.12); border-color: rgba(126, 220, 255, 0.48); }

.control-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.control-row output { color: #f8f0d7; font-variant-numeric: tabular-nums; }

input[type="range"] { width: 100%; margin: 10px 0 14px; accent-color: var(--accent); }

.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button-grid button {
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid rgba(147, 184, 240, 0.18);
  background: rgba(255,255,255,0.045);
  font-size: 11px;
  cursor: pointer;
}
.button-grid button:hover, .button-grid button[aria-pressed="true"] { border-color: rgba(255, 211, 107, 0.46); background: rgba(255, 211, 107, 0.09); }

.hint { margin: 11px 0 0; font-size: 9px; color: #6e82a3; line-height: 1.5; }

.info-panel { position: absolute; left: clamp(18px, 4vw, 58px); bottom: 78px; width: min(310px, calc(100vw - 40px)); padding: 14px 16px; border-radius: 18px; transition: opacity .25s ease, transform .25s ease; }

.info-panel__title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.info-panel h2 { margin: 6px 0 2px; font-size: 24px; letter-spacing: .02em; }
#info-index { color: rgba(255,255,255,.16); font-weight: 800; font-size: 25px; }
.info-panel p { margin: 6px 0 11px; color: #9daecc; font-size: 11px; line-height: 1.5; }
.info-panel dl { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 0; }
.info-panel dl div { padding: 7px 8px; border-radius: 10px; background: rgba(255,255,255,.035); }
.info-panel dt { font-size: 9px; color: #6780a6; margin-bottom: 5px; }
.info-panel dd { margin: 0; font-size: 10px; line-height: 1.35; color: #dce6f7; }

.planet-nav {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  max-width: calc(100vw - 40px);
  overflow-x: auto;
  border-radius: 999px;
  scrollbar-width: none;
}
.planet-nav::-webkit-scrollbar { display: none; }

.planet-chip {
  flex: 0 0 auto;
  min-width: 52px;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8195b3;
  cursor: pointer;
  font-size: 9px;
  transition: .2s ease;
}
.planet-chip::before { content: ""; width: var(--chip-size, 9px); height: var(--chip-size, 9px); border-radius: 50%; background: var(--chip-color); box-shadow: 0 0 10px color-mix(in srgb, var(--chip-color) 55%, transparent); }
.planet-chip[data-kind="overview"]::before {
  background: radial-gradient(circle, rgba(255,211,107,.95) 0 22%, transparent 26%), transparent;
  border: 1px solid rgba(255,211,107,.9);
  box-shadow: 0 0 0 3px rgba(255,211,107,.08), 0 0 14px rgba(255,211,107,.42);
}
.planet-chip:hover, .planet-chip.is-active { color: #fff1c3; background: rgba(255,255,255,.06); }

.labels-layer { position: absolute; inset: 0; pointer-events: none; }
.planet-label { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; font-size: 9px; color: #dbe5f6; text-shadow: 0 2px 8px #000; opacity: 0; transition: opacity .2s ease, color .2s ease; }
.planet-label::before { content: ""; width: 1px; height: 12px; background: linear-gradient(rgba(126,220,255,.55), transparent); }
.labels-layer.is-visible .planet-label.is-onscreen { opacity: .52; }
.labels-layer.is-visible .planet-label.is-onscreen.is-focused { opacity: 1; color: #fff1bd; }

.loading-screen { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: #020611; z-index: 20; transition: opacity .55s ease, visibility .55s ease; }
.loading-screen.is-hidden { opacity: 0; visibility: hidden; }
.loading-screen p { color: #8fa5c5; font-size: 12px; letter-spacing: .08em; }
.loading-orbit { width: 74px; height: 74px; border: 1px solid rgba(126,220,255,.25); border-radius: 50%; position: relative; animation: spin 1.4s linear infinite; }
.loading-orbit span { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 18px #ffd36b; top: -6px; left: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .hero-copy { top: 24px; left: 20px; }
  .lede { display: none; }
  .system-status { display: none; }
  .controls { top: auto; right: 14px; bottom: 86px; width: 230px; padding: 14px; }
  .controls__heading { margin-bottom: 12px; }
  .controls__heading strong { font-size: 15px; }
  .hint { display: none; }
  .info-panel { left: 14px; bottom: 86px; width: min(280px, calc(100vw - 270px)); }
  .info-panel dl { display: none; }
  .info-panel p { margin-bottom: 0; }
}

@media (max-width: 620px) {
  .hero-copy h1 { font-size: 44px; }
  .eyebrow { font-size: 8px; }
  .controls { left: 12px; right: 12px; bottom: 80px; width: auto; }
  .controls__heading, .hint, .control-row, input[type="range"] { display: none; }
  .button-grid { grid-template-columns: repeat(4, 1fr); }
  .button-grid button { padding: 9px 5px; font-size: 9px; }
  .info-panel { display: none; }
  .planet-nav { bottom: 14px; max-width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
