/* Reset + base element styles + shared layout primitives */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--color-page);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  background: var(--color-page);
  color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /*
    No overflow-x here: setting overflow on body/html breaks position:sticky
    for the header (a well-known CSS gotcha).
  */
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  transition: color var(--transition);
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.4;
}

h1 {
  font-size: var(--text-3xl);
  text-align: center;
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Visible only to assistive tech / keyboard users */
.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 2000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-dark);
  color: var(--color-white);
}

.skip-link:focus {
  top: var(--space-4);
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
  margin-top: var(--space-7);
}

/* Keeps anchor-linked sections from being tucked under the sticky header */
[id] {
  scroll-margin-top: 110px;
}

.page-title {
  margin: 42px 0;
}

/* Text from the CMS: paragraphs, links and lists */
.prose > * + * {
  margin-top: 1em;
}

.prose a {
  text-decoration: underline;
}

.prose a:hover {
  color: var(--color-orange);
}

.prose h2,
.prose h3 {
  margin-top: 1.2em;
}

.prose ul {
  list-style: disc;
  padding-left: 1.4em;
}

.prose img {
  margin-inline: auto;
}

@media (max-width: 767px) {
  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 1.875rem;
  }
}

@media (max-width: 478px) {
  h1 {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
