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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  figure,
  blockquote,
  dl,
  dd,
  ol,
  ul {
    margin: 0;
  }

  ol[role="list"],
  ul[role="list"] {
    padding: 0;
    list-style: none;
  }

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

  img {
    height: auto;
  }

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

  button {
    cursor: pointer;
  }

  table {
    border-collapse: collapse;
  }

  [hidden] {
    display: none !important;
  }
}

@layer base {
  html {
    scroll-padding-top: var(--space-6);
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--page);
    color: var(--text-1);
    font: var(--type-body);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3,
  h4 {
    color: var(--text-1);
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;

    &:hover {
      text-decoration-thickness: 2px;
    }
  }

  :focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
  }

  ::selection {
    background: var(--accent-tint);
    color: var(--text-1);
  }

  strong,
  b {
    font-weight: 600;
  }

  small {
    font: var(--type-micro);
  }

  hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-6) 0;
  }

  code,
  kbd,
  samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--accent-text);
    font: var(--type-interface);
    font-weight: 600;
    box-shadow: var(--shadow-raised);
    transform: translateY(-200%);

    &:focus-visible {
      transform: none;
    }
  }

  .num {
    font-variant-numeric: tabular-nums;
  }

  .prose {
    max-width: var(--measure);
    font: var(--type-body-large);
    color: var(--text-1);

    & > * + * {
      margin-top: 1em;
    }

    & h2 {
      font: var(--type-section);
      margin-top: 1.6em;
    }

    & h3 {
      font: var(--type-subsection);
      margin-top: 1.4em;
    }

    & ul,
    & ol {
      padding-left: 1.4em;
    }

    & li + li {
      margin-top: 0.4em;
    }

    & blockquote {
      padding-left: var(--space-4);
      border-left: 2px solid var(--line);
      color: var(--text-2);
    }
  }
}

@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;
  }
}
