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

  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    scroll-padding-top: 84px;
  }

  body {
    margin: 0;
    min-height: 100vh;
    background: var(--base);
    color: var(--body);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
  }

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

  img {
    height: auto;
  }

  a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
  }

  button,
  input,
  textarea,
  select {
    font: inherit;
  }

  button {
    cursor: pointer;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0;
    color: var(--teal-dark);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
  }

  h2 {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  h3 {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  }

  p {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.72;
  }

  ul,
  ol {
    margin-block: 0;
  }

  ::selection {
    background: rgba(232, 184, 106, 0.42);
    color: var(--ink);
  }

  :focus-visible {
    outline: 3px solid rgba(6, 155, 140, 0.42);
    outline-offset: 4px;
  }

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

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

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

  .skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .skip-link:focus {
    left: 16px;
    top: 16px;
    z-index: 999;
    width: auto;
    height: auto;
    padding: 10px 14px;
    border-radius: var(--radius-full);
    background: var(--teal-dark);
    color: var(--base);
  }
}
