:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  --max-width: 72rem;
  --max-width-prose: 42rem;
  --transition: 160ms ease;
}

html {
  color-scheme: light dark;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); margin-top: var(--space-10); }
h3 { font-size: var(--text-xl); margin-top: var(--space-6); }

p { margin-top: var(--space-4); }
p:first-child { margin-top: 0; }

a {
  color: var(--color-accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

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

.prose > * + * {
  margin-top: var(--space-4);
}

.prose ul,
.prose ol {
  list-style: disc;
  padding-inline-start: 1.25em;
}

.prose ol {
  list-style: decimal;
}

section {
  padding-block: var(--space-10);
}

/* Clears the fixed corner mark/waypoints trigger, which sit outside normal
   flow (see components.css). The home hero is exempt — its photo is meant
   to bleed to the very top of the viewport, with the corner marks floating
   over it. */
main > section:first-of-type:not(.hero-home) {
  padding-top: var(--space-12);
}

/* Locks background scroll while the waypoints overlay is open
   (site/assets/js/theme.js toggles this class). */
html.waypoints-open {
  overflow: hidden;
}

.section-tight {
  padding-block: var(--space-8);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

/* A one-line deck under a page's <h1> — the mono "coordinate" register
   used for a genuine subtitle, not a label announcing the heading above
   it (see docs/design.md's "atlas, not a dashboard" typography note). */
.deck {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  max-width: var(--max-width-prose);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* .sr-only: the core Markdown renderer's "(new tab)" hint on external links. */
.visually-hidden,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 48rem) {
  h1 { font-size: 3.5rem; }
}
