/* ============================================================
 * Covalent Bio — Base
 * Reset + typography + layout primitives. No component rules.
 * ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-base);
  color: var(--color-ink);
  background: var(--color-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "cv02" on;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* Selection */
::selection { background: var(--color-teal); color: var(--color-ivory); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
  border-radius: var(--r-2);
}

/* Typography primitives */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: var(--lh-tight);
  color: var(--color-ink);
}
h1 { font-size: var(--fs-72); line-height: 0.95; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-48); line-height: 1.02; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-30); }
h4 { font-size: var(--fs-24); }

p { font-size: var(--fs-16); line-height: var(--lh-loose); color: var(--color-ink-2); max-width: var(--max-w-text); }
p + p { margin-top: 1em; }

em, .italic { font-style: italic; }
strong, b { font-weight: 600; }
small { font-size: var(--fs-14); }
code, kbd, samp, .mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: var(--tracking-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-teal);
}

.serif-italic {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: -0.01em;
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow { width: 100%; max-width: 880px; margin-inline: auto; padding-inline: var(--gutter); }
.container-wide   { width: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--sp-20); }
.section-tight { padding-block: var(--sp-12); }
.section-loose { padding-block: var(--sp-32); }

.divider-rule { height: 1px; background: var(--color-border); border: 0; margin-block: var(--sp-12); }

/* Stack helper */
.stack > * + * { margin-top: var(--stack-gap, var(--sp-4)); }
.stack-2 { --stack-gap: var(--sp-2); }
.stack-3 { --stack-gap: var(--sp-3); }
.stack-4 { --stack-gap: var(--sp-4); }
.stack-6 { --stack-gap: var(--sp-6); }
.stack-8 { --stack-gap: var(--sp-8); }

/* Utility */
.txt-mono   { font-family: var(--font-mono); letter-spacing: var(--tracking-mono); }
.txt-up     { text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.txt-muted  { color: var(--color-ink-3); }
.txt-teal   { color: var(--color-teal); }
.txt-center { text-align: center; }
.surface    { background: var(--color-paper); }
.surface-ivory { background: var(--color-ivory); }
.surface-teal  { background: var(--color-teal); color: var(--color-ivory); }
.surface-teal :is(h1, h2, h3, h4) { color: var(--color-ivory); }
.surface-teal p { color: var(--color-ivory); opacity: 0.85; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
