/* ─────────────────────────────────────────────
   Base — reset, typography, accessibility defaults
   ───────────────────────────────────────────── */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: var(--line-height-tight);
  color: var(--color-navy);
  font-weight: 600;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-2xl); margin-top: var(--space-xl); }
h3 { font-size: var(--font-size-xl); margin-top: var(--space-lg); }
h4 { font-size: var(--font-size-lg); margin-top: var(--space-md); }

p {
  margin-top: var(--space-md);
  max-width: 68ch; /* comfortable reading measure */
}

ul, ol {
  margin-top: var(--space-md);
  padding-left: 1.25em;
}

li + li {
  margin-top: var(--space-xs);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-link-hover);
}

/* Visible keyboard focus everywhere — never remove outline without
   replacing it. This matters as much as any visual polish. */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Utility: visually hide content while keeping it available to
   screen readers (e.g. "Skip to content" targets, labels) */
.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 {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition-fast);
}

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