@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, ul, ol, dl, dd, figure, blockquote, address { margin: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  img, svg, video, iframe { display: block; max-inline-size: 100%; }
  img { block-size: auto; }
  button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
  button { cursor: pointer; }
  a { color: inherit; }
  address { font-style: normal; }
  table { border-collapse: collapse; }
  [hidden] { display: none; }
}

@layer base {
  html {
    font-family: var(--font-sans);
    line-height: var(--lh-normal);
    color: var(--ink);
    background: var(--surface);
    scroll-padding-block-start: var(--space-6);
    /* never set font-size here: the page opts into OS text scaling (meta text-scale) */
  }
  body {
    min-block-size: 100vh;
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
    font-size: var(--fs-md);
    overflow-wrap: break-word;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
  }
  main { flex: 1; }
  h1, h2, h3, h4 {
    font-weight: var(--fw-medium);
    line-height: var(--lh-tight);
    letter-spacing: var(--track-title);
    text-wrap: balance;
  }
  h1, h2, h3, h4 { overflow-wrap: anywhere; }
  h1 { font-size: var(--fs-h1-sm); }
  h2 { font-size: var(--fs-h2-sm); }
  h3 { font-size: var(--fs-h3-sm); line-height: var(--lh-snug); }
  h4 { font-size: var(--fs-h4-sm); line-height: var(--lh-snug); }
  strong, b { font-weight: var(--fw-strong); }
  small { font-size: var(--fs-sm); }
  a { text-decoration-thickness: 0.0625em; text-underline-offset: 0.18em; }
  :focus-visible, .is-focus { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
  ::selection { background: var(--brand); color: var(--on-brand); }
  hr { border: 0; border-block-start: 1px solid var(--border-strong); margin: var(--space-8) 0; }

  @media (min-width: 48em) {
    h1 { font-size: var(--fs-h1); }
    h2 { font-size: var(--fs-h2); }
    h3 { font-size: var(--fs-h3); }
    h4 { font-size: var(--fs-h4); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto; transition-duration: 0.01ms; animation-duration: 0.01ms; }
  }
}
