/* Docs + content pages share this stylesheet. Lifted the sunset
   palette and prose/UI font split from the landing page so the whole
   site reads as one thing. */
:root {
  --paper: #f5e6d4;
  --ink: #2a1660;
  --ink-rgb: 42, 22, 96;
  --muted: #7a5a80;
  --accent: #c14a1e;
  --accent-rgb: 193, 74, 30;
  --accent-glow-rgb: 243, 165, 72;
  --plum: #6b3fa0;
  --border: rgba(42, 22, 96, 0.18);
  --font-prose: 'Crimson Pro', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #140a2e;
    --ink: #f0e0d0;
    --ink-rgb: 240, 224, 208;
    --muted: #a08fb8;
    --accent: #f3a548;
    --accent-rgb: 243, 165, 72;
    --plum: #8b6bc2;
    --border: rgba(240, 224, 208, 0.15);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-prose);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(180deg, #0B0D23 0%, #2A1B5F 45%, #7A174D 100%) fixed;
  }
}
body.docs-page {
  --paper: #f7f3ec;
  --ink: #25231f;
  --ink-rgb: 37, 35, 31;
  --muted: #6d675d;
  --accent: #9b5f24;
  --accent-rgb: 155, 95, 36;
  --border: rgba(37, 35, 31, 0.14);
  background: var(--paper);
}
@media (prefers-color-scheme: dark) {
  body.docs-page {
    --paper: #181816;
    --ink: #eee7d9;
    --ink-rgb: 238, 231, 217;
    --muted: #aaa28f;
    --accent: #d89a48;
    --accent-rgb: 216, 154, 72;
    --border: rgba(238, 231, 217, 0.16);
    background: linear-gradient(180deg, #0B0D23 0%, #151626 42%, #181816 100%) fixed;
  }
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Top nav ============ */
.topnav {
  display: flex;
  gap: 22px;
  max-width: 672px;
  margin: 0 auto;
  padding: 20px 0 32px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.topnav a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.topnav a:hover {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--muted);
}
.topnav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============ Content pages (Manifesto, Changelog) ============ */
.content-page .wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.content-main h1 {
  font-size: 34px;
  font-weight: 600;
  margin: 8px 0 32px;
  letter-spacing: -0.01em;
}
.content-main h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 48px 0 14px;
}
.content-main h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 10px;
}
.content-main p, .content-main ul, .content-main ol {
  margin: 0 0 18px;
}
.content-main ul, .content-main ol { padding-left: 22px; }
.content-main li { margin-bottom: 6px; }
.content-main code {
  font-family: var(--font-mono);
  font-size: 15px;
  background: rgba(var(--ink-rgb), 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.content-main pre {
  background: rgba(var(--ink-rgb), 0.06);
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.content-main pre code { background: none; padding: 0; font-size: inherit; }
.content-main blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}

/* ============ Docs pages ============ */
.docs-page .docs-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 40px;
  margin-top: 20px;
}
@media (max-width: 1000px) {
  .docs-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .docs-layout .toc { display: none; }
}
@media (max-width: 720px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-layout .sidebar { border-bottom: 1px dashed var(--border); padding-bottom: 16px; }
}
.sidebar {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
}
.sidebar .search { margin-bottom: 20px; }
.sidebar .search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.sidebar .search input:focus {
  outline: none;
  border-color: var(--accent);
}
#search-results {
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
}
#search-results li { padding: 4px 0; }
#search-results li a { color: var(--ink); font-size: 13px; }
#search-results li a:hover { color: var(--accent); }
.sidebar-tree, .sidebar-tree ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.sidebar-tree ul { padding-left: 12px; margin-top: 4px; }
.sidebar-tree li { margin-bottom: 4px; }
.sidebar-tree a {
  color: var(--muted);
  display: block;
  padding: 4px 8px;
  border-radius: 3px;
}
.sidebar-tree a:hover { color: var(--ink); text-decoration: none; background: rgba(var(--ink-rgb), 0.05); }
.sidebar-tree a.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  font-weight: 600;
}
.sidebar-tree .group-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 8px 4px;
  font-weight: 700;
}
.docs-main h1 {
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.docs-main h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 44px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  position: relative;
}
.docs-main h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
  position: relative;
}
.docs-main p, .docs-main ul, .docs-main ol { margin: 0 0 16px; }
.docs-main ul, .docs-main ol { padding-left: 22px; }
.docs-main li { margin-bottom: 4px; }
.docs-main code {
  font-family: var(--font-mono);
  font-size: 15px;
  background: rgba(var(--ink-rgb), 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.docs-main pre {
  background: rgba(var(--ink-rgb), 0.06);
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.docs-main pre code { background: none; padding: 0; font-size: inherit; }
.docs-main img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px 0 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.docs-main .heading-anchor {
  color: var(--muted);
  opacity: 0;
  position: absolute;
  left: -18px;
  text-decoration: none;
  font-weight: 400;
}
.docs-main h2:hover .heading-anchor,
.docs-main h3:hover .heading-anchor { opacity: 1; }

/* ============ Right-rail ToC ============ */
.toc {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.toc-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 4px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc-h3 { padding-left: 12px; font-size: 12px; }

/* ============ Footer ============ */
.page-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-ui);
}
.page-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 12px;
}
.page-footer a {
  color: var(--muted);
  border-bottom: 1px dotted var(--muted);
}
.page-footer a:hover { color: var(--ink); border-bottom-color: var(--ink); text-decoration: none; }
