/* ═══════════════════════════════════════════════
   NOSATEC SAS – animations.css
   Animaciones de entrada (AOS manual), efectos,
   partículas decorativas, etc.
═══════════════════════════════════════════════ */

/* ─── AOS manual (data-aos) ─── */
[data-aos] {
  opacity: 0;
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-aos="fade-up"] {
  transform: translateY(40px);
}
[data-aos="fade-down"] {
  transform: translateY(-40px);
}
[data-aos="fade-right"] {
  transform: translateX(-40px);
}
[data-aos="fade-left"] {
  transform: translateX(40px);
}
[data-aos="zoom-in"] {
  transform: scale(0.88);
}

[data-aos].aos-animate {
  opacity: 1;
  transform: none;
}

/* ─── Noise texture overlay en hero ─── */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}

/* ─── Grid background sutil ─── */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  pointer-events: none;
  mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    black 30%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    black 30%,
    transparent 100%
  );
}

/* ─── Glow radial fondo hero ─── */
.hero-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

/* ─── Partículas flotantes decorativas ─── */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-20vh) rotate(720deg);
    opacity: 0;
  }
}

/* ─── Líneas decorativas en secciones ─── */
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent-cyan),
    transparent
  );
  opacity: 0.3;
}

/* ─── Carta hover shine ─── */
.tilt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    130deg,
    transparent 30%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.tilt-card:hover::after {
  opacity: 1;
}

/* ─── Loading bar en top ─── */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.loader-bar-wrap {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  background: var(--gradient-main);
  border-radius: 2px;
  animation: loaderProgress 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loaderProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ─── Scroll progress indicator ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-main);
  z-index: 1001;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* ─── Hero text splitting animation ─── */
.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px) rotateX(-40deg);
  animation: charReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes charReveal {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─── Glitch effect en logo (opcional, actívalo en hover) ─── */
.nav-logo:hover .logo-text {
  animation: glitch 0.3s ease;
}

@keyframes glitch {
  0% {
    text-shadow: none;
  }
  20% {
    text-shadow:
      -2px 0 var(--accent-cyan),
      2px 0 var(--accent-violet);
  }
  40% {
    text-shadow:
      2px 0 var(--accent-cyan),
      -2px 0 var(--accent-violet);
  }
  60% {
    text-shadow: -1px 0 var(--accent-cyan);
  }
  80% {
    text-shadow: 1px 0 var(--accent-violet);
  }
  100% {
    text-shadow: none;
  }
}

/* ─── Scan line en tarjetas featured ─── */
.service-card.featured::before {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    transparent
  );
  animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
  0% {
    top: -2px;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ─── Botón ripple ─── */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ─── WhatsApp pulse ring ─── */
.btn-whatsapp::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 2px solid rgba(37, 211, 102, 0.3);
  animation: waPulse 2.5s ease-in-out infinite;
}

@keyframes waPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.04);
  }
}
