:root {
  color-scheme: dark;
  --bg: #050810;
  --bg-soft: #090e19;
  --surface: rgba(13, 20, 34, 0.76);
  --surface-solid: #0d1422;
  --surface-strong: rgba(19, 29, 47, 0.92);
  --text: #f5f7fb;
  --muted: #8c99ae;
  --soft: #627087;
  --line: rgba(161, 183, 218, 0.14);
  --line-strong: rgba(161, 183, 218, 0.23);
  --accent: #6da8ff;
  --accent-soft: rgba(77, 143, 240, 0.14);
  --warm: #ffb86c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #edf2f8;
  --bg-soft: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.77);
  --surface-solid: #fff;
  --surface-strong: rgba(255, 255, 255, 0.94);
  --text: #10243d;
  --muted: #63748a;
  --soft: #8795a6;
  --line: rgba(45, 69, 99, 0.11);
  --line-strong: rgba(45, 69, 99, 0.2);
  --accent: #1768d9;
  --accent-soft: rgba(23, 104, 217, 0.1);
  --warm: #d6782e;
  --shadow: 0 24px 70px rgba(59, 83, 111, 0.13);
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    sans-serif;
  transition: background 0.3s, color 0.3s;
}
body:before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      circle at 52% 22%,
      rgba(55, 104, 190, 0.14),
      transparent 28%
    ),
    radial-gradient(circle at 8% 90%, rgba(119, 72, 177, 0.08), transparent 28%);
  z-index: -1;
}
[data-theme='light'] body:before {
  background: radial-gradient(
      circle at 50% 10%,
      rgba(94, 151, 230, 0.15),
      transparent 28%
    ),
    radial-gradient(
      circle at 95% 90%,
      rgba(131, 103, 198, 0.08),
      transparent 30%
    );
}
button,
input,
select {
  font: inherit;
}
.topbar {
  height: 72px;
  width: min(1560px, calc(100% - 40px));
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand span {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand i {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  margin: 0 2px;
}
.brand strong {
  font-family: Georgia, serif;
  color: var(--muted);
  font-size: 17px;
  font-style: italic;
  font-weight: 500;
}
.mission-status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mission-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #65d59c;
  box-shadow: 0 0 0 5px rgba(101, 213, 156, 0.1), 0 0 18px #65d59c;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.language-picker,
.home-link,
.icon-button {
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: blur(14px);
}
.language-picker select {
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: 750;
}
.icon-button {
  width: 39px;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.icon-button span {
  font-size: 15px;
}
.home-link b {
  color: var(--accent);
}
.discovery-shell {
  width: min(1560px, calc(100% - 40px));
  height: calc(100vh - 94px);
  min-height: 660px;
  margin: 10px auto 12px;
  display: grid;
  grid-template-columns: 278px minmax(520px, 1fr) 332px;
  gap: 11px;
}
.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}
.catalog,
.details {
  padding: 24px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.17em;
}
.eyebrow em {
  font-style: normal;
  letter-spacing: 0.05em;
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.eyebrow.plain {
  margin-bottom: 11px;
}
.catalog h1 {
  margin: 17px 0 10px;
  font-family: Georgia, serif;
  font-size: 31px;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.catalog > p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.search-box {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  padding: 0 12px;
  margin-bottom: 14px;
}
.search-box span {
  font-size: 21px;
  color: var(--muted);
  transform: rotate(-16deg);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 12px;
}
.body-list {
  display: grid;
  gap: 5px;
}
.body-button {
  --body: #6da8ff;
  position: relative;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 39px 1fr 17px;
  align-items: center;
  gap: 11px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: 0.22s;
}
.body-button:hover {
  background: var(--accent-soft);
}
.body-button.active {
  background: var(--surface-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}
.body-button.active:before {
  content: '';
  position: absolute;
  left: -4px;
  width: 3px;
  height: 28px;
  border-radius: 4px;
  background: var(--body);
  box-shadow: 0 0 15px var(--body);
}
.body-orb {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 27%,
    color-mix(in srgb, var(--body) 48%, white),
    var(--body) 55%,
    color-mix(in srgb, var(--body) 60%, black)
  );
  box-shadow: inset -7px -5px 11px rgba(0, 0, 0, 0.3),
    0 4px 13px color-mix(in srgb, var(--body) 28%, transparent);
}
.body-orb.sun {
  box-shadow: 0 0 18px color-mix(in srgb, var(--body) 55%, transparent),
    inset -5px -4px 11px rgba(180, 64, 0, 0.22);
}
.body-copy strong,
.body-copy small {
  display: block;
}
.body-copy strong {
  font-size: 12px;
}
.body-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.body-arrow {
  color: var(--soft);
  font-size: 17px;
}
.body-button.active .body-arrow {
  color: var(--body);
  transform: translateX(2px);
}
.universe {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(4, 8, 17, 0.97),
    rgba(8, 15, 29, 0.94)
  );
  isolation: isolate;
}
.space-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.space-stage.dragging {
  cursor: grabbing;
}
#spaceCanvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
}
.viewer-head {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.viewer-head > div:first-child {
  padding: 10px 12px;
  border: 1px solid rgba(185, 207, 244, 0.13);
  border-radius: 13px;
  background: rgba(7, 12, 23, 0.57);
  backdrop-filter: blur(12px);
}
.viewer-head small,
.viewer-head strong {
  display: block;
}
.viewer-head small {
  color: #7e8ca4;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.15em;
}
.viewer-head strong {
  margin-top: 5px;
  color: #f7f9fe;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}
.viewer-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.tool-button,
.round-button {
  height: 38px;
  border: 1px solid rgba(185, 207, 244, 0.14);
  border-radius: 12px;
  background: rgba(7, 12, 23, 0.65);
  color: #a7b3c6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.tool-button b {
  font-size: 9px;
}
.tool-button.active {
  border-color: rgba(100, 162, 255, 0.45);
  background: rgba(56, 119, 218, 0.2);
  color: #dbe9ff;
}
.round-button {
  width: 38px;
  justify-content: center;
  padding: 0;
}
.viewer-bottom {
  position: absolute;
  z-index: 5;
  bottom: 17px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.gesture-help,
.speed-control {
  pointer-events: auto;
  border: 1px solid rgba(185, 207, 244, 0.13);
  background: rgba(7, 12, 23, 0.63);
  backdrop-filter: blur(12px);
  border-radius: 13px;
  color: #99a7bb;
}
.gesture-help {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 9px;
}
.gesture-help span {
  font-size: 16px;
  color: #76adff;
}
.speed-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
}
.speed-control small {
  font-size: 7px;
  letter-spacing: 0.13em;
  font-weight: 800;
  margin: 0 4px;
}
.speed-control button {
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8695aa;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}
.speed-control button.active {
  background: #1d65c6;
  color: #fff;
}
.scale-note {
  position: absolute;
  z-index: 5;
  left: 18px;
  bottom: 68px;
  max-width: 290px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #76859a;
  font-size: 8px;
  line-height: 1.45;
  pointer-events: none;
}
.scale-note span {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(141, 166, 205, 0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.scale-note p {
  margin: 2px 0;
}
.loading {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #070b14;
  color: #a9b6c9;
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: opacity 0.45s;
}
.loading.done {
  opacity: 0;
  pointer-events: none;
}
.loading.failed {
  padding: 32px;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0;
}
.loading.failed span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 184, 108, 0.36);
  border-radius: 50%;
  color: var(--warm);
  animation: none;
}
.loading span {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(109, 168, 255, 0.2);
  border-top-color: #6da8ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.object-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.space-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 5px 7px;
  border: 1px solid rgba(182, 205, 241, 0.15);
  border-radius: 8px;
  background: rgba(5, 10, 20, 0.58);
  color: #dbe7f8;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
  opacity: 0.82;
  backdrop-filter: blur(6px);
  transition: opacity 0.2s;
}
.space-label:before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--label-color, #6da8ff);
  box-shadow: 0 0 8px var(--label-color, #6da8ff);
}
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.object-number {
  font-family: Georgia, serif;
  color: var(--soft);
  font-size: 14px;
}
.type-chip {
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.planet-portrait {
  --portrait: #6da8ff;
  position: relative;
  width: 92px;
  height: 92px;
  margin: 24px 0 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle at 31% 27%,
    color-mix(in srgb, var(--portrait) 40%, white),
    var(--portrait) 48%,
    color-mix(in srgb, var(--portrait) 60%, black)
  );
  box-shadow: inset -17px -12px 25px rgba(0, 0, 0, 0.35),
    0 15px 40px color-mix(in srgb, var(--portrait) 23%, transparent);
}
.planet-portrait span {
  position: absolute;
  inset: -9px;
  border: 1px solid color-mix(in srgb, var(--portrait) 26%, transparent);
  border-radius: 50%;
  transform: rotateX(68deg);
}
.planet-portrait i {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.76);
  filter: blur(3px);
  border-radius: 50%;
  position: absolute;
  left: 24px;
  top: 20px;
}
.details h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 39px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}
.latin-name {
  margin: 7px 0 17px;
  color: var(--soft);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}
.summary {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
  margin-bottom: 21px;
}
.fact {
  padding: 10px 9px;
}
.fact:nth-child(odd) {
  padding-left: 0;
  border-right: 1px solid var(--line);
}
.fact span,
.fact strong {
  display: block;
}
.fact span {
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 7px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.fact strong {
  font-size: 10px;
  font-weight: 750;
}
.moon-section {
  margin-bottom: 18px;
}
.moon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.moon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 9px;
}
.moon i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab5c2;
  box-shadow: inset -2px -1px 2px rgba(0, 0, 0, 0.3);
}
.moon.empty {
  opacity: 0.65;
}
.discovery-note {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--text);
}
.discovery-note > span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.discovery-note strong {
  font-size: 9px;
}
.discovery-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.source-note {
  text-align: center;
  color: var(--soft);
  font-size: 7px;
  margin: 16px 0 0;
}
.mobile-body-nav {
  display: none;
}
@media (max-width: 1180px) {
  .mission-status {
    display: none;
  }
  .discovery-shell {
    grid-template-columns: 235px minmax(480px, 1fr);
  }
  .details {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) minmax(260px, 0.8fr);
    gap: 0 24px;
    height: auto;
  }
  .detail-top {
    grid-column: 1/-1;
  }
  .planet-portrait {
    grid-column: 1;
    grid-row: 2/7;
  }
  .details h2,
  .latin-name,
  .summary {
    grid-column: 2;
  }
  .facts,
  .moon-section,
  .discovery-note,
  .source-note {
    grid-column: 3;
  }
  .facts {
    grid-row: 2/4;
    margin: 0;
  }
  .moon-section {
    grid-row: 4/6;
  }
  .discovery-note {
    grid-row: 6;
  }
  .source-note {
    display: none;
  }
}
@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }
  .topbar {
    width: calc(100% - 22px);
    height: 62px;
  }
  .brand i,
  .brand strong,
  .home-link span {
    display: none;
  }
  .brand img {
    width: 29px;
    height: 29px;
  }
  .home-link {
    width: 38px;
    justify-content: center;
    padding: 0;
  }
  .discovery-shell {
    width: calc(100% - 16px);
    height: auto;
    min-height: 0;
    margin: 8px auto;
    display: flex;
    flex-direction: column;
  }
  .catalog {
    display: none;
  }
  .universe {
    order: 1;
    height: calc(100svh - 145px);
    min-height: 500px;
    border-radius: 20px;
  }
  .details {
    order: 2;
    display: block;
    padding: 23px 20px;
  }
  .details h2 {
    font-size: 36px;
  }
  .planet-portrait {
    width: 78px;
    height: 78px;
    margin-top: 20px;
  }
  .viewer-head {
    padding: 12px;
  }
  .viewer-head > div:first-child {
    padding: 8px 9px;
  }
  .viewer-head strong {
    font-size: 15px;
  }
  .tool-button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .tool-button b {
    display: none;
  }
  .round-button {
    display: none;
  }
  .viewer-bottom {
    bottom: 11px;
    left: 11px;
    right: 11px;
  }
  .gesture-help {
    max-width: 165px;
    line-height: 1.3;
    padding: 8px 9px;
  }
  .speed-control small {
    display: none;
  }
  .scale-note {
    left: 12px;
    bottom: 56px;
    max-width: 230px;
  }
  .space-label {
    font-size: 7px;
    padding: 4px 6px;
  }
  .mobile-body-nav {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    height: 67px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    gap: 7px;
    overflow-x: auto;
    background: color-mix(in srgb, var(--bg-soft) 89%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(20px);
    scrollbar-width: none;
  }
  .mobile-body-button {
    --body: #6da8ff;
    flex: 0 0 50px;
    height: 49px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .mobile-body-button i {
    display: block;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: radial-gradient(
      circle at 30% 27%,
      color-mix(in srgb, var(--body) 45%, white),
      var(--body) 53%,
      color-mix(in srgb, var(--body) 60%, black)
    );
    box-shadow: inset -5px -4px 8px rgba(0, 0, 0, 0.3);
  }
  .mobile-body-button.active {
    border-color: var(--body);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--body) 18%, transparent);
  }
}
@media (max-width: 410px) {
  .top-actions {
    gap: 4px;
  }
  .language-picker {
    padding: 0 7px;
  }
  .icon-button,
  .home-link {
    width: 36px;
  }
  .viewer-head small {
    font-size: 7px;
  }
  .viewer-head strong {
    font-size: 14px;
  }
  .speed-control button {
    padding: 0 6px;
  }
  .gesture-help b {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .loading span {
    animation: none;
  }
  .mission-status span {
    box-shadow: none;
  }
}
