/* Scroll-film engine — structural styles. Sites theme the chapter text themselves. */
.sf { position: relative; }
.sf-stage { position: relative; overflow: hidden; background: #0b0b0c; }
.sf-canvas { display: none; }
.sf-poster { display: block; width: 100%; height: auto; }

/* Live: pinned stage, canvas fills it, chapters overlay and swap */
.sf--live { height: var(--sf-length, 500svh); }
.sf--live .sf-stage { position: sticky; top: 0; height: 100vh; height: 100svh; }
.sf--live .sf-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.sf--live .sf-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sf--live .sf-chapter { position: absolute; z-index: 2; opacity: 0; transform: translateY(18px); pointer-events: none;
  transition: opacity .6s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.sf--live .sf-chapter.is-active { opacity: 1; transform: none; pointer-events: auto; }
.sf--live:not(.sf--ready) .sf-chapter { transition: none; }
.sf--live .sf-stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgb(0 0 0 / .35), transparent 30%, transparent 55%, rgb(0 0 0 / .55)); }

/* Static (no JS, reduced motion, failure): chapters become a readable sequence of stills */
.sf:not(.sf--live) .sf-chapter { position: relative; }
.sf--static .sf-poster { display: none; }
.sf-still { display: block; width: 100%; height: auto; margin-bottom: 20px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .sf--live .sf-chapter { transition: none; }
}
