/* ============================================================================
   base.css — reset, body defaults, typography baseline
   Consumes tokens from tokens.css. No layout, no components — only the
   typographic and visual baseline that every page inherits.
   ============================================================================ */

/* ---------- Reset ---------- */

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

html,
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ---------- HTML — text rendering ---------- */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Body — typographic baseline ---------- */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  font-weight: var(--font-weight-body);
  font-size: var(--size-body);
  line-height: 1.6;
}

/* ---------- Headings — Display family, tight leading, nav color ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-light);
  color: var(--color-nav);
  line-height: 1.05;
}

/* ---------- Prose — max-width + paragraph rhythm (L151–155, L166–167) ---------- */

p {
  max-width: var(--prose-max-width);
  /* Prevent widows (single short word stranded on its own line at end of
     paragraph). Especially important for centered prose where widows are
     highly visible. Graceful fallback in older browsers — widows return,
     nothing else breaks. */
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-paragraph);
}

/* ---------- Italic — brand voice, emotion (L93–99) ---------- */

em,
i {
  font-style: italic;
}

/* ---------- Links — strip browser defaults; components.css re-adds CTA underline ---------- */

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

/* ---------- Selection — branded text selection ---------- */

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

/* ---------- Mobile tap — remove blue iOS tap highlight (no-icons rule extends here) ---------- */

a,
button {
  -webkit-tap-highlight-color: transparent;
}
