/* ============================================================================
scrollcraft: a scroll-driven interaction runtime
----------------------------------------------------------------------------
Vanilla JS. Zero dependencies. Zero DOM generation.
The engine does NOT build your page. You author real, semantic HTML and mark
it up with data-sc-* attributes; the engine reads them and drives them from a
single scroll value on a single rAF loop. That is deliberate: a runtime that
generates its own DOM from a config object makes every site it touches look
identical, which is the failure mode this replaces.
---------------------------------------------------------------------------
ACTS: the unit of scroll time
---------------------------------------------------------------------------
...
data-sc-act scrub | pin | pan | flow (default: flow)
data-sc-clip-map="travel" opts a pinned act OUT of full-life clip mapping.
By DEFAULT a scrub clip is mapped across the stage's entire
on-screen life, not across its pinned travel, because a pinned
stage is visible for a viewport BEFORE the pin begins (sliding
up into view) and a viewport AFTER it ends (sliding off the
top). Mapped to pinned travel, the clip sits on its first
frame through the whole entry and its last frame through the
whole exit: the reader watches a still photograph while the
page moves. Pair it with data-sc-dwell, which moves quickly at
the edges and settles in the middle, so the fast motion lands
on the two slides and the settle lands inside the pin where
the copy is. data-sc-runout is accepted and ignored; it named
the old opt-in for the exit half of this.
data-sc-span viewport-heights of scroll this act owns. Pinned devices only
(scrub/pin/pan). Default 1.5. The engine sets the outer
height and sticks the first .sc-stage / [data-sc-stage] child.
Every act exposes a normalized progress p (0..1):
pinned p = (y - top) / (height - vh)
flow p = (y + vh - top) / (height + vh)
and publishes it as --sc-p on the act element, so CSS can read it too.
---------------------------------------------------------------------------
DEVICES: what p drives
---------------------------------------------------------------------------
data-sc-scrub on