/* Reset, typography, focus, motion. */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--text-1);
  background: var(--bg-app);
}

h1, h2, h3, h4 { margin: 0 0 var(--sp-2); font-weight: 600; line-height: 1.25; }
h1 { font-size: var(--text-xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-md); }
h3 { font-size: var(--text-base); }

p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }

hgroup { margin-bottom: var(--sp-4); }
hgroup h1, hgroup h2 { margin-bottom: var(--sp-1); }
hgroup p { color: var(--text-2); font-size: var(--text-sm); margin: 0; }

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

small { font-size: var(--text-xs); }
strong { font-weight: 600; }

ul, ol { margin: 0 0 var(--sp-3); padding-left: 1.25rem; }

blockquote {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--accent);
  background: var(--bg-inset);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  overflow-x: auto;
  white-space: pre-wrap;
}

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

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

/* Focus — a visible ring everywhere; never a bare outline:none. */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* Utility text tones. --text-3 is decorative-only; .muted stays AA. */
.muted { color: var(--text-2); }
.done { color: var(--ok); font-weight: 600; }
.hold { color: var(--danger); font-weight: 600; }

/* Screen-reader-only helper. */
.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.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
