/* === ANIMAZIONI BIBÓ === */

/* Scroll reveal — applicato via IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }

/* Reveal con scala (per immagini) */
.reveal-img {
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1200ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 1400ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-img.in {
  opacity: 1;
  transform: scale(1);
}

/* Reveal display: split per parole con stagger */
.reveal-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(80%);
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.reveal-words.in .word {
  opacity: 1;
  transform: translateY(0);
}
.reveal-words .word:nth-child(1) { transition-delay: 0ms; }
.reveal-words .word:nth-child(2) { transition-delay: 90ms; }
.reveal-words .word:nth-child(3) { transition-delay: 180ms; }
.reveal-words .word:nth-child(4) { transition-delay: 270ms; }
.reveal-words .word:nth-child(5) { transition-delay: 360ms; }

/* Hover lift */
.lift { transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 380ms ease; }
.lift:hover { transform: translateY(-6px); }

/* Cono hero floating */
@keyframes coneFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-18px) rotate(1deg); }
}
.cone-float { animation: coneFloat 7s ease-in-out infinite; }

/* Yellow stamp spin (uses .stamp-spin class for clarity) */
@keyframes stampSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.stamp-spin { animation: stampSpin 22s linear infinite; }

/* Pulsing dot */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}
.pulse-dot { animation: pulse 2.4s ease-in-out infinite; }

/* Drift dots in hero */
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(20px, -30px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-25px, 18px); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(15px, 25px); } }
.drift-1 { animation: drift1 9s ease-in-out infinite; }
.drift-2 { animation: drift2 11s ease-in-out infinite; }
.drift-3 { animation: drift3 8s ease-in-out infinite; }

/* Marquee speed override */
@keyframes mq2 { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track-fast { animation: mq2 28s linear infinite !important; }

/* Underline grow on hover */
.link-grow { position: relative; }
.link-grow::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.link-grow:hover::after { transform: scaleX(1); transform-origin: left; }

/* Flavor card subtle bounce on hover */
.flavor-cell { transition: background-color 320ms ease, color 320ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.flavor-cell:hover { z-index: 2; transform: scale(1.02); }
.flavor-cell .dot-mark { transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.flavor-cell:hover .dot-mark { transform: scale(2.2); }

/* Parallax helper - JS sets --p (-1 to 1) */
.parallax { transform: translateY(calc(var(--p, 0) * 60px)); transition: transform 60ms linear; }

/* Image zoom on hover */
.zoom-wrap { overflow: hidden; }
.zoom-wrap img { transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1); }
.zoom-wrap:hover img { transform: scale(1.08); }

/* Shine effect for buttons */
.shine { position: relative; overflow: hidden; isolation: isolate; }
.shine::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.shine:hover::before { transform: translateX(100%); }

/* Cursor blink for the today indicator */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.blink { animation: blink 1.4s ease-in-out infinite; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-img, .reveal-words .word { opacity: 1 !important; transform: none !important; }
  .cone-float, .stamp-spin, .drift-1, .drift-2, .drift-3, .pulse-dot { animation: none !important; }
}
