/* The $50 water-bucket story: four steps beside a sticky drawing that changes as you scroll.
 Shared by clean-water.html and give.html (markup lives in each page, logic in water-steps.js). */
.how{counter-reset:s}
.hstep{display:grid;grid-template-columns:80px 1fr;gap:clamp(20px,3vw,44px);padding:34px 0;border-top:1px solid var(--line);align-items:start}
.hstep:last-child{border-bottom:1px solid var(--line)}
.hstep .n{font-family:'Playfair Display',serif;font-size:clamp(34px,3.6vw,52px);color:var(--gold);line-height:.9;font-weight:500}
.hstep h3{font-size:clamp(22px,2.4vw,32px);margin-bottom:10px}
.hstep p{color:var(--body);font-size:17.5px;max-width:62ch}

/* ---------- how-it-works: steps beside a sticky illustration ---------- */
.howgrid{display:grid;grid-template-columns:1fr minmax(300px,430px);gap:clamp(28px,4vw,72px);align-items:start}
.stagewrap{position:sticky;top:104px}
.stage{width:100%;height:auto;display:block;overflow:visible}
.stage .ln{fill:none;stroke:var(--deep);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.stage .ln.thin{stroke-width:1.2;opacity:.45}
.stage .gold{stroke:var(--gold)}
.stage .fillsand{fill:var(--sand)}
.stage .cap{font-family:'Newsreader',Georgia,serif;font-size:12px;letter-spacing:.18em;text-transform:uppercase;fill:var(--body)}
.stage .amt{font-family:'Playfair Display',Georgia,serif;font-size:27px;fill:var(--deep)}
.stage .yrs{font-family:'Playfair Display',Georgia,serif;font-size:19px;fill:var(--gold);letter-spacing:.06em}

/* water level rises with the active step */
.waterlift{transform:translateY(202px);transition:transform 1.15s var(--soft)}
.stage[data-step="2"] .waterlift{transform:translateY(130px)}
.stage[data-step="3"] .waterlift{transform:translateY(62px)}
.stage[data-step="4"] .waterlift{transform:translateY(0)}
.wavefill{fill:var(--teal);opacity:.17}
.waveline{fill:none;stroke:var(--teal);stroke-width:1.6;opacity:.55}
.waveslide{animation:drift 9s linear infinite}

/* one scene per step, crossfaded */
.scene{opacity:0;transform:translateY(10px);transition:opacity .55s var(--e),transform .55s var(--soft)}
.stage[data-step="1"] .s1,.stage[data-step="2"] .s2,
.stage[data-step="3"] .s3,.stage[data-step="4"] .s4,
.stage[data-step="4"] .s4b{opacity:1;transform:none}

/* the family celebrating behind the pail — soft, never black */
.pailfill{fill:var(--ivory)}
.stage .folk{stroke:var(--teal);stroke-width:1.5;opacity:.5}
.stage .cgold{fill:var(--gold);stroke:none;opacity:.7}
.stage .cteal{fill:var(--teal);stroke:none;opacity:.55}
.cfa{animation:float 3.6s ease-in-out infinite alternate}
.cfb{animation:float 4.8s ease-in-out infinite alternate;animation-delay:-1.4s}
.cfc{animation:float 5.6s ease-in-out infinite alternate;animation-delay:-2.6s}
@keyframes float{from{transform:translateY(-7px)}to{transform:translateY(9px)}}

/* the step you're reading is the one lit */
.hstep{opacity:.42;transition:opacity .5s var(--e)}
.hstep.on{opacity:1}
.hstep .n{transition:color .5s var(--e)}
.hstep:not(.on) .n{color:var(--body)}

@keyframes drift{from{transform:translateX(0)}to{transform:translateX(-160px)}}

@media(max-width:980px){
  .hstep{grid-template-columns:1fr;gap:6px}
  .howgrid{grid-template-columns:1fr;gap:8px}
  .stagewrap{order:-1;top:78px;background:var(--ivory);padding:6px 0 10px}
  .stage{max-width:330px;margin:0 auto}
}
/* phones: smaller picture, tighter steps */
@media(max-width:640px){
  .stage{max-width:250px}
  .hstep{grid-template-columns:40px 1fr;gap:12px;padding:18px 0}
  .hstep .n{font-size:28px}
  .hstep h3{font-size:21px;margin-bottom:4px}
  .hstep p{font-size:16px;line-height:1.55}
}
@media(prefers-reduced-motion:reduce){
  .waterlift,.scene{transition:none}
  .waveslide,.cfa,.cfb,.cfc{animation:none}
}
