/* ═══════════════════════════════════════════════════════
   CREATIVE INVASION PRO — ANIMATION ENHANCEMENT v2.0
   - Animated gradient logo
   - Staggered card entrances
   - 3D card tilt (enhanced via JS)
   - Active nav highlighting
   - Counter animation support
   - Hero text shimmer
═══════════════════════════════════════════════════════ */

/* ── GRADIENTE ANIMADO EN LOGO Y TEXTO ────────────────── */
@keyframes ci-gradient-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.ci-gradient-text {
  background: linear-gradient(
    90deg,
    var(--ci-red),
    var(--ci-blue),
    var(--ci-cyan),
    var(--ci-red)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ci-gradient-flow 4s ease infinite;
}

/* ── HERO H1 SHIMMER SUTIL ──────────────────────────────── */
@keyframes ci-hero-in {
  from { opacity: 0; transform: translateY(30px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.ci-hero h1 {
  animation: ci-hero-in 0.85s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0.1s;
}
.ci-hero .ci-pill {
  animation: ci-hero-in 0.7s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0s;
}
.ci-hero p {
  animation: ci-hero-in 0.85s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0.2s;
}
.ci-hero .ci-hero-actions {
  animation: ci-hero-in 0.85s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0.32s;
}
.ci-hero .ci-trust-row {
  animation: ci-hero-in 0.85s cubic-bezier(.22,1,.36,1) both;
  animation-delay: 0.44s;
}
.ci-hero-card {
  animation: ci-hero-in 1s cubic-bezier(.22,1,.36,1) both !important;
  animation-delay: 0.25s !important;
}

/* ── ORBES FLOTANTES ────────────────────────────────────── */
@keyframes ci-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-24px) scale(1.06); }
}
@keyframes ci-float-slow {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(18px) scale(0.94); }
}
.ci-orb-one { animation: ci-float      8s ease-in-out infinite; }
.ci-orb-two { animation: ci-float-slow 11s ease-in-out infinite; }

/* ── PROOF STRIP — ENTRADA ESCALONADA ───────────────────── */
.ci-proof-grid > div {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.ci-proof-grid.is-visible > div:nth-child(1) { opacity:1; transform:none; transition-delay: 0s;    }
.ci-proof-grid.is-visible > div:nth-child(2) { opacity:1; transform:none; transition-delay: .09s;  }
.ci-proof-grid.is-visible > div:nth-child(3) { opacity:1; transform:none; transition-delay: .18s;  }
.ci-proof-grid.is-visible > div:nth-child(4) { opacity:1; transform:none; transition-delay: .27s;  }

/* ── SERVICIOS — STAGGER ────────────────────────────────── */
.ci-services-grid .ci-service-card:nth-child(1) { transition-delay: 0s;   }
.ci-services-grid .ci-service-card:nth-child(2) { transition-delay: .1s;  }
.ci-services-grid .ci-service-card:nth-child(3) { transition-delay: .2s;  }
.ci-services-grid .ci-service-card:nth-child(4) { transition-delay: .3s;  }

/* ── PASOS DEL MÉTODO — STAGGER ─────────────────────────── */
.ci-process .ci-step:nth-child(1) { transition-delay: 0s;   }
.ci-process .ci-step:nth-child(2) { transition-delay: .12s; }
.ci-process .ci-step:nth-child(3) { transition-delay: .24s; }
.ci-process .ci-step:nth-child(4) { transition-delay: .36s; }

/* ── STATS — STAGGER ────────────────────────────────────── */
.ci-stats .ci-stat {
  opacity: 0;
  transform: scale(.92) translateY(10px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.22,1,.36,1);
}
.ci-stats.is-visible .ci-stat:nth-child(1) { opacity:1; transform:none; transition-delay: 0s;   }
.ci-stats.is-visible .ci-stat:nth-child(2) { opacity:1; transform:none; transition-delay: .1s;  }
.ci-stats.is-visible .ci-stat:nth-child(3) { opacity:1; transform:none; transition-delay: .2s;  }
.ci-stats.is-visible .ci-stat:nth-child(4) { opacity:1; transform:none; transition-delay: .3s;  }

/* ── PLANES — STAGGER ───────────────────────────────────── */
.ci-pricing-grid .ci-price-card:nth-child(1) { transition-delay: 0s;   }
.ci-pricing-grid .ci-price-card:nth-child(2) { transition-delay: .13s; }
.ci-pricing-grid .ci-price-card:nth-child(3) { transition-delay: .26s; }

/* ── 3D HOVER EN CARDS ──────────────────────────────────── */
.ci-service-card,
.ci-work-card,
.ci-price-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── ACTIVE NAV LINK ────────────────────────────────────── */
.ci-menu a.ci-nav-active {
  color: var(--ci-red);
  position: relative;
}
.ci-menu a.ci-nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ci-red), var(--ci-blue));
}

