/* ── Reset & Base ─────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #faf9f6;
  --fg: #2b2b2b;
  --fg-muted: #6b6b6b;
  --accent: #5e4b8a;
  --accent-hover: #7a64a6;
  --border: #e0ddd8;
  --code-bg: #f0ede8;
  --max-width: 42rem;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ─────────────────────────────────────────── */
#preamble nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  gap: 1.5rem;
}

#preamble nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  transition: color 0.15s;
}

#preamble nav a:hover {
  color: var(--accent);
}

/* ── Content ─────────────────────────────────────── */
#content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  flex: 1;
  width: 100%;
}

/* ── Typography ──────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

h2 { font-size: 1.6rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; }
h4 { font-size: 1.05rem; margin-top: 1.25rem; }

p {
  margin-bottom: 1rem;
}

/* ── Links ───────────────────────────────────────── */
#content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

#content a:hover {
  color: var(--accent-hover);
}

/* ── Lists ───────────────────────────────────────── */
ul, ol {
  margin: 0.5rem 0 1rem 1.25rem;
}

li {
  margin-bottom: 0.3rem;
}

/* ── Code ────────────────────────────────────────── */
code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
}

/* ── Blockquote ──────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1rem 0;
  color: var(--fg-muted);
  font-style: italic;
}

/* ── Horizontal rule ─────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Tables ──────────────────────────────────────── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fg-muted);
}

/* ── Footer ──────────────────────────────────────── */
#postamble {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

#postamble footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ── Org-specific cleanup ────────────────────────── */
.outline-2,
.outline-3 {
  margin-bottom: 1.5rem;
}

.outline-text-2,
.outline-text-3 {
  margin-top: 0.5rem;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }

  #preamble nav {
    padding: 1rem;
    gap: 1.25rem;
  }

  #content {
    padding: 1.5rem 1rem 3rem;
  }

  h2 { font-size: 1.4rem; }
}
