/* ============================================================
   ANIMATIONS.CSS — Keyframes, scroll-reveal, hover states
   Noctis Systems
   ============================================================ */

/* ── Keyframes ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px var(--glow); }
  50%       { box-shadow: 0 0 32px var(--glow-strong), 0 0 64px var(--glow); }
}

@keyframes lineScan {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes barFill {
  from { width: 0%; }
  to   { width: var(--fill); }
}

/* ── Hero entrada animada ── */
.hero__badge { animation: fadeUp 0.7s var(--ease-out) 0.1s both; }
.hero__title { animation: fadeUp 0.8s var(--ease-out) 0.2s both; }
.hero__lead  { animation: fadeUp 0.8s var(--ease-out) 0.35s both; }
.hero__form  { animation: fadeUp 0.8s var(--ease-out) 0.45s both; }
.hero__meta  { animation: fadeUp 0.7s var(--ease-out) 0.55s both; }
.hero__stats { animation: fadeUp 0.7s var(--ease-out) 0.65s both; }
.scroll-hint { animation: fadeUp 0.6s var(--ease-out) 0.9s both; }

/* Línea del scroll-hint */
.scroll-hint__line {
  animation: breathe 2.4s ease-in-out infinite;
}

/* ── Scroll-reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out),
              transform 0.65s var(--ease-out);
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger para grids */
.reveal-stagger .feature-card:nth-child(1),
.reveal-stagger .testimonio-card:nth-child(1),
.reveal-stagger .funcion-block:nth-child(1) { transition-delay: 0s; }

.reveal-stagger .feature-card:nth-child(2),
.reveal-stagger .testimonio-card:nth-child(2),
.reveal-stagger .funcion-block:nth-child(2) { transition-delay: 0.08s; }

.reveal-stagger .feature-card:nth-child(3),
.reveal-stagger .testimonio-card:nth-child(3),
.reveal-stagger .funcion-block:nth-child(3) { transition-delay: 0.16s; }

.reveal-stagger .feature-card:nth-child(4),
.reveal-stagger .funcion-block:nth-child(4) { transition-delay: 0.24s; }

.reveal-stagger .feature-card:nth-child(5),
.reveal-stagger .funcion-block:nth-child(5) { transition-delay: 0.32s; }

.reveal-stagger .feature-card:nth-child(6),
.reveal-stagger .funcion-block:nth-child(6) { transition-delay: 0.4s; }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}

.reveal-stagger.reveal--visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Nav logo mark glow ── */
.nav__logo-mark {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ── Feature card hover glow ── */
.feature-card:hover .feature-card__symbol {
  background: rgba(124,58,237,0.2);
  border-color: rgba(167,139,250,0.45);
  box-shadow: 0 0 12px rgba(124,58,237,0.3);
}

/* ── Scroll hint flicker ── */
.scroll-hint__dot {
  display: inline-block;
  animation: breathe 2s ease-in-out infinite;
}

/* ── CTA button scan effect ── */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: skewX(-15deg);
  transition: left 0s;
}

.btn-primary:hover::after {
  left: 160%;
  transition: left 0.6s var(--ease-out);
}

/* ── Panel operativo layers floating ── */
.panel-operativo__layer:nth-child(1) {
  animation: float 6s ease-in-out infinite;
}

.panel-operativo__layer:nth-child(2) {
  animation: float 5.2s ease-in-out 0.4s infinite;
}

.panel-operativo__layer:nth-child(3) {
  animation: float 4.8s ease-in-out 0.8s infinite;
}

/* ── Inbox status badge pulse ── */
.inbox-row__status--new {
  animation: breathe 2.5s ease-in-out infinite;
}

/* ── Bar fill animada ── */
.panel-layer__bar-fill {
  animation: barFill 2s var(--ease-out) 1s both;
  animation-fill-mode: both;
}

/* ── Pricing card featured glow ── */
.pricing-card--featured {
  animation: glowPulse 4s ease-in-out infinite;
}

/* ── Mockup message bubbles ── */
.mockup-msg { animation: fadeUp 0.5s var(--ease-out) both; }
.mockup-msg:nth-child(2) { animation-delay: 0.15s; }
.mockup-msg:nth-child(3) { animation-delay: 0.3s; }
.mockup-msg:nth-child(4) { animation-delay: 0.45s; }
.mockup-msg:nth-child(5) { animation-delay: 0.6s; }

/* ── Secciones con fondo semitransparente gradiente ── */
.section--dark {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(17,16,26,0.45) 20%,
    rgba(17,16,26,0.45) 80%,
    transparent 100%
  );
}

.section--darker {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(8,7,13,0.6) 15%,
    rgba(8,7,13,0.6) 85%,
    transparent 100%
  );
}

/* ── Hover en links del footer ── */
.footer__link {
  position: relative;
  display: inline-block;
}

.footer__link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--violet-light);
  transition: width var(--duration) var(--ease-out);
}

.footer__link:hover::after { width: 100%; }

/* ── Funcion block hover indicator ── */
.funcion-block {
  position: relative;
  overflow: hidden;
}

.funcion-block::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--violet), var(--violet-light));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--duration) var(--ease-out);
}

.funcion-block:hover::before { transform: scaleY(1); }

/* ── Toast slide animation ── */
#toast.toast--visible {
  animation: slideDown 0.45s var(--ease-out);
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@keyframes chatPulse {
  0% {
    transform: scale(0.88);
    opacity: 0.65;
  }
  70%, 100% {
    transform: scale(1.22);
    opacity: 0;
  }
}
