/* How it works: the guided journey. A light travels along the track; each card wakes up in turn and plays its own story.
   Without JavaScript, or with "reduce motion", every card simply shows its finished state. */
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes badgePop{0%{transform:scale(1)}40%{transform:scale(1.4)}100%{transform:scale(1)}}
@keyframes giPop{0%{transform:scale(.6)}60%{transform:scale(1.25)}100%{transform:scale(1)}}
@keyframes sheen{from{background-position:130% 0}to{background-position:-130% 0}}

/* the track above the cards */
.track{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:18px;position:relative;height:24px;margin:0 0 16px;--p:0}
.track .tl,.track .tp{position:absolute;top:50%;height:3px;margin-top:-1.5px;left:calc((100% - 72px) / 10);border-radius:3px}
.track .tl{width:calc(4 * ((100% - 72px) / 5 + 18px));background:var(--line2)}
.track .tp{width:calc(var(--p) * 4 * ((100% - 72px) / 5 + 18px));background:linear-gradient(90deg,var(--g1),var(--glow));transition:width 1s cubic-bezier(.4,0,.2,1)}
.track .tg{position:absolute;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:var(--glow);box-shadow:0 0 0 6px rgba(53,227,148,.25),0 0 18px rgba(53,227,148,.85);left:calc((100% - 72px) / 10 + var(--p) * 4 * ((100% - 72px) / 5 + 18px));transition:left 1s cubic-bezier(.4,0,.2,1);opacity:0;z-index:2}
.how.run .track .tg{opacity:1}
.track .td{place-self:center;position:relative;z-index:1;width:16px;height:16px;border-radius:50%;background:#fff;border:3px solid var(--line);transition:background .4s,border-color .4s,box-shadow .4s}
.track .td.on{background:var(--g1);border-color:var(--g1)}
.track .td.cur{box-shadow:0 0 0 7px rgba(10,154,99,.2)}

/* cards */
.s5c{transition:translate .35s cubic-bezier(.2,.8,.2,1),box-shadow .35s ease}
.s5c.active{translate:0 -10px;box-shadow:0 28px 60px rgba(14,42,77,.18),0 0 0 3px rgba(10,154,99,.38)}
.s5c.gr.active{box-shadow:0 28px 60px rgba(6,108,71,.40),0 0 0 3px rgba(53,227,148,.55)}
.s5c.active .n{animation:badgePop .8s cubic-bezier(.2,1.5,.4,1)}
.s5c.gr{overflow:hidden}
.s5c.gr::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(110deg,transparent 35%,rgba(255,255,255,.16) 50%,transparent 65%);background-size:260% 100%;animation:sheen 5s linear infinite}

/* 1: goal bars fill one after another */
.s5c .vr u{animation:none;width:var(--w)}
.how.run .s5c:not(.played) .vr u{width:0}
.s5c.active .vr u{animation:barFrom 1.1s cubic-bezier(.3,.8,.3,1) both}
.s5c.active .vr:nth-child(2) u{animation-delay:.25s}.s5c.active .vr:nth-child(3) u{animation-delay:.5s}
@keyframes barFrom{from{width:0}to{width:var(--w)}}
.s5c.active .vr .gi{animation:giPop .5s ease both}
.s5c.active .vr:nth-child(2) .gi{animation-delay:.25s}.s5c.active .vr:nth-child(3) .gi{animation-delay:.5s}

/* 2: the needle sweeps, the score counts up, the label appears */
.s5c .v2 .nd{animation:none;transform:rotate(-5deg)}
.how.run .s5c:not(.played) .v2 .nd{transform:rotate(-86deg)}
.s5c.active .v2 .nd{animation:needleSweep 1.8s cubic-bezier(.3,1.3,.5,1) both}
@keyframes needleSweep{from{transform:rotate(-86deg)}to{transform:rotate(-5deg)}}
.how.run .s5c:not(.played) .sc span{opacity:0}
.s5c.active .sc span{animation:fadeUp .5s ease 1.5s both}

