@layer base {
  html {
    font-family: var(--font-sans);
    font-size: 100%;
    line-height: var(--line-height);
    color: var(--color-text);
    background: var(--color-canvas);
    accent-color: var(--color-accent);
  }

  /* Direction is set on <html dir> from the request locale (he → rtl, en → ltr).
     All spacing uses logical properties so one stylesheet serves both. */

  body {
    display: flex;
    flex-direction: column;
    min-block-size: 100dvh;
    /* Inline gutter lives on the page containers (.site-header/.wrapper/.site-footer)
       so they share one centered, capped column; the column flex + a growing
       .wrapper keep the footer pinned to the bottom on short pages. */
  }

  a {
    color: var(--color-link);
    text-underline-offset: 0.15em;
    transition: color var(--transition);
  }
  a:hover { text-decoration: underline; }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
    margin-block-end: var(--block-space-half);
  }

  h1 { font-size: var(--text-xx-large); }
  h2 { font-size: var(--text-x-large); }
  h3 { font-size: var(--text-large); }
  h4 { font-size: var(--text-medium); }

  :where(p, ul, ol) { margin-block-end: var(--block-space); }

  strong, b { font-weight: 600; }
  small { font-size: var(--text-small); }

  hr {
    border: none;
    border-block-start: var(--border);
    margin-block: var(--block-space-double);
  }

  ::selection {
    background: var(--color-brand-soft);
    color: var(--color-text);
  }

  :focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: var(--radius-small);
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
    }
  }
}
