/* This sky sits between the starfield and globe, so Earth can eclipse it. */
.distant-sky {
  position: absolute; inset: 0; overflow: hidden; container-type: size;
  pointer-events: none; user-select: none; transition: opacity .45s ease;
}
.distant-body {
  position: absolute; display: block; width: var(--body-size);
  translate: calc(-50% + var(--sight-x, 0) * var(--parallax))
             calc(-50% + var(--sight-y, 0) * var(--parallax));
  animation: distant-body-drift var(--period) ease-in-out var(--phase) infinite alternate;
}
.distant-body img {display: block; width: 100%; height: auto; pointer-events: none;}
.distant-sun {
  left: 14.5%; top: 19.5%; --body-size: clamp(39px, 6.2cqw, 72px);
  --parallax: 1.8px; --dx: 2px; --dy: -2px; --phase: -18s; --period: 63s;
}
.distant-sun::before {
  content: ""; position: absolute; inset: -90%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, #ecaf693c 0%, #e5954216 24%, #d38f4c06 47%, transparent 69%);
}
.distant-saturn {
  left: 86%; top: 72%; --body-size: clamp(27px, 4.2cqw, 51px); opacity: .9;
  --parallax: 3.2px; --dx: -4px; --dy: 3px; --phase: -9s; --period: 42s;
}
.distant-neptune {
  left: 89%; top: 19%; --body-size: clamp(11px, 1.4cqw, 18px); opacity: .86;
  --parallax: .9px; --dx: -1.5px; --dy: 1.5px; --phase: -26s; --period: 83s;
}
@keyframes distant-body-drift {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(var(--dx),var(--dy),0); }
}
.map-stage:has(#light-field[aria-pressed="false"]) .distant-sky { opacity: 0; }
.map-stage:has(#light-field[aria-pressed="false"]) .distant-body,
html:has(#prelude[open]) .distant-body {animation-play-state: paused;}

@container (max-width: 580px) or (max-aspect-ratio: 1.14) {
  .distant-sun {left: 11.6%; top: 21%; --body-size: clamp(30px, 8.4cqw, 48px);}
  .distant-saturn {left: 92.5%; top: 74.5%; --body-size: clamp(26px, 7.7cqw, 39px);}
  .distant-neptune {left: 90%; top: 22%; --body-size: clamp(10px, 2.8cqw, 14px);}
}
@container (max-height: 265px) {
  .distant-sun {top: max(54px, 23%);}
  .distant-saturn {left: 84%; top: 68%;}
  .distant-neptune {top: max(54px, 22%);}
}
@media (prefers-reduced-motion: reduce) {
  .distant-body {animation: none; translate: -50% -50%;}
  .distant-sky {transition: none;}
}
