/* ==========================================================================
   reset.css — element-level reset + base defaults
   --------------------------------------------------------------------------
   Milestone 1 · Foundation scaffold

   Layer role: `base` (Phase 6 §5.2). Hand-rolled reset — no third-party reset
   library (frameworks/libraries are out of scope per project constraints).

   Scope: box-sizing, element defaults (body, headings, links, images, form
   controls). Global a11y rules (focus-visible ring, selection, reduced-motion
   guard) live in utilities.css per the M1 plan.
   ========================================================================== */

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

/* Root defaults */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--color-background);
  color: var(--color-body);
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--color-background);
  color: var(--color-body);
}

/* Headings — font family + color per Phase 1 §2; sizes and weights are applied
   per level by the type scale utilities in typography.css, not here. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: var(--color-heading);
}

/* Vertical-rhythm elements — margin reset */
p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Links — primary color (Phase 1 §1.3); underline kept as the default
   non-color affordance. Nav/text-link treatment is a component concern. */
a {
  color: var(--color-primary);
}

/* Media — never exceed their container */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form controls — inherit type styles */
button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

fieldset {
  margin: 0;
  border: 0;
  padding: 0;
}

/* Tables — collapse borders by default (Phase 1 §9 uses horizontal rules) */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Horizontal rules — Phase 1 §6 dividers */
hr {
  border: 0;
  border-top: 1px solid var(--color-border);
}
