/* ==========================================================================
   BASE
   Reset + default typography. No layout, no components — just what every
   page starts from once tokens.css is loaded.
   ========================================================================== */

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

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

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

h1, h2, h3, h4{
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin: 0 0 var(--space-3);
}

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

p{
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}

small, .text-sm{
  font-size: var(--text-sm);
}

a{
  color: var(--color-accent);
  text-decoration: none;
}

a:hover{
  color: var(--color-accent-hover);
  text-decoration: underline;
}

ul, ol{
  margin: 0;
  padding: 0;
  list-style: none;
}

button{
  font-family: inherit;
}

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

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

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

/* Visible keyboard focus everywhere — never remove outline without replacing it */
:focus-visible{
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

/* ---- Small text utilities used across pages ---- */
.text-muted{ color: var(--color-text-muted); }
.text-faint{ color: var(--color-text-faint); }
.text-accent{ color: var(--color-accent); }
.text-center{ text-align: center; }
.text-end{ text-align: right; }
.fw-bold{ font-weight: 700; }

/* ---- Small spacing utilities (stacking cards/sections vertically) ---- */
.mb-1{ margin-bottom: var(--space-1); }
.mb-2{ margin-bottom: var(--space-2); }
.mb-3{ margin-bottom: var(--space-3); }
.mb-4{ margin-bottom: var(--space-5); }
.mt-3{ margin-top: var(--space-3); }
.mt-4{ margin-top: var(--space-5); }
