/* Scroll story for the new homepage (home-new.php). Same brand tokens as site.css.
   Default = static stacked chapters (no JS / reduced motion). .story--anim (added by story.js)
   turns the book on: a tall scroller with a pinned 100svh stage and absolutely stacked pages. */
.story{background:var(--slate-x);color:#fff;position:relative}
.story__stage{position:relative;background:linear-gradient(135deg,#061f44,var(--slate-x) 60%,#14427a)}
.story__canvas{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;opacity:0;transition:opacity 1.2s ease}
.story__canvas.is-live{opacity:1}
.story__page{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;text-align:center;padding:88px 24px;min-height:80vh}
.story__inner{max-width:760px;margin:0 auto;display:flex;flex-direction:column;align-items:center}
.story__eyebrow{display:block;font-size:13px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--accent);margin:0 0 14px}
.story__h{color:#fff;font-family:var(--display);font-weight:600;font-size:clamp(32px,4.6vw,58px);line-height:1.08;letter-spacing:-.01em;margin:0 0 .45em;text-wrap:balance}
.story__page--hero .story__h{font-size:clamp(34px,4.2vw,58px)}
/* hero keeps the current homepage composition: text left, Jennifer right */
.story__inner--hero{max-width:var(--wrap);width:100%;display:grid;grid-template-columns:1.25fr .75fr;gap:56px;align-items:center;text-align:left}
.story__inner--hero .story__art--portrait{order:2;width:clamp(220px,30vw,360px);margin:0;justify-self:center}
.story__inner--hero .story__p{margin-left:0}
.story__inner--hero .story__ctas{justify-content:flex-start}
.story__p{max-width:600px;margin:0 auto 28px;font-size:clamp(16px,1.35vw,19px);line-height:1.6;color:#d3dff0}
.story__ctas{display:flex;gap:14px;flex-wrap:wrap;justify-content:center}
.story__ctas .btn{min-width:180px;text-align:center}

/* art */
.story__art{width:clamp(200px,34vh,340px);margin:0 auto 22px}
.story__art svg{display:block;width:100%;height:auto;overflow:visible}
.story__art .ln{fill:none;stroke:#cfe3f7;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.story__art .dim{stroke:rgba(207,227,247,.45);stroke-width:2.5}
.story__art .gd{fill:none;stroke:var(--accent);stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}
.story__art .gdf{fill:var(--accent)}
.story__art .lnf{fill:#9cc8f0}
.story__art .dimf{fill:rgba(156,200,240,.45)}
.story__art .hl{opacity:.35}
.story__art .tick{fill:none;stroke:var(--slate-x);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.story__art .count{font-family:var(--display);font-weight:700;font-size:20px;fill:#fff}
.story__art .lbl{font-family:var(--font);font-weight:700;font-size:9px;letter-spacing:1.4px;fill:#9cc8f0}
.story__art .qk{stroke-width:3}
.story__art--portrait{position:relative;width:clamp(150px,24vh,220px);aspect-ratio:1}
.story__art--portrait img{position:absolute;inset:7%;width:86%;height:86%;object-fit:cover;border-radius:50%;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.story__art--portrait svg{position:absolute;inset:0}
.story__art--portrait .ring{fill:none;stroke:var(--accent);stroke-width:4;stroke-linecap:round}

/* reveal choreography — only when animating; otherwise everything is fully drawn */
.story--anim .dw{stroke-dasharray:1;stroke-dashoffset:calc(1 - clamp(0, (var(--r,1) - var(--s,0)) / .5, 1))}
.story--anim .pop{transform-box:fill-box;transform-origin:center;opacity:clamp(0, (var(--r,1) - var(--s,.5)) * 6, 1);transform:scale(calc(.5 + .5 * clamp(0, (var(--r,1) - var(--s,.5)) * 6, 1)))}
.story--anim .rise{transform:translateY(calc((1 - clamp(0, (var(--r,1) - var(--s,0)) / .5, 1)) * 26px))}
.story--anim .sweep{transform:translate(calc(var(--r,1) * -86px), calc(var(--r,1) * 22px))}
.story--anim .story__page.live .ring-w{animation:story-ring 1.6s ease-in-out infinite}
@keyframes story-ring{50%{opacity:.25}}

/* the book (JS sets .story__book height) */
.story--anim .story__stage{position:sticky;top:0;height:100vh;height:100svh;min-height:600px;overflow:hidden}
.story--anim .story__page{position:absolute;inset:0;min-height:0;padding:72px 24px 48px;will-change:opacity}
.story--anim .story__page:not(.live){pointer-events:none}

/* scroll hint + dots */
.story__hint{display:none}
.story--anim .story__hint{display:flex;flex-direction:column;align-items:center;gap:8px;position:absolute;left:50%;bottom:22px;transform:translateX(-50%);font-size:12px;letter-spacing:.16em;text-transform:uppercase;color:#b9c8dc}
.story__hint i{width:2px;height:28px;background:linear-gradient(var(--accent),transparent);animation:story-hint 1.8s ease-in-out infinite}
@keyframes story-hint{0%{transform:scaleY(0);transform-origin:top}50%{transform:scaleY(1);transform-origin:top}51%{transform-origin:bottom}100%{transform:scaleY(0);transform-origin:bottom}}
.story__dots{display:none}
.story--anim .story__dots{display:flex;flex-direction:column;gap:12px;position:absolute;right:26px;top:50%;transform:translateY(-50%);z-index:5;transition:opacity .4s}
.story__dots button{width:10px;height:10px;padding:0;border-radius:50%;border:1.5px solid rgba(255,255,255,.55);background:transparent;cursor:pointer;transition:background .3s,transform .3s}
.story__dots button.on{background:var(--accent);border-color:var(--accent);transform:scale(1.25)}
.story__dots button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

@media (max-width:900px){
  .story__inner--hero{grid-template-columns:1fr;gap:20px;text-align:center}
  .story__inner--hero .story__art--portrait{order:0;width:clamp(130px,22vh,190px)}
  .story__inner--hero .story__ctas{justify-content:center}.story__inner--hero .story__p{margin-left:auto}
}
@media (max-width:700px){
  .story--anim .story__dots{right:10px;gap:9px}
  .story__dots button{width:8px;height:8px}
  .story__page{padding-left:20px;padding-right:20px}
}
@media (max-height:700px){.story__art{width:clamp(160px,28vh,260px);margin-bottom:12px}.story__p{margin-bottom:18px}}
@media (prefers-reduced-motion:reduce){.story__canvas{transition:none;opacity:1}.story__hint i,.story__page .ring-w{animation:none}}
/* hero sits under the site header at scroll 0, so anchor it high (keeps the CTA above the fold) */
.story--anim .story__page--hero{align-items:flex-start;padding-top:clamp(28px,7vh,80px)}
@media (max-width:700px){
  .story__page--hero .story__h{font-size:clamp(28px,8vw,34px)}
  .story__inner--hero .story__art--portrait{width:clamp(96px,15vh,130px)}
  .story__inner--hero .story__eyebrow{font-size:11px;margin-bottom:8px}
  .story__inner--hero .story__p{font-size:15px;margin-bottom:18px}
  .story--anim .story__dots{right:5px}
}
@media (max-height:800px) and (min-width:701px){
  .story__page--hero .story__h{font-size:clamp(30px,5.6vh,46px)}
  .story__inner--hero .story__art--portrait{width:clamp(180px,38vh,280px)}
  .story__inner--hero .story__p{margin-bottom:18px}
  .story--anim .story__page--hero{padding-top:clamp(20px,4vh,40px)}
}

/* daytime scene: text sits on a frosted navy card so white type stays readable over sky and sand */
.story--anim .story__page:not(.story__page--hero) .story__inner,.story--anim .story__herotext{background:rgba(10,42,87,.66);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:20px;padding:26px 40px 30px;box-shadow:0 18px 50px rgba(6,31,68,.22)}
.story--anim .story__herotext{padding:30px 36px 32px}
.story--anim .story__hint{color:var(--slate-x);font-weight:600}
.story__dots button{border-color:rgba(10,42,87,.55);background:rgba(255,255,255,.55)}
@media (max-width:700px){.story--anim .story__page:not(.story__page--hero) .story__inner,.story--anim .story__herotext{padding:18px 18px 22px;border-radius:16px}}
/* hero card: keep the headline to ~4 lines so the CTA stays above the fold */
@media (min-width:901px){.story__inner--hero{grid-template-columns:1.5fr .6fr;gap:40px}.story--anim .story__page--hero .story__h{font-size:clamp(30px,3.5vw,50px)}}
/* speed step: the stopwatch hand sweeps a full turn as the chapter reveals */
.story__art .sweep-hand{transform-box:view-box;transform-origin:130px 96px}
.story--anim .story__art .sweep-hand{transform:rotate(calc(var(--r,1) * 360deg))}
/* story stage pins just below the sticky header */
.story--anim .story__stage{top:var(--hdrc,0px);height:calc(100vh - var(--hdrc,0px));height:calc(100svh - var(--hdrc,0px))}
