/* Accessibility rules shared by every page. site.css and app-shell.css both
   @import this file; login, signup and 404 (which use neither) link it
   directly. It is deliberately tiny: the rules here are the ones a keyboard,
   screen-reader or low-vision user depends on, so they live in one place
   where a page can add to them but never quietly undo them.

   What it covers, by WCAG 2.1 AA criterion:
     2.4.7  Focus visible     — the :focus-visible ring
     2.4.1  Bypass blocks     — .skip-link (marketing pages carry it in
                                markup; app-shell.js injects it on shell pages)
     2.3.3  Animation control — the prefers-reduced-motion block
     1.3.1  Info/relations    — .sr-only for labels the design keeps off-canvas */

/* Keyboard focus ring. :focus-visible means a mouse click never paints it.
   Inputs keep their own box-shadow ring: their `outline: none` comes later in
   the cascade at equal specificity, so it wins — that is intended. */
:focus-visible {
  outline: 2px solid var(--accent, #0b7268);
  outline-offset: 2px;
}
/* Teal clears 3:1 on the cream but not on the dark rail; mint does (7.9:1). */
.rn-sidebar :focus-visible,
.rn-topbar :focus-visible { outline-color: #2dd4bf; }

/* Skip link — off-canvas until it takes focus, then a pill at the top left. */
.skip-link {
  position: absolute;
  top: -100px; left: 1rem;
  z-index: 1000;
  background: var(--ink, #14211e);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.skip-link:focus { top: 1rem; outline-color: #fff; }

/* <main tabindex="-1"> receives focus from the skip link and after a soft
   navigation. It is a landmark, not a control, so it never shows the ring. */
main[tabindex="-1"]:focus { outline: none; }

/* Screen-reader-only text: in the accessibility tree, off the canvas. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Reduced motion: every animation and transition collapses to a single frame.
   Durations stay non-zero so animationend/transitionend still fire for any
   script waiting on them. A page with a nicer static fallback for one
   animation (the loading dial's sonar) keeps it — its rule is more specific. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
