/* =========================================================
   Animaciones ambiente: corren solo mientras la slide está activa.
   Usan las propiedades individuales translate / scale / rotate para
   no pisar las transformaciones de entrada que hace GSAP.
   ========================================================= */

/* Pausar todo lo que no está en pantalla (incluye miniaturas de la vista general) */
.slide:not(.active) *,
.slide:not(.active) *::before,
.slide:not(.active) *::after{animation-play-state:paused!important}

/* Capas de partículas */
.fx,.fx-top{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.fx{z-index:0}
.fx-top{z-index:6;overflow:visible}
:where(.slide > :not(.fx,.fx-top,.blob,.pnum,[style*="position:absolute"])){position:relative;z-index:1}
.ico-wrap{position:relative}

/* ---------- Keyframes ---------- */
@keyframes amb-float{from{translate:0 -9px}to{translate:0 9px}}
@keyframes amb-bob{0%,100%{translate:0 0}50%{translate:0 -6px}}
@keyframes amb-bob-big{0%,100%{translate:0 0}50%{translate:0 -12px}}
@keyframes amb-nudge{0%,100%{translate:0 0}50%{translate:10px 0}}
@keyframes amb-kb{from{scale:1;translate:0 0}to{scale:1.1;translate:-2% -1.5%}}
@keyframes amb-ping{0%{transform:scale(1);opacity:.75}100%{transform:scale(1.55);opacity:0}}
@keyframes amb-glow{0%,100%{box-shadow:0 0 0 0 rgba(var(--gc),0),0 18px 40px -14px rgba(0,0,0,.25)}50%{box-shadow:0 0 0 12px rgba(var(--gc),.16),0 0 60px 8px rgba(var(--gc),.28)}}
@keyframes amb-sheen{0%{left:-45%}38%,100%{left:135%}}
@keyframes amb-shim{from{background-position:160% 0}to{background-position:-60% 0}}
@keyframes amb-flow{to{background-position:0 -40px}}
@keyframes amb-stripes{to{background-position:40px 0}}
@keyframes amb-wave{0%,24%,100%{scale:1}12%{scale:1.16}}
@keyframes amb-beat{0%,40%,100%{scale:1}8%{scale:1.2}16%{scale:1}26%{scale:1.12}}
@keyframes amb-flip{0%,82%{rotate:y 0deg}92%,100%{rotate:y 360deg}}
@keyframes amb-breathe{0%,100%{scale:1}50%{scale:1.035}}
@keyframes amb-spin{to{rotate:360deg}}
@keyframes amb-rise{0%{translate:0 0;opacity:0}12%{opacity:var(--o,.6)}85%{opacity:var(--o,.6)}100%{translate:var(--dx) -1180px;opacity:0}}
@keyframes amb-drift{0%{translate:0 0;rotate:var(--rot)}50%{translate:14px -22px;rotate:calc(var(--rot) + 12deg)}100%{translate:-10px 10px;rotate:calc(var(--rot) - 8deg)}}
@keyframes amb-dash{to{stroke-dashoffset:-36}}
@keyframes amb-sweep{0%{left:0;opacity:0}6%{opacity:1}94%{opacity:1}100%{left:100%;opacity:0}}
@keyframes amb-color{0%,100%{color:var(--orange)}50%{color:var(--wine)}}

/* ---------- Utilidades ---------- */
.float{animation:amb-float var(--fd,4.4s) ease-in-out infinite alternate;animation-delay:var(--dl,0s)}
.bob{animation:amb-bob-big 2.6s ease-in-out infinite;animation-delay:var(--dl,0s)}
.nudge{animation:amb-nudge 1.8s ease-in-out infinite}
.kb img,img.kbimg{animation:amb-kb 16s ease-in-out infinite alternate;animation-delay:var(--dl,0s)}

.ping::after,.ping2::before{content:"";position:absolute;inset:0;border-radius:inherit;border:3px solid var(--ping,var(--lime));animation:amb-ping 2.4s cubic-bezier(.2,.6,.3,1) infinite;pointer-events:none}
.ping2::before{animation-delay:1.2s}
.ping.round::after{border-radius:50%}
.ring.ping::after{inset:8.5%}

.glow{--gc:174,203,42;animation:amb-glow 3.2s ease-in-out infinite}
.glow.red{--gc:232,120,140}

.sheen{overflow:hidden}
.sheen::before,.pillar::before,.bars.inv .bar::before,.roi .bar.pos::before{content:"";position:absolute;top:-60%;bottom:-60%;width:28%;left:-45%;z-index:1;pointer-events:none;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.26),transparent);transform:skewX(-18deg);
  animation:amb-sheen 5s ease-in-out infinite;animation-delay:var(--dl,1.6s)}

