/* Animazioni del sito: solo CSS, nessuno script.
   Tutto si spegne con prefers-reduced-motion; senza supporto allo scroll-driven
   il contenuto resta semplicemente visibile. */

/* Atmosfera: due luci sky che derivano lente dietro la hero */
.aurora { position: absolute; inset: -120px 0 auto; height: 900px; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px);
  background: radial-gradient(circle, color-mix(in srgb, var(--vivid-cyan) 34%, transparent) 0%, transparent 68%);
}
.aurora::before { width: 620px; height: 620px; left: 8%; top: 40px; animation: drift-a 22s ease-in-out infinite alternate; }
.aurora::after {
  width: 520px; height: 520px; right: 4%; top: 260px; animation: drift-b 26s ease-in-out infinite alternate;
  background: radial-gradient(circle, color-mix(in srgb, var(--vivid-blue) 22%, transparent) 0%, transparent 70%);
}
@keyframes drift-a { to { transform: translate(140px, 90px) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-160px, -60px) scale(0.9); } }

/* Ingresso della hero al caricamento, a cascata */
.rise { animation: rise 0.9s var(--ease-out) both; }
.rise.d1 { animation-delay: 0.08s; } .rise.d2 { animation-delay: 0.16s; }
.rise.d3 { animation-delay: 0.24s; } .rise.d4 { animation-delay: 0.38s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Pallino "vivo" nella pillola della hero */
.live-dot { position: relative; }
.live-dot::after {
  content: ""; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: currentColor; animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping { 70%, 100% { transform: scale(3.2); opacity: 0; } }

/* Pillole che galleggiano attorno alla schermata principale */
.float { animation: bob 6s ease-in-out infinite; }
.float.f2 { animation-duration: 7.5s; animation-delay: -2s; }
.float.f3 { animation-duration: 6.8s; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* Scroll-driven: la schermata della hero si raddrizza, le sezioni emergono */
@supports (animation-timeline: view()) {
  .tilt img {
    transform-origin: 50% 0;
    animation: untilt linear both; animation-timeline: view(); animation-range: entry 0% cover 45%;
  }
  @keyframes untilt { from { transform: perspective(1400px) rotateX(18deg) scale(0.94); } to { transform: none; } }

  .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 5% cover 28%; }
  @keyframes reveal { from { opacity: 0; transform: translateY(40px) scale(0.98); } }

  .reveal-side { animation: slide linear both; animation-timeline: view(); animation-range: entry 5% cover 32%; }
  .feature.flip .reveal-side { animation-name: slide-r; }
  @keyframes slide { from { opacity: 0; transform: translateX(-48px); } }
  @keyframes slide-r { from { opacity: 0; transform: translateX(48px); } }
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after, .rise, .live-dot::after, .float,
  .tilt img, .reveal, .reveal-side { animation: none !important; }
}
