/* ===== Base ===== */
:root {
  --bg: #0f172a;            /* slate-900 */
  --panel: #111827;         /* gray-900 */
  --text: #e5e7eb;          /* gray-200 */
  --muted: #cbd5e1;         /* slate-300 */
  --accent: #60a5fa;        /* blue-400 */
  --accent-2: #a78bfa;      /* violet-400 */
  --border: #1f2937;        /* gray-800 */
  --link: #93c5fd;          /* blue-300 */
  --link-hover: #bfdbfe;    /* blue-200 */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* ===== Layout ===== */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.site-header {
  background: linear-gradient(180deg, rgba(96,165,250,0.08), rgba(167,139,250,0.06));
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0 0 .25rem 0;
  font-size: clamp(1.6rem, 2.4vw + 1rem, 2.4rem);
  letter-spacing: .2px;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

/* ===== Content ===== */
h2, h3, h4 {
  margin-top: 1.25rem;
  margin-bottom: .5rem;
  line-height: 1.25;
}

h2 {
  font-size: clamp(1.25rem, 1.4vw + 1rem, 1.75rem);
  color: var(--accent-2);
}

.section-title {
  font-size: clamp(1.1rem, 1.2vw + 1rem, 1.45rem);
  color: var(--accent);
}

.subsection-title {
  font-size: 1.05rem;
  margin-top: 1rem;
  color: var(--text);
}

.toc-section {
  padding-block: .5rem 1rem;
}

.divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 1.25rem 0;
}

/* Lists */
ul.toc-list {
  padding-left: 1.15rem;
  margin: .25rem 0 .75rem;
}

ul.toc-list li {
  margin: .25rem 0;
}

ul.toc-list ul {
  margin-top: .25rem;
}

/* Inline code */
code {
  background: rgba(148,163,184,.15); /* slate-400 @ 15% */
  border: 1px solid var(--border);
  border-radius: .35rem;
  padding: .05rem .35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .93em;
}

/* Links */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

.back-to-top {
  margin-top: 2rem;
  text-align: right;
}

/* ===== Utilities ===== */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --panel: #f8fafc;
    --text: #0f172a;
    --muted: #334155;
    --accent: #2563eb;
    --accent-2: #7c3aed;
    --border: #e5e7eb;
    --link: #1d4ed8;
    --link-hover: #1e40af;
  }
  code { background: rgba(2,6,23,.05); border-color: #e5e7eb; }
}
