/* Shared typography for the portfolio and case studies. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading: "Space Grotesk", "Inter", system-ui, sans-serif;
  --type-body: 1.0625rem;
  --type-display: clamp(2.25rem, 5.2vw, 4.5rem);
  --type-section: clamp(1.875rem, 3.5vw, 3rem);
  --type-subheading: clamp(1.375rem, 2vw, 1.75rem);
  --type-lead: clamp(1.125rem, 2vw, 1.3125rem);
  --type-small: .875rem;
  --type-label: .75rem;
  --type-ui: .9375rem;
  --type-brand: 1.25rem;
  --type-card-title: 1.25rem;
  --type-quote: clamp(1.5rem, 3vw, 2.5rem);
  --type-stat: clamp(2rem, 4.8vw, 3.5rem);
  --line-body: 1.65;
  --line-display: 1.1;
  --line-section: 1.15;
  --line-subheading: 1.25;
  --line-small: 1.5;
  --tracking-display: -.03em;
  --tracking-section: -.025em;
  --tracking-label: .08em;
}

body {
  font-family: var(--font);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: var(--line-body);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading);
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--type-display);
  line-height: var(--line-display);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--type-section);
  line-height: var(--line-section);
  letter-spacing: var(--tracking-section);
}

h3 {
  font-size: var(--type-subheading);
  line-height: var(--line-subheading);
  letter-spacing: var(--tracking-section);
}

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

strong, b {
  font-weight: 600;
}

.brand {
  font-family: var(--heading);
  font-size: var(--type-brand);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.btn, .button, .next-link, .text-link, .family-filter {
  font-family: var(--font);
  font-size: var(--type-ui);
  font-weight: 600;
  line-height: 1.4;
}

.back-link, .chapter-nav a {
  font-family: var(--font);
  font-size: var(--type-small);
  font-weight: 600;
  line-height: var(--line-small);
}

.eyebrow, .section-kicker {
  font-family: var(--font);
  font-size: var(--type-label);
  font-weight: 700;
  line-height: var(--line-small);
  letter-spacing: var(--tracking-label);
}

.lede, .hero-lede, .hero-thesis, .chapter-lede {
  font-size: var(--type-lead);
  line-height: var(--line-body);
}

figcaption, .caption {
  font-size: var(--type-small);
  font-weight: 400;
  line-height: var(--line-small);
}

.metric dd {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  :root {
    --type-body: 1rem;
  }
}