/* ── MOBILE BAR — ACTIVE ────────────────────────────────── */
.ci-mobile-bar a.ci-nav-active {
  background: var(--ci-soft);
  color: var(--ci-red);
}

/* ── COUNTER — CLASE DE APOYO ───────────────────────────── */
.ci-stat strong {
  display: block;
  font-size: 2.1rem;
  letter-spacing: -.05em;
  font-weight: 900;
  transition: color .3s ease;
}
.ci-stat.is-counting strong { color: var(--ci-cyan); }

/* ── LINK DE SERVICIO CON FLECHA ANIMADA ────────────────── */
.ci-service-card a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .22s ease, color .22s ease;
}
.ci-service-card a:hover { gap: 10px; }

/* ── BOTONES — EFECTO RIPPLE ────────────────────────────── */
.ci-btn {
  position: relative;
  overflow: hidden;
}
.ci-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.15);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
  border-radius: inherit;
}
.ci-btn:hover::before { transform: scaleX(1); }

/* ── TESTIMONIAL CARD — QUOTE MARK ─────────────────────── */
.ci-testimonial-card {
  position: relative;
}
.ci-testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 24px;
  right: 48px;
  font-size: 10rem;
  line-height: 1;
  font-weight: 900;
  color: rgba(91,77,255,.08);
  font-family: Georgia, serif;
  pointer-events: none;
}

/* ── LOGO MARK — PULSO SUTIL ────────────────────────────── */
@keyframes ci-pulse-glow {
  0%, 100% { box-shadow: 0 10px 28px rgba(74,125,255,.30); }
  50%       { box-shadow: 0 10px 44px rgba(255,36,88,.50); }
}
.ci-logo-mark { animation: ci-pulse-glow 5s ease-in-out infinite; }

/* ── PRELOADER FLUIDO "INVASION" ────────────────────────── */
.ci-preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--ci-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.ci-goo-container {
  filter: url('#ci-gooey');
  position: absolute;
  inset: -20vh -20vw;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.ci-blob {
  position: absolute;
  border-radius: 50%;
  animation-fill-mode: forwards;
  will-change: transform;
}

.ci-blob-red {
  width: 140px; height: 140px; background: var(--ci-red);
  transform: translate(-100vw, -100vh);
  animation: ci-blob-in-red 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.ci-blob-blue {
  width: 180px; height: 180px; background: var(--ci-blue);
  transform: translate(100vw, 100vh);
  animation: ci-blob-in-blue 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards 0.15s;
}

.ci-blob-cyan {
  width: 120px; height: 120px; background: var(--ci-cyan);
  transform: translate(100vw, -100vh);
  animation: ci-blob-in-cyan 1.4s cubic-bezier(0.25, 1, 0.5, 1) forwards 0.3s;
}

@keyframes ci-blob-in-red { to { transform: translate(-30px, -20px); } }
@keyframes ci-blob-in-blue { to { transform: translate(40px, 30px); } }
@keyframes ci-blob-in-cyan { to { transform: translate(-10px, -40px); } }

/* Explosion phase */
.ci-goo-container.is-exploding .ci-blob {
  animation: ci-blob-explode 1.5s cubic-bezier(0.85, 0, 0.15, 1) forwards !important;
}

@keyframes ci-blob-explode {
  0%   { transform: scale(1) translate(0,0); }
  50%  { transform: scale(3) translate(0,0); opacity: 1; }
  100% { transform: scale(40) translate(0,0); opacity: 0; }
}

/* Center Text */
.ci-goo-text {
  position: absolute;
  z-index: 10;
  color: #fff;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.06em;
  opacity: 0;
  transform: scale(0.8);
  animation: ci-text-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 1.2s;
  pointer-events: none;
}

@keyframes ci-text-pop {
  to { opacity: 1; transform: scale(1); }
}

.ci-goo-text.is-exploding {
  animation: ci-text-explode 0.8s ease-in forwards;
}

@keyframes ci-text-explode {
  to { opacity: 0; transform: scale(3); filter: blur(10px); }
}

/* ESTADO CARGADO */
body.is-loaded .ci-preloader {
  opacity: 0;
  pointer-events: none;
}

body.is-loaded {
  overflow: auto !important;
}

body:not(.is-loaded) {
  overflow: hidden !important;
}

