/* ScrollFilm — layout and the blend kit (references/signature-moment.md, step 5).
   Set on the section: --sf-bg (the page colour the film sits on, measured by film_prep.py), --sf-top (sticky offset,
   e.g. the header height), --sf-height (pinned distance, default 300vh), optional --sf-grade (a CSS filter) and
   --sf-grain (a texture url). The blend makes the film's edges become the page: no rectangle, no matte. */
.sf { position: relative; height: var(--sf-height, 300vh); background: var(--sf-bg); }
.sf__stage { position: sticky; top: var(--sf-top, 0px); height: calc(100svh - var(--sf-top, 0px)); overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.sf__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--sf-bg); filter: var(--sf-grade, none); }

/* the edge dissolve: the film's border fades into --sf-bg, so it reads as the page lit from inside, not a clip on it */
.sf__blend { position: absolute; inset: -1px; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 72% 78% at 50% 50%, transparent 58%, var(--sf-bg) 100%),
    linear-gradient(var(--sf-bg), transparent 12%, transparent 88%, var(--sf-bg)); }
.sf[data-blend="wide"] .sf__blend { background:
    radial-gradient(ellipse 64% 70% at 50% 50%, transparent 42%, var(--sf-bg) 96%),
    linear-gradient(var(--sf-bg), transparent 20%, transparent 80%, var(--sf-bg)); }
.sf[data-blend="none"] .sf__blend { display: none; }
/* the page's own grain over the film: one material, not a video under glass */
.sf__blend::after { content: ""; position: absolute; inset: 0; background: var(--sf-grain, none); opacity: .16; mix-blend-mode: overlay; }

/* type layers: give them z-index 2+ so they sit above the blend, and drive them with var(--sf-<beat>) */

.sf--still { height: auto; }
.sf--still .sf__stage { position: relative; top: 0; height: 90svh; }
@media (prefers-reduced-motion: reduce) {
  .sf { height: auto; }
  .sf__stage { position: relative; top: 0; height: 90svh; }
}
