/* Sigma+ — animazioni del sito
   Tutto si attiva solo se JavaScript è presente (classe .anim su <html>)
   e se il visitatore non ha chiesto di ridurre il movimento. */

:root { --ease-out: cubic-bezier(.2, .7, .2, 1); --ease-pop: cubic-bezier(.34, 1.5, .64, 1); }

/* ---------- apertura della pagina (hero) ---------- */
@keyframes sp-hero-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes sp-hero-zoom { from { transform: scale(1.09); } to { transform: scale(1); } }
html.anim .a-hero { animation: sp-hero-in .95s var(--ease-out) both; animation-delay: var(--d, 0ms); }
html.anim .a-zoom { animation: sp-hero-zoom 2.8s var(--ease-out) both; transform-origin: 70% 50%; }
html.anim .a-played { animation: none !important; }

/* ---------- comparsa allo scorrimento ---------- */
html.anim .a-up {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
html.anim .a-side { transform: translateX(-36px); }
html.anim .a-up.is-in { opacity: 1; transform: none; }

/* le tre sfere si "accendono" in ordine: conformità, controllo, strategia */
html.anim .a-sphere {
  opacity: 0; transform: scale(.35);
  transition: opacity .5s var(--ease-out), transform .75s var(--ease-pop);
  transition-delay: var(--d, 0ms);
}
html.anim .a-sphere.is-in { opacity: 1; transform: none; }

/* contenuto che cambia dopo un clic (es. scelta del settore) */
@keyframes sp-swap { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html.anim .a-swap { animation: sp-swap .45s var(--ease-out) both; }

/* ---------- interazioni ---------- */
.a-lift { transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out), border-color .28s; }
.a-lift:hover { transform: translateY(-5px); box-shadow: 0 18px 36px -18px rgba(6, 51, 27, .35); }
.a-lift img[src*="sfera-"] { transition: transform .5s var(--ease-pop); }
.a-lift:hover img[src*="sfera-"] { transform: scale(1.1) rotate(-6deg); }

.a-btn { transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), filter .2s; }
.a-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .45); filter: brightness(1.06); }
.a-btn:active { transform: translateY(0); }

/* link del menu: sottolineatura che scorre */
.a-nav { position: relative; }
.a-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px;
  background: #9BD4B3; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out);
}
.a-nav:hover::after, .a-nav[aria-current="page"]::after { transform: scaleX(1); }

/* intestazione che resta in alto e si compatta allo scorrimento */
.a-header { position: sticky; top: 0; z-index: 50; transition: box-shadow .3s; }
.a-header.is-scrolled { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5); }

/* ---------- chi preferisce meno movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  html.anim .a-hero, html.anim .a-zoom, html.anim .a-swap { animation: none !important; }
  html.anim .a-up, html.anim .a-sphere { opacity: 1 !important; transform: none !important; transition: none !important; }
  .a-lift, .a-btn, .a-nav::after { transition: none !important; }
  .a-lift:hover, .a-btn:hover, .a-lift:hover img { transform: none !important; }
}
