/**
 * Home — motion “istituzionale”: presenza costante, ingressi ordinati, reveal allo scroll.
 * Rispetta prefers-reduced-motion: niente loop né reveal differiti.
 */

@keyframes lsHomePrimeAmb {
  0% {
    opacity: 0.55;
    transform: scale(1) translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03) translate3d(0.4%, -0.3%, 0);
  }
  100% {
    opacity: 0.62;
    transform: scale(1.01) translate3d(-0.3%, 0.2%, 0);
  }
}

@keyframes lsHomePrimeHeroGlow {
  0% {
    opacity: 0.75;
    transform: translateX(-50%) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1.06);
  }
}

@keyframes lsHomePrimeMapBreath {
  0% {
    opacity: 0.34;
    transform: scale(1);
  }
  100% {
    opacity: 0.42;
    transform: scale(1.015);
  }
}

@keyframes lsHomePrimeSectionAccent {
  0% {
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
    filter: brightness(1);
  }
  100% {
    box-shadow: 0 0 18px rgba(45, 212, 191, 0.55);
    filter: brightness(1.08);
  }
}

@keyframes lsHomePrimeTopvLoading {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes lsHomePrimeTopvSpotlight {
  0% {
    transform: translate3d(0, 18px, 0) scale(0.98);
    box-shadow:
      0 0 0 1px rgba(45, 212, 191, 0.04),
      0 8px 28px rgba(0, 0, 0, 0.2),
      0 18px 48px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    box-shadow:
      0 0 0 1px rgba(45, 212, 191, 0.06),
      0 12px 40px rgba(0, 0, 0, 0.32),
      0 28px 64px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

@keyframes lsHomePrimeCtaSheen {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -160% 0;
  }
}

#lsStaticWelcome.ls-home-v2 {
  overflow-x: clip;
}

#lsStaticWelcome.ls-home-v2::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 18% 22%, rgba(45, 212, 191, 0.14), transparent 52%),
    radial-gradient(ellipse 60% 50% at 88% 18%, rgba(99, 102, 241, 0.1), transparent 48%),
    radial-gradient(ellipse 55% 45% at 50% 95%, rgba(15, 23, 42, 0.35), transparent 55%);
  opacity: 0.65;
  animation: lsHomePrimeAmb 22s ease-in-out infinite alternate;
}

#lsStaticWelcome.ls-home-v2 .ls-home-v2__scroll {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .ls-home-v2__hero-glow {
    animation: lsHomePrimeHeroGlow 9s ease-in-out infinite alternate;
  }

  #lsHeroMapBg {
    animation: lsHomePrimeMapBreath 28s ease-in-out infinite alternate;
  }

  .ls-home-v2__section-label::before {
    animation: lsHomePrimeSectionAccent 5.5s ease-in-out infinite alternate;
  }

  .ls-home-v2__topv-loading:not([hidden]) {
    animation: lsHomePrimeTopvLoading 1.25s ease-in-out infinite;
  }

  .ls-home-v2__topv-card.ls-home-topv-card--spotlight {
    animation: lsHomePrimeTopvSpotlight 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .ls-home-reveal {
    opacity: 0;
    transform: translate3d(0, 32px, 0) scale(0.985);
    transition:
      opacity 0.78s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.78s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
  }

  .ls-home-reveal--visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: auto;
  }

  .ls-home-reveal--visible .ls-home-v2__cta-stack .ls-home-v2__cta:nth-child(1) {
    transition:
      opacity 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.08s,
      transform 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.08s,
      box-shadow 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.08s;
  }

  .ls-home-reveal--visible .ls-home-v2__cta-stack .ls-home-v2__cta:nth-child(2) {
    transition:
      opacity 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
      transform 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
      box-shadow 0.62s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
  }

  .ls-home-reveal:not(.ls-home-reveal--visible) .ls-home-v2__cta-stack .ls-home-v2__cta {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }

  .ls-home-reveal--visible .ls-home-v2__cta-stack .ls-home-v2__cta {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .ls-home-v2__cta {
    position: relative;
  }

  .ls-home-v2__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
      105deg,
      transparent 38%,
      rgba(255, 255, 255, 0.22) 50%,
      transparent 62%
    );
    background-size: 240% 100%;
    opacity: 0.32;
    animation: lsHomePrimeCtaSheen 16s ease-in-out infinite alternate;
    mix-blend-mode: soft-light;
  }

  .ls-home-v2__cta:focus-visible {
    outline: 2px solid rgba(45, 212, 191, 0.65);
    outline-offset: 3px;
  }

  .ls-home-v2__cta > * {
    position: relative;
    z-index: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #lsStaticWelcome.ls-home-v2::before {
    animation: none !important;
    opacity: 0.5;
  }

  .ls-home-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ls-home-reveal .ls-home-v2__cta-stack .ls-home-v2__cta {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .ls-home-v2__topv-card.ls-home-topv-card--spotlight {
    animation: none !important;
  }

  .ls-home-v2__topv-loading:not([hidden]) {
    animation: none !important;
    opacity: 0.85;
  }

  .ls-home-v2__cta::before {
    display: none !important;
  }
}
