/* base.css — reset, typography, links, focus. Element selectors only. */

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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
  }

  body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4 {
    margin: 0 0 var(--space-3);
    line-height: var(--leading-tight);
    color: var(--color-primary);
    font-weight: 700;
    overflow-wrap: break-word;
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  h4 { font-size: var(--text-base); }

  p, ul, ol, dl, table, figure, blockquote {
    margin: 0 0 var(--space-4);
  }

  ul, ol {
    padding-inline-start: 1.4em;
  }

  li + li {
    margin-top: var(--space-1);
  }

  a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
  }

  a:hover {
    color: var(--color-accent-dark);
    text-decoration-thickness: 2px;
  }

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

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
  }

  th, td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
  }

  th {
    color: var(--color-primary);
    font-weight: 600;
  }

  hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--space-6) 0;
  }

  strong { font-weight: 600; }

  address { font-style: normal; }

  /* Form controls inherit the page font; styling lives in components.css */
  button, input, select, textarea {
    font: inherit;
    color: inherit;
  }

  /* Keyboard focus is always visible and high-contrast */
  :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
  }

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