:root {
  --bg: #0f1115;
  --bg-soft: #161922;
  --card: #1b1f2a;
  --border: #262b38;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #5b9dff;
  --accent-soft: #1f2c44;
  --code-bg: #12151c;
  --radius: 12px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  line-height: 1.85;
  font-size: 17px;
  direction: rtl;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.brand:hover { text-decoration: none; }
nav.main a {
  color: var(--muted);
  margin-inline-start: 18px;
  font-size: 15px;
}
nav.main a:hover { color: var(--text); text-decoration: none; }

/* hero */
.hero { padding: 56px 0 26px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; font-weight: 700; }
.hero p { color: var(--muted); margin: 0; font-size: 17px; }

/* post list */
.posts { padding: 8px 0 60px; }
.post-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  transition: border-color .15s, transform .15s;
  color: var(--text);
}
.post-card:hover { border-color: #34415c; text-decoration: none; transform: translateY(-2px); }
.post-card h2 { margin: 0 0 6px; font-size: 20px; }
.post-card .excerpt { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  padding: 1px 9px;
  font-size: 12px;
}

/* article */
article.post { padding: 40px 0 64px; }
article.post h1 { font-size: 28px; margin: 0 0 12px; line-height: 1.4; }
article.post .meta { margin-bottom: 30px; }
article.post h2 { font-size: 22px; margin: 34px 0 12px; }
article.post h3 { font-size: 18px; margin: 26px 0 10px; }
article.post p { margin: 0 0 16px; }
article.post ul, article.post ol { padding-inline-start: 22px; }
article.post li { margin-bottom: 6px; }
article.post img { max-width: 100%; border-radius: var(--radius); }

blockquote {
  border-inline-start: 3px solid var(--accent);
  background: var(--bg-soft);
  margin: 18px 0;
  padding: 10px 18px;
  color: var(--muted);
  border-radius: 0 8px 8px 0;
}

code {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 14px;
  direction: ltr;
  unicode-bidi: embed;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; }

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

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 28px 0;
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--muted); }

/* 404 */
.center-box { text-align: center; padding: 90px 0; }
.center-box h1 { font-size: 64px; margin: 0; }
.center-box p { color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 25px; }
  nav.main a { margin-inline-start: 12px; }
}
