/* CONTAFI — Propuesta "Inicio 2": home más dinámico.
   Solo lo carga /inicio-2/. Usa los tokens de tokens.css (navy, teal, gold).
   Todas las animaciones usan transform/opacity y se desactivan con
   prefers-reduced-motion. */

/* La cinta inclinada y los fondos animados no deben generar scroll horizontal */
#main { overflow-x: clip; }

/* ---------- Barra de progreso de lectura ---------- */
.i2-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; pointer-events: none; }
.i2-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-400), var(--gold-400)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Entrada al cargar (hero) ---------- */
@keyframes i2Up { from { opacity: 0; transform: translateY(110%); } to { opacity: 1; transform: none; } }
@keyframes i2Fade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.i2-in { display: inline-block; animation: i2Fade 0.9s var(--ease-emphasized) both; animation-delay: var(--d, 0ms); }
.i2-line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.i2-line .i2-in { animation-name: i2Up; }

/* ---------- Hero ---------- */
.i2-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 85% 10%, var(--navy-600) 0%, var(--navy-900) 55%, #031a31 100%);
  color: var(--white); padding: clamp(56px, 9vw, 120px) 0 clamp(72px, 10vw, 136px);
}
.i2-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.i2-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; will-change: transform; }
.i2-blob--a { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; background: var(--teal-600); top: -18%; right: -10%; animation: i2Drift 18s ease-in-out infinite alternate; }
.i2-blob--b { width: 34vw; height: 34vw; max-width: 460px; max-height: 460px; background: var(--navy-400); bottom: -22%; left: -8%; animation: i2Drift 22s ease-in-out infinite alternate-reverse; }
.i2-blob--c { width: 18vw; height: 18vw; max-width: 240px; max-height: 240px; background: var(--gold-500); opacity: 0.22; top: 40%; left: 42%; animation: i2Drift 16s ease-in-out infinite alternate; }
@keyframes i2Drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(6%, 8%, 0) scale(1.12); } }
.i2-grid {
  position: absolute; inset: 0; opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.i2-hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.i2-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px);
  font-size: var(--text-xs); font-weight: var(--font-semibold); letter-spacing: .06em; text-transform: uppercase; color: var(--teal-100);
}
.i2-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-300); box-shadow: 0 0 0 0 rgba(77,210,216,.6); animation: i2Ping 2.4s var(--ease-standard) infinite; }
@keyframes i2Ping { 0% { box-shadow: 0 0 0 0 rgba(77,210,216,.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(77,210,216,0); } }
.i2-title {
  color: var(--white); font-size: clamp(2.5rem, 5.6vw, 4.6rem); font-weight: var(--font-extrabold);
  line-height: 1.02; letter-spacing: -0.03em; margin: var(--space-5) 0 var(--space-5);
}
.i2-rotator {
  background: linear-gradient(90deg, var(--teal-300), var(--gold-300)); -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: opacity .35s var(--ease-standard), transform .35s var(--ease-emphasized);
}
.i2-rotator.is-out { opacity: 0; transform: translateY(-40%); }
.i2-lead { color: var(--navy-100); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.65; max-width: 34em; margin-bottom: var(--space-8); }
.i2-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.i2-btn-ghost { color: var(--white); border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.04); }
.i2-btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.6); color: var(--white); }
.i2-where { margin-top: var(--space-6); font-size: var(--text-sm); color: var(--navy-200); letter-spacing: .02em; }
.i2-magnetic { transition: transform .25s var(--ease-emphasized), background var(--duration-normal); will-change: transform; }

