/* Override the base reveal rule until the observer has registered the element. */
.reveal:not(.s-motion-pending) {
  opacity: 1;
  transform: none;
  transition: none;
}

.s-motion-progress {
  position: fixed;
  z-index: 12;
  inset: 0 0 auto;
  height: 3px;
  background: var(--amber);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
}

.nav-header a[aria-current="location"] {
  color: var(--amber-soft);
  text-decoration: underline;
  text-underline-offset: .3em;
}

.s-motion-glow {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal.s-motion-pending {
    transition-property: opacity, transform;
    transition-duration: .65s;
    transition-timing-function: var(--ease);
    transition-delay: var(--s-motion-delay, 0ms);
  }

  .reveal.s-motion-pending:not(.in):not(.reveal-left, .reveal-scale) {
    transform: translateY(16px);
  }

  .reveal.s-motion-pending:focus-within {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.s-motion-pending:is(h1, h2, h3, h4, h5, h6)::after,
  .reveal.s-motion-pending .s-motion-heading::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    margin-block-start: .35em;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .65s var(--ease) calc(var(--s-motion-delay, 0ms) + 90ms);
  }

  .reveal.s-motion-pending.in:is(h1, h2, h3, h4, h5, h6)::after,
  .reveal.s-motion-pending.in .s-motion-heading::after {
    transform: scaleX(1);
  }

  .s-motion-count {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    font-variant-numeric: tabular-nums;
  }

  .s-motion-count-original {
    opacity: 0;
  }

  .s-motion-count-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .s-motion-count-strip {
    position: absolute;
    inset: 0;
    text-align: center;
  }

  .s-motion-count-strip > span {
    display: block;
  }

  .s-motion-nav {
    transition: transform .35s var(--ease);
  }

  .s-motion-nav.s-motion-nav-hidden:not(:focus-within, :has([aria-expanded="true"])) {
    transform: translateY(-100%);
  }

  .s-motion-parallax {
    translate: 0 var(--s-motion-y, 0px);
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .s-motion-glow {
    display: block;
    position: fixed;
    z-index: 11;
    inset: 0 auto auto 0;
    width: 16rem;
    aspect-ratio: 1;
    background: radial-gradient(circle, var(--amber-soft), transparent 68%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease);
  }

  .s-motion-glow.s-motion-glow-visible {
    opacity: .12;
  }

  .s-motion-magnetic {
    translate: var(--s-motion-magnet-x, 0px) var(--s-motion-magnet-y, 0px);
    transition: translate .25s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
  }

  .s-motion-parallax.s-motion-magnetic {
    translate: var(--s-motion-magnet-x, 0px)
      calc(var(--s-motion-y, 0px) + var(--s-motion-magnet-y, 0px));
  }
}
