/* ==========================================================================
   Biting Consulting — piezas comunes de las páginas con animación al hacer
   scroll (inicio y ERP). Va después de styles.css y antes del CSS de cada
   página. Todo lo animado cuelga de <html class="motion">, que pone
   js/motion.js; sin esa clase, las páginas se ven en orden y sin escenas.
   ========================================================================== */

:root {
  --out: cubic-bezier(.16, 1, .3, 1);
  --pin-top: calc(var(--header-h) + 2px);
  --pin-h: calc(100vh - var(--pin-top));
}
@supports (height: 100svh) {
  :root { --pin-h: calc(100svh - var(--pin-top)); }
}

/* Cada escena es alta y su contenido (.pin) se queda fijo mientras se recorre */
.motion [data-scene] { position: relative; }
.motion .pin {
  position: sticky;
  top: var(--pin-top);
  height: var(--pin-h);
  overflow: hidden;
  /* clip: ni un ancla ni el foco pueden desplazar por dentro la escena fija */
  overflow: clip;
}

/* Aparición suave de bloques sueltos */
.motion .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s var(--out), transform 1.1s var(--out);
}
.motion .reveal.is-visible { opacity: 1; transform: none; }
.motion .actions.reveal { transition-delay: .12s; }

/* Formas orgánicas de fondo: cambian de forma solas y JS las mueve con el scroll */
.blobs { display: none; }
.motion .blobs { display: block; position: absolute; inset: 0; pointer-events: none; }
.motion .blobs__pin { position: sticky; top: var(--pin-top); height: var(--pin-h); overflow: hidden; }
.blob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34vmax;
  height: 34vmax;
  margin: -17vmax 0 0 -17vmax;
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: bc-morph 14s ease-in-out infinite alternate;
  will-change: transform, border-radius;
}
.blob--1 { background: var(--tint-2); }
.blob--2 { background: rgba(146, 185, 220, .45); width: 26vmax; height: 26vmax; margin: -13vmax 0 0 -13vmax; animation-duration: 11s; animation-delay: -3s; }
.blob--3 { background: rgba(7, 82, 163, .14); width: 30vmax; height: 30vmax; margin: -15vmax 0 0 -15vmax; animation-duration: 17s; animation-delay: -6s; }
.blob--4 { background: var(--tint); width: 22vmax; height: 22vmax; margin: -11vmax 0 0 -11vmax; animation-duration: 13s; animation-delay: -2s; }
.blob--5 { background: rgba(0, 35, 79, .10); width: 18vmax; height: 18vmax; margin: -9vmax 0 0 -9vmax; animation-duration: 15s; animation-delay: -8s; }
.blob--6 { background: rgba(146, 185, 220, .30); width: 14vmax; height: 14vmax; margin: -7vmax 0 0 -7vmax; animation-duration: 10s; animation-delay: -5s; }
.band--navy .blob--1 { background: rgba(7, 82, 163, .35); }
.band--navy .blob--4 { background: rgba(146, 185, 220, .12); }
.band--navy .blob--5 { background: rgba(255, 255, 255, .05); }
@keyframes bc-morph {
  0% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  33% { border-radius: 63% 37% 41% 59% / 58% 36% 64% 42%; }
  66% { border-radius: 37% 63% 55% 45% / 35% 62% 38% 65%; }
  100% { border-radius: 55% 45% 34% 66% / 60% 48% 52% 40%; }
}

/* Indicador para bajar */
.scroll-cue { display: none; }
.motion .scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sky);
}
.motion .scroll-cue:hover { color: #fff; text-decoration: none; }
.scroll-cue__line { position: relative; width: 2px; height: 40px; overflow: hidden; background: var(--on-dark-line); }
.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sky);
  transform: translateY(-100%);
  animation: bc-cue 2s var(--out) infinite;
}
@keyframes bc-cue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}
