/* ============================================================
   Reset, body, typography, code blocks, scrollbar
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Background grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 166, 87, 0.04), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(121, 192, 255, 0.03), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.2;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  margin: 28px 0 10px;
  color: var(--text);
}

h4 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 20px 0 8px;
}

p { margin-bottom: 14px; color: var(--text); }
p + p { margin-top: -2px; }

.lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 70ch;
  line-height: 1.6;
}

ul, ol { margin: 0 0 16px 24px; }
li { margin-bottom: 6px; }
li::marker { color: var(--accent); }

strong { color: var(--accent); font-weight: 600; }
em { font-style: italic; color: var(--text-muted); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent-2);
  border: 1px solid var(--border-soft);
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Inline-code syntax classes used inside <pre> blocks */
.cmd { color: var(--success); }
.cmt { color: var(--text-dim); font-style: italic; }
.kw  { color: var(--accent-3); }
.str { color: var(--accent); }
.num { color: var(--accent-2); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
