/* ═══════════════════════════════════════════════
   base.css — Typography, body, foundational styles
   ═══════════════════════════════════════════════ */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--cr-text-primary);
  background-color: var(--cr-bg-deep);
  overflow-x: hidden;
}

/* ── Headings ─────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
  color: var(--cr-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

/* ── Body text ────────────────────────────────── */

p {
  color: var(--cr-text-secondary);
  line-height: 1.7;
  max-width: 68ch;
}

p + p {
  margin-top: var(--space-md);
}

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

/* ── Links ────────────────────────────────────── */

a {
  color: var(--cr-cyan);
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--cr-text-primary);
}

/* ── Code-like text ───────────────────────────── */

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

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

::selection {
  background: var(--cr-red);
  color: var(--cr-bg-deep);
}

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

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cr-bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--cr-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cr-text-dim);
}

/* ── Skip link ────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--cr-red);
  color: var(--cr-bg-deep);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  z-index: 9999;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-md);
}

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

.text-red    { color: var(--cr-red); }
.text-cyan   { color: var(--cr-cyan); }
.text-green  { color: var(--cr-green); }
.text-amber  { color: var(--cr-amber); }
.text-dim    { color: var(--cr-text-dim); }
.text-bright { color: var(--cr-text-primary); }

/* ── Screen reader only ───────────────────────── */

.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;
}

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
}
