/* Solar System page. Relies on the variables, fonts, header and footer in main.css. */

.page-solar-system { background: #000; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#scene.dragging { cursor: grabbing; }

/* Header floats over the sky */
.page-solar-system .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: clamp(24px, 4vw, 56px) clamp(24px, 5vw, 72px) 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.page-solar-system .site-header a { pointer-events: auto; }

/* Planet names in the scene */
#labels {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.label {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.label .dot {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.label .name {
  position: absolute;
  left: 0;
  top: calc(var(--r, 0px) + 6px);
  transform: translateX(-50%);
  padding: 0 4px;
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 6px #000, 0 0 12px #000;
  pointer-events: auto;
  cursor: pointer;
}

@media (hover: hover) {
  .label .name:hover { text-decoration: underline; text-underline-offset: 3px; }
}

.label.big .dot,
.label.noname .name { display: none; }

/* Planet list, bottom left just above the footer, aligned with the header and footer edges */
.solar-dock {
  position: fixed;
  z-index: 2;
  left: clamp(24px, 5vw, 72px);
  bottom: calc(var(--footer-h, 76px) + 16px);
  max-width: calc(100% - 2 * clamp(24px, 5vw, 72px));
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 9, 9, .66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.solar-dock__row {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
}

.solar-dock__row::-webkit-scrollbar { display: none; }

.solar-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.solar-chip .sw {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

@media (hover: hover) {
  .solar-chip:hover { background: rgba(242, 239, 232, .1); }
}

.solar-chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--black);
}

.solar-chip:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: -3px;
}

.solar-credit {
  position: fixed;
  z-index: 2;
  right: clamp(24px, 5vw, 72px);
  bottom: calc(var(--footer-h, 76px) + 16px);
  height: var(--dock-h, 44px);
  display: flex;
  align-items: center;
  margin: 0;
  font-size: .6rem;
  letter-spacing: .02em;
  color: rgba(242, 239, 232, .38);
  text-shadow: 0 1px 2px #000;
}

/* When the screen is too narrow to fit it beside the planet list, it moves just above */
.solar-credit.is-stacked {
  bottom: calc(var(--footer-h, 76px) + var(--dock-h, 44px) + 22px);
  height: auto;
}

.solar-credit a { color: inherit; }

.solar-error {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(100% - 48px, 520px);
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: .85rem;
  line-height: 1.7;
}

.solar-error[hidden] { display: none; }

@media (max-width: 680px) {
  .page-solar-system .site-header { padding: 24px 22px 36px; }
  .solar-credit { right: 22px; }
  .solar-dock { left: 22px; max-width: calc(100% - 44px); }
}