/* Foto con revelado tipo cortina + tarjetas flotantes */
.i2-hero__visual { position: relative; }
.i2-photo {
  border-radius: 28px; overflow: hidden; aspect-ratio: 4 / 3.4; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6);
  animation: i2Curtain 1.2s var(--ease-emphasized) .25s both;
}
.i2-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); animation: i2Zoom 1.8s var(--ease-emphasized) .25s both; }
@keyframes i2Curtain { from { clip-path: inset(0 0 100% 0 round 28px); } to { clip-path: inset(0 0 0 0 round 28px); } }
@keyframes i2Zoom { to { transform: scale(1); } }
.i2-float {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
  background: rgba(255,255,255,.92); color: var(--navy-800); box-shadow: 0 18px 40px -12px rgba(4,33,61,.45);
  border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(8px); font-size: var(--text-sm);
  animation: i2Pop .8s var(--ease-emphasized) both, i2Float 6s ease-in-out infinite;
}
.i2-float strong { display: block; font-family: var(--font-heading); font-size: var(--text-sm); }
.i2-float small { display: block; color: var(--slate-500, #64748b); font-size: var(--text-xs); }
.i2-float--a { left: -7%; top: 12%; animation-delay: .9s, 1.7s; }
.i2-float--b { right: -6%; bottom: 14%; flex-direction: column; align-items: flex-start; gap: 8px; animation-delay: 1.1s, 2.2s; }
.i2-float--c { left: 6%; bottom: -5%; animation-delay: 1.3s, 2.6s; }
.i2-float__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-500); color: var(--white); font-weight: 700; }
@keyframes i2Pop { from { opacity: 0; transform: translateY(18px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes i2Float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.i2-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; }
.i2-bars i { width: 12px; height: var(--h); border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--teal-400), var(--navy-500)); transform-origin: bottom; animation: i2Grow 1s var(--ease-emphasized) both; }
.i2-bars i:nth-child(1) { animation-delay: 1.3s; } .i2-bars i:nth-child(2) { animation-delay: 1.38s; } .i2-bars i:nth-child(3) { animation-delay: 1.46s; }
.i2-bars i:nth-child(4) { animation-delay: 1.54s; } .i2-bars i:nth-child(5) { animation-delay: 1.62s; } .i2-bars i:nth-child(6) { animation-delay: 1.7s; background: linear-gradient(180deg, var(--gold-300), var(--gold-600)); }
@keyframes i2Grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.i2-pulse { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: i2Ping 2s infinite; box-shadow: 0 0 0 0 rgba(34,197,94,.5); }

/* ---------- Cinta en movimiento ---------- */
.i2-marquee { background: var(--teal-500); color: var(--white); overflow: hidden; padding: 16px 0; transform: rotate(-1.2deg) scale(1.02); margin-top: -18px; position: relative; z-index: 2; box-shadow: 0 12px 30px -16px rgba(0,100,107,.6); }
.i2-marquee__track { display: flex; width: max-content; animation: i2Marquee 38s linear infinite; }
.i2-marquee span { font-family: var(--font-heading); font-weight: var(--font-semibold); font-size: var(--text-lg); white-space: nowrap; padding: 0 28px; display: inline-flex; align-items: center; gap: 28px; }
.i2-marquee span::after { content: "✦"; color: var(--gold-200); font-size: .8em; }
.i2-marquee:hover .i2-marquee__track { animation-play-state: paused; }
@keyframes i2Marquee { to { transform: translateX(-50%); } }

/* ---------- Revelado al hacer scroll ---------- */
.i2-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-emphasized), transform .8s var(--ease-emphasized); transition-delay: var(--d, 0ms); }
.i2-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Cifras ---------- */
.i2-stats { padding: clamp(56px, 7vw, 88px) 0 var(--space-8); }
.i2-stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.i2-stat { padding: var(--space-6) var(--space-5); border-left: 3px solid var(--teal-500); background: linear-gradient(90deg, var(--teal-50), transparent 85%); border-radius: 0 16px 16px 0; }
.i2-stat__num { display: block; font-family: var(--font-heading); font-weight: var(--font-extrabold); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; color: var(--navy-700); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.i2-stat__num small { font-size: .55em; vertical-align: .55em; margin-right: 2px; }
.i2-stat__label { display: block; margin-top: var(--space-2); color: var(--color-foreground-muted); font-size: var(--text-sm); line-height: 1.5; }

/* ---------- Secciones ---------- */
.i2-section { padding: clamp(64px, 8vw, 112px) 0; }
.i2-head { max-width: 680px; margin-bottom: var(--space-10); }
.i2-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.i2-head p { color: var(--color-foreground-muted); }
.i2-head--split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }

