:root {
  --vh: 1vh;
  color-scheme: dark;
}
@supports (height: 1dvh) {
  :root { --vh: 1dvh; }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #02030a;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Layer sizes derive from both axes so the composition tracks aspect ratio. */
  --sun: min(80 * var(--vh), 64vw);
  --earth: min(96 * var(--vh), 76vw);
  --galaxy: max(54vw, 62 * var(--vh));
}

.layer {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.starfield {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.galaxy {
  width: var(--galaxy);
  left: calc(var(--galaxy) * -0.12);
  top: calc(var(--galaxy) * -0.17);
}

.sun {
  width: var(--sun);
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
}

.earth {
  width: var(--earth);
  right: calc(var(--earth) * -0.16);
  bottom: calc(var(--earth) * -0.33);
}

.domain {
  position: absolute;
  left: 0;
  right: 0;
  top: 15%;
  margin: 0;
  padding: 0 5vw;
  text-align: center;
  font: 300 clamp(1.5rem, 1rem + 3.4vw, 4.5rem) / 1.1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.9);
  overflow-wrap: anywhere;
}

/* Portrait: stack the bodies vertically, keep text in the upper third. */
@media (max-aspect-ratio: 1/1) {
  .scene {
    --sun: min(74vw, 46 * var(--vh));
    --earth: min(112vw, 62 * var(--vh));
    --galaxy: max(78vw, 46 * var(--vh));
  }
  .galaxy { top: calc(var(--galaxy) * -0.26); }
  .earth { right: calc(var(--earth) * -0.2); bottom: calc(var(--earth) * -0.28); }
  .sun { top: 47%; }
  .domain { top: 19%; }
}

/* Short landscape (phones on their side). */
@media (max-height: 480px) and (min-aspect-ratio: 1/1) {
  .domain { top: 8%; }
  .sun { top: 56%; }
}
