html {
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../assets/noise.svg');
  background-repeat: repeat;
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: overlay;
  opacity: 0.35;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

p {
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-accent-blue);
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent-blue-hover); }
a:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--color-accent-blue);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-dim); }

/* ── Focus ── */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 3px;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--color-text-muted); }
.text-dim   { color: var(--color-text-dim); }
.text-blue  { color: var(--color-accent-blue); }
.text-amber { color: var(--color-accent-amber); }