/* ---------- Bento de servicios con borde que sigue el cursor ---------- */
.i2-bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(170px, auto); gap: var(--space-4); }
.i2-tile {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6);
  border-radius: 22px; background: var(--white); text-decoration: none; color: inherit; overflow: hidden;
  border: 1px solid var(--color-border); box-shadow: 0 1px 2px rgba(4,33,61,.04);
  transition: transform .35s var(--ease-emphasized), box-shadow .35s var(--ease-emphasized), opacity .8s var(--ease-emphasized);
}
.i2-tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--teal-400), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.i2-tile:hover::before { opacity: 1; }
.i2-tile:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -24px rgba(10,43,76,.35); }
.i2-tile h3 { font-size: var(--text-lg); margin: var(--space-2) 0 0; }
.i2-tile p { color: var(--color-foreground-muted); font-size: var(--text-sm); margin: 0; }
.i2-tile__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.i2-tile__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i2-tile__more { margin-top: auto; padding-top: var(--space-4); font-weight: var(--font-semibold); font-size: var(--text-sm); color: var(--teal-600); }
.i2-tile--big { grid-column: span 2; grid-row: span 2; background: linear-gradient(160deg, var(--navy-700), var(--navy-900)); border-color: transparent; }
.i2-tile--big h3 { color: var(--white); font-size: var(--text-2xl); }
.i2-tile--big p { color: var(--navy-100); font-size: var(--text-base); max-width: 26em; }
.i2-tile--big .i2-tile__icon { background: rgba(255,255,255,.1); color: var(--teal-200); width: 56px; height: 56px; }
.i2-tile--big .i2-tile__more { color: var(--teal-200); }
.i2-tile--tall { grid-column: span 2; background: linear-gradient(160deg, var(--teal-50), var(--white)); }
.i2-tile--wide { grid-column: span 2; }

/* ---------- Línea de tiempo que se dibuja con el scroll ---------- */
.i2-process { background: var(--white); }
.i2-timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); padding-top: var(--space-10); }
.i2-timeline__line { position: absolute; top: 26px; left: 4%; right: 4%; height: 2px; background: var(--color-border); }
.i2-timeline__line span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--gold-400)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.i2-step { position: relative; }
.i2-step__n {
  position: absolute; top: calc(-1 * var(--space-10) + 4px); left: 0; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--navy-700); color: var(--white); font-family: var(--font-heading); font-weight: var(--font-bold); font-size: var(--text-sm);
  box-shadow: 0 0 0 6px var(--white);
}
.i2-step h3 { font-size: var(--text-lg); margin-top: var(--space-6); }
.i2-step p { color: var(--color-foreground-muted); font-size: var(--text-sm); }

/* ---------- Clientes ---------- */
.i2-trust__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-12); align-items: center; }
.i2-trust h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
.i2-trust p { color: var(--color-foreground-muted); margin-bottom: var(--space-6); max-width: 32em; }
.i2-client {
  display: grid; justify-items: start; gap: 6px; padding: var(--space-8); border-radius: 24px; text-decoration: none;
  background: linear-gradient(145deg, var(--white), var(--teal-50)); border: 1px solid var(--teal-100);
  box-shadow: 0 30px 60px -36px rgba(0,100,107,.5); transition: transform .4s var(--ease-emphasized), opacity .8s var(--ease-emphasized);
}
.i2-client:hover { transform: translateY(-6px) rotate(-0.6deg); }
.i2-client .client-mono { margin-bottom: var(--space-3); }
.i2-client__name { font-family: var(--font-heading); font-weight: var(--font-bold); font-size: var(--text-2xl); color: var(--navy-700); }
.i2-client__sector { color: var(--color-foreground-muted); font-size: var(--text-sm); }

