/* animations.css — Pablo / t4skor — verde #4ADE80 sobre #0B0F14
   Funciona sobre el HTML existente sin editarlo. Respetuoso con
   prefers-reduced-motion. Cargar con <link rel="stylesheet" href="assets/animations.css"> */

/* ============ Keyframes ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes blink-caret {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  50%      { box-shadow: 0 0 24px 4px rgba(74, 222, 128, 0.35); }
}
@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes hero-gradient {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* ============ Reveal (lo añade animations.js automáticamente) ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger: el JS fija --d por índice (0ms, 90ms, 180ms…) */
.reveal-stagger { transition-delay: var(--d, 0ms); }

/* Sin JS: si el observer no corre, nada queda oculto para siempre.
   El JS solo añade .reveal justo antes de observar, así que con JS
   desactivado no hay .reveal y todo se ve normal. */

/* ============ Hero: fondo con gradiente animado sutil ============ */
section[data-block-type="hero"] {
  background-image:
    radial-gradient(600px 220px at 15% 0%, rgba(74, 222, 128, 0.08), transparent 70%),
    radial-gradient(500px 240px at 85% 20%, rgba(74, 222, 128, 0.05), transparent 70%);
  background-size: 200% 200%;
  animation: hero-gradient 18s ease-in-out infinite;
}
/* Entrada del titular del hero */
section[data-block-type="hero"] h1 {
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
section[data-block-type="hero"] p {
  animation: fadeIn 1s ease 0.25s both;
}

/* ============ Terminal caret (prompt "t4skor@arch:~$ …") ============ */
.terminal-caret::after {
  content: "▊";
  display: inline-block;
  margin-left: 2px;
  color: #4ADE80;
  animation: blink-caret 1.06s steps(1) infinite;
  vertical-align: baseline;
}

/* ============ Botones primarios: glow + lift ============ */
/* Botón primario = <a> con fondo verde inline; secundario = transparente */
section[data-block-type="hero"] a[style*="background:var(--color-primary)"],
div[data-block-type="button"] a[style*="background:var(--color-primary)"],
a[style*="background:var(--color-primary)"] {
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}
section[data-block-type="hero"] a[style*="background:var(--color-primary)"]:hover,
div[data-block-type="button"] a[style*="background:var(--color-primary)"]:hover,
a[style*="background:var(--color-primary)"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  animation: glow-pulse 1.8s ease-in-out infinite;
}
section[data-block-type="hero"] a[style*="background:transparent"]:hover,
a[style*="background:transparent"]:hover {
  transform: translateY(-2px);
}
.btn-glow:hover {
  transform: translateY(-2px);
  animation: glow-pulse 1.8s ease-in-out infinite;
}

/* ============ Cards "lo que hago": hover lift ============ */
[data-block-type="features"] li,
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
[data-block-type="features"] li:hover,
.card-hover:hover {
  transform: translateY(-6px);
  border-color: rgba(74, 222, 128, 0.55) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(74, 222, 128, 0.25);
}
/* Iconos lucide: float sutil + acento al hover de la card */
[data-block-type="features"] li svg {
  animation: float-soft 5s ease-in-out infinite;
  transition: transform 0.25s ease, filter 0.25s ease;
}
[data-block-type="features"] li:nth-child(2n) svg { animation-delay: 0.8s; }
[data-block-type="features"] li:nth-child(3n) svg { animation-delay: 1.6s; }
[data-block-type="features"] li:hover svg {
  transform: scale(1.12) rotate(-4deg);
  filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.6));
}

/* ============ FAQ details: hover + apertura suave ============ */
[data-block-type="faq"] details {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
[data-block-type="faq"] details:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 222, 128, 0.5) !important;
}
[data-block-type="faq"] details[open] {
  border-color: rgba(74, 222, 128, 0.5) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
[data-block-type="faq"] summary { transition: color 0.2s ease; }
[data-block-type="faq"] details[open] summary { color: #4ADE80; }
/* Contenido animado por WAAPI desde JS; fallback CSS */
[data-block-type="faq"] details[open] > *:not(summary) {
  animation: fadeIn 0.3s ease both;
}

/* ============ Imágenes / figures: zoom suave ============ */
figure[data-block-type="image"] {
  overflow: hidden;
  border-radius: 12px;
}
figure[data-block-type="image"] img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}
figure[data-block-type="image"]:hover img {
  transform: scale(1.03);
  filter: drop-shadow(0 0 24px rgba(74, 222, 128, 0.15));
}

/* ============ Footer: links con subrayado animado ============ */
footer[data-block-type="footer"] a {
  position: relative;
  transition: color 0.2s ease;
}
footer[data-block-type="footer"] a:hover { color: #4ADE80 !important; }

/* ============ Progress bar fina (la crea animations.js) ============ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #4ADE80, #22c55e);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
  z-index: 9999;
  pointer-events: none;
}

/* ============ Reduced motion: desactivar TODO ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  section[data-block-type="hero"],
  section[data-block-type="hero"] h1,
  section[data-block-type="hero"] p,
  [data-block-type="features"] li svg,
  .terminal-caret::after {
    animation: none !important;
  }
  #scroll-progress { display: none !important; }
}
