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

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

  body {
    margin: 0;
    background: var(--ff-bg);
    color: var(--ff-text);
    font-family: var(--ff-font-ui);
    font-size: var(--ff-text-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  p {
    margin: 0;
  }

  a {
    color: var(--ff-accent-text);
    text-underline-offset: 0.2em;
  }

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

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

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

  /* 16 px in fields: iOS zooms smaller ones */
  input,
  select,
  textarea {
    font-size: max(var(--ff-text-md), 16px);
  }

  [hidden] {
    display: none;
  }

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

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

  .ff-stack > * + * {
    margin-top: var(--ff-space-4);
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
