/* ════════════════════════════════════════════════════════════════════
   DACOM — Sistema de animaciones global
   Carga después de Tailwind. Respeta prefers-reduced-motion.
   ════════════════════════════════════════════════════════════════════ */

/* ── Scroll reveal ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal-left  { transform: translateX(-48px); }
.reveal-right { transform: translateX(48px); }
.reveal-scale { transform: scale(0.92); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Entrada del hero (al cargar, sin esperar scroll) ───────────── */
.hero-fade {
  opacity: 0;
  animation: heroFade 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: var(--hero-delay, 0ms);
}
@keyframes heroFade {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: none; }
}

/* ── Haz láser de escaneo (temática metrología) ─────────────────── */
.scan-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 120px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 113, 227, 0.10) 35%,
    rgba(0, 198, 255, 0.40) 50%,
    rgba(0, 113, 227, 0.10) 65%,
    transparent
  );
  animation: scanSweep 7s linear infinite;
}
.scan-beam::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(0, 198, 255, 0.85);
  box-shadow: 0 0 18px 4px rgba(0, 170, 255, 0.55);
}
@keyframes scanSweep {
  0%   { transform: translateX(-25vw); }
  100% { transform: translateX(115vw); }
}

/* Variante acotada a un contenedor (imagen, tarjeta) */
.scan-beam-local {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -15%;
  width: 90px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 198, 255, 0.14) 35%,
    rgba(0, 198, 255, 0.48) 50%,
    rgba(0, 198, 255, 0.14) 65%,
    transparent
  );
  animation: scanLocal 4.5s ease-in-out infinite;
}
.scan-beam-local::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(0, 225, 255, 0.9);
  box-shadow: 0 0 16px 3px rgba(0, 200, 255, 0.6);
}
@keyframes scanLocal {
  0%   { left: -15%; }
  55%  { left: 105%; }
  100% { left: -15%; }
}

/* ── Rejilla técnica de fondo ───────────────────────────────────── */
.metro-grid {
  background-image:
    linear-gradient(rgba(0, 113, 227, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 113, 227, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
}

/* ── Blobs flotantes de gradiente ───────────────────────────────── */
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  pointer-events: none;
  animation: blobFloat 16s ease-in-out infinite alternate;
}
.blob-2 { animation-duration: 21s; animation-delay: -7s; }
@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, -45px) scale(1.18); }
}

/* ── Punto pulsante (badge "en vivo") ───────────────────────────── */
.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #0071e3;
  flex: none;
}
.pulse-dot::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: rgba(0, 113, 227, 0.45);
  animation: pulseDot 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes pulseDot {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ── CTA con resplandor ─────────────────────────────────────────── */
.cta-glow {
  animation: ctaPulse 2.8s ease-out infinite;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.cta-glow:hover { transform: translateY(-3px) scale(1.03); }
@keyframes ctaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.45); }
  70%  { box-shadow: 0 0 0 16px rgba(0, 113, 227, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}

/* ── Tarjetas: elevación y zoom de imagen al hover ──────────────── */
.glass-panel {
  transition:
    transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.45s;
}
.glass-panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 113, 227, 0.14);
  border-color: rgba(0, 113, 227, 0.35);
}
article.glass-panel img {
  transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
article.glass-panel:hover img { transform: scale(1.06); }

/* ── Marquee de partners ────────────────────────────────────────── */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 5rem;
  width: max-content;
  animation: marqueeScroll 24s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  to { transform: translateX(-50%); }
}

/* ── Números de estadísticas ────────────────────────────────────── */
.stat-number {
  background: linear-gradient(135deg, #0071e3, #00c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ── Chips de iconos en beneficios ──────────────────────────────── */
.benefit-icon {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.45s;
}
.glass-panel:hover .benefit-icon {
  transform: scale(1.12) rotate(-6deg);
}

/* ── Header con sombra al hacer scroll ──────────────────────────── */
header {
  transition: box-shadow 0.4s ease;
}
header.header-scrolled {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.10);
}

/* ── Indicador de scroll del hero ───────────────────────────────── */
.scroll-hint {
  animation: scrollHint 2.2s ease-in-out infinite;
}
@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(10px); opacity: 1; }
}

/* ── Accesibilidad: movimiento reducido ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-fade {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .scan-beam,
  .scan-beam-local,
  .blob,
  .pulse-dot::before,
  .cta-glow,
  .marquee-track,
  .scroll-hint {
    animation: none !important;
  }
}
