/* ==========================================================================
   BASE: reset, typography and layout primitives.
   Reads only tokens from tokens.css. Do not put site-specific values here.
   ========================================================================== */

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video, picture { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; }
  p, h1, h2, h3, h4, li, dd { overflow-wrap: break-word; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-4)); }

  body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    color: var(--color-ink);
    background: var(--color-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: var(--lh-tight);
    font-weight: var(--fw-bold);
    letter-spacing: -0.015em;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); font-weight: var(--fw-semibold); }
  p { text-wrap: pretty; }

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

  :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  strong { font-weight: var(--fw-semibold); }

  /* Layout primitives */
  .container {
    width: 100%;
    max-width: calc(var(--container-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }

  .stack > * + * { margin-top: var(--stack-gap, var(--space-4)); }
  .flow-top { margin-top: var(--space-7); }

  .grid {
    display: grid;
    gap: var(--grid-gap, var(--space-5));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 16rem)), 1fr));
  }
  .grid--wide { --grid-min: 20rem; }
  .grid--narrow { --grid-min: 13rem; }

  .split {
    display: grid;
    gap: var(--space-7);
    align-items: center;
  }
  @media (min-width: 56rem) {
    .split { grid-template-columns: 1fr 1fr; }
    .split--reverse > :first-child { order: 2; }
  }

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

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

  @media print {
    .site-header, .site-footer, .cta-band, .skip-link { display: none; }
    body { color: #000; background: #fff; }
  }
}
