/* ═══════════════════════════════════════════════════════════════════
   BASE — Reset, html/body, typography defaults, scrollbars, utilities
   ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

::selection { background: var(--accent-soft); color: var(--accent-fg); }

/* Custom scrollbar */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--paper-300); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--paper-400); }

/* ── Display type helpers ── */
.eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--w-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.display-1 {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--w-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--fg);
}
.display-2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--w-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--fg);
}
.display-3 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--w-black);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-tight);
  color: var(--fg);
}
.h1 { font-size: var(--text-2xl); font-weight: var(--w-black); letter-spacing: var(--tracking-snug); line-height: var(--leading-tight); }
.h2 { font-size: var(--text-xl); font-weight: var(--w-bold);  letter-spacing: var(--tracking-snug); line-height: var(--leading-tight); }
.h3 { font-size: var(--text-lg); font-weight: var(--w-bold);  letter-spacing: var(--tracking-snug); line-height: var(--leading-snug);  }
.body-lg { font-size: var(--text-md); line-height: var(--leading-base); }
.body    { font-size: var(--text-base); line-height: var(--leading-base); }
.body-sm { font-size: var(--text-sm); line-height: var(--leading-base); color: var(--fg-muted); }
.body-xs { font-size: var(--text-xs); line-height: var(--leading-base); color: var(--fg-muted); }
.mono    { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ── Layout utilities ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); }
.gap-6 { gap: var(--s-6); }
.gap-7 { gap: var(--s-7); }
.flex-1 { flex: 1; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; }

.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); } .mt-8 { margin-top: var(--s-8); }
.mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); } .mb-6 { margin-bottom: var(--s-6); }
.mb-7 { margin-bottom: var(--s-7); } .mb-8 { margin-bottom: var(--s-8); }

.text-muted { color: var(--fg-muted); }
.text-faint { color: var(--fg-faint); }
.text-inverse { color: var(--fg-inverse); }
.text-purple { color: var(--purple); }
.text-coral  { color: var(--coral); }
.text-teal   { color: var(--teal); }
.text-amber  { color: var(--amber-d); }
.text-blue   { color: var(--blue); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }

/* ── Focus state ── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-blue);
  border-radius: var(--r-sm);
}

/* ── Hide-but-accessible ── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
