/* ============================================================
   components/progress.css — dd-progress + dd-scroll-progress · P2 s3
   ------------------------------------------------------------
   Two audio-flavoured progress motifs:

   1. .dd-progress — a waveform bar. A waveform silhouette is applied
      as a CSS mask to the whole control, so the muted track and the
      coral fill both take the bar shape. Drive it with --value:
        <div class="dd-progress" role="progressbar" aria-valuenow="60"
             aria-valuemin="0" aria-valuemax="100">
          <span class="dd-progress__fill" style="--value:60%"></span>
        </div>

   2. .dd-scroll-progress — a thin scrub bar (fixed) whose fill scales
      with page scroll; window.ddScrollProgress wires [data-dd-scroll-progress]
      by setting --p (0..1). Reuses the coral gradient + the scrub motif.

   Fill width transitions are gated behind prefers-reduced-motion.
   ============================================================ */

.dd-progress {
    position: relative;
    width: 100%;
    height: 32px;
    background: var(--coral-100);
    -webkit-mask: var(--wave-mask) left center / var(--wave-mask-size) repeat-x;
    mask: var(--wave-mask) left center / var(--wave-mask-size) repeat-x;
}

.dd-progress--sm {
    height: 20px;
}

.dd-progress--lg {
    height: 48px;
}

.dd-progress__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--value, 0%);
    max-width: 100%;
    background: var(--grad-coral);
    transition: width var(--dur-base) var(--ease-soft);
}

/* ---- scroll progress: a thin scrub bar under the chrome ----------- */
.dd-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: var(--z-sticky);
    background: var(--coral-100);
    pointer-events: none;
    overflow: hidden;
}

.dd-scroll-progress__bar {
    height: 100%;
    width: 100%;
    background: var(--grad-coral);
    transform: scaleX(var(--p, 0));
    transform-origin: left center;
    /* no transition — it must track the scroll position exactly */
}

@media (prefers-reduced-motion: reduce) {
    .dd-progress__fill {
        transition: none;
    }
}
