/* Layer order is repeated in every file: browsers use the first declaration they see, and files load alphabetically. */
@layer tokens, base, components, pages;

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

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

  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-text);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  main { flex: 1; }

  h1, h2, h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  h1 { font-size: var(--heading-lg); letter-spacing: -0.015em; }
  h2 { font-size: var(--heading-md); }
  h3 { font-size: var(--heading-sm); }

  p { margin: 0; text-wrap: pretty; }

  img { display: block; max-width: 100%; height: auto; }

  a { color: var(--teal); text-underline-offset: 0.18em; }
  a:hover { color: var(--teal-deep); }

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

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

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

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