@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f0e6;
  --paper: #fffaf3;
  --ink: #1f1b16;
  --muted: #6f675d;
  --line: #e2d4c2;
  --accent: #1f6f8b;
  --accent-hot: #e85d4c;
  --accent-soft: #e4f4f8;
  --quote: #1f6f8b;
  --quote-bg: #eef6f8;
  --code-bg: #f3e6d4;
  --chip-bg: #fff4d6;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Vazirmatn, Tahoma, sans-serif;
  line-height: 1.85;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hot);
}

.inner {
  width: min(42rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: 2.2rem 0 0;
  border-bottom: none;
  background: var(--paper);
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.site-title .point {
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--accent-hot);
  flex-shrink: 0;
}

.site-bio {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
}

.site-nav a + a::before {
  content: "·";
  display: inline-block;
  margin: 0 0.7rem;
  color: var(--accent-hot);
}

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

.site-nav a.nav-rss {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.site-nav a.nav-rss svg {
  display: block;
  width: 1.05em;
  height: 1.05em;
}

.header-rule {
  position: relative;
  height: 1px;
  margin-top: 1.25rem;
  background: var(--ink);
}

.header-rule::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-hot);
  transform: translate(50%, -50%);
}

main.inner {
  padding: 2rem 0 3.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.page-header h1,
.post-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
  line-height: 1.45;
  font-weight: 700;
}

.lede,
.meta {
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  position: relative;
  padding: 1.25rem 1.15rem 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.post-list li::before {
  content: "";
  position: absolute;
  top: 1.55rem;
  right: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-hot);
}

.post-list time,
.meta time {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list h2 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.post-list h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-list h2 a:hover {
  color: var(--accent);
}

.summary {
  margin: 0;
  color: #3f3a34;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
}

.chip {
  display: inline-block;
  padding: 0.05rem 0.65rem;
  border: 1px solid #f0c9a0;
  border-radius: 999px;
  background: var(--chip-bg);
  color: #9a4b16;
  text-decoration: none;
  font-size: 0.85rem;
}

.chip::before {
  content: "";
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.4em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.12em;
}

.chip:hover,
.chip-tag {
  background: var(--accent-soft);
  border-color: #9fd3e0;
  color: var(--accent);
}

.content {
  margin-top: 1.4rem;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  line-height: 1.4;
  font-weight: 700;
}

.content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.content h3 {
  font-size: 1.08rem;
}

.content p,
.content li {
  overflow-wrap: anywhere;
}

.content blockquote {
  position: relative;
  margin: 1.4rem 0;
  padding: 0.55rem 1.25rem 0.55rem 1rem;
  border-right: 2px solid var(--quote);
  background: var(--quote-bg);
  color: #3a4a52;
  border-radius: 0 2px 2px 8px;
}

.content blockquote::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--quote);
}

.content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  direction: ltr;
  unicode-bidi: isolate;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.content pre.code,
.content pre {
  position: relative;
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
  background: #1c2433;
  color: #dbe4f0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border-radius: 10px;
  line-height: 1.55;
  font-size: 0.88rem;
  box-shadow: inset 0 0 0 1px #2c3a50;
}

.code-block {
  margin: 1.4rem 0;
  direction: ltr;
  unicode-bidi: isolate;
  background: #1c2433;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #2c3a50;
  overflow: hidden;
}

.code-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.4rem 0.5rem 0;
}

.code-copy {
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #dbe4f0;
  background: #2c3a50;
  border: 0;
  border-radius: 6px;
  padding: 0.22rem 0.7rem;
  cursor: pointer;
}

.code-copy:hover {
  background: var(--accent-hot);
  color: #fff;
}

.code-copy.is-copied {
  background: #2f6f4e;
  color: #fff;
}

.content .code-block pre,
.content .code-block pre.code {
  margin: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

.content pre code {
  background: transparent;
  padding: 0;
  color: #dbe4f0;
}

.content figure,
.content .post-figure {
  margin: 1.7rem 0;
  padding: 0.85rem 0.85rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.content figure img,
.content .post-figure img,
.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 8px;
}

.content figcaption {
  margin: 0.65rem 0 0.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.content figcaption::before {
  content: "";
  display: inline-block;
  width: 0.38em;
  height: 0.38em;
  margin-left: 0.4em;
  border-radius: 50%;
  background: var(--accent-hot);
  vertical-align: 0.15em;
}

.content .footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}

/* Math stays LTR even on an RTL page. Unicode bidi can otherwise
   mirror arrows and shuffle Con(T) ⇒ … into the wrong visual order. */
.content .math,
.content .katex,
.content .katex-display {
  direction: ltr;
  unicode-bidi: isolate;
}

.content .math.inline {
  display: inline-block;
}

.content .math.display,
.content .katex-display {
  display: block;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 1.1rem 0;
  padding: 0.4rem 0;
}

.content .katex-display > .katex {
  display: inline-block;
  text-align: initial;
  direction: ltr;
  unicode-bidi: isolate;
}

.post-tags {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.post-tags span {
  color: var(--muted);
  margin-left: 0.4rem;
}

.taxonomy-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.taxonomy-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.taxonomy-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.taxonomy-list a:hover {
  color: var(--accent);
}

.count {
  color: var(--muted);
}

.hljs {
  background: transparent;
  color: #dbe4f0;
}

.content pre .hljs-keyword,
.content pre .hljs-selector-tag,
.content pre .hljs-literal,
.content pre .hljs-section,
.content pre .hljs-link {
  color: #ff7aa2;
}

.content pre .hljs-built_in,
.content pre .hljs-type {
  color: #c9a0ff;
}

.content pre .hljs-title,
.content pre .hljs-title.function_,
.content pre .hljs-title.class_ {
  color: #7dc4ff;
}

.content pre .hljs-string,
.content pre .hljs-attr,
.content pre .hljs-attribute,
.content pre .hljs-symbol {
  color: #7ee787;
}

.content pre .hljs-number,
.content pre .hljs-bullet {
  color: #ffb86b;
}

.content pre .hljs-comment,
.content pre .hljs-quote,
.content pre .hljs-meta {
  color: #8b97ad;
  font-style: italic;
}

.content pre .hljs-name,
.content pre .hljs-selector-id,
.content pre .hljs-selector-class {
  color: #7ee0c5;
}

.content pre .hljs-variable,
.content pre .hljs-template-variable,
.content pre .hljs-params {
  color: #f8d38d;
}

.content pre .hljs-addition {
  color: #7ee787;
}

.content pre .hljs-deletion {
  color: #ff7aa2;
}
