/* Reset + element defaults */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--color-ink);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Long unbreakable strings (emails, URLs) wrap instead of overflowing.
       Buttons keep their own white-space:nowrap, so this never breaks labels. */
    overflow-wrap: anywhere;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; color: var(--color-ink); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

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

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

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

/* Visible, consistent focus ring for keyboard users */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Utilities */
.muted   { color: var(--color-muted); }
.faint   { color: var(--color-faint); }
.small   { font-size: var(--fs-sm); }
.right   { text-align: right; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.flex { display: flex; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.flex-gap { display: flex; align-items: center; gap: var(--sp-2); }
.grow { flex: 1; }
.hidden { display: none !important; }
.sr-only {
    position: absolute; 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.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
