/* Orb 3D della hero: la goccia di vetro dell'app (actable/ui/widgets/orb.css)
   in grande, con tre orbite di luce in prospettiva che le passano davanti e
   dietro. Solo CSS. I colori sono la palette viva di tokens.css. */
.orb3d { position: relative; width: min(440px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.orb-stage {
  position: absolute; inset: 0;
  animation: orb-float 7s ease-in-out infinite;
}
@keyframes orb-float { 50% { transform: translateY(-14px); } }

/* Alone colorato e ombra a terra: danno peso e luce all'oggetto */
.orb-glow {
  position: absolute; inset: -12%; border-radius: 50%; filter: blur(40px);
  background: radial-gradient(circle at 45% 45%, color-mix(in srgb, var(--vivid-cyan) 70%, transparent),
    color-mix(in srgb, var(--vivid-blue) 42%, transparent) 45%, transparent 70%);
  animation: orb-pulse 5s ease-in-out infinite;
}
@keyframes orb-pulse { 50% { opacity: 0.6; transform: scale(0.94); } }
.orb-floor {
  position: absolute; left: 22%; right: 22%; bottom: -6%; height: 8%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(15, 23, 42, 0.22), transparent);
  filter: blur(6px); animation: orb-floor 7s ease-in-out infinite;
}
@keyframes orb-floor { 50% { transform: scale(0.82); opacity: 0.6; } }

/* Corpo di vetro che si deforma, con dentro il colore che si rimescola */
.orb-body {
  position: absolute; inset: 18%; z-index: 2; overflow: hidden; isolation: isolate;
  border-radius: 62% 38% 55% 45% / 45% 58% 42% 55%;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.04));
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--vivid-blue) 60%, transparent);
  animation: orb-morph 12s ease-in-out infinite;
  transition: transform 0.6s var(--ease-out);
}
.orb3d:hover .orb-body { transform: scale(1.04); }
@keyframes orb-morph {
  33% { border-radius: 45% 55% 40% 60% / 58% 42% 58% 42%; }
  66% { border-radius: 55% 45% 62% 38% / 40% 60% 45% 55%; }
}
.orb-mesh { position: absolute; inset: -8%; animation: orb-swirl 18s linear infinite; filter: saturate(1.45) brightness(1.05); }
@keyframes orb-swirl { to { transform: rotate(360deg); } }
.orb-blob { position: absolute; width: 92%; height: 92%; border-radius: 50%; filter: blur(22px); }
.orb-blob.b1 { left: -12%; top: -8%; background: radial-gradient(circle, var(--vivid-cyan) 0%, transparent 66%); animation: blob1 7s ease-in-out infinite; }
.orb-blob.b2 { right: -16%; top: -12%; background: radial-gradient(circle, var(--vivid-sky) 0%, transparent 64%); animation: blob2 9.3s ease-in-out infinite; }
.orb-blob.b3 { right: -10%; bottom: -14%; background: radial-gradient(circle, var(--vivid-blue) 0%, transparent 62%); animation: blob3 8.1s ease-in-out infinite; }
.orb-blob.b4 { left: -14%; bottom: -10%; background: radial-gradient(circle, var(--vivid-teal) 0%, transparent 64%); animation: blob4 10.7s ease-in-out infinite; }
@keyframes blob1 { 40% { transform: translate(30%, 22%) scale(1.2); } 75% { transform: translate(10%, 38%) scale(0.9); } }
@keyframes blob2 { 40% { transform: translate(-28%, 30%) scale(0.88); } 75% { transform: translate(-6%, 8%) scale(1.2); } }
@keyframes blob3 { 45% { transform: translate(-24%, -32%) scale(1.22); } 80% { transform: translate(-36%, -6%); } }
@keyframes blob4 { 38% { transform: translate(28%, -26%) scale(0.9); } 72% { transform: translate(6%, -38%) scale(1.16); } }
.orb-shine {
  position: absolute; left: 16%; top: 9%; width: 36%; height: 22%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.95), transparent 70%); filter: blur(6px);
}
.orb-rim {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 -30px 50px -24px color-mix(in srgb, var(--vivid-blue) 55%, transparent);
}

/* Orbite in 2D (niente 3D: Safari non animava le vecchie). Ogni orbita è un'ellisse
   ruotata: la linea è statica (metà dietro l'orb, metà davanti), la stella la
   percorre con due oscillazioni sfasate di un quarto di giro (X e Y = coseno e
   seno) e passa davanti/dietro l'orb cambiando z-index. Si anima solo transform:
   lo fa la GPU, senza ridisegnare la pagina. */
.orb-ring, .orb-sat {
  position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--h);
  translate: -50% -50%; rotate: var(--a);
}
.orb-ring { z-index: 1; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--vivid-sky) 40%, rgba(255, 255, 255, 0.75)); }
.orb-ring.front { z-index: 3; clip-path: inset(50% 0 0 0); }
.orb-sat { --ease: cubic-bezier(0.37, 0, 0.63, 1); /* ~ seno */
  animation: sat-x calc(var(--t) / 2) var(--ease) infinite alternate, sat-z var(--t) step-end infinite;
}
.orb-sat i { position: absolute; inset: 0; animation: sat-y calc(var(--t) / 2) var(--ease) calc(var(--t) / -4) infinite alternate; }
.orb-sat i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2); border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent), 0 0 20px 6px var(--c);
  animation: sat-depth calc(var(--t) / 2) var(--ease) calc(var(--t) / -4) infinite alternate;
}
@keyframes sat-x { from { transform: translateX(-50%); } to { transform: translateX(50%); } }
@keyframes sat-y { from { transform: translateY(-50%); } to { transform: translateY(50%); } }
@keyframes sat-depth { from { scale: 0.6; opacity: 0.55; } to { scale: 1.15; opacity: 1; } }
@keyframes sat-z { 0% { z-index: 4; } 50%, 100% { z-index: 0; } } /* metà giro davanti, metà dietro */
.o1 { --w: 100%; --h: 30%; --a: -16deg; --t: 12s; --s: 13px; --c: var(--vivid-cyan); }
.o2 { --w: 86%; --h: 40%; --a: 32deg; --t: 17s; --s: 10px; --c: var(--vivid-teal); }
.o3 { --w: 94%; --h: 20%; --a: 12deg; --t: 23s; --s: 8px; --c: var(--vivid-blue); }

@media (prefers-reduced-motion: reduce) {
  .orb-stage, .orb-glow, .orb-floor, .orb-body, .orb-mesh, .orb-blob, .orb-sat, .orb-sat i, .orb-sat i::after { animation: none !important; }
  .orb-sat { z-index: 4; transform: translateX(-42%); } .orb-sat i { transform: translateY(26%); }
}
