/* ============================================================
   AGENZIA VERDEROSA — Animations.css
   Animazioni, transizioni, keyframes, effetti on-scroll
   ============================================================ */

/* ── KEYFRAMES ── */

/* Particelle hero */
@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-120vh) rotate(360deg); opacity: 0; }
}

/* Scroll indicator ruota */
@keyframes scrollWheel {
  0%   { transform: translateY(0);   opacity: 1; }
  60%  { transform: translateY(14px); opacity: 0; }
  61%  { transform: translateY(0);   opacity: 0; }
  100% { opacity: 1; }
}

/* Pulse marker mappa */
@keyframes markerPulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  50%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1);   opacity: 0; }
}

/* Pulse WhatsApp flottante */
@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 4px 40px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.12); }
}

/* Loader logo fade-in */
@keyframes loaderLogoIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Hero eyebrow */
@keyframes eyebrowIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Cursor pulse on hover */
@keyframes cursorPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -50%) scale(1.3); }
}

/* Card hover glow */
@keyframes cardGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(201,168,76,0.15); }
  50%       { box-shadow: 0 0 40px rgba(201,168,76,0.35); }
}

/* Text shimmer (per section eyebrows) */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Fade in up base */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide in from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Scale in */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

/* Word reveal (clip) */
@keyframes wordReveal {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-8px); }
  to   { clip-path: inset(0 0% 0 0);   transform: translateX(0); }
}

/* ── LOADER ANIMAZIONI ── */
.loader-logo {
  animation: loaderLogoIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── HERO WORD REVEAL ── */
.hero-word {
  opacity: 0;
  animation: fadeInUp 0.9s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
.hero-word:nth-child(1) { animation-delay: 0.2s; }
.hero-word:nth-child(2) { animation-delay: 0.4s; }
.hero-word:nth-child(3) { animation-delay: 0.6s; }
.hero-word:nth-child(4) { animation-delay: 0.8s; }

.hero-eyebrow { animation: eyebrowIn 0.7s ease 0.1s forwards; }
.hero-subtitle.reveal-fade { animation: fadeInUp 0.7s ease 1s forwards; }
.hero-cta.reveal-fade      { animation: fadeInUp 0.7s ease 1.2s forwards; }

/* ── REVEAL ON SCROLL ── */
/* Applicati da JS tramite IntersectionObserver / GSAP */
.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.34, 1.0, 0.64, 1),
              transform 0.7s cubic-bezier(0.34, 1.0, 0.64, 1);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-48px);
  transition: opacity 0.7s cubic-bezier(0.34, 1.0, 0.64, 1),
              transform 0.7s cubic-bezier(0.34, 1.0, 0.64, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(48px);
  transition: opacity 0.7s cubic-bezier(0.34, 1.0, 0.64, 1),
              transform 0.7s cubic-bezier(0.34, 1.0, 0.64, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger delay per elementi figli consecutivi */
.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-up:nth-child(3) { transition-delay: 0.2s; }
.reveal-up:nth-child(4) { transition-delay: 0.3s; }
.reveal-up:nth-child(5) { transition-delay: 0.4s; }

/* Team cards stagger */
.team-card:nth-child(1) { transition-delay: 0s; }
.team-card:nth-child(2) { transition-delay: 0.15s; }

/* Brand cards stagger */
.brand-card { transition-delay: 0s; }
.brand-card:nth-child(1)  { transition-delay: 0.00s; }
.brand-card:nth-child(2)  { transition-delay: 0.08s; }
.brand-card:nth-child(3)  { transition-delay: 0.16s; }
.brand-card:nth-child(4)  { transition-delay: 0.24s; }
.brand-card:nth-child(5)  { transition-delay: 0.32s; }
.brand-card:nth-child(6)  { transition-delay: 0.40s; }
.brand-card:nth-child(7)  { transition-delay: 0.48s; }
.brand-card:nth-child(8)  { transition-delay: 0.56s; }
.brand-card:nth-child(9)  { transition-delay: 0.64s; }

/* Servizi cards stagger */
.servizio-card { transition-delay: 0s; }
.servizio-card:nth-child(1) { transition-delay: 0.00s; }
.servizio-card:nth-child(2) { transition-delay: 0.08s; }
.servizio-card:nth-child(3) { transition-delay: 0.16s; }
.servizio-card:nth-child(4) { transition-delay: 0.24s; }
.servizio-card:nth-child(5) { transition-delay: 0.32s; }
.servizio-card:nth-child(6) { transition-delay: 0.40s; }
.servizio-card:nth-child(7) { transition-delay: 0.48s; }
.servizio-card:nth-child(8) { transition-delay: 0.56s; }

/* Province list stagger */
.province-item:nth-child(1) { transition-delay: 0.0s; }
.province-item:nth-child(2) { transition-delay: 0.1s; }
.province-item:nth-child(3) { transition-delay: 0.2s; }
.province-item:nth-child(4) { transition-delay: 0.3s; }
.province-item:nth-child(5) { transition-delay: 0.4s; }

/* ── BRAND CARD HOVER ── */
.brand-card {
  transform-style: preserve-3d;
}
.brand-card:hover {
  animation: cardGlow 2s ease infinite;
}

/* Bordo glow sulla card al hover */
.brand-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, rgba(201,168,76,0.5), transparent, rgba(201,168,76,0.2));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.brand-card:hover::after { opacity: 1; }

/* ── WHATSAPP PULSE ── */
.whatsapp-float {
  animation: waPulse 2.5s ease infinite;
}

/* ── MAPPA: Province hover ── */
.prov {
  transition: fill 0.25s ease, filter 0.25s ease;
}
.marker-group:hover .marker-dot,
.marker-group:focus .marker-dot {
  filter: url(#glow) brightness(1.3);
}
.prov-label {
  transition: fill 0.25s ease;
}
.prov:hover + .prov-label,
.marker-group:hover ~ text {
  fill: rgba(255,255,255,0.9);
}

/* ── NAVBAR TRANSITION ── */
#navbar {
  transform: translateY(0);
  transition: transform 0.4s ease, background 0.4s ease,
              backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}
#navbar.hidden { transform: translateY(-100%); }

/* ── SECTION EYEBROW SHIMMER ── */
.section-eyebrow {
  background: linear-gradient(
    90deg,
    var(--green-mid) 0%,
    var(--gold) 50%,
    var(--green-mid) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
  display: inline-block;
}
.section-eyebrow--light {
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    var(--gold-light) 50%,
    var(--gold) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── STORIA IMAGE PARALLAX ── */
.storia-image-frame {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ── HERO PARALLAX ── */
.hero-bg-gradient {
  will-change: transform;
}

/* ── FILTER BUTTON TRANSITION ── */
.filter-btn {
  position: relative;
  overflow: hidden;
}
.filter-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: -1;
}

/* ── PREFERS REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-word,
  .hero-eyebrow,
  .hero-subtitle.reveal-fade,
  .hero-cta.reveal-fade {
    opacity: 1;
    animation: none;
    transform: none;
  }
  .reveal-up,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .whatsapp-float { animation: none; }
  .marker-pulse  { animation: none; opacity: 0.4; }
  .section-eyebrow,
  .section-eyebrow--light {
    animation: none;
  }
}
