/* ==========================================================================
   ENDOTEC — ANIMATIONS.CSS
   Keyframes, classes de scroll reveal, hover states e microinterações.
   ========================================================================== */

/* ---------- 1. SCROLL REVEAL (controlado via animations.js + Intersection Observer) ---------- */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.9s cubic-bezier(0.25, 0.8, 0.25, 1),
              transform 0.9s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-up { transform: translateY(36px); }
.reveal-left { transform: translateX(-46px); }
.reveal-right { transform: translateX(46px); }

.reveal-up.in-view,
.reveal-left.in-view,
.reveal-right.in-view {
  opacity: 1;
  transform: translate(0, 0);
}

/* ---------- 2. KEYFRAMES ---------- */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scroll-dot {
  0% { opacity: 1; transform: translate(-50%, 0); }
  70% { opacity: 0; transform: translate(-50%, 16px); }
  100% { opacity: 0; transform: translate(-50%, 0); }
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 3. APLICAÇÃO DE FLUTUAÇÃO ---------- */
.floating-card {
  animation: float-y 6s ease-in-out infinite;
}

.card-cross { animation-delay: 0s; }
.card-pulse { animation-delay: 1.2s; }
.card-shield { animation-delay: 0.6s; }
.card-drop { animation-delay: 1.8s; }

.about-float-card {
  animation: float-y 7s ease-in-out infinite;
}

.float-card-b { animation-delay: 1.5s; }

/* ---------- 4. TILT 3D NOS CARDS (controlado via JS setando --rx/--ry) ---------- */
.tilt-card {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform 0.35s ease-out, box-shadow var(--transition-fast);
}

/* ---------- 5. LUZ ACOMPANHANDO O MOUSE ---------- */
.hero-glow {
  animation: fade-in 1.6s ease forwards;
}

/* ---------- 6. MENU MOBILE ---------- */
.nav-menu {
  transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. TESTEMUNHOS 3D (estados controlados via JS com classes) ---------- */
.testimonial-card {
  opacity: 0;
  pointer-events: none;
}

.testimonial-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) translateZ(0) rotateY(0deg) scale(1);
  z-index: 3;
}

.testimonial-card.is-prev {
  opacity: 0.5;
  transform: translateX(-60%) translateZ(-200px) rotateY(25deg) scale(0.85);
  z-index: 2;
}

.testimonial-card.is-next {
  opacity: 0.5;
  transform: translateX(60%) translateZ(-200px) rotateY(-25deg) scale(0.85);
  z-index: 2;
}

.testimonial-card.is-hidden {
  opacity: 0;
  transform: translateX(0) translateZ(-400px) scale(0.7);
  z-index: 1;
}

/* ---------- 7b. CURSOR — ESTADO ATIVO SOBRE ELEMENTOS INTERATIVOS ---------- */
.cursor-ring--active {
  width: 54px;
  height: 54px;
  border-color: rgba(19, 85, 134, 0.6);
  background: rgba(31, 123, 185, 0.08);
}

/* ---------- 8. REDUZIR MOVIMENTO (ACESSIBILIDADE) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
