:root {
  --content-width: 98rem;
  --body-padding: 6.4rem;
  --page-padding: 1.6rem;

  --font-family: -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-family--mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --font-size-base: 11px;
  --font-size-xx-small: 1.1rem;
  --font-size-x-small: 1.2rem;
  --font-size-small: 1.4rem;
  --font-size-medium: 1.6rem;
  --font-size-large: 1.8rem;
  --font-size-x-large: 2.4rem;
  --font-size-xx-large: 3.4rem;

  --base-space: 1.25em;
  --half-space: calc(var(--base-space) / 2);
  --quarter-space: calc(var(--base-space) / 4);
  --double-space: calc(var(--base-space) * 2);

  @media (min-width: 60em) {
    --font-size-xx-small: 1.2rem;
    --font-size-x-small: 1.4rem;
    --font-size-small: 1.6rem;
    --font-size-medium: 1.8rem;
    --font-size-large: 2rem;
    --font-size-x-large: 2.8rem;
    --font-size-xx-large: 4rem;
  }
}

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

html,
body {
  margin: 0;
}

html {
  background: var(--color-bg--main);
  color: var(--color-txt);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: var(--font-size-medium);
  padding: 0 0 var(--body-padding);
  margin: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

figure {
  display: inherit;
  margin: 0;
}

/* Typography */

h6, h5, h4, h3, h2, h1, .hdg {
  font-weight: bold;
  line-height: 1;
  text-wrap: balance;
  @supports (text-wrap: pretty) {
    text-wrap: pretty;
  }
}
h6, .hdg--xx-small { font-size: var(--font-size-xx-small); }
h5, .hdg--x-small { font-size: var(--font-size-x-small); }
h4, .hdg--small { font-size: var(--font-size-small); }
h3, .hdg--medium { font-size: var(--font-size-medium); }
h2, .hdg--large { font-size: var(--font-size-large); }
h1, .hdg--x-large { font-size: var(--font-size-x-large); }
.hdg--xx-large { font-size: var(--font-size-xx-large); }

.txt--xx-small { font-size: var(--font-size-xx-small); }
.txt--x-small { font-size: var(--font-size-x-small); }
.txt--small { font-size: var(--font-size-small); }
.txt--medium { font-size: var(--font-size-medium); }
.txt--large { font-size: var(--font-size-large); }
.txt--x-large { font-size: var(--font-size-x-large); }
.txt--xx-large { font-size: var(--font-size-xx-large); }

.txt--bold { font-weight: bold; }
.txt--normal { font-weight: normal; }
.txt--subtle { color: var(--color-txt--subtle); }
.txt--uppercase { text-transform: uppercase; }
.txt--spread { letter-spacing: 0.25rem; }

.u-nowrap { white-space: nowrap; }
.txt--break-words { word-wrap: break-word; }

/* Links */

a {
  color: var(--color-txt--action);
  word-wrap: break-word;
}

.permalink {
  color: inherit;
}

.decorated {
  color: var(--color-txt--action);
  text-decoration: underline;
}

.undecorated {
  color: inherit;
  text-decoration: none;
}

/* Utilities & Layout */

.border--top { border-top: 1px solid var(--color-border--light); }
.border--bottom { border-bottom: 1px solid var(--color-border--light); }

.i-flex { display: inline-flex !important; }
.flex { display: flex; }
.flex--column { display: flex; flex-direction: column; }
.flex--centered { justify-content: center; }
.flex--align-center { display: flex; align-items: center; }
.flex-item--grow { flex-grow: 1; }

.align--center { text-align: center; }
.align--center\@medium { 
  @media (min-width: 40em) { 
    text-align: center; 
  } 
}

/* Spacing utilities */

.flush--top { margin-top: 0 !important; }
.flush--bottom { margin-bottom: 0 !important; }
.flush--ends { margin-top: 0 !important; margin-bottom: 0 !important; }

.push { margin: var(--base-space) !important; }
.push--top { margin-top: var(--base-space) !important; }
.push--bottom { margin-bottom: var(--base-space) !important; }
.push--ends { margin-top: var(--base-space) !important; margin-bottom: var(--base-space) !important; }

.push_half { margin: var(--half-space) !important; }
.push_half--top { margin-top: var(--half-space) !important; }
.push_half--bottom { margin-bottom: var(--half-space) !important; }
.push_half--ends { margin-top: var(--half-space) !important; margin-bottom: var(--half-space) !important; }

.push_quarter { margin: var(--quarter-space) !important; }
.push_quarter--top { margin-top: var(--quarter-space) !important; }
.push_quarter--bottom { margin-bottom: var(--quarter-space) !important; }
.push_quarter--ends { margin-top: var(--quarter-space) !important; margin-bottom: var(--quarter-space) !important; }

.push_double { margin: var(--double-space) !important; }
.push_double--top { margin-top: var(--double-space) !important; }
.push_double--bottom { margin-bottom: var(--double-space) !important; }
.push_double--ends { margin-top: var(--double-space) !important; margin-bottom: var(--double-space) !important; }

.unpad { padding: 0 !important; }

/* Page structure */

.page {
  width: 100%;
  max-width: var(--content-width);
  min-height: calc(100vh - var(--body-padding) - (var(--page-padding) * 2));
  padding: var(--page-padding);
  margin: 0 auto;
  position: relative;
}

.page--medium\@medium {
  @media (min-width: 40em) {
    .page__content { max-width: 75rem; }
  }
}

.page__content {
  max-width: var(--content-width);
  margin: 0 auto;
}