@layer base {
  html {
    min-width: 320px;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    background: var(--color-paper);
    scrollbar-width: thin;
    scrollbar-color: var(--color-line-strong) var(--color-paper);
  }

  body {
    background: var(--color-paper);
    font-family: var(--font-sans);
    font-size: var(--text-lead);
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
  }

  h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.04em;
  }

  h1 {
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  :is(a, button, input, select, textarea, summary) {
    touch-action: manipulation;
  }

  /* Controls, not content: a long press shouldn't select their labels */
  :is(button, .btn, .chip) {
    -webkit-user-select: none;
    user-select: none;
  }

  :focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: 3px;
  }

  /* Text fields and menus show focus quietly, never with the coral outline, even when tapped: browsers
     count any focus on them as keyboard focus. Each gives its own neutral focus */
  :is(input:not([type="submit"]), textarea, select):focus-visible {
    outline: none;
  }

  ::selection {
    background: var(--color-selection);
    color: var(--color-ink);
  }
}
