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

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

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 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-accent-strong);
  margin: 0 0 var(--space-4);
}

h1 { font-size: var(--fs-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

ul, ol {
  padding-left: 1.4em;
}

blockquote {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: 1rem;
}

/* ---- Accessibility: visible focus for all interactive elements ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove focus ring for mouse users while keeping it for keyboard nav */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green-950);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  z-index: 1000;
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-wide);
}

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

/* ---- Screen-reader only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Selection ---- */
::selection {
  background: var(--green-300);
  color: var(--green-950);
}

/* ---- Hairline rule, used throughout as a structural device ---- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-7) 0;
}
