/* ==========================================================================
   base.css — modern reset, document defaults, a11y primitives.
   Colors reference tokens.css only; no raw hex here.
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
video {
  height: auto;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

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

p,
li {
  text-wrap: pretty;
}

/* ---- Headings (Fraunces per scale) ------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  letter-spacing: var(--tracking-h1);
  font-weight: var(--weight-bold);
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
}

h3 {
  font-family: var(--font-ui);
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  font-weight: var(--weight-semibold);
}

/* ---- Focus visibility -------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--copper-600);
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ---- Selection --------------------------------------------------------- */
::selection {
  background-color: var(--sage-300);
  color: var(--ink);
}

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background-color: var(--moss-950);
  color: var(--paper);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius);
  transition: top var(--dur-fast) var(--ease-out);
}

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

/* ---- Screen-reader-only ------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ---- Print sanity ------------------------------------------------------ */
@media print {
  :root {
    --paper: white;
  }
  body {
    background: white;
    color: black;
  }
  .skip-link,
  nav,
  .cta-band,
  .media-slot__control {
    display: none !important;
  }
  a {
    color: black;
    text-decoration: underline;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: rgb(0 0 0 / 0.6);
  }
}
