/* base page-wide rules - reset, body/heading defaults, .container, skip link.
   needs variables.css loaded first since this uses var(--color-...) a lot */

/* reset - strip the browser's default spacing/styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* visible outline on whatever's focused, so keyboard users can see where they are */
:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* page defaults */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.2rem; }

/* headings above are too big for small phones, shrink them a bit */
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

p {
  margin: 0 0 1em;
}

/* centers content and stops it stretching too wide on big screens.
   almost every section wraps its content in this */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* "skip to main content" link -- hidden off screen until a keyboard user
   tabs to it, then it pops into view so they can skip the nav menu */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  border-radius: var(--radius-sm);
}

/* respect the "reduce motion" accessibility setting */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
