/* Shared scroll motion for the PixaCaller vertical pages (agritech, edtech, edmtech).
   The same file is used by all three pages: keep the copies identical. Works with assets/js/main.js.
   Everything here is hidden only when JS runs (.js on <html>), and is switched off for reduced motion. */

:root { --m-ease: cubic-bezier(0.23, 1, 0.32, 1); } /* strong ease-out */
html { overflow-x: clip; } /* side-sliding reveals never cause sideways scrolling on phones */

/* ---------- Hero load sequence: copy rises in step by step, the artwork settles, chips pop last ---------- */
@keyframes m-rise { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
@keyframes m-art { from { transform: translate3d(0, 56px, 0); } } /* no fade: the hero image paints at once (LCP) */
@keyframes m-pop { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.92); } }
@keyframes m-wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.js [data-load] { animation: m-rise 900ms var(--m-ease) both; animation-delay: calc(var(--step, 0) * 90ms); }
.js [data-load="art"] { animation-name: m-art; animation-duration: 1200ms; }
.js [data-load="chip"] { animation-name: m-pop; animation-duration: 700ms; }
.js [data-load="wipe"] { animation-name: m-wipe; animation-duration: 1300ms; }

/* ---------- Scroll reveal: main.js adds .in once, 70 ms apart for elements that enter together ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 32px, 0);
  transition: opacity 700ms var(--m-ease), transform 900ms var(--m-ease), clip-path 1100ms var(--m-ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal[data-reveal="left"] { transform: translate3d(-48px, 0, 0); }
.js .reveal[data-reveal="right"] { transform: translate3d(48px, 0, 0); }
.js .reveal[data-reveal="zoom"] { transform: scale(0.9); }
.js .reveal[data-reveal="rise"] { opacity: 1; transform: translate3d(0, 24px, 0); clip-path: inset(100% 0 0 0); } /* artwork wipes up from its base */
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-reveal="rise"].in { clip-path: inset(0 0 0 0); }

/* Bar charts grow from the left, one bar after another, once their card is revealed */
.js .reveal .bar-fill { transform: scaleX(0); transform-origin: left center; }
.js .reveal.in .bar-fill { transform: none; transition: transform 1200ms var(--m-ease); transition-delay: calc(var(--reveal-delay, 0ms) + 300ms); }
.js .reveal.in .bar:nth-child(2) .bar-fill { transition-delay: calc(var(--reveal-delay, 0ms) + 390ms); }
.js .reveal.in .bar:nth-child(3) .bar-fill { transition-delay: calc(var(--reveal-delay, 0ms) + 480ms); }
.js .reveal.in .bar:nth-child(4) .bar-fill { transition-delay: calc(var(--reveal-delay, 0ms) + 570ms); }
.js .reveal.in .bar:nth-child(5) .bar-fill { transition-delay: calc(var(--reveal-delay, 0ms) + 660ms); }

/* Numbers that count up keep their width steady while they change */
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- Scroll-linked depth (browsers with scroll-driven animations; others simply don't move) ---------- */
@supports (animation-timeline: scroll()) {
  @keyframes m-parallax { to { transform: translate3d(0, var(--parallax, 60px), 0); } }
  .js [data-parallax] { animation: m-parallax linear both; animation-timeline: scroll(root block); animation-range: 0 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-load], .js [data-parallax] { animation: none; }
  .js .reveal, .js .reveal .bar-fill { opacity: 1; transform: none; clip-path: none; transition: none; }
}
