/* Wardrop Digital effects library — scroll-progress 1.0.0 (Wardrop Digital original). */
/* A 3px bar. Page mode is fixed to the top of the screen; section mode is the first child of its section and
   sticks to the top while that section is on screen. Tier 3 (contract 18): it follows the visitor's own
   scrolling, so reduced motion changes nothing. Custom properties: --fx-progress-colour, --fx-progress-top. */
[data-fx="scroll-progress"] {
  position: fixed;
  top: var(--fx-progress-top, 0px);
  left: 0;
  right: 0;
  z-index: 40;
  height: 3px;
  background: var(--fx-progress-colour, currentColor);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
[data-fx="scroll-progress"][data-fx-target="section"] {
  position: sticky;
  width: 100%;
  margin-bottom: -3px; /* takes no room in the section */
}

@keyframes fx-scroll-progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@supports (animation-timeline: scroll()) {
  [data-fx="scroll-progress"] {
    animation: fx-scroll-progress-grow linear both;
    animation-timeline: scroll(root);
  }
  /* A section gets a named view timeline from the script; "contain" runs from its top reaching the top of
     the screen to its bottom reaching the bottom of the screen. */
  .fx-scroll-progress__host { view-timeline: --fx-progress-section block; }
  [data-fx="scroll-progress"][data-fx-target="section"] {
    animation-timeline: --fx-progress-section;
    animation-range: contain 0% contain 100%;
  }
}
