/* Shared essentials for every direction (load before the direction's own stylesheet). Deliberately
   tiny: a modern reset and the accessibility helpers the router and the shells rely on. All visual
   design lives in each direction's styles.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
site-root { display: block; }

/* The router moves focus to the new page's <h1>; it is not a control, so no ring on it. */
site-root h1:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Skip link: hidden until focused. Each direction styles its colours. */
.skip-link { position: absolute; left: 1rem; top: -100%; z-index: 1000; padding: 0.75rem 1rem; }
.skip-link:focus { top: 1rem; }

/* Reveal helper: content is visible by default (no JavaScript, reduced motion). A direction's script
   adds .js-motion to <html> and .is-in to elements as they enter the viewport. */
@media (prefers-reduced-motion: no-preference) {
  .js-motion [data-reveal]:not(.is-in) { opacity: 0; }
}
@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; }
}
