/* ═══════════════════════════════════════════════
   SCUTARIUS — Effects / Motion / Ambience
   Layer additivo: non modifica la logica esistente.
   ═══════════════════════════════════════════════ */

/* Rispetta chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Barra di progresso scroll ── */
#scrollProgress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 1200;
  background: linear-gradient(90deg, var(--accent), #f0d074, var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 80ms linear;
  pointer-events: none;
}

/* ── Canvas maglia radio nell'hero ── */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}
.hero .container { z-index: 2; }
.hero::before { z-index: 1; }

/* Bagliore aurora animato dietro all'hero */
.hero-aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 25% 30%, rgba(201,168,76,0.10), transparent 70%),
    radial-gradient(closest-side at 78% 70%, rgba(59,130,246,0.08), transparent 70%),
    radial-gradient(closest-side at 60% 15%, rgba(201,168,76,0.06), transparent 70%);
  filter: blur(20px);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2%, -1.5%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 1.5%, 0) scale(1.02); }
}

/* ── Titolo hero: gradiente animato sull'accento ── */
.hero-content h1 .accent {
  background: linear-gradient(100deg, #C9A84C 0%, #f4dd8f 45%, #C9A84C 60%, #b8972f 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine {
  to { background-position: 220% center; }
}

/* ── Badge "live" pulsante nell'hero ── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 22px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(201,168,76,0.35);
  backdrop-filter: blur(6px);
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: livePulse 1.8s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal-left  { transform: translateX(-32px); }
.reveal-right { transform: translateX(32px); }
.reveal-zoom  { transform: scale(.94); }
.reveal-left.in, .reveal-right.in, .reveal-zoom.in { transform: none; }

/* Stagger automatico per griglie */
.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(1){transition-delay:.04s}
.stagger.in > *:nth-child(2){transition-delay:.09s}
.stagger.in > *:nth-child(3){transition-delay:.14s}
.stagger.in > *:nth-child(4){transition-delay:.19s}
.stagger.in > *:nth-child(5){transition-delay:.24s}
.stagger.in > *:nth-child(6){transition-delay:.29s}
.stagger.in > *:nth-child(7){transition-delay:.34s}
.stagger.in > *:nth-child(8){transition-delay:.39s}
.stagger.in > *:nth-child(n+9){transition-delay:.44s}

/* ── Bottoni: shimmer + ripple ── */
.btn { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: none;
}
.btn-primary:hover::after { animation: sheen 0.9s ease; }
@keyframes sheen { to { left: 140%; } }

.btn-primary:hover { box-shadow: 0 8px 26px rgba(201,168,76,0.35), 0 0 0 1px rgba(201,168,76,0.4); }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.35);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(3.2); opacity: 0; } }

/* ── Card: tilt + glow interattivo ── */
.corps-card, .feature-card, .pricing-card, .security-item {
  transform-style: preserve-3d;
  position: relative;
}
.feature-card::before, .corps-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(201,168,76,0.14), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.feature-card:hover::before, .corps-card:hover::before { opacity: 1; }

.feature-card:hover .feature-icon,
.corps-card:hover .corps-icon {
  transform: scale(1.08) translateZ(20px);
  box-shadow: 0 6px 18px rgba(201,168,76,0.28);
}
.feature-icon, .corps-icon { transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease; }

/* ── Contatori hero: pop al termine ── */
.stat-item .stat-value.counted { animation: countPop .5s cubic-bezier(.16,1,.3,1); }
@keyframes countPop { 0%{transform:scale(1)} 40%{transform:scale(1.18)} 100%{transform:scale(1)} }

/* ── Hero mockup: radar sweep sopra il mock ── */
.hero-mockup { transition: transform .4s cubic-bezier(.16,1,.3,1); }
.mockup-radar {
  position: absolute;
  right: 18px; bottom: 18px;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.35);
  background:
    repeating-radial-gradient(circle at center, rgba(201,168,76,0.12) 0 1px, transparent 1px 16px);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.mockup-radar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, rgba(201,168,76,0.55), transparent 25%);
  animation: sweep 3.2s linear infinite;
}
.mockup-radar::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px; margin: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
@keyframes sweep { to { transform: rotate(360deg); } }

