/* Global base — gary.design. Imported once in BaseLayout after tokens.css. */

/* ---- Reset (minimal, modern) ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; }
img, picture, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ---- Base ---- */
html {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}
body {
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis: none;                 /* never fake-bold or fake-italic */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---- Headings: Space Grotesk 700, tight tracking, no italic ever ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -0.01em; }

/* ---- Body copy ---- */
p { max-width: 68ch; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }
strong, b { font-weight: 700; }
em, i { font-style: italic; }            /* Atkinson has a true italic */

/* ---- Focus: real, always visible (a11y bar, §3) — 3px accent outline ---- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Selection ---- */
::selection { background: var(--accent-soft); color: var(--text); }

/* ---- Layout helper ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
