/* Copied from the app: src/components/muse/muse.css (orb part only), branch facelift, 06/11/2026; widened to the eight
   areas on 3/12/2026 (the glow and the swirl take --a7…--b8). Keep in step with the app: if the orb changes there, copy it again. */
/*
 * Atlas's orb (it was Muse until 6/11/2026): a sphere in all eight of the palette's area colours (the "Atlas mock-up" canvas, artboard 7, option A).
 * Layers, back to front: a glow behind, a slow swirl of the sixteen stops, three bands drifting at different speeds (the
 * equator fastest, so it reads as a globe turning), shading at the limb, a highlight that stays put, a rim of light.
 * Sizes are in em: set font-size to a tenth of the orb's width. Periods are mutually prime so nothing falls into step.
 * The colours arrive as --a1…--b8 from MuseOrb.tsx (areaStops), so the orb follows the palette.
 */
.muse-orb {
  position: relative;
  border-radius: 50%;
  flex: none;
  animation: muse-bob 6.5s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}
.muse-orb .mo-glow {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--b1), var(--b2), var(--b3), var(--b4), var(--b5), var(--b6), var(--b7), var(--b8), var(--b1));
  filter: blur(2.6em);
  opacity: 0.45;
  animation: muse-spin 23s linear infinite;
  transition: opacity 320ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
:root[data-theme='dark'] .muse-orb .mo-glow {
  opacity: 0.65;
}
.muse-orb .mo-ball {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(circle at 50% 50%, var(--b5), var(--a1));
}
.muse-orb .mo-swirl {
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 90deg, var(--a1), var(--b1), var(--a2), var(--b2), var(--a3), var(--b3), var(--a4), var(--b4), var(--a5), var(--b5), var(--a6), var(--b6), var(--a7), var(--b7), var(--a8), var(--b8), var(--a1));
  filter: blur(1.2em);
  animation: muse-spin 29s linear infinite reverse;
}
.muse-orb .mo-band {
  position: absolute;
  left: 0;
  width: 400%;
  filter: blur(0.9em);
  opacity: 0.6;
}
.muse-orb .mo-eq {
  top: 30%;
  height: 40%;
  opacity: 0.7;
  background: linear-gradient(90deg, var(--b3), var(--a4), var(--b5), var(--a1), var(--b2), var(--a6), var(--b3), var(--a4), var(--b5), var(--a1), var(--b2), var(--a6), var(--b3));
  animation: muse-belt 11s linear infinite;
}
.muse-orb .mo-up {
  top: 2%;
  height: 34%;
  background: linear-gradient(90deg, var(--a2), var(--b4), var(--a5), var(--b1), var(--a3), var(--b6), var(--a2), var(--b4), var(--a5), var(--b1), var(--a3), var(--b6), var(--a2));
  animation: muse-belt 17s linear infinite;
}
.muse-orb .mo-lo {
  top: 64%;
  height: 34%;
  background: linear-gradient(90deg, var(--b6), var(--a3), var(--b1), var(--a5), var(--b4), var(--a2), var(--b6), var(--a3), var(--b1), var(--a5), var(--b4), var(--a2), var(--b6));
  animation: muse-belt 19s linear infinite;
}
.muse-orb .mo-shade {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, rgba(255, 255, 255, 0) 36%, rgba(18, 16, 34, 0.16) 66%, rgba(18, 16, 34, 0.46) 100%);
}
.muse-orb .mo-spec {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0.5) 7%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(ellipse 50% 22% at 50% 94%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 70%);
}
.muse-orb .mo-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 0.25em 0.8em rgba(255, 255, 255, 0.45),
    inset 0 -0.6em 1.6em rgba(18, 16, 34, 0.18);
}
.muse-orb .mo-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mo-ink, #fff);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

