:root {
  --bg: #0f0f10;
  --bg-elev: #18181b;
  --fg: #d6d6d4;
  --fg-muted: #8c8c8a;
  --accent: #7eb88c;
  --error: #d97a7a;
  --rule: #26262a;
  --max-w: 38rem;
  --serif: ui-serif, Georgia, "Iowan Old Style", Charter, "Vazirmatn", "Noto Naskh Arabic", Tahoma, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Vazirmatn", "Noto Sans Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  padding: 4rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.site-header,
main {
  width: 100%;
  max-width: var(--max-w);
}

.site-header { margin-bottom: 3rem; }

.site-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.site-title a {
  color: var(--fg);
  text-decoration: none;
}

.site-title a:hover { color: var(--accent); }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.tree {
  list-style: disc;
  padding-inline-start: 1.5rem;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--fg);
}

.tree ul {
  list-style: circle;
  padding-inline-start: 1.5rem;
  margin: 0;
}

.tree ul ul { list-style: square; }

.tree li { margin: 0; }

.tree li::marker { color: var(--fg-muted); }

.tree a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tree a:hover { color: var(--fg); }

.tree li.dim,
.tree li.loading,
.tree li.error { color: var(--fg-muted); }
.tree li.error { color: var(--error); }

.tree + article { margin-top: 2rem; }

.post h1 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.post h2 {
  font-size: 1.125rem;
  margin: 2.5rem 0 0.75rem;
}

.post h3 {
  font-size: 1rem;
  margin: 2rem 0 0.5rem;
}

.post p { margin: 1.1rem 0; }

.post ul, .post ol { padding-inline-start: 1.5rem; }
.post li { margin: 0.3rem 0; }

.post blockquote {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 1rem;
  margin: 1.5rem 0;
  color: var(--fg-muted);
  font-style: italic;
}

.post code {
  font-size: 0.95em;
  background: var(--bg-elev);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.post pre {
  background: var(--bg-elev);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.post pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.post hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.post a { text-decoration: underline; text-underline-offset: 2px; }

.dim { color: var(--fg-muted); }

.loading, .error {
  color: var(--fg-muted);
  font-style: italic;
}

.error { color: var(--error); }

[dir="rtl"] {
  font-family: "Vazirmatn", "Noto Naskh Arabic", Tahoma, var(--serif);
  line-height: 1.85;
}

[dir="rtl"] code,
[dir="rtl"] pre {
  font-family: var(--mono);
  direction: ltr;
  text-align: left;
}
