/*
  Base reset, typography defaults and accessibility baselines.
  Loaded after variables.css, before layout.css.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Respect the user's device text-size setting; do not lock zoom. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-stone-100);
  color: var(--color-slate-900);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-forest-950);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-2);
}

h1 { font-size: var(--text-2xl); font-weight: 600; }
h2 { font-size: var(--text-xl); font-weight: 600; }
h3 { font-size: var(--text-lg); font-weight: 600; }

p {
  margin: 0 0 var(--space-3);
}

small,
.text-sm {
  font-size: var(--text-sm);
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

img {
  max-width: 100%;
  display: block;
}

/*
  Bug fix: several components set their own `display` (`.notice { display:
  flex }`, `.field { display: flex }`, `.btn { display: inline-flex }`,
  etc). Author stylesheet rules always beat the browser's built-in
  `[hidden] { display: none }` rule, regardless of specificity — so
  without this, setting `element.hidden = true` on anything carrying one
  of those classes silently does nothing. This one rule fixes it globally,
  for every current and future case, instead of patching each component.
*/
[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
}

/* Visible keyboard focus everywhere — required for accessibility, and staff
   may attach a keyboard to a tablet for faster data entry. */
:focus-visible {
  outline: 3px solid var(--color-forest-700);
  outline-offset: 2px;
}

/* Respect reduced-motion preferences across the whole app. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Utility: visually hidden but available to assistive technology. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden the same way as .visually-hidden until it receives
   keyboard focus, at which point it becomes a normal, visible, styled
   link — the standard pattern for letting keyboard users jump past the
   app-bar's nav link and status chips straight to the page content. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: 1000;
  background: var(--color-forest-800);
  color: var(--color-stone-50);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
}
