/* Navigation feedback, on every page that loads utils.js (base.html and the
   standalone onboarding page). */

/* Thin top progress bar for every navigation: in-place SPA swaps (spa-nav.js)
   and full page loads (utils.js), which otherwise leave the old page frozen
   until the next one paints. Below the status bar in the app, where top: 0 is
   covered. It creeps on a long curve so a slow phone network still shows
   movement, and it animates transform only. */
.aq-spa-progress {
  position: fixed;
  top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-dim);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 200ms ease, opacity 200ms ease;
}
.aq-spa-progress.is-loading {
  opacity: 1;
  transform: scaleX(0.9);
  transition: transform 12s cubic-bezier(0.05, 0.75, 0.2, 1), opacity 150ms ease;
}
.aq-spa-progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 200ms ease, opacity 400ms ease 100ms;
}
@media (prefers-reduced-motion: reduce) {
  .aq-spa-progress { transition: opacity 120ms ease; }
  .aq-spa-progress.is-loading { transition: opacity 150ms ease; }
}

/* Touch screens: a tapped link or button dims while held, so a tap that
   starts a slow navigation shows it registered. */
@media (pointer: coarse) {
  a[href]:active,
  button:not(:disabled):active,
  [role="button"]:active {
    opacity: 0.7;
  }
}
