/* ============================================================================
   base.css — reset, document defaults, and layout primitives.
   Depends only on tokens.css. No component styles here.
   ============================================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
/* overflow-x: clip guards against any single element widening the page on
   narrow screens (it clips without breaking position: sticky). */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* Focus — always visible, keyboard-first */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Layout primitives */
.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

/* Result column: one consistent vertical rhythm between the major blocks
   (hero, stats, colors, type, assets, …). Flex-gap avoids margin-collapse
   surprises, and empty result containers (research/enhance before they run)
   collapse away so they add no phantom space. */
#content {
  display: flex;
  flex-direction: column;
  gap: var(--s-14);
  padding-top: var(--s-10);
  padding-bottom: var(--s-20);
}
#content > :empty { display: none; }

/* Eyebrow label — the recurring structural device: a mono, tracked, uppercase
   caption that names a section. Encodes hierarchy, not decoration. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: var(--w-med);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Inter-section spacing is owned by #content's flex gap (above). A .section is
   just a semantic wrapper; extra .section blocks stacked in one container keep
   the same rhythm. */
.section + .section { margin-top: var(--s-14); }
.section-head {
  display: flex; align-items: baseline; gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-soft);
}
.section-title {
  font-family: var(--font-ui);
  font-size: 18px; font-weight: var(--w-semi);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-count {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  color: var(--ink-3);
}

/* Utility */
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Design-tokens table (rendered by main.js). */
.token-table { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1px 0; }
.token-row { display: contents; }
.token-name, .token-val {
  font-family: var(--font-mono); font-size: var(--t-label);
  padding: 6px 10px; border-bottom: 1px solid var(--border-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.token-name { color: var(--ink-3); }
.token-val { color: var(--ink-2); }
