@font-face { font-family: "IRANSans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/static/fonts/iran-normal.woff2") format("woff2"); }
@font-face { font-family: "IRANSans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/static/fonts/iran-medium.woff2") format("woff2"); }
@font-face { font-family: "IRANSans"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/static/fonts/iran-bold.woff2") format("woff2"); }

/* ---- design tokens (light) ---- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --fg: #1b2230;
  --fg-soft: #3b475c;
  --muted: #5b6577;
  --border: #e3e8ef;
  --accent: #0a6ad1;
  --accent-fg: #ffffff;
  --accent-soft: #e8f1fd;
  --ok: #0f8a4b;
  --ok-soft: #e4f6ec;
  --warn: #a15c00;
  --warn-soft: #fff3df;
  --code-bg: #f6f8fa;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
  --radius: 12px;
  --font: "IRANSans", Tahoma, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --navy: #0b1220; --sky: #5cc8ff; --navy-soft: #a9b8cc; --navy-muted: #8fa3bf;
  --max: 74rem;
  --measure: 72ch;
  color-scheme: light;
}
/* dark: follows the system unless the visitor picked a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1218; --bg-soft: #141a22; --surface: #161d26; --fg: #e8ecf2; --fg-soft: #c3cbd8;
    --muted: #94a0b4; --border: #263040; --accent: #5aa9ff; --accent-fg: #07121f; --accent-soft: #14283f;
    --ok: #4cd08a; --ok-soft: #12301f; --warn: #f0b45a; --warn-soft: #33260f;
    --code-bg: #0d1117; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1218; --bg-soft: #141a22; --surface: #161d26; --fg: #e8ecf2; --fg-soft: #c3cbd8;
  --muted: #94a0b4; --border: #263040; --accent: #5aa9ff; --accent-fg: #07121f; --accent-soft: #14283f;
  --ok: #4cd08a; --ok-soft: #12301f; --warn: #f0b45a; --warn-soft: #33260f;
  --code-bg: #0d1117; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---- redesigned pages (home, post): shared palette, light/dark ---- */
.home, .post-page {
  --h-bg: #f4f6fa; --h-card: #fff; --h-ink: #0b1220; --h-muted: #4b5565; --h-faint: #6b7686; --h-line: #e3e8f0;
  --h-soft: #eef3fb; --h-link: #0468d7; --h-btn-line: #d5dce6; --h-focus: #0468d7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.home, .post-page) { --h-bg: #0e1218; --h-card: #161d26; --h-ink: #e8ecf2; --h-muted: #a8b3c5; --h-faint: #94a0b4;
    --h-line: #263040; --h-soft: #1c2633; --h-link: #5aa9ff; --h-btn-line: #34415a; --h-focus: #5aa9ff; }
}
:root[data-theme="dark"] :is(.home, .post-page) { --h-bg: #0e1218; --h-card: #161d26; --h-ink: #e8ecf2; --h-muted: #a8b3c5; --h-faint: #94a0b4;
  --h-line: #263040; --h-soft: #1c2633; --h-link: #5aa9ff; --h-btn-line: #34415a; --h-focus: #5aa9ff; }
.mono { font-family: var(--mono); }
.dots { background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 22px 22px; }

/* ---- reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 1rem; line-height: 1.95; min-height: 100vh; display: flex; flex-direction: column;
  text-rendering: optimizeLegibility;
}
main { flex: 1; padding-block: 1.5rem 3rem; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 1rem; }
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.5; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip-link { position: absolute; inset-inline-start: .5rem; top: -4rem; background: var(--accent); color: var(--accent-fg);
  padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: .5rem; }
pre, code { direction: ltr; text-align: left; unicode-bidi: plaintext; font-family: var(--mono); }

@media (min-width: 48rem) {
  h1 { font-size: 2.1rem; } h2 { font-size: 1.55rem; }
  .container { padding-inline: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---- header (dark navy in both themes, as in the home mockup) ---- */
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--sky); }
.hd-row { position: relative; height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: var(--navy); display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { font: 11px var(--mono); color: var(--navy-muted); letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: 28px; margin-inline-start: 16px; font-size: 14px; font-weight: 500; }
.main-nav a { color: var(--navy-soft); text-decoration: none; transition: color .15s; }
.main-nav a:hover { color: #fff; }
.main-nav .nav-only-sm, .main-nav .nav-only-xs, .icon-btn.nav-toggle { display: none; }
.hd-actions { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.header-search { position: relative; display: flex; align-items: center; gap: 8px; width: 260px; height: 44px; padding: 0 14px;
  border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: var(--navy-muted); }
.header-search:focus-within { border-color: var(--sky); }
.header-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; font-size: 13px; }
.header-search input::placeholder { color: var(--navy-muted); opacity: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.hd-login { display: inline-flex; align-items: center; height: 44px; max-width: 14rem; padding: 0 20px; border-radius: 12px; background: #0468d7;
  color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter .15s, transform .15s; }
.hd-login:hover { filter: brightness(1.08); transform: translateY(-1px); }
@media (max-width: 1080px) {
  .header-search { display: none; }
  .icon-btn.nav-toggle { display: inline-grid; }
  .main-nav { display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0; padding: 8px 24px 16px; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .main-nav.is-open { display: flex; }
  .main-nav a { display: flex; align-items: center; min-height: 44px; font-size: 15px; }
  .main-nav .nav-only-sm { display: flex; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .hide-xs { display: none; }
  .main-nav { padding-inline: 16px; }
  .main-nav .nav-only-xs { display: flex; }
}

.live-results { position: absolute; inset-inline: 0; top: calc(100% + .4rem); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.live-results:empty { display: none; }
.live-list { list-style: none; margin: 0; padding: .25rem; }
.live-list a { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem .75rem; border-radius: 8px;
  color: var(--fg); text-decoration: none; line-height: 1.6; }
.live-list a:hover { background: var(--accent-soft); }
.live-list small { color: var(--muted); white-space: nowrap; }
.live-empty { padding: .75rem 1rem; color: var(--muted); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.2rem; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); font: inherit; font-weight: 500;
  text-decoration: none; cursor: pointer; line-height: 1.5; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); filter: none; }
.btn-sm { padding: .3rem .9rem; font-size: .9rem; }
.btn-block { display: flex; width: 100%; }

/* ---- footer ---- */
.site-footer { background: var(--navy); color: var(--navy-soft); margin-top: 2rem; }
.ft-wrap { padding-block: 64px 32px; display: flex; flex-direction: column; gap: 48px; }
.ft-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.ft-brand p { margin: 16px 0 0; max-width: 440px; font-size: 14px; line-height: 2; }
.ft-col { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.ft-title { margin: 0 0 4px; font-size: 14px; color: #fff; }
.site-footer a:not(.brand) { color: var(--navy-soft); text-decoration: none; transition: color .15s; }
.site-footer a:not(.brand):hover { color: #fff; }
.ft-copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 13px; color: var(--navy-muted); }
@media (max-width: 640px) { .ft-wrap { padding-block: 40px 24px; gap: 32px; } .ft-grid { grid-template-columns: 1fr; gap: 28px; } }
