/* Phase 9 — base styles: reset, typography, body, links. */

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

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-3);
  color: var(--color-text);
  font-family: inherit;
  line-height: var(--line-height-snug);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.01em;
}
h2 { font-size: var(--font-size-h2); font-weight: var(--font-weight-semibold); }
h3 { font-size: var(--font-size-h3); font-weight: var(--font-weight-semibold); line-height: 1.4; }
h4 { font-size: var(--font-size-h4); font-weight: var(--font-weight-semibold); line-height: 1.4; }

p { margin: 0 0 var(--space-3); }

small { font-size: var(--font-size-small); color: var(--color-text-muted); }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

code, kbd, pre, samp {
  font-family: var(--font-family-mono);
  font-size: 0.85em;
}

code {
  background: var(--color-surface-strong);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

pre {
  background: var(--color-surface-strong);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  overflow: auto;
  font-size: var(--font-size-small);
  line-height: 1.45;
  border: 1px solid var(--color-border);
}

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

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

/* Tables — base. Component overrides live in components.css. */
table { border-collapse: collapse; width: 100%; }

/* Helper text utility — used across pages and partials. */
.muted     { color: var(--color-text-muted); font-size: var(--font-size-small); }
.subtle    { color: var(--color-text-subtle); }
.text-mono { font-family: var(--font-family-mono); }
.text-sm   { font-size: var(--font-size-small); }
.text-xs   { font-size: var(--font-size-micro); }

/* Visually-hidden helper (accessibility). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Focus-visible — keyboard rings on every interactive element. */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-ring);
  border-radius: var(--radius);
}
