/* ═══════════════════════════════════════════════════════
   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 TIPOGRÁFICO PREMIUM ────────────────────────── */
.ci-preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Dual Panels for curtain effect */
.ci-preloader-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100vh;
  background: var(--ci-ink);
  transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
  will-change: transform;
  pointer-events: auto;
}
.ci-preloader-panel-left { left: 0; transform-origin: left; }
.ci-preloader-panel-right { right: 0; transform-origin: right; }

.ci-preloader-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Counter */
.ci-preloader-counter {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(20px);
  animation: ci-preloader-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

/* Split Text Reveal */
.ci-preloader-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.ci-preloader-line {
  overflow: hidden;
  padding: 5px 0; /* Prevents text clipping */
}

.ci-preloader-word {
  display: block;
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #fff;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform, opacity;
}

.is-animating .ci-preloader-word {
  animation: ci-reveal-text 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.is-animating .ci-preloader-line:nth-child(1) .ci-preloader-word {
  animation-delay: 0.1s;
}

.is-animating .ci-preloader-line:nth-child(2) .ci-preloader-word {
  animation-delay: 0.25s;
}

@keyframes ci-reveal-text {
  0% { transform: translateY(110%) rotate(3deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}
@keyframes ci-preloader-in {
  to { transform: translateY(0); opacity: 1; }
}

/* Flash Effect */
.ci-preloader-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 10001;
}

.ci-preloader-flash.is-flashing {
  animation: ci-camera-flash 0.5s ease-out forwards;
}

@keyframes ci-camera-flash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ESTADO CARGADO (Curtain reveal) */
body.is-loaded .ci-preloader-panel-left {
  transform: scaleX(0);
}
body.is-loaded .ci-preloader-panel-right {
  transform: scaleX(0);
}
body.is-loaded .ci-preloader-inner {
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

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

