/* ==========================================================================
   Base + layout. Components live in components.css.
   Mobile-first: base styles target 360px, then scale up.
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* room for the fixed bottom nav on mobile */
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
p  { color: var(--text-2); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(2rem, 1.2rem + 3vw, 4rem); }
.section__head { margin-bottom: var(--space-6); }
.section__head p { margin-top: var(--space-2); max-width: 62ch; }
.section__head--row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: var(--space-3);
}

.stack > * + * { margin-top: var(--space-4); }
.prose { max-width: 68ch; }
.prose p + p { margin-top: var(--space-4); }
.prose ul { margin: var(--space-4) 0 var(--space-4) var(--space-6); list-style: disc; color: var(--text-2); }
.prose li + li { margin-top: var(--space-2); }

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

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; top: -999px; left: var(--space-4);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-3) var(--space-5);
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; border-radius: var(--radius-md);
}
.skip-link:focus { top: var(--space-3); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Every interactive element clears the 44px touch target. */
a, button, input, [role="button"] { touch-action: manipulation; }
