/* =========================================================
   JUSPIRE — PROGRESS

   Purpose: page reading-progress bar, driven by root scroll.
   The one component allowed to hold scroll animation.

   Invisible unless data-motion is native.

   Variants: none.
   ========================================================= */

@layer ja-components {
  .ja-progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;

    z-index: var(--ja-layer-toast);

    block-size: 3px;

    background: var(--ja-primary);

    transform-origin: 0 50%;
    scale: 0 1;

    pointer-events: none;
  }

  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: scroll()) {
      :root[data-motion="native"] .ja-progress {
        animation-name: ja-grow;
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: scroll(root);
      }
    }
  }
}