/* Texto con brillo */
.bignum.shimmer{background:linear-gradient(100deg,#AECB2A 38%,#f3ffc6 50%,#AECB2A 62%);background-size:260% 100%;
  -webkit-background-clip:text;background-clip:text;color:transparent;animation:amb-shim 5s linear infinite}
.tshimmer .w,.tshimmer{background:linear-gradient(100deg,#AECB2A 40%,#f3ffc6 50%,#AECB2A 60%);background-size:300% 100%;
  -webkit-background-clip:text;background-clip:text;color:transparent;animation:amb-shim 3.6s linear infinite}

/* ---------- Partículas ---------- */
.rp{position:absolute;bottom:-30px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#e9f7a8,#AECB2A 60%,rgba(174,203,42,.2));animation:amb-rise 14s linear infinite}
.fruit{position:absolute;animation:amb-drift var(--fd,7s) ease-in-out infinite alternate;animation-delay:var(--dl,0s);filter:drop-shadow(0 10px 16px rgba(0,0,0,.15))}
.fruit svg{width:100%;height:auto;display:block}
.emit{position:absolute;line-height:1;display:grid;place-items:center;will-change:transform,opacity;filter:drop-shadow(0 4px 8px rgba(0,0,0,.25))}
.emit svg{width:100%;height:100%;fill:currentColor;stroke:none}
.dtap{position:absolute;left:50%;top:50%;width:120px;height:120px;margin:-60px 0 0 -60px;z-index:3;pointer-events:none;color:#fff;filter:drop-shadow(0 6px 18px rgba(0,0,0,.4))}
.dtap svg{width:100%;height:100%;fill:currentColor;stroke:none}
.ig .im{position:relative}

/* ---------- Específicos por componente ---------- */
/* íconos en cajitas: vaivén suave */
.ico-wrap>.ico{animation:amb-bob 3.4s ease-in-out infinite}
.row:nth-child(2n) .ico-wrap>.ico,.card:nth-child(2n) .ico-wrap>.ico{animation-delay:-1.2s}
.card:nth-child(3n) .ico-wrap>.ico{animation-delay:-2.1s}

/* índice */
.idx .n{animation:amb-bob 3.2s ease-in-out infinite}
.idx button:nth-child(2) .n{animation-delay:-.5s}.idx button:nth-child(3) .n{animation-delay:-1s}
.idx button:nth-child(4) .n{animation-delay:-1.5s}.idx button:nth-child(5) .n{animation-delay:-2s}.idx button:nth-child(6) .n{animation-delay:-2.5s}

/* árbol de problemas: flujo en los conectores */
.tree .link span{background:repeating-linear-gradient(0deg,var(--g700) 0 10px,var(--lime) 10px 20px);background-size:100% 40px;animation:amb-flow .9s linear infinite}

/* ola en badges numerados */
.nitem .badge{animation:amb-wave 4.2s ease-in-out infinite}
.nitem:nth-child(2) .badge{animation-delay:.25s}.nitem:nth-child(3) .badge{animation-delay:.5s}
.nitem:nth-child(4) .badge{animation-delay:.75s}.nitem:nth-child(5) .badge{animation-delay:1s}
.nitem:nth-child(6) .badge{animation-delay:1.25s}.nitem:nth-child(7) .badge{animation-delay:1.5s}
.nitem:nth-child(8) .badge{animation-delay:1.75s}.nitem:nth-child(9) .badge{animation-delay:2s}

/* ventas: línea de tendencia */
.bars{position:relative}
.trend{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1}
.bars:not(.inv) .b{position:relative;z-index:2}
.bars:not(.inv) .val{background:var(--cream);padding:0 14px;border-radius:10px}
.trend polyline{fill:none;stroke:var(--wine);stroke-width:4;stroke-dasharray:12 6;stroke-linecap:round;stroke-linejoin:round;animation:amb-dash 1.1s linear infinite}

/* PESTEL: letras que giran por turnos */
.pestel .L{animation:amb-flip 7s ease-in-out infinite}
.pestel .card:nth-child(2) .L{animation-delay:1.1s}.pestel .card:nth-child(3) .L{animation-delay:2.2s}
.pestel .card:nth-child(4) .L{animation-delay:3.3s}.pestel .card:nth-child(5) .L{animation-delay:4.4s}.pestel .card:nth-child(6) .L{animation-delay:5.5s}

/* elementos que flotan desfasados */
.floaty>*{animation:amb-float 4.2s ease-in-out infinite alternate}
.floaty>*:nth-child(2){animation-delay:-1.1s}.floaty>*:nth-child(3){animation-delay:-2.2s}.floaty>*:nth-child(4){animation-delay:-3.3s}

/* anillos respiran */
.ring svg{animation:amb-breathe 4s ease-in-out infinite}

/* corazones que laten */
.beats>*{animation:amb-beat 2.6s ease-in-out infinite}
.beats>*:nth-child(2){animation-delay:.15s}.beats>*:nth-child(3){animation-delay:.3s}.beats>*:nth-child(4){animation-delay:.45s}.beats>*:nth-child(5){animation-delay:.6s}

/* Frut All rezagada: rayas en movimiento */
.hbar .fl{position:relative;overflow:hidden}
.hbar.me .fl::after,.meter .fill::after{content:"";position:absolute;inset:0;border-radius:inherit;
  background-image:linear-gradient(45deg,rgba(255,255,255,.28) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.28) 50%,rgba(255,255,255,.28) 75%,transparent 75%);
  background-size:40px 40px;animation:amb-stripes 1.2s linear infinite}
.hbar.me .v{animation:amb-color 2.4s ease-in-out infinite}

/* FODA */
.foda h3 i{display:inline-block;animation:amb-bob 3s ease-in-out infinite}
.foda>div:nth-child(2) h3 i{animation-delay:-.75s}.foda>div:nth-child(3) h3 i{animation-delay:-1.5s}.foda>div:nth-child(4) h3 i{animation-delay:-2.25s}

/* objetivo: marcador de meta */
.meter .pin{position:absolute;left:16%;top:22px;width:52px;height:52px;margin-left:-26px;border-radius:50%;background:#fff;border:8px solid var(--g700);box-shadow:0 8px 20px rgba(27,94,32,.3);z-index:2}

/* pilares */
.pillars .arrow svg{animation:amb-nudge 1.6s ease-in-out infinite}
.pillar>.ico{animation:amb-bob 3s ease-in-out infinite}
.pillar:nth-child(3)>.ico{animation-delay:-1s}.pillar:nth-child(5)>.ico{animation-delay:-2s}
.pillar:nth-child(3)::before{animation-delay:2.4s}.pillar:nth-child(5)::before{animation-delay:3.2s}

/* plataformas */
.plat .logo{animation:amb-float 4s ease-in-out infinite alternate}
.card:nth-child(2) .plat .logo,.plat:nth-child(2) .logo{animation-delay:-1.3s}.plat:nth-child(3) .logo{animation-delay:-2.6s}

/* Instagram: el corazón late */
.ig .acts svg:first-child{animation:amb-beat 3s ease-in-out infinite}

/* inversión mes a mes */
.bars.inv .bar{position:relative;overflow:hidden}
.bars.inv .b:nth-child(1) .bar::before{animation-delay:.6s}.bars.inv .b:nth-child(2) .bar::before{animation-delay:.75s}
.bars.inv .b:nth-child(3) .bar::before{animation-delay:.9s}.bars.inv .b:nth-child(4) .bar::before{animation-delay:1.05s}
.bars.inv .b:nth-child(5) .bar::before{animation-delay:1.2s}.bars.inv .b:nth-child(6) .bar::before{animation-delay:1.35s}

/* listas con flechas */
.nudges li .ico{animation:amb-nudge 2s ease-in-out infinite}
.nudges li:nth-child(2) .ico{animation-delay:.2s}.nudges li:nth-child(3) .ico{animation-delay:.4s}.nudges li:nth-child(4) .ico{animation-delay:.6s}

/* calendario: día "publicando" */
.cal .d{transition:box-shadow .3s}
.cal .d.now{box-shadow:0 0 0 4px #fff,0 0 0 8px var(--g900),0 14px 30px rgba(0,0,0,.25);z-index:2}

/* galerías con Ken Burns */
.gal .ph img{animation:amb-kb 15s ease-in-out infinite alternate}
.gal .ph:nth-child(2) img{animation-delay:-3s}.gal .ph:nth-child(3) img{animation-delay:-6s}
.gal .ph:nth-child(4) img{animation-delay:-9s}.gal .ph:nth-child(5) img{animation-delay:-12s}.gal .ph:nth-child(6) img{animation-delay:-4.5s}
.persona:nth-child(2) .kb img{animation-delay:-5s}.persona:nth-child(3) .kb img{animation-delay:-10s}

/* presupuesto: órbita */
.orbit{position:absolute;inset:-30px;border-radius:50%;border:2px dashed rgba(27,94,32,.28);animation:amb-spin 30s linear infinite;pointer-events:none}
.orbit::after{content:"";position:absolute;top:-9px;left:50%;margin-left:-9px;width:18px;height:18px;border-radius:50%;background:var(--lime);box-shadow:0 0 0 6px rgba(174,203,42,.25)}

/* cronograma: línea que recorre el semestre */
.gantt{position:relative}
.sweep{position:absolute;left:430px;right:0;top:-14px;bottom:-14px;pointer-events:none;z-index:3}
.sweep i{position:absolute;top:0;bottom:0;width:4px;margin-left:-2px;border-radius:4px;background:var(--lime);
  box-shadow:0 0 18px 4px rgba(174,203,42,.6);animation:amb-sweep 8s linear infinite}
.sweep i::before{content:"";position:absolute;top:-8px;left:50%;width:18px;height:18px;margin-left:-9px;border-radius:50%;background:var(--lime);border:3px solid #fff}

/* ROI: barras positivas con brillo */
.roi .bar.pos{overflow:hidden}
.roi .sc:nth-child(4) .bar.pos::before{animation-delay:1s}.roi .sc:nth-child(5) .bar.pos::before{animation-delay:1.4s}

/* flechas de fórmulas */
.down{animation:amb-bob 1.8s ease-in-out infinite}

@media (prefers-reduced-motion:reduce){
  .fx,.fx-top{display:none}
  .slide *,.slide *::before,.slide *::after{animation:none!important}
}
