/* ── BRANDT INTERACTIVE — BASE ELEMENT STYLES ─────────────────────────────
   Loads after tokens.css. No color, spacing, or type value here should be
   a literal — everything routes through the custom properties.
   ──────────────────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  line-height: 1.15;
  font-weight: 400;
  margin: 0 0 var(--space-4);
}

h1 { font-size: var(--text-display-xl); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-body-l); }

p {
  margin: 0 0 var(--space-4);
  max-width: 70ch;
}

p.lead { font-size: var(--text-body-l); }

a {
  color: var(--color-blue);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--color-navy); }

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

.label,
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink); /* not brass — see tokens.css contrast note */
}

img { max-width: 100%; height: auto; display: block; }

/* ── Layout containers (design-system.md §5) ───────────────────────────── */
.container-wide     { max-width: var(--container-wide);     margin-inline: auto; padding-inline: var(--space-5); }
.container-standard { max-width: var(--container-standard); margin-inline: auto; padding-inline: var(--space-5); }
.container-reading  { max-width: var(--container-reading);  margin-inline: auto; padding-inline: var(--space-5); }

/* ── Section spacing (design-system.md §5) ─────────────────────────────
   A section owns its vertical rhythm and its background. It never owns a
   max-width — put a .container-* div inside it. Putting both on one element
   insets the background tint to the container width (D-051 fix). */
section, .section {
  padding-block: var(--space-8);
}
@media (min-width: 1024px) {
  section, .section { padding-block: var(--space-9); }
}
@media (max-width: 640px) {
  section, .section { padding-block: var(--space-7); }
}

/* ── Focus states — WCAG 2.2 AA ─────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-control);
}

/* ── Skip link ──────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
  z-index: 1000;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* ── Reduced motion (design-system.md §9) ──────────────────────────────── */
@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;
  }
}
