@font-face {
  font-family: Vazirmatn;
  src: url("Vazirmatn-v33.003.4e3fa217d38fdafc.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  /* Keep Latin on the system font; Persian and Arabic use Vazirmatn. */
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF,
    U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7F, U+1EE00-1EEFF, U+200C-200F;
}

:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #eeeee7;
  --ink: #26251e;
  --muted: #6f6e64;
  --line: #d7d7cc;
  --accent: #934329;
  --separator: #b7b7a6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #171714;
    --surface: #20201b;
    --ink: #eeeee6;
    --muted: #aeaea0;
    --line: #3b3b32;
    --accent: #e8a184;
    --separator: #626255;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171714;
  --surface: #20201b;
  --ink: #eeeee6;
  --muted: #aeaea0;
  --line: #3b3b32;
  --accent: #e8a184;
  --separator: #626255;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.8 Vazirmatn, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
a:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 20px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  min-height: 52px;
  margin-inline: auto;
  padding: 8px 24px;
  border-block-end: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 600; letter-spacing: -.055em; }
.brand-mark {
  width: 15px;
  height: 18px;
  border-block: 2px solid currentColor;
  position: relative;
  transform: skewY(-16deg);
}
.brand-mark::after { content: ""; position: absolute; top: 6px; inset-inline: 0; border-block-start: 2px solid currentColor; }
.site-actions { display: flex; align-items: center; gap: 24px; }
.bot-link { color: var(--ink); }
.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  min-height: 36px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--surface); border-color: var(--muted); }

main { max-width: 824px; margin: 20px auto 0; padding: 0 24px 24px; }
.thread-header { margin-block-end: 18px; }
.eyebrow { color: var(--muted); font-size: 12px; line-height: 1.5; }
h1 { margin: 8px 0 12px; font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 450; line-height: 1.2; overflow-wrap: anywhere; text-wrap: balance; }
.byline { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; line-height: 1.6; }
.byline a[rel="author"] { color: var(--ink); }
.byline bdi { color: var(--muted); display: inline-block; }
.source-link { color: var(--muted); }
.source-link span { display: inline-block; margin-inline-start: 3px; }
.thread-content { min-width: 0; }
.thread-post + .thread-post::before {
  content: "";
  display: block;
  height: 1px;
  margin-block: 8px;
  background: linear-gradient(to right, transparent, var(--separator), transparent);
  opacity: .5;
}
p { white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; }
.thread-post > p, .quoted-post > p { margin: 0; }
.thread-post > p a, .quoted-post > p:not(.quote-author) a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .2em; }
.thread-post > p a:hover, .quoted-post a:hover { text-decoration-color: currentColor; }
img, video { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.post-media { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-block: 10px; }
.post-media.multi-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-media > img, .post-media > video { min-width: 0; margin: 0; align-self: start; }
.post-media > img { grid-column: 1 / -1; justify-self: center; }
.post-media > video { width: 100%; background: #11110f; }
.quoted-post { margin: 10px 0; }
.quote-separator { height: 1px; border: 0; margin: 10px 0; background: linear-gradient(to right, transparent, var(--separator), transparent); }
.quote-author { display: block; font-size: 13px; font-style: normal; line-height: 1.6; }
.quote-author a { color: var(--muted); }
.quoted-post .quote-author { margin-block-end: 6px; }
footer { margin-block-start: 20px; padding-block-start: 12px; border-block-start: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer a { color: var(--ink); }
@media (max-width: 600px) {
  body { font-size: 17px; }
  .site-bar { min-height: 52px; padding: 8px 16px; }
  .site-actions { gap: 14px; }
  main { margin-block-start: 14px; padding: 0 16px 20px; }
  .thread-header { margin-block-end: 18px; }
  .byline { gap: 10px 20px; font-size: 13px; }
}
@media (max-width: 380px) { .bot-link { display: none; } }
@media print {
  :root, :root:not([data-theme]), :root[data-theme="dark"] { --bg: #fff; --surface: #f5f5f5; --ink: #111; --muted: #444; --line: #ccc; --accent: #111; --separator: #aaa; color-scheme: light; }
  .site-bar, .skip-link { display: none; }
  main { margin: 0 auto; padding: 0; }
  .thread-header { margin-block-end: 24px; }
}
