/* ==========================================================================
   animations.css — Biblioteca de keyframes nomeadas
   Reveal: animações disparam quando slide.is-active aparece (via reveal.js)
   ========================================================================== */

/* --- Blob float (3 variações pra paralelizar) --- */
@keyframes blob-float-a {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px,40px) scale(0.94); }
}
@keyframes blob-float-b {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-50px,30px) scale(1.12); }
}
@keyframes blob-float-c {
  0%, 100% { transform: translate(0,0) rotate(0deg) scale(1); }
  50% { transform: translate(20px,-50px) rotate(8deg) scale(0.92); }
}

/* --- Pulse padrão --- */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* --- Pulse glow (luminosidade ao redor) --- */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,94,62,0); }
  50% { box-shadow: 0 0 0 18px rgba(226,94,62,0); }
  0% { box-shadow: 0 0 0 0 rgba(226,94,62,0.45); }
}

/* --- Marquee horizontal infinito --- */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes marquee-scroll-rev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* --- Ember pulse (chamas) --- */
@keyframes ember-pulse {
  0%, 100% { filter: brightness(1); transform: scaleY(1); }
  50% { filter: brightness(1.35); transform: scaleY(1.18); }
}
@keyframes flame-flicker {
  0% { transform: translateY(-50%) scale(1) rotate(-4deg); }
  100% { transform: translateY(-50%) scale(1.18) rotate(4deg); }
}

/* --- Spinner / coin --- */
@keyframes garantia-spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
@keyframes coin-flip {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(720deg); }
}

