/* ============================================================
   base.css — reset, typography, accessibility
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

html, body { overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.6;
  color: var(--text-on-dark);
  background: var(--surface-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

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

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

/* ---- headings ---- */
h1, h2, h3, h4 { overflow-wrap: break-word; }

h1, .display-xl {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1;
  font-weight: 300;
  font-size: var(--display-xl);
  line-height: .94;
  letter-spacing: -.02em;
}

.display-l {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1;
  font-weight: 400;
  font-size: var(--display-l);
  line-height: 1.02;
  letter-spacing: -.015em;
}

h2, .h2 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 60, 'WONK' 1;
  font-weight: 400;
  font-size: var(--h2);
  line-height: 1.1;
  letter-spacing: -.01em;
}

h3, .h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--h3);
  line-height: 1.25;
}

p { max-width: var(--measure); }

.lede {
  font-size: var(--lede);
  line-height: 1.45;
  font-weight: 400;
}

.small { font-size: var(--small); }

/* ---- the mono voice: labels, eyebrows, data ---- */
.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--label);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--label);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-on-dark-mute);
}

.on-light .eyebrow, .surface-light .eyebrow { color: var(--text-on-light-mute); }

.binomial {
  font-family: var(--font-mono);
  font-style: italic;
  text-transform: none;
  letter-spacing: .02em;
}

/* ---- links ---- */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover {
  text-decoration-color: var(--candytuft);
  text-decoration-thickness: 2px;
}
.surface-light a, .on-light a { text-decoration-color: var(--rule-light); }
.surface-light a:hover, .on-light a:hover { text-decoration-color: var(--candytuft); }

/* ---- focus ---- */
:focus-visible {
  outline: 2px solid var(--gorse);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  top: -60px;
  left: var(--pad-x);
  z-index: 200;
  padding: 12px 20px;
  background: var(--candytuft);
  color: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: var(--small);
  text-decoration: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 0; }

/* ---- selection ---- */
::selection { background: var(--candytuft); color: var(--ink-deep); }

/* ---- utilities ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.measure { max-width: var(--measure); }

hr {
  border: none;
  border-top: 1px solid var(--rule-dark);
  margin: calc(var(--tile) * 2) 0;
}
.surface-light hr { border-top-color: var(--rule-light); }
