/* ─────────────────────────────────────────────────────────────
   reset.css — modern reset + a11y primitives + print styles
   Depends on tokens.css (must load first).
   ───────────────────────────────────────────────────────────── */

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

body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

body {
  min-height: 100vh;
  line-height: var(--lh-body);
  /* Prevent stray horizontal scroll on mobile from any element that
     overshoots the viewport (transforms, absolute positioning, etc.).
     `clip` doesn't establish a scroll container, so position:sticky
     descendants still pin against the viewport correctly. */
  overflow-x: clip;
  /* Stop elastic overscroll (rubber-band) at top and bottom of the
     document — keeps the footer locked when the user hits the bottom
     instead of letting the page bounce past its content end. */
  overscroll-behavior-y: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

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

/* ── A11y primitives ─────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 12px 16px;
  background: var(--color-text-primary);
  color: var(--color-bg);
  transform: translateY(-200%);
  transition: transform 150ms ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
}

/* ── Print ───────────────────────────────────────────────── */

@media print {
  nav,
  .skip-link,
  .reading-progress,
  .section-nav {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  *,
  *::before,
  *::after {
    background-image: none !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}