/*
 * Atlas's eight satellites (the solar system, 6/11/2026; eight since 3/12/2026): one per area, each on its own tilted orbit with its own period, so
 * the pattern never comes round the same way twice. A moon's x and y are two eased swings a quarter-turn apart, which
 * traces an ellipse; its z-index swaps at the half-turns, so it passes in front of the planet and behind it. With the
 * moons on, the planet shrinks to leave them room inside the button.
 */
.muse-orb[data-moons] .mo-ball {
  inset: 17%;
}
.muse-orb[data-moons] .mo-glow {
  inset: -2%;
}
.muse-orb .mo-ball {
  z-index: 2;
}
.muse-orb .mo-mark {
  z-index: 4;
}
.muse-orb .mo-plane {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--tilt));
  animation: mo-z calc(var(--d) * 2) steps(1, end) var(--dz) infinite;
}
.muse-orb .mo-y {
  position: absolute;
  animation: mo-y var(--d) cubic-bezier(0.37, 0, 0.63, 1) var(--dy) infinite alternate both;
}
.muse-orb .mo-x {
  position: absolute;
  animation: mo-x var(--d) cubic-bezier(0.37, 0, 0.63, 1) var(--dx) infinite alternate both;
}
.muse-orb .mo-dot {
  position: absolute;
  width: 0.78em;
  height: 0.78em;
  margin: -0.39em;
  border-radius: 50%;
  box-shadow:
    inset 0 -0.08em 0.14em rgba(0, 0, 0, 0.26),
    inset 0 0.06em 0.06em rgba(255, 255, 255, 0.6);
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.3, 1);
}
/* a note waiting: the moon of the area it is about swells */
.muse-orb[data-state='note'] .mo-plane[data-hot] .mo-dot {
  transform: scale(1.8);
}
.muse-orb[data-state='thinking'] .mo-plane,
.muse-orb[data-state='thinking'] .mo-y,
.muse-orb[data-state='thinking'] .mo-x {
  animation-duration: calc(var(--d) * 0.7);
}
.muse-orb[data-state='thinking'] .mo-plane {
  animation-duration: calc(var(--d) * 1.4);
}
@keyframes mo-y {
  from {
    transform: translateY(calc(var(--ry) * -1));
  }
  to {
    transform: translateY(var(--ry));
  }
}
@keyframes mo-x {
  from {
    transform: translateX(calc(var(--rx) * -1));
  }
  to {
    transform: translateX(var(--rx));
  }
}
@keyframes mo-z {
  0% {
    z-index: 1;
  }
  50%,
  100% {
    z-index: 3;
  }
}

/* thinking: everything turns faster and the glow brightens */
.muse-orb[data-state='thinking'] .mo-glow {
  opacity: 0.8;
  animation-duration: 5s;
}
.muse-orb[data-state='thinking'] .mo-swirl {
  animation-duration: 7s;
}
.muse-orb[data-state='thinking'] .mo-eq {
  animation-duration: 3s;
}
.muse-orb[data-state='thinking'] .mo-up {
  animation-duration: 5s;
}
.muse-orb[data-state='thinking'] .mo-lo {
  animation-duration: 7s;
}
/* a note waiting: one pulse, then a brighter glow */
.muse-orb[data-state='note'] .mo-glow {
  opacity: 0.85;
  animation:
    muse-spin 23s linear infinite,
    muse-pulse 1.3s cubic-bezier(0.2, 0.8, 0.3, 1) 1;
}

@keyframes muse-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes muse-belt {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@keyframes muse-bob {
  from {
    transform: translateY(-0.12em);
  }
  to {
    transform: translateY(0.12em);
  }
}
@keyframes muse-pulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .muse-orb:not([data-motion='full']),
  .muse-orb:not([data-motion='full']) .mo-glow,
  .muse-orb:not([data-motion='full']) .mo-swirl,
  .muse-orb:not([data-motion='full']) .mo-band,
  .muse-orb:not([data-motion='full']) .mo-plane,
  .muse-orb:not([data-motion='full']) .mo-y,
  .muse-orb:not([data-motion='full']) .mo-x {
    animation: none;
  }
}