/* 3: stocks are screened, the filter pulses, the fits pop in, the numbers count */
.s5c .v3 .dotgrid i{animation:none;opacity:.5}
.s5c.active .v3 .dotgrid i{animation:dotWave 1.5s ease-in-out both}
.s5c.active .v3 .dotgrid i:nth-child(4n+2){animation-delay:.15s}.s5c.active .v3 .dotgrid i:nth-child(4n+3){animation-delay:.3s}.s5c.active .v3 .dotgrid i:nth-child(4n){animation-delay:.45s}
@keyframes dotWave{0%{opacity:.25;transform:scale(1)}40%{opacity:1;transform:scale(1.6);background:var(--navy)}100%{opacity:.5;transform:scale(1)}}
.s5c.active .v3 .funnel{animation:funnelPulse 1.1s ease .6s both}
@keyframes funnelPulse{0%{transform:scale(1)}45%{transform:scale(1.3);stroke:var(--g1)}100%{transform:scale(1)}}
.how.run .s5c:not(.played) .v3 .fitgrid i{opacity:0;transform:scale(.3)}
.s5c.active .v3 .fitgrid i{animation:fitIn .4s cubic-bezier(.2,1.5,.4,1) both}
.s5c.active .v3 .fitgrid i:nth-child(1){animation-delay:1.05s}.s5c.active .v3 .fitgrid i:nth-child(2){animation-delay:1.12s}.s5c.active .v3 .fitgrid i:nth-child(3){animation-delay:1.19s}.s5c.active .v3 .fitgrid i:nth-child(4){animation-delay:1.26s}.s5c.active .v3 .fitgrid i:nth-child(5){animation-delay:1.33s}.s5c.active .v3 .fitgrid i:nth-child(6){animation-delay:1.4s}.s5c.active .v3 .fitgrid i:nth-child(7){animation-delay:1.47s}.s5c.active .v3 .fitgrid i:nth-child(8){animation-delay:1.54s}.s5c.active .v3 .fitgrid i:nth-child(9){animation-delay:1.61s}
@keyframes fitIn{from{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}
.how.run .s5c:not(.played) .v3 .counts div{opacity:0}
.s5c.active .v3 .counts div{animation:fadeUp .5s ease .2s both}
.s5c.active .v3 .counts .fit{animation-delay:1.3s}

/* 4: a typing bubble, then the WhatsApp message arrives and pings */
.v4{position:relative}
.typing{position:absolute;left:4px;top:50%;margin-top:-20px;display:flex;gap:5px;padding:13px 15px;border-radius:16px;background:#fff;opacity:0;box-shadow:0 8px 20px rgba(0,0,0,.18)}
.typing i{width:7px;height:7px;border-radius:50%;background:#9AA7B8;animation:typeDot 1s ease-in-out infinite}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes typeDot{0%,100%{transform:translateY(0);opacity:.5}50%{transform:translateY(-4px);opacity:1}}
.s5c .v4 .msg{animation:none;opacity:1;transform:none}
.how.run .s5c:not(.played) .v4 .msg{opacity:0}
.s5c.active .v4 .typing{animation:typingShow 1.2s ease both}
@keyframes typingShow{0%{opacity:0}15%,80%{opacity:1}100%{opacity:0}}
.s5c.active .v4 .msg{animation:msgPop .6s cubic-bezier(.2,.9,.3,1.2) 1.15s both}
@keyframes msgPop{from{opacity:0;transform:translateY(16px) scale(.94)}to{opacity:1;transform:none}}
.s5c.active .v4 .mi::after{content:"";position:absolute;inset:0;border-radius:50%;border:2px solid #1FBF6B;animation:ping 1.4s ease-out 1.5s 2}

/* 5: a cursor taps Approve, a ripple spreads, then "Approved" slides in */
.v5 .approve{position:relative;animation:none;transform:none}
.v5 .approved{animation:none;opacity:1;transform:none}
.how.run .s5c:not(.played) .v5 .approved{opacity:0}
.cursor{position:absolute;right:-8px;bottom:-16px;width:28px;height:28px;fill:#0B1B33;stroke:#fff;stroke-width:1.2;opacity:0;z-index:2;pointer-events:none}
.rip{position:absolute;inset:0;border-radius:16px;border:2px solid rgba(255,255,255,.95);opacity:0;pointer-events:none}
.s5c.active .v5 .approve{animation:pressSeq 3.2s ease both}
@keyframes pressSeq{0%,38%{transform:none}46%{transform:scale(.93)}56%,100%{transform:none}}
.s5c.active .v5 .cursor{animation:curMove 3.2s ease both}
@keyframes curMove{0%{opacity:0;transform:translate(70px,50px)}15%{opacity:1}40%{opacity:1;transform:translate(0,0)}60%{opacity:1;transform:translate(0,0)}85%{opacity:0;transform:translate(14px,14px)}100%{opacity:0}}
.s5c.active .v5 .rip{animation:ripOut .9s ease 1.4s both}
@keyframes ripOut{from{opacity:.9;transform:scale(1)}to{opacity:0;transform:scale(1.4)}}
.s5c.active .v5 .approved{animation:fadeUp .5s ease 1.9s both}

@media (max-width:1100px){.track{display:none}}
@media (prefers-reduced-motion:reduce){
  .how .track .tg{display:none}
  .s5c.gr::after{display:none}
}
