/* Typography.

   One typeface does almost everything. The discipline is in weight, size and
   tracking rather than in mixing families.

   Monospace is reserved for measured values: CAS numbers, molecular formulas,
   molecular weights, purity figures, prices, batch references. If a number is
   not a measurement it is set in the body face. Using mono for labels and
   eyebrows is what makes a site read as technical rather than clinical, so
   labels use letterspaced small caps in the body face instead. */

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--ground);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--track-display);
  font-weight: 600;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: var(--leading-snug); letter-spacing: var(--track-tight); }
h4 { font-size: var(--step-1); line-height: var(--leading-snug); letter-spacing: var(--track-tight); }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}
a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }

strong, b { font-weight: 600; }
small { font-size: var(--step--1); }

/* Measured values.

   Kept as a class because the values still want tabular figures so columns of
   numbers line up, and slightly tighter tracking so a CAS number reads as one
   token. It is set in the body face: no monospace anywhere on the site. */
.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
  letter-spacing: -0.005em;
  font-weight: 500;
  color: var(--ink);
}

/* Section labels. Body face, letterspaced, small. This replaces the monospace
   eyebrow that made everything read as a terminal. */
.eyebrow {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
}
.eyebrow--quiet { color: var(--ink-faint); }

.label {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Long form */
.prose { max-width: var(--measure); font-size: var(--step-1); line-height: 1.7; }
.prose > * + * { margin-top: var(--s-5); }
.prose h2 { margin-top: var(--s-8); font-size: var(--step-2); }
.prose h3 { margin-top: var(--s-6); font-size: var(--step-1); }
.prose h2 + p, .prose h3 + p { margin-top: var(--s-3); }
.prose ul, .prose ol { padding-left: 1.15em; }
.prose li + li { margin-top: var(--s-2); }
.prose blockquote {
  margin-inline: 0;
  padding: var(--s-5);
  background: var(--mist);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--step-1);
  font-weight: 500;
}
.prose code {
  font-size: 0.92em;
  background: var(--mist-deep);
  padding: 0.12em 0.36em;
  border-radius: 4px;
  font-weight: 500;
}
.prose img { border-radius: var(--radius); margin-block: var(--s-6); }
.prose table { font-size: var(--step--1); }

/* Comparison tables inside long form content. Hairline rules, tabular figures,
   scrollable on a phone rather than crushed. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  margin-block: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.prose thead th,
.prose tr:first-child th {
  text-align: left;
  background: var(--mist);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.prose td, .prose tbody th {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.prose tbody th { text-align: left; font-weight: 500; }
.prose tr:last-child td, .prose tr:last-child th { border-bottom: 0; }
.prose tr:nth-child(even) td { background: var(--mist); }

@media (max-width: 620px) {
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
  .prose td, .prose th { white-space: normal; min-width: 120px; }
}
