/* ═══════════════════════════════════════════════════════
   CEO — Capa de dinamismo (se carga después de style.css)
   Revertir: quitar los <link>/<script> de dynamic.* en index.html
   ═══════════════════════════════════════════════════════ */

/* ── Barra de progreso de scroll ─────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--blue), #60a5fa 60%, #7c3aed);
  z-index: 1001; pointer-events: none;
}

/* ── Revelado al hacer scroll (solo si JS activó html.rv-on) ── */
html.rv-on .rv {
  opacity: 0; transform: translateY(28px);
  transition: opacity .7s var(--trans), transform .7s var(--trans);
  transition-delay: calc(var(--rv-i, 0) * 90ms);
  will-change: opacity, transform;
}
html.rv-on .rv.rv-left  { transform: translateX(-38px); }
html.rv-on .rv.rv-right { transform: translateX(38px); }
html.rv-on .rv.rv-zoom  { transform: scale(.94); }
html.rv-on .rv.rv-in    { opacity: 1; transform: none; }

/* ── Menú: sección activa (scroll-spy) ───────────────── */
.nav-links a { position: relative; }
.nav-links a.active { color: var(--blue-dk); background: var(--sky); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--blue);
  animation: navLine .35s var(--trans);
}
@keyframes navLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Tarjetas: foco de luz que sigue al cursor + inclinación ── */
.bento-card, .access-card, .step { --mx: 50%; --my: 50%; }
.bento-card:hover {
  background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(37,99,235,.075), transparent 55%);
}
.access-card:hover, .step:hover {
  background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(96,165,250,.16), transparent 55%);
}
.bento-card.tilt-on:hover, .access-card.tilt-on:hover {
  transform: translateY(-6px) perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* ── Botones: brillo al pasar + feedback al presionar ── */
.btn { position: relative; overflow: hidden; }
.btn-primary::after, .btn-white::after {
  content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.38), transparent);
  transform: skewX(-20deg); transition: left .65s var(--trans); pointer-events: none;
}
.btn-white::after { background: linear-gradient(120deg, transparent, rgba(37,99,235,.16), transparent); }
.btn-primary:hover::after, .btn-white:hover::after { left: 150%; }
.btn:active { transform: translateY(0) scale(.97); }

/* ── Hero: parallax suave con el mouse ───────────────── */
.hero-mesh  { transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px), 0); transition: transform .35s ease-out; }
.hero-panel { transform: translate3d(calc(var(--px, 0) * 8px),  calc(var(--py, 0) * 6px),  0); transition: transform .35s ease-out; }

/* ── Contadores: pulso al terminar ───────────────────── */
[data-target].counted { display: inline-block; animation: countPop .5s var(--trans); }
@keyframes countPop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* ── Accesibilidad: sin movimiento si el usuario lo pide ── */
@media (prefers-reduced-motion: reduce) {
  html.rv-on .rv { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-mesh, .hero-panel { transform: none !important; }
  .btn-primary::after, .btn-white::after, .scroll-progress { display: none; }
  [data-target].counted, .nav-links a.active::after { animation: none; }
}
/* Sin hover real (táctil): sin inclinación */
@media (hover: none) {
  .bento-card.tilt-on:hover, .access-card.tilt-on:hover { transform: translateY(-6px); }
}

/* ═══════════ v2 — cambios claramente visibles ═══════════ */

/* Hero: red de nodos animada + aurora en movimiento */
#hero-net { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero-mesh::before, .hero-mesh::after { content: ''; position: absolute; border-radius: 50%; filter: blur(70px); }
.hero-mesh::before {
  width: 560px; height: 560px; left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(59,130,246,.55), transparent 70%);
  animation: auroraA 16s ease-in-out infinite;
}
.hero-mesh::after {
  width: 500px; height: 500px; right: -120px; top: 40px;
  background: radial-gradient(circle, rgba(124,58,237,.34), transparent 70%);
  animation: auroraB 21s ease-in-out infinite;
}
@keyframes auroraA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px,70px) scale(1.15); } }
@keyframes auroraB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-110px,90px) scale(1.12); } }

/* Hero: entrada escalonada del contenido al cargar */
.hero-eyebrow, .hero-h1, .hero-sub, .hero-ctas, .hero-meta {
  opacity: 0; transform: translateY(26px);
  animation: heroIn .9s var(--trans) forwards;
}
.hero-eyebrow { animation-delay: .05s; }
.hero-h1      { animation-delay: .20s; }
.hero-sub     { animation-delay: .38s; }
.hero-ctas    { animation-delay: .54s; }
.hero-meta    { animation-delay: .70s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* Palabra clave con degradado que fluye */
.hero-em {
  background-image: linear-gradient(100deg, var(--blue), #7c3aed, #06b6d4, var(--blue));
  background-size: 300% 100%;
  animation: emFlow 7s linear infinite;
}
@keyframes emFlow { to { background-position: -300% 0; } }

/* CTA principal con pulso de luz */
.hero-ctas .btn-primary { animation: heroIn .9s .54s var(--trans) forwards, ctaPulse 2.8s 1.6s infinite; }
@keyframes ctaPulse {
  0%   { box-shadow: 0 4px 14px rgba(37,99,235,.30), 0 0 0 0 rgba(37,99,235,.45); }
  70%  { box-shadow: 0 4px 14px rgba(37,99,235,.30), 0 0 0 16px rgba(37,99,235,0); }
  100% { box-shadow: 0 4px 14px rgba(37,99,235,.30), 0 0 0 0 rgba(37,99,235,0); }
}

/* Panel del hero flotando */
.hero-panel .panel-window { animation: panelBob 7s ease-in-out infinite; }
@keyframes panelBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Franja de servicios en desplazamiento continuo */
.tech-strip {
  background: var(--navy); overflow: hidden; padding: 17px 0; position: relative;
  border-block: 1px solid rgba(255,255,255,.07);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tech-track { display: flex; gap: 48px; width: max-content; animation: marquee 42s linear infinite; }
.tech-strip:hover .tech-track { animation-play-state: paused; }
.tech-track span {
  display: inline-flex; align-items: center; gap: 12px; white-space: nowrap;
  font-size: 14px; font-weight: 600; letter-spacing: .02em; color: #cbd5e1;
}
.tech-track span::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #60a5fa; box-shadow: 0 0 12px #60a5fa;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Revelado al scroll más marcado */
html.rv-on .rv { transform: translateY(46px); filter: blur(6px); transition-property: opacity, transform, filter; }
html.rv-on .rv.rv-left  { transform: translateX(-60px); }
html.rv-on .rv.rv-right { transform: translateX(60px); }
html.rv-on .rv.rv-zoom  { transform: scale(.88); }
html.rv-on .rv.rv-in    { filter: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero-h1, .hero-sub, .hero-ctas, .hero-meta { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-mesh::before, .hero-mesh::after, .hero-em, .hero-ctas .btn-primary, .hero-panel .panel-window, .tech-track { animation: none !important; }
  html.rv-on .rv { filter: none !important; }
}
