/* aryasoft.org — site styles (RTL, light/dark) */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #5b6676;
  --border: #e2e8f0;
  --brand: #0f766e;
  --brand-strong: #0b5d57;
  --on-brand: #ffffff;
  --brand-soft: #e3f4f1;
  --ring: rgba(15, 118, 110, .35);
  --grad: linear-gradient(135deg, #0f766e 0%, #4338ca 100%);
  --grad-text: linear-gradient(90deg, #0d9488, #4f46e5);
  --code-bg: #0f172a;
  --code-text: #e5e9f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -14px rgba(15, 23, 42, .22);
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1140px;
  --narrow: 780px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1020;
    --surface: #10192d;
    --surface-2: #162139;
    --text: #e8eef7;
    --text-2: #c4cfde;
    --text-3: #97a5b9;
    --border: #23314d;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --on-brand: #04211e;
    --brand-soft: rgba(45, 212, 191, .11);
    --ring: rgba(45, 212, 191, .45);
    --grad-text: linear-gradient(90deg, #2dd4bf, #a5b4fc);
    --code-bg: #070c18;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(148, 163, 184, .08), 0 14px 34px -18px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(45, 212, 191, .28); }
h1, h2, h3 { line-height: 1.5; color: var(--text); font-weight: 800; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: var(--narrow); }
.muted { color: var(--text-3); font-size: 14.5px; }

.skip {
  position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100;
  padding: 8px 14px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-2); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 15.5px; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.nav a.nav-cta { background: var(--brand); color: var(--on-brand); font-weight: 700; margin-inline-start: 6px; }
.nav a.nav-cta:hover { background: var(--brand-strong); }

@media (max-width: 720px) {
  .site-header { position: static; }
  .header-inner { flex-wrap: wrap; gap: 4px; padding-block: 12px 8px; min-height: 0; }
  .nav { width: 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -6px; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 12px; font-size: 15px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1.4;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 10px 24px -12px var(--brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light { background: #ffffff; color: #0f172a; }
.btn-light:hover { background: #ecfdf9; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 76px 0 68px; }
.hero::before, .hero::after { content: ""; position: absolute; pointer-events: none; border-radius: 50%; }
.hero::before { width: 640px; height: 640px; top: -260px; left: -180px; background: radial-gradient(closest-side, rgba(20, 184, 166, .2), transparent); }
.hero::after { width: 560px; height: 560px; bottom: -300px; right: -160px; background: radial-gradient(closest-side, rgba(79, 70, 229, .16), transparent); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 52px; align-items: center; }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 3px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 14px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.45; margin: 0 0 18px; }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 2vw, 19.5px); color: var(--text-2); margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.term { background: var(--code-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgba(148, 163, 184, .16); }
.term-bar { display: flex; gap: 7px; padding: 12px 16px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); direction: ltr; }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; }
.term-bar span:nth-child(1) { background: #f87171; }
.term-bar span:nth-child(2) { background: #fbbf24; }
.term-bar span:nth-child(3) { background: #34d399; }
.term pre { margin: 0; padding: 20px 22px; border: 0; border-radius: 0; background: none; font-size: 14.5px; line-height: 2; }
.t-p { color: #5eead4; }
.t-ok { color: #34d399; }
.t-dim { color: #94a3b8; }

@media (max-width: 900px) {
  .hero { padding: 48px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 0 36px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; }
.section-head p { margin: 0; color: var(--text-2); }
.more { margin: 28px 0 0; font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  display: block; padding: 26px; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.card h3 { font-size: 19px; margin: 16px 0 6px; }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.9; }
.icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.icon svg { width: 26px; height: 26px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
.steps li { padding: 24px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); counter-increment: step; }
.steps li::before {
  content: counter(step, persian);
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: 12px; background: var(--grad); color: #ffffff; font-weight: 800;
}
.steps h3 { margin: 0 0 6px; font-size: 18px; }
.steps p { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.9; }

@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .section { padding: 52px 0; }
  .cards, .steps { grid-template-columns: 1fr; }
}

/* Article cards */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card a {
  display: flex; flex-direction: column; height: 100%; padding: 24px; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.post-card a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.post-tag { align-self: flex-start; padding: 1px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; }
.post-card h2, .post-card h3 { font-size: 18.5px; line-height: 1.65; margin: 12px 0 8px; }
.post-card p { flex: 1; margin: 0 0 16px; color: var(--text-2); font-size: 15px; line-height: 1.85; }
.post-meta { color: var(--text-3); font-size: 13.5px; }
@media (max-width: 980px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .post-list { grid-template-columns: 1fr; } }

/* Call to action band */
.cta { padding: 0 0 80px; }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 40px 44px; border-radius: 24px; background: var(--grad); color: #ffffff; box-shadow: var(--shadow);
}
.cta h2 { color: #ffffff; margin: 0 0 6px; font-size: clamp(22px, 3vw, 30px); }
.cta p { margin: 0; color: rgba(255, 255, 255, .92); }
@media (max-width: 720px) { .cta-inner { flex-direction: column; align-items: flex-start; padding: 28px; } }

/* Inner page header */
.page-hero { padding: 48px 0 32px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 8px 0 10px; }
.page-hero .lead { margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-3); }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-hidden] { opacity: .55; }

/* Services */
.service-list { display: grid; gap: 20px; }
.service {
  display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.service h2 { font-size: 22px; margin: 4px 0 6px; }
.service p { margin: 0 0 14px; color: var(--text-2); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.checks li { position: relative; padding-inline-start: 26px; font-size: 15.5px; }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 2px; top: 0; color: var(--brand); font-weight: 800; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { direction: ltr; padding: 5px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-weight: 600; font-size: 15px; }
@media (max-width: 620px) {
  .service { grid-template-columns: 1fr; gap: 12px; padding: 22px; }
  .checks { grid-template-columns: 1fr; }
}

/* Contact */
.contact-card {
  display: flex; align-items: center; gap: 18px; margin: 0 0 36px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.contact-card h2 { margin: 0; font-size: 17px; color: var(--text-2); font-weight: 600; }
.contact-card p { margin: 2px 0; }
.email { font-size: clamp(20px, 3vw, 26px); font-weight: 800; direction: ltr; unicode-bidi: isolate; }

/* Articles */
.article-head { padding: 40px 0 6px; }
.article-head h1 { font-size: clamp(27px, 3.8vw, 40px); margin: 12px 0 12px; }
.article-head .eyebrow { margin: 18px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--text-3); font-size: 14.5px; }
.toc { margin: 28px 0 10px; padding: 18px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toc strong { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; padding-inline-start: 22px; columns: 2; column-gap: 32px; }
.toc li { font-size: 15px; break-inside: avoid; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--brand); }
@media (max-width: 620px) { .toc ol { columns: 1; } }

.prose { font-size: 17.5px; overflow-wrap: break-word; }
.prose h2 { font-size: clamp(21px, 2.6vw, 26px); margin: 44px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-inline-start: 24px; }
.prose li { margin: 6px 0; }
.prose ol, .toc ol { list-style-type: persian; }
.prose li::marker { color: var(--brand); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 4px; }

code { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate; }
:not(pre) > code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
pre {
  direction: ltr; text-align: left; margin: 0 0 22px; padding: 18px 20px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-text); border: 1px solid rgba(148, 163, 184, .14); border-radius: var(--radius-sm);
  font-size: 14.5px; line-height: 1.75; tab-size: 4;
}
pre code { font-size: inherit; white-space: pre; }
.note { margin: 0 0 22px; padding: 16px 20px; border-radius: var(--radius-sm); background: var(--brand-soft); border-inline-start: 4px solid var(--brand); }
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; background: var(--surface); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.article-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  margin: 44px 0 8px; padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.article-cta strong { font-size: 18px; }
.article-cta p { margin: 4px 0 0; color: var(--text-2); }
.related { padding: 48px 0 76px; }
.related h2 { font-size: 22px; margin: 0 0 18px; }

/* 404 */
.notfound { padding: 96px 0; text-align: center; }
.notfound .code { margin: 0; font-size: 104px; font-weight: 900; line-height: 1.1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound h1 { font-size: clamp(26px, 3.5vw, 36px); margin: 8px 0 10px; }
.notfound .hero-actions { justify-content: center; }

/* Footer */
.site-footer { padding: 52px 0 28px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-2); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; }
.footer-grid .brand { font-size: 18px; }
.footer-grid .brand img { width: 32px; height: 32px; }
.footer-grid p { margin: 10px 0 0; }
.footer-grid h2 { margin: 0 0 10px; font-size: 15px; color: var(--text); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 5px 0; line-height: 1.8; }
.footer-grid a:not(.brand) { color: var(--text-2); }
.footer-grid a:not(.brand):hover { color: var(--brand); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 14px; }
.footer-bottom a { color: var(--text-3); }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-about { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