/* ---------- Planes con borde animado en el recomendado ---------- */
.i2-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); align-items: stretch; }
.i2-plan { position: relative; display: flex; flex-direction: column; padding: var(--space-8); border-radius: 24px; background: var(--white); border: 1px solid var(--color-border); transition: transform .35s var(--ease-emphasized), box-shadow .35s, opacity .8s var(--ease-emphasized); }
.i2-plan:hover { transform: translateY(-6px); box-shadow: 0 28px 56px -30px rgba(10,43,76,.4); }
.i2-plan h3 { font-size: var(--text-xl); }
.i2-plan__price { font-family: var(--font-heading); font-weight: var(--font-extrabold); font-size: clamp(2rem, 3vw, 2.5rem); color: var(--navy-700); letter-spacing: -0.02em; }
.i2-plan__note { color: var(--color-foreground-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.i2-plan ul { list-style: none; padding: 0; margin: 0 0 var(--space-8); display: grid; gap: var(--space-3); }
.i2-plan li { position: relative; padding-left: 28px; font-size: var(--text-sm); }
.i2-plan li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 6px; background: var(--teal-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300949E' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat; }
.i2-plan .btn { margin-top: auto; width: 100%; }
.i2-plan--hot { background: linear-gradient(165deg, var(--navy-700), var(--navy-900)); color: var(--white); border: none; isolation: isolate; }
.i2-plan--hot::before {
  content: ""; position: absolute; inset: -2px; border-radius: 26px; z-index: -1;
  background: conic-gradient(from var(--angle, 0deg), var(--teal-400), var(--gold-400), var(--navy-500), var(--teal-400));
  animation: i2Spin 6s linear infinite;
}
.i2-plan--hot::after { content: ""; position: absolute; inset: 0; border-radius: 24px; z-index: -1; background: linear-gradient(165deg, var(--navy-700), var(--navy-900)); }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes i2Spin { to { --angle: 360deg; } }
.i2-plan--hot h3, .i2-plan--hot li { color: var(--white); }
.i2-plan--hot .i2-plan__price { color: var(--teal-300); }
.i2-plan--hot .i2-plan__note { color: var(--navy-100); }
.i2-plan__badge { position: absolute; top: -13px; left: var(--space-8); background: var(--gold-400); color: var(--navy-900); font-size: var(--text-xs); font-weight: var(--font-bold); padding: 5px 12px; border-radius: 8px; }

/* ---------- Blog ---------- */
.i2-blog { background: var(--white); }
.i2-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.i2-post { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 22px; overflow: hidden; background: var(--slate-50); transition: transform .35s var(--ease-emphasized), box-shadow .35s, opacity .8s var(--ease-emphasized); }
.i2-post:hover { transform: translateY(-6px); box-shadow: 0 28px 56px -30px rgba(10,43,76,.4); }
.i2-post__img { aspect-ratio: 16 / 10; overflow: hidden; }
.i2-post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-emphasized); }
.i2-post:hover .i2-post__img img { transform: scale(1.06); }
.i2-post__body { padding: var(--space-5) var(--space-6) var(--space-6); }
.i2-post__meta { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--teal-700); text-transform: uppercase; letter-spacing: .06em; }
.i2-post h3 { font-size: var(--text-lg); margin: var(--space-2) 0 0; line-height: 1.3; }

/* ---------- CTA final ---------- */
.i2-cta { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: clamp(48px, 7vw, 96px) var(--space-6); border-radius: 32px; background: var(--navy-900); color: var(--white); }
.i2-cta h2 { color: var(--white); font-size: clamp(1.9rem, 3.6vw, 3rem); letter-spacing: -0.02em; max-width: 18em; margin: 0 auto var(--space-3); text-wrap: balance; }
.i2-cta p { color: var(--navy-100); margin-bottom: var(--space-8); }
.i2-cta__glow { position: absolute; inset: -40%; z-index: -1; background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(0,169,180,.45) 90deg, transparent 180deg, rgba(214,164,56,.35) 270deg, transparent 360deg); animation: i2Rotate 14s linear infinite; filter: blur(40px); }
@keyframes i2Rotate { to { transform: rotate(1turn); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .i2-bento { grid-template-columns: repeat(2, 1fr); }
  .i2-tile--big, .i2-tile--tall, .i2-tile--wide { grid-column: span 2; grid-row: auto; }
  .i2-stats__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .i2-hero__inner { grid-template-columns: 1fr; }
  .i2-hero__visual { max-width: 560px; margin: var(--space-6) auto 0; width: 100%; }
  .i2-float--a { left: -2%; } .i2-float--b { right: -2%; }
  .i2-trust__inner { grid-template-columns: 1fr; gap: var(--space-8); }
  .i2-plans, .i2-posts { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .i2-timeline { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-12); }
  .i2-timeline__line { display: none; }
}
@media (max-width: 560px) {
  .i2-bento, .i2-stats__grid, .i2-timeline { grid-template-columns: 1fr; }
  .i2-tile--big, .i2-tile--tall, .i2-tile--wide { grid-column: auto; }
  .i2-float { font-size: var(--text-xs); padding: 10px 12px; }
  .i2-float--b { display: none; }
  .i2-actions .btn { width: 100%; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .i2-in, .i2-photo, .i2-photo img, .i2-float, .i2-bars i, .i2-blob, .i2-dot, .i2-pulse,
  .i2-marquee__track, .i2-plan--hot::before, .i2-cta__glow { animation: none !important; }
  .i2-photo img { transform: none; }
  .i2-reveal { opacity: 1; transform: none; transition: none; }
}
