/* Foqus — agent swarm hero rebuild
   Mientras html.swarm-on está activo, los bloques del hero esperan a que
   el enjambre los "construya". swarm.js marca cada bloque con
   [data-swarm-done] cuando termina. */

html.swarm-on .hero .hero-meta-block:not([data-swarm-done]),
html.swarm-on .hero h1:not([data-swarm-done]),
html.swarm-on .hero .lede:not([data-swarm-done]),
html.swarm-on .hero .hero-actions:not([data-swarm-done]) {
  opacity: 0 !important;
  filter: blur(8px);
}

/* clip-path (no transform) para no alterar la medida del bloque */
html.swarm-on .hero .hero-rule:not([data-swarm-done]) {
  clip-path: inset(0 100% 0 0);
}

html.swarm-on .hero .hero-meta-block,
html.swarm-on .hero h1,
html.swarm-on .hero .lede,
html.swarm-on .hero .hero-actions {
  transition:
    opacity 700ms cubic-bezier(.2, .7, .2, 1),
    transform 800ms cubic-bezier(.2, .7, .2, 1),
    filter 600ms cubic-bezier(.2, .7, .2, 1) !important;
  transition-delay: 0ms !important;
}

html.swarm-on .hero .hero-rule {
  clip-path: inset(0 0 0 0);
  transition: clip-path 900ms cubic-bezier(.65, 0, .35, 1);
}

/* Resto de la página: cada bloque .reveal espera a su mini equipo de agentes */
html.swarm-on section:not(.hero) .reveal:not([data-swarm-done]) {
  opacity: 0 !important;
  filter: blur(6px);
}

html.swarm-on section:not(.hero) .reveal {
  transition:
    opacity 700ms cubic-bezier(.2, .7, .2, 1),
    transform 800ms cubic-bezier(.2, .7, .2, 1),
    filter 600ms cubic-bezier(.2, .7, .2, 1) !important;
  transition-delay: 0ms !important;
}

/* Footer: mismo armado que los bloques de la página */
html.swarm-on .foot .foot-big:not([data-swarm-done]),
html.swarm-on .foot .foot-col:not([data-swarm-done]),
html.swarm-on .foot .foot-bot:not([data-swarm-done]) {
  opacity: 0;
  filter: blur(6px);
}

html.swarm-on .foot .foot-big,
html.swarm-on .foot .foot-col,
html.swarm-on .foot .foot-bot {
  transition: opacity 700ms cubic-bezier(.2, .7, .2, 1), filter 600ms cubic-bezier(.2, .7, .2, 1);
}

/* Botón de WhatsApp: aparece cuando lo terminan los agentes, con un pop chico */
html.swarm-on .wa-fab:not([data-swarm-done]) {
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
}

html.swarm-on .wa-fab[data-swarm-done] {
  animation: swarm-pop 520ms cubic-bezier(.2, .9, .3, 1.35);
}

@keyframes swarm-pop {
  from { opacity: 0; filter: blur(6px); transform: scale(.82); }
  to   { opacity: 1; filter: blur(0); transform: scale(1); }
}

.swarm-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 40; /* debajo del nav (50) */
}

@media (prefers-reduced-motion: reduce) {
  .swarm-canvas { display: none; }
}
