@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #64707d;
  --border: #e4e4dc;
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --code-bg: #f1f1ea;
  --pre-bg: #1e2530;
  --pre-text: #e6e9ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --surface: #1b2027;
    --text: #e3e6ea;
    --muted: #97a1ad;
    --border: #2b323b;
    --accent: #4fd1c5;
    --accent-soft: #17332f;
    --code-bg: #262d36;
    --pre-bg: #0e1116;
    --pre-text: #dfe3e8;
  }
}

* { box-sizing: border-box; }

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

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

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

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

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--surface); font-size: 1.1rem; line-height: 1; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-header nav a { color: var(--muted); font-size: .95rem; }
.site-header nav a:hover { color: var(--accent); text-decoration: none; }

main.wrap { padding-block: 32px 48px; min-height: 60vh; }

.intro { margin-bottom: 32px; }
.intro h1 { margin: 0 0 4px; font-size: 2rem; }
.intro p { margin: 0 0 8px; color: var(--muted); }

h1 { font-size: 1.75rem; line-height: 1.6; margin: 0 0 8px; }
h2 { font-size: 1.25rem; line-height: 1.7; margin: 36px 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin-bottom: 18px; }
.card h2 { margin: 0; font-size: 1.2rem; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.card p { margin: 6px 0 0; }

.meta { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }
.tags { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 12px; font-size: .82rem; line-height: 2; }
.tag:hover { text-decoration: none; filter: brightness(.96); }

.post header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.post p { margin: 14px 0; }
.post ul, .post ol { padding-inline-start: 24px; margin: 14px 0; }
.post li { margin: 4px 0; }

code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; background: var(--code-bg); border-radius: 5px; padding: 2px 6px; unicode-bidi: isolate; }
pre { background: var(--pre-bg); color: var(--pre-text); border-radius: 10px; padding: 16px 18px; overflow-x: auto; line-height: 1.7; text-align: left; margin: 18px 0; }
pre code { background: none; padding: 0; font-size: .86rem; color: inherit; }

.note { border-inline-start: 4px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 10px 16px; margin: 18px 0; }

.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .92rem; }
.post-nav a { max-width: 48%; }

.tag-index { list-style: none; padding: 0; }
.tag-index li { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 18px; margin-bottom: 10px; }
.count { color: var(--muted); font-size: .88rem; }

.contact-line { font-size: 1.15rem; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-block: 18px; }
.site-footer p { margin: 0; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .intro h1 { font-size: 1.6rem; }
  h1 { font-size: 1.45rem; }
  .card { padding: 14px 16px; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
}