/* --- Reveals direcionais (slide entra) --- */
@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-down {
  from { opacity: 0; transform: translateY(-60px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-80px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes zoom-blur {
  from { opacity: 0; transform: scale(1.4); filter: blur(20px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* --- Letter / linha stagger reveal --- */
@keyframes letter-rise {
  from { opacity: 0; transform: translateY(40%) rotateX(-60deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* --- Stamp slam (carimbo cai e vibra · termina opacity 1 sempre) --- */
@keyframes stamp-slam {
  0% { opacity: 0; transform: rotate(-12deg) scale(2.5); filter: blur(10px); }
  55% { opacity: 1; transform: rotate(-15deg) scale(0.92); filter: blur(0); }
  70% { opacity: 1; transform: rotate(-10deg) scale(1.04); }
  85% { opacity: 1; transform: rotate(-13deg) scale(0.98); }
  100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}

/* --- Glitch flash --- */
@keyframes glitch-flash {
  0%, 100% { transform: translate(0,0); filter: none; }
  20% { transform: translate(-3px,2px); filter: hue-rotate(20deg); }
  40% { transform: translate(2px,-2px); filter: hue-rotate(-20deg); }
  60% { transform: translate(-1px,1px); filter: none; }
  80% { transform: translate(1px,-1px); filter: hue-rotate(10deg); }
}

/* --- Terminal typing --- */
@keyframes type-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes type-stream {
  from { width: 0; }
  to { width: 100%; }
}

/* --- Numeric roulette (digit roll) --- */
@keyframes digit-roll {
  from { transform: translateY(0); }
  to { transform: translateY(-90%); }
}

/* --- Shake atenção --- */
@keyframes shake-attention {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-3px,1px) rotate(-0.5deg); }
  20% { transform: translate(3px,-1px) rotate(0.5deg); }
  30% { transform: translate(-2px,1px); }
  40% { transform: translate(2px,-2px); }
  50% { transform: translate(-1px,2px); }
  60% { transform: translate(1px,-1px); }
}

/* --- Price drop impact (preço cai em câmera lenta + vibrate) --- */
@keyframes price-drop-impact {
  0% { opacity: 0; transform: scale(3) translateY(-40%); filter: blur(20px); }
  60% { opacity: 1; transform: scale(0.94) translateY(0); filter: blur(0); }
  72% { transform: scale(1.04); }
  84% { transform: scale(0.99); }
  100% { transform: scale(1); }
}

/* --- Mask wipe (revela em diagonal) --- */
@keyframes mask-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes mask-wipe-diag {
  from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* --- Confetti burst (radial dots) --- */
@keyframes confetti-pop {
  0% { opacity: 1; transform: translate(0,0) rotate(0) scale(0); }
  20% { opacity: 1; transform: translate(0,0) scale(1.2); }
  100% {
    opacity: 0;
    transform: translate(var(--tx, 100px), var(--ty, -100px)) rotate(360deg) scale(0.6);
  }
}

/* --- Chat flood (mensagens entram em onda) --- */
@keyframes chat-bubble-in {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Gradient shift --- */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Tracker fill (barra preenche) --- */
@keyframes tracker-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* --- Card flip 3D --- */
@keyframes card-flip-y {
  from { transform: rotateY(-90deg); opacity: 0; }
  to { transform: rotateY(0); opacity: 1; }
}

/* --- Paper rip (rasga papel) --- */
@keyframes paper-rip {
  0% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  100% {
    clip-path: polygon(
      0 0, 100% 0, 100% 49%, 92% 51%, 86% 49%, 78% 52%, 70% 48%, 62% 51%,
      54% 49%, 46% 51%, 38% 49%, 30% 52%, 22% 48%, 14% 51%, 8% 49%, 0 51%,
      0 100%, 0 100%
    );
  }
}

/* --- Marquee text slam (texto em linha bate de lado) --- */
@keyframes marquee-slam-in {
  0% { transform: translateX(-100vw) skewX(-12deg); opacity: 0; }
  60% { transform: translateX(8px) skewX(4deg); opacity: 1; }
  100% { transform: translateX(0) skewX(0); opacity: 1; }
}

/* --- Mosaic reveal (tiles aparecem em grid) --- */
@keyframes mosaic-tile-in {
  from { opacity: 0; transform: scale(0.4) rotate(20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* --- Kaleidoscope rotate --- */
@keyframes kaleidoscope-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Ticker feed (item desliza pra dentro) --- */
@keyframes ticker-feed-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Helper utilitário: aplicado quando slide.is-active --- */
.slide.is-active [data-anim],
.slide.is-active [data-stagger] > * {
  animation-duration: var(--duration-reveal);
  animation-timing-function: var(--ease-out-quint);
  animation-fill-mode: both;
}

.slide [data-anim] { opacity: 0; }
.slide.is-active [data-anim="slide-up"]   { animation-name: slide-in-up; }
.slide.is-active [data-anim="slide-down"] { animation-name: slide-in-down; }
.slide.is-active [data-anim="slide-left"] { animation-name: slide-in-left; }
.slide.is-active [data-anim="slide-right"]{ animation-name: slide-in-right; }
.slide.is-active [data-anim="zoom"]       { animation-name: zoom-in; }
.slide.is-active [data-anim="zoom-blur"]  { animation-name: zoom-blur; animation-duration: 900ms; }
.slide.is-active [data-anim="stamp"]      { animation-name: stamp-slam; animation-duration: 900ms; }
.slide.is-active [data-anim="glitch"]     { animation-name: glitch-flash; animation-duration: 700ms; animation-iteration-count: 1; }
.slide.is-active [data-anim="price-drop"] { animation-name: price-drop-impact; animation-duration: 1100ms; }
.slide.is-active [data-anim="mask"]       { animation-name: mask-wipe; animation-duration: 800ms; }
.slide.is-active [data-anim="mask-diag"]  { animation-name: mask-wipe-diag; animation-duration: 900ms; }
.slide.is-active [data-anim="card-flip"]  { animation-name: card-flip-y; animation-duration: 750ms; }
.slide.is-active [data-anim="marquee-slam"]{animation-name: marquee-slam-in; animation-duration: 800ms; }
.slide.is-active [data-anim="paper-rip"]  { animation-name: paper-rip; animation-duration: 900ms; }

/* Stagger: filhos diretos com delay incremental */
.slide [data-stagger] > * { opacity: 0; animation-name: slide-in-up; }
.slide.is-active [data-stagger] > *:nth-child(1) { animation-delay: 0.05s; }
.slide.is-active [data-stagger] > *:nth-child(2) { animation-delay: 0.18s; }
.slide.is-active [data-stagger] > *:nth-child(3) { animation-delay: 0.30s; }
.slide.is-active [data-stagger] > *:nth-child(4) { animation-delay: 0.42s; }
.slide.is-active [data-stagger] > *:nth-child(5) { animation-delay: 0.54s; }
.slide.is-active [data-stagger] > *:nth-child(6) { animation-delay: 0.66s; }
.slide.is-active [data-stagger] > *:nth-child(7) { animation-delay: 0.78s; }
.slide.is-active [data-stagger] > *:nth-child(8) { animation-delay: 0.90s; }
.slide.is-active [data-stagger] > *:nth-child(9) { animation-delay: 1.02s; }
.slide.is-active [data-stagger] > *:nth-child(10){ animation-delay: 1.14s; }

/* Stagger letter-by-letter (cada span vira letra) */
.slide [data-stagger-letters] > span { display: inline-block; opacity: 0; }
.slide.is-active [data-stagger-letters] > span { animation: letter-rise 0.6s var(--ease-out-quint) both; }

/* Linhas reveal-line (cada linha do hero) */
.slide .reveal-line {
  display: block;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.7s var(--ease-out-quint), transform 0.7s var(--ease-out-quint);
}
.slide.is-active .reveal-line { opacity: 1; transform: translateY(0); }
.slide.is-active .reveal-line:nth-child(1) { transition-delay: 0.1s; }
.slide.is-active .reveal-line:nth-child(2) { transition-delay: 0.3s; }
.slide.is-active .reveal-line:nth-child(3) { transition-delay: 0.5s; }
.slide.is-active .reveal-line:nth-child(4) { transition-delay: 0.7s; }
.slide.is-active .reveal-line:nth-child(5) { transition-delay: 0.9s; }

/* --- RGB split (glitch chromático) --- */
@keyframes rgb-split {
  0%, 100% { text-shadow: none; transform: translate(0,0); }
  20% { text-shadow: -3px 0 var(--color-mac-red), 3px 0 var(--color-terminal-blue); transform: translate(-1px,0); }
  40% { text-shadow: 3px 0 var(--color-mac-red), -3px 0 var(--color-terminal-blue); transform: translate(1px,0); }
  60% { text-shadow: none; transform: translate(0,0); }
}

/* --- Vibrate text (alerta suave · pulse de atenção) --- */
@keyframes vibrate {
  0%, 100% { transform: translate(0,0); opacity: 1; }
  50% { transform: translate(0, -2px); opacity: 0.78; }
}
/* alias suave: pulse-soft pra usar em vez de vibrate em textos longos */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* --- Neon pulse (luz pulsa) --- */
@keyframes neon-pulse {
  0%, 100% {
    text-shadow:
      0 0 8px rgba(226,94,62,0.8),
      0 0 24px rgba(226,94,62,0.55),
      0 0 60px rgba(226,94,62,0.3);
  }
  50% {
    text-shadow:
      0 0 14px rgba(226,94,62,1),
      0 0 40px rgba(226,94,62,0.7),
      0 0 90px rgba(226,94,62,0.4);
  }
}

/* --- Scanline (linha CRT que desce) --- */
@keyframes scanline-pass {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* --- Slam impact (cai como martelo · termina opacity 1) --- */
@keyframes slam-impact {
  0% { transform: scale(4) translateY(-200px); opacity: 0; filter: blur(20px); }
  60% { transform: scale(0.94) translateY(0); opacity: 1; filter: blur(0); }
  70% { transform: scale(1.06) translateY(0); opacity: 1; }
  80% { transform: scale(0.98) translateY(8px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- Diagonal tear (rasgo na diagonal) --- */
@keyframes diagonal-tear-in {
  from { clip-path: polygon(0 100%, 0 100%, 0 100%, 0 100%); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* --- Bg gradient sweep (varre o fundo) --- */
@keyframes bg-sweep {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* --- Spotlight (lanterna passa) --- */
@keyframes spotlight-sweep {
  0% { transform: translateX(-100%) skewX(-25deg); }
  100% { transform: translateX(300%) skewX(-25deg); }
}

/* --- Number ticker (números sobem rolagem) --- */
@keyframes ticker-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-90%); }
}

/* --- Stretch H1 (estica letra horizontal) --- */
@keyframes h-stretch {
  0% { transform: scaleX(0.4); opacity: 0; }
  60% { transform: scaleX(1.04); opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}

/* --- Aplicação via data-anim --- */
.slide.is-active [data-anim="rgb-split"]   { animation: rgb-split 700ms steps(4) 1; opacity: 1; }
.slide.is-active [data-anim="vibrate"]     { animation: vibrate 1.8s ease-in-out infinite; opacity: 1; }
.slide.is-active [data-anim="pulse-soft"]  { animation: pulse-soft 2.4s ease-in-out infinite; opacity: 1; }
.slide.is-active [data-anim="neon-pulse"]  { animation: neon-pulse 2.4s ease-in-out infinite; opacity: 1; }
.slide.is-active [data-anim="slam"]        { animation: slam-impact 1100ms var(--ease-out-quint) both; opacity: 1; }
.slide.is-active [data-anim="tear"]        { animation: diagonal-tear-in 900ms var(--ease-out-quint) both; opacity: 1; }
.slide.is-active [data-anim="h-stretch"]   { animation: h-stretch 800ms var(--ease-out-quint) both; opacity: 1; }

/* Scanline overlay (precisa de wrapper .scanline) */
.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.scanline::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 24%;
  background: linear-gradient(180deg, transparent 0%, rgba(226,94,62,0.18) 50%, transparent 100%);
  animation: scanline-pass 4s linear infinite;
}
.scanline--fast::before { animation-duration: 1.8s; height: 14%; }

/* Sweep gradient hover-like infinito (usar em fundos de slide-pitch) */
.bg-sweep {
  background: linear-gradient(110deg, rgba(226,94,62,0) 30%, rgba(226,94,62,0.18) 50%, rgba(226,94,62,0) 70%);
  background-size: 200% 100%;
  animation: bg-sweep 8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