/* Blip animati sul radar */
.mockup-radar .blip {
  position: absolute;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: blipFade 3.2s ease-in-out infinite;
}
@keyframes blipFade { 0%,100%{opacity:0} 40%{opacity:1} }

/* ── Navbar: sottolineatura animata + link attivo ── */
.navbar-links a { position: relative; }
.navbar-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.navbar-links a:hover::after,
.navbar-links a.active::after { transform: scaleX(1); }
.navbar-links a.active { color: var(--text-primary); }

/* ── Sezioni: linea divisoria luminosa ── */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 160px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

/* ── Overline con puntini animati ── */
.section-header .overline { position: relative; display: inline-block; }
.section-header .overline::before,
.section-header .overline::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.section-header .overline::before { right: 100%; margin-right: 12px; transform: scaleX(-1); }
.section-header .overline::after  { left: 100%; margin-left: 12px; }

/* ── Toggle audio flottante ── */
#audioToggle {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 1400;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--accent);
  background: rgba(17,24,39,0.85);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#audioToggle:hover { transform: scale(1.08); border-color: var(--accent); box-shadow: var(--shadow-glow); }
#audioToggle.muted { color: var(--text-muted); }
#audioToggle .eq {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 16px;
}
#audioToggle .eq span {
  width: 3px; background: currentColor; border-radius: 2px;
  animation: eqBar 0.9s ease-in-out infinite;
}
#audioToggle .eq span:nth-child(1){height:7px; animation-delay:0s}
#audioToggle .eq span:nth-child(2){height:14px; animation-delay:.15s}
#audioToggle .eq span:nth-child(3){height:9px; animation-delay:.3s}
#audioToggle .eq span:nth-child(4){height:12px; animation-delay:.45s}
@keyframes eqBar { 0%,100%{transform:scaleY(.4)} 50%{transform:scaleY(1)} }
#audioToggle.muted .eq span { animation-play-state: paused; transform: scaleY(.35); }

/* ── App download / CTA finale ── */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: 90px 0;
  text-align: center;
  background:
    linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.cta-band::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(201,168,76,0.12), transparent 60%);
  pointer-events: none;
}
.cta-band h2 { font-size: 2.2rem; margin-bottom: 14px; }
.cta-band p { color: var(--text-secondary); max-width: 560px; margin: 0 auto 28px; }
.store-badges { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: all .25s ease;
  color: var(--text-primary);
}
.store-badge:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); color: var(--text-primary); }
.store-badge .store-emoji { font-size: 1.6rem; }
.store-badge .store-txt small { display: block; font-size: .7rem; color: var(--text-muted); }
.store-badge .store-txt strong { font-size: 1rem; }

/* ── Micro-parallax "float" per il mockup ── */
@keyframes floatY { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.hero-visual .hero-mockup { animation: floatY 6s ease-in-out infinite; }

/* ── Cursore glow (solo desktop, puntatore fine) ── */
@media (hover: hover) and (pointer: fine) {
  #cursorGlow {
    position: fixed;
    top: 0; left: 0;
    width: 340px; height: 340px;
    margin: -170px 0 0 -170px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 900;
    background: radial-gradient(circle, rgba(201,168,76,0.08), transparent 60%);
    transition: opacity .3s ease;
    opacity: 0;
    will-change: transform;
  }
  body.cursor-on #cursorGlow { opacity: 1; }
}

/* ── Scrollbar landing più elegante non necessaria: già gestita ── */

/* ── Vignettatura + scanline cinematografica sull'hero ── */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 3px);
  mix-blend-mode: normal;
}

/* ── Reveal con leggero 3D ── */
.reveal { transform: translateY(30px) rotateX(6deg); transform-origin: center bottom; }
.reveal.in { transform: none; }

/* ── Bagliore emblema scudo ── */
.logo-icon.shield { transition: filter .3s ease, transform .3s ease; }
.navbar-brand:hover .logo-icon.shield { filter: brightness(1.15); transform: rotate(-4deg) scale(1.05); }

/* ── Blip radar (assicura visibilità nel device) ── */
.device .mockup-radar .blip { animation: blipFade 3.2s ease-in-out infinite; }

/* ── Responsività effetti ── */
@media (max-width: 768px) {
  #audioToggle { bottom: 16px; left: 16px; width: 42px; height: 42px; }
  .cta-band h2 { font-size: 1.6rem; }
  .hero-visual .hero-mockup { animation: none; }
}
