/* ──────────────────────────────────────────────────────────────
   Base — reset, typography, focus, shared keyframes, print scaffold.
   Depends on tokens.css. Load order: tokens.css → base.css → components.css.
   ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-main);
  font-family: "Nunito Sans", Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  font-family: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
textarea,
select {
  font-family: inherit;
}
textarea {
  resize: vertical;
}

/* Keyboard focus — dark arboretum-blue ring (5.93:1 on white, 5.29:1 on page
   bg, passes SC 1.4.11) with a maize halo so it also reads on the dark blue
   header. Consistent across the suite. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--arboretum-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--michigan-maize);
}

/* On the dark blue header, invert: maize ring is the high-contrast indicator */
header :focus-visible,
.header :focus-visible {
  outline: 3px solid var(--michigan-maize);
  box-shadow: 0 0 0 5px var(--arboretum-blue);
}

/* Visually-hidden until focused — for skip links and off-screen labels */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — off-screen until focused, then pinned to the top-left */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--michigan-blue);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus {
  top: 8px;
}

/* Shared animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
  }
}
.fade-up {
  animation: fadeUp 0.2s ease both;
}

/* Respect reduced-motion: disable non-essential entrance/pulse animations.
   Progress spinners remain (they convey status, SC 2.3.3 note). */
@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;
  }
  .fade-up {
    animation: none !important;
  }
  /* Keep the loader spin — it is a progress indicator */
  .spinner,
  [class*="spin"] {
    animation-duration: 0.8s !important;
    animation-iteration-count: infinite !important;
  }
}

/* Print — hide interactive chrome, drop page tint */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
