/* Base — reset, typography, focus, motion */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  font-feature-settings: 'kern', 'liga', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Belt-and-suspenders: stop long unbreakable strings (like emails or URLs)
   from forcing a horizontal scroll on small viewports. */
h1, h2, h3, p, a, dd { overflow-wrap: break-word; }

/* Typography — Inter only, weights 400/600/800 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  margin: 0 0 var(--space-m);
  color: var(--color-text);
}
h1 { font-size: var(--step-6); line-height: 1.02; }
h2 { font-size: var(--step-4); line-height: 1.08; }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); }
h4 { font-size: var(--step-1); font-weight: var(--weight-semi); line-height: var(--leading-snug); letter-spacing: 0; }

p {
  margin: 0 0 var(--space-m);
  max-width: var(--container-prose);
  text-wrap: pretty;
}

a {
  color: var(--color-action);
  text-decoration-color: hsl(195 50% 50% / 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--color-action-hover); text-decoration-color: var(--color-action-hover); }
}

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

ul, ol { padding-left: 1.25rem; margin: 0 0 var(--space-m); }
li { margin: var(--space-2xs) 0; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-l) 0;
}

::selection { background: var(--accent-700); color: var(--color-text); }

/* Focus — WCAG 2.2 AA: ≥2px solid, 3:1 contrast vs unfocused */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-action);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Skip link — first focusable */
.skip-link {
  position: absolute;
  left: 0; top: 0;
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-s) var(--space-m);
  font-weight: var(--weight-semi);
  text-decoration: none;
  border-radius: 0 0 var(--radius-s) 0;
  transform: translateY(-100%);
  transition: transform var(--dur-fast) var(--ease-out);
  z-index: var(--z-toast);
}
.skip-link:focus-visible { transform: translateY(0); outline-offset: -3px; }

/* Reduced motion — preserve color/opacity, kill translate/scale */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Visually hidden, accessible */
.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;
}

/* Eyebrow / kicker text */
.eyebrow {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-action);
  margin-bottom: var(--space-s);
}
