/* ==========================================================================
   Webfonts, reset, typography, layout primitives
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Inter-Regular-lt.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Inter-Medium-lt.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/Inter-Bold-lt.woff2") format("woff2");
}

/* ---- reset ---- */

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

html {
  /* 1rem = 10px, which keeps the rem scale readable */
  font-size: 62.5%;
}

body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--body-max-width);
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--base);
  color: var(--black);
  font-family: var(--font-body);
  font-size: var(--text-m);
  font-weight: 400;
  line-height: var(--line-height-body);
  text-wrap: balance;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure {
  margin: 0;
}

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

img {
  height: auto;
  border: 0;
  vertical-align: middle;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- typography ---- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--line-height-header);
  max-width: 100%;
  text-wrap: balance;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
}

/* Vertical rhythm inside a block of running text */
.prose > * + * {
  margin-block-start: 1em;
}

.prose ul,
.prose ol {
  margin-block: 1em;
  padding-inline-start: 2em;
}

.prose li + li {
  margin-block-start: 0.5em;
}

/* A paragraph after a list already has the list's bottom margin */
.prose > :is(ul, ol) + * {
  margin-block-start: 0;
}

/* ---- layout primitives ---- */

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-block: var(--section-space);
  padding-inline: var(--gutter);
}

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

/* ---- skip links (only visible on keyboard focus) ---- */

.skip-link {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 9999;
  transform: translateY(-250%);
  padding: 0.75em 1.5em;
  border-radius: 0.5em;
  background: var(--black);
  color: var(--white);
  font-size: var(--text-m);
  line-height: 1;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 0.2rem solid var(--black);
  outline-offset: 0.25em;
}
