/* fx.css · scroll-linked/pinned-steps, steps light up while the numbers stay put · owner: Lizzy East · all rights reserved */

/* A plain numbered list on phones and without JavaScript. On wider screens a big
   number stays in view beside the steps (decorative: the real numbers are the
   list's own) and the step crossing the middle of the screen is lit. */
[data-fx~="scroll-linked/pinned-steps"] { display: grid; gap: 2rem; }
[data-fx~="scroll-linked/pinned-steps"] ol { display: grid; gap: 1.5rem; margin: 0; padding-left: 1.5rem; }
[data-fx~="scroll-linked/pinned-steps"] [data-fx-step] { position: relative; padding: 0.5rem 0 0.5rem 1rem; }
[data-fx~="scroll-linked/pinned-steps"] [data-fx-step]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 3px;
  background: var(--fx-step-accent, #1f4fd1);
  opacity: 0;
}
[data-fx~="scroll-linked/pinned-steps"] [data-fx-step].is-current::before { opacity: 1; }
[data-fx~="scroll-linked/pinned-steps"] [data-fx-pin] { display: none; }
@media (min-width: 48rem) {
  [data-fx~="scroll-linked/pinned-steps"] { grid-template-columns: minmax(8rem, 1fr) 2fr; align-items: start; }
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-pin] {
    display: grid;
    position: sticky;
    top: calc(50vh - 3rem);
    font-size: clamp(4rem, 9vw, 6.5rem);
    font-weight: 800;
    line-height: 1;
  }
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-pin] > * { grid-area: 1 / 1; opacity: 0; }
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-pin] > .is-current,
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-pin]:not(:has(.is-current)) > :first-child { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-pin] > *,
  [data-fx~="scroll-linked/pinned-steps"] [data-fx-step]::before { transition: opacity 300ms var(--fx-ease); }
}
