/* ==========================================================================
   Base: reset, typography, layout primitives, focus, utilities
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

/* ---- Headings -------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  font-weight: 640;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  font-weight: 620;
  letter-spacing: -0.022em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  font-weight: 620;
  letter-spacing: -0.012em;
}

p {
  text-wrap: pretty;
}

/* ---- Links ----------------------------------------------------------------- */

a {
  color: var(--sb-moss-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--sb-moss-deep);
  text-decoration-thickness: 2px;
}

/* ---- Focus ----------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* ---- Layout primitives ----------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

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

.section--alt {
  background: var(--color-surface-alt);
  border-block: 1px solid var(--color-border-subtle);
}

.section--rule {
  border-top: 1px solid var(--color-border);
}

.section-head {
  max-width: 46rem;
}

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

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--color-text-soft);
  max-width: 40em;
}

/* Body copy never runs wider than a comfortable measure */
.prose {
  max-width: var(--measure);
}

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

/* ---- Utilities ------------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--sb-moss-deep);
  color: var(--sb-white);
  font: 600 var(--fs-sm) / 1 var(--font-ui);
  border-radius: var(--radius-m);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--sb-white);
}

[hidden] {
  display: none !important;
}
