/* Hero solar system: six orbits, twelve bodies, a ringed planet, a moon and a soft sun.
   Each planet sits on an "arm" the size of its orbit, so it is always lit from the
   centre (the sun), however far the orbit has turned. Muted colours only. */

.hero-orbits { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }

/* the sun: a quiet glow behind the title */
.sun {
  position: absolute; width: min(520px, 86vw); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, rgb(var(--glow-rgb) / .20) 0%, rgb(var(--glow-rgb) / .08) 32%, transparent 62%),
    radial-gradient(circle, rgb(var(--accent-rgb) / .10) 0%, transparent 70%);
  animation: sunPulse 7s ease-in-out infinite;
}
@keyframes sunPulse { 50% { transform: scale(1.06); opacity: .8; } }

/* extra orbits (o1–o3 live in style.css) */
.o4 { width: min(1360px, 210vw); aspect-ratio: 1; animation-duration: 220s; animation-direction: reverse; border-color: rgb(var(--ink-rgb) / .07); }
.o5 { width: min(1640px, 250vw); aspect-ratio: 1; animation-duration: 290s; border-style: dashed; border-color: rgb(var(--ink-rgb) / .05); }
.o6 { width: min(1940px, 300vw); aspect-ratio: 1; animation-duration: 360s; animation-direction: reverse; border-color: rgb(var(--ink-rgb) / .045); }

/* a faint dotted asteroid belt between o3 and o4 */
.belt {
  position: absolute; width: min(1230px, 190vw); aspect-ratio: 1; border-radius: 50%;
  border: 2px dotted rgb(var(--ink-rgb) / .10); animation: spin 400s linear infinite;
}

/* planet arm + ball */
.pl { position: absolute; inset: 0; transform: rotate(var(--a, 0deg)); pointer-events: none; }
.ball {
  --s: 12px;
  position: absolute; left: 50%; top: 0; width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%;
  /* lit side faces the sun (down the arm, towards the centre) */
  background: radial-gradient(circle at 50% 78%, var(--c1), var(--c2) 48%, var(--c3) 88%);
  box-shadow: 0 0 calc(var(--s) * .9) var(--halo, transparent);
}

/* positions around each orbit */
.o1 .pl:nth-child(1) { --a: 8deg; }   .o1 .pl:nth-child(2) { --a: 205deg; }
.o2 .pl:nth-child(1) { --a: 128deg; } .o2 .pl:nth-child(2) { --a: 312deg; }
.o3 .pl:nth-child(1) { --a: 58deg; }  .o3 .pl:nth-child(2) { --a: 236deg; }
.o4 .pl:nth-child(1) { --a: 288deg; } .o4 .pl:nth-child(2) { --a: 102deg; } .o4 .pl:nth-child(3) { --a: 172deg; }
.o5 .pl:nth-child(1) { --a: 214deg; } .o5 .pl:nth-child(2) { --a: 34deg; }
.o6 .pl:nth-child(1) { --a: 82deg; }  .o6 .pl:nth-child(2) { --a: 252deg; }

/* the bodies: soft, desaturated tones */
.pl-gold  .ball { --s: 16px; --c1: #fbf0d4; --c2: #d9b878; --c3: #7d6236; --halo: rgb(230 201 143 / .55); }
.pl-ivory .ball { --s: 7px;  --c1: #ffffff; --c2: #e7e2d6; --c3: #8f8a7e; }
.pl-lav   .ball { --s: 30px; --c1: #ece6ff; --c2: #a99bd6; --c3: #4a3f78; --halo: rgb(167 155 208 / .45); }
.pl-rose  .ball { --s: 14px; --c1: #fbe3e0; --c2: #d6a3a0; --c3: #7a4f55; --halo: rgb(214 163 160 / .35); }
.pl-ringed .ball { --s: 40px; --c1: #f8ecd2; --c2: #cdb48a; --c3: #6e5a3e; --halo: rgb(205 180 138 / .35); }
.pl-white .ball, .pl-white2 .ball { --s: 9px; --c1: #ffffff; --c2: #dcdbe6; --c3: #8d8aa0; --halo: rgb(255 255 255 / .35); }
.pl-white2 .ball { --s: 6px; }
.pl-teal  .ball { --s: 22px; --c1: #e4f3f1; --c2: #94bdb8; --c3: #3f6663; --halo: rgb(148 189 184 / .35); }
.pl-ice   .ball { --s: 8px;  --c1: #f3f8ff; --c2: #bccde6; --c3: #66789a; }
.pl-gold2 .ball { --s: 6px;  --c1: #fff4d8; --c2: #e6c98f; --c3: #8a7040; --halo: rgb(230 201 143 / .5); }
.pl-giant .ball { --s: 58px; --c1: #e6e2ff; --c2: #8f88c8; --c3: #2f2a55; --halo: rgb(143 136 200 / .35); }
.pl-blush .ball { --s: 18px; --c1: #fdeee6; --c2: #e1b9a6; --c3: #7d5a4d; --halo: rgb(225 185 166 / .3); }
.pl-sand  .ball { --s: 24px; --c1: #fbf3e2; --c2: #cfbf9c; --c3: #6b5f47; --halo: rgb(207 191 156 / .3); }

/* soft bands on the giant and the ringed planet */
.pl-giant .ball::after, .pl-ringed .ball::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-linear-gradient(0deg, transparent 0 18%, rgb(255 255 255 / .08) 18% 24%);
}

/* ring */
.ring {
  position: absolute; left: 50%; top: 50%; width: 190%; height: 42%;
  transform: translate(-50%, -50%) rotate(-18deg); border-radius: 50%;
  border: 2px solid rgb(230 201 143 / .55); box-shadow: 0 0 10px rgb(230 201 143 / .25);
}
.ring::after { content: ''; position: absolute; inset: 4px -6px; border-radius: 50%; border: 1px solid rgb(230 201 143 / .25); }

/* moon around the lavender planet */
.moon-orbit { position: absolute; inset: -16px; border-radius: 50%; border: 1px dashed rgb(var(--ink-rgb) / .10); animation: spin 9s linear infinite; }
.moon { position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fff, #b9b5c8); box-shadow: 0 0 6px rgb(255 255 255 / .5); }

/* light theme: daylight shadows instead of glows */
html[data-theme="light"] .ball { box-shadow: 0 4px calc(var(--s) * .6) -2px rgb(60 50 90 / .28); }
html[data-theme="light"] .ring { border-color: rgb(168 130 58 / .55); box-shadow: none; }
html[data-theme="light"] .ring::after { border-color: rgb(168 130 58 / .25); }
html[data-theme="light"] .belt { border-color: rgb(var(--ink-rgb) / .12); }

/* phones: keep the system lighter */
@media (max-width: 820px) {
  .o6, .pl-white2 { display: none; }
  .pl-giant .ball { --s: 44px; }
  .pl-ringed .ball { --s: 32px; }
}
