@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #f6f4ee;
  --ink: #1e2321;
  --ink-soft: #4a5049;
  --rule: #d8d3c5;
  --accent: #2f4d3a;
  --accent-soft: #e7ede8;
  --todo: #b5471b;
  --todo-bg: #fbe9e0;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.65;
  font-size: 17px;
}

.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
}

/* Sidebar */
nav.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 48px 28px 48px 32px;
  border-right: 1px solid var(--rule);
}

.brand {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.brand-sub {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

.doc-set {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--rule);
}

.doc-set li { position: relative; }

.doc-set a, .doc-set .pending {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  padding: 10px 0 10px 20px;
  text-decoration: none;
  color: var(--ink-soft);
}

.doc-set a:hover { color: var(--accent); }

.doc-set a.active {
  color: var(--accent);
  font-weight: 600;
}

.doc-set a.active::before,
.doc-set li.current::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 12px;
  width: 2px;
  height: 20px;
  background: var(--accent);
}

.doc-set .pending {
  color: #a9a396;
  cursor: default;
}

.doc-set .pending .tag {
  font-size: 10.5px;
  border: 1px solid #cdc7b8;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

.sidebar-footer {
  margin-top: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
}

.sidebar-footer a { color: var(--accent); }

/* Main content */
main {
  flex: 1;
  min-width: 0;
  padding: 56px 64px 96px;
}

.doc-header {
  margin-bottom: 8px;
}

.doc-header h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.doc-meta {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

article h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 44px 0 14px;
  color: var(--accent);
}

article h1 { display: none; } /* title already in doc-header */

article p { margin: 0 0 16px; color: var(--ink); }

article strong { color: var(--ink); }

article a { color: var(--accent); }

article mark {
  background: var(--todo-bg);
  color: var(--todo);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-decoration: none;
}

article ul, article ol { margin: 0 0 16px; padding-left: 22px; }
article li { margin-bottom: 6px; }

article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  nav.sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 28px 24px;
  }
  .doc-set { border-left: none; padding-left: 0; }
  .doc-set a, .doc-set .pending { padding-left: 0; }
  .doc-set a.active::before, .doc-set li.current::before { display: none; }
  main { padding: 36px 24px 64px; }
}
