/* base.css — reset, typography, the reading measure. */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: calc(clamp(16px, 0.6vw + 14px, 18px) * var(--fs-scale));
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--bg);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* The reading column — every text-bearing surface is constrained. */
.measure {
  max-width: min(92vw, var(--measure));
  margin-inline: auto;
}
.measure--narrow { max-width: min(92vw, var(--measure-narrow)); }

/* Headings — display face, tight tracking, balanced wrap. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--size-2xl); }
h2 { font-size: var(--size-xl); line-height: var(--lh-heading); }
h3 { font-size: var(--size-lg); line-height: var(--lh-subhead); font-weight: 600; }
h4 { font-size: var(--size-md); line-height: var(--lh-subhead); }

p {
  margin: 0;
  text-wrap: pretty;
  hyphens: auto;
}
p + p { margin-block-start: var(--sp-md); }

.lead {
  font-size: var(--size-md);
  color: var(--text);
}

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

/* Mono is for labels, ops, code, and structural metadata. */
.mono, code, kbd, .label {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  letter-spacing: 0.01em;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--size-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  padding-block: 0.1em;
}
a:hover { color: var(--text); }

ul, ol { margin: var(--sp-md) 0; padding-inline-start: 1.4em; }
li + li { margin-block-start: var(--sp-xs); }

hr {
  border: none;
  border-top: 1px solid var(--rule-solid);
  margin-block: var(--sp-lg);
}

/* Accessibility: visible keyboard focus everywhere. Color is never the only signal. */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 3px;
}
::selection { background: var(--amber-soft); color: var(--text); }

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

/* Screen-reader-only text. */
.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;
}
