/* ============================================================
   BASE
   Reset, document defaults, typography.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--ease-default);
}

a:hover { color: var(--teal-deep); }

button {
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul, ol { list-style: none; }

/* Accessibility: visible focus ring on keyboard nav */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Visually hidden utility — off-screen for sighted users,
   still read by screen readers. Used for structural headings. */
.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 — fully hidden until focused, then snaps to the
   top-left. No slide transition (keyboard users want it instant). */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-size: 0.85rem;
  z-index: var(--z-modal);
  /* Clipped out of view until focus — avoids any sliver peek */
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  clip: auto;
  clip-path: none;
  color: var(--white);
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Typography primitives */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
}

p { line-height: 1.65; }

/* Page transitions live in css/transitions.css (loaded on every page,
   including standalone case studies that don't link base.css). */

/* Respect reduced-motion preference (disables parallax, smooth scroll, etc.) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
