/* ═══════════════════════════════════════════════════════════
   Base — Reset, Typography, Global
   ═══════════════════════════════════════════════════════════ */

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

html {
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-mono);
  font-weight: var(--fw-regular);
  color: var(--text-0);
  background: var(--bg-0);
  line-height: var(--lh-normal);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Typography ──────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  color: var(--text-0);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { color: var(--text-1); line-height: var(--lh-relaxed); }

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--text-0); }

code, pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

pre {
  background: var(--bg-1);
  border: 1px solid var(--border-0);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  overflow-x: auto;
  color: var(--text-1);
}

/* ── Selection ───────────────────────────────────────────── */

::selection {
  background: var(--cyan-dim);
  color: var(--text-0);
}

/* ── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Focus ───────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ── Utility ─────────────────────────────────────────────── */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-3); }

.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }
