/* ══════════════════════════════════════════════════════════
   site.css — سایتِ عمومیِ کاریز آی‌کیو

   یک فایل، بدونِ CDN، بدونِ فریم‌ورک. دلیل: هر درخواستِ بیرونی یک
   نقطهٔ شکستِ اضافه است و روی اینترنتِ ایران هم کند است هم گاهی
   مسدود. کلِ این فایل کمتر از یک درخواستِ CDN وزن دارد.

   زبانِ بصری همان پنل است: زمینهٔ گرمِ کاغذی، جداسازی با **نور** نه
   با خط، و نورِ همیشه از بالا.
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #e8e6e1;
  --bg-2:      #dedbd4;
  --surface:   #f6f5f2;
  --raised:    #fdfdfc;
  --ink:       #2c2a26;
  --ink-2:     #5b564d;
  --muted:     #857f73;
  --line:      #d8d5cd;

  --brand:     #2f6f5e;   /* سبزِ کاریز — آرام، نه فسفری */
  --brand-2:   #245648;
  --brand-soft:#e2ede9;
  --accent:    #b4762f;   /* برنزِ گرم برای تأکید */

  --hi:        rgba(255, 255, 255, 0.95);
  --sh:        rgba(80, 72, 60, 0.16);
  --sh-deep:   rgba(80, 72, 60, 0.26);

  --r:         14px;
  --r-sm:      10px;

  --raise:
    inset 0 1px 0 var(--hi),
    0 1px 2px var(--sh),
    0 6px 14px -6px var(--sh-deep);
  --raise-lg:
    inset 0 1px 0 var(--hi),
    0 2px 4px var(--sh),
    0 14px 28px -10px var(--sh-deep);
  --inset:
    inset 0 2px 5px var(--sh),
    inset 0 -1px 0 rgba(255, 255, 255, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #171a1f;
    --bg-2:      #12151a;
    --surface:   #232830;
    --raised:    #2b313a;
    --ink:       #eceef1;
    --ink-2:     #b9bfc7;
    --muted:     #8d96a1;
    --line:      #2a3038;
    --brand:     #6fbfa5;
    --brand-2:   #8fd4bd;
    --brand-soft:#1e2b28;
    --accent:    #d9a35f;
    --hi:        rgba(255, 255, 255, 0.07);
    --sh:        rgba(0, 0, 0, 0.45);
    --sh-deep:   rgba(0, 0, 0, 0.6);
    --inset:
      inset 0 2px 5px rgba(0, 0, 0, 0.55),
      inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  }
}

* { box-sizing: border-box; }

html { direction: rtl; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ⚠️ لینکِ پرش برای کاربرِ صفحه‌خوان. تا زمانی که فوکوس نگیرد دیده
   نمی‌شود، ولی وجودش شرطِ دسترس‌پذیریِ پایه است. */
.skip {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: .6rem 1rem;
  z-index: 99; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { inset-inline-start: 0; }

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

h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ─── سرصفحه ─────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.hdr-in {
  display: flex; align-items: center; gap: 1rem;
  min-height: 66px;
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-weight: 900; font-size: 1.05rem;
  box-shadow: var(--raise);
}
.brand-txt { font-size: 1.05rem; }

.nav-wrap { flex: 1; }
.nav-wrap > summary { display: none; }
.nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); padding: .45rem .7rem; border-radius: var(--r-sm);
  font-size: .93rem; white-space: nowrap;
}
.nav a:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 700; }

.hdr-cta { display: flex; gap: .5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.15rem; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-weight: 700; font-size: .93rem;
  border: 0; cursor: pointer; box-shadow: var(--raise);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--raise-lg); }
.btn:active { transform: translateY(0); box-shadow: var(--inset); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.lg { padding: .8rem 1.6rem; font-size: 1rem; }

/* ─── بخش‌ها و کارت‌ها ───────────────────────────────────── */
section { padding: 3.5rem 0; }
section.tight { padding: 2rem 0; }

.card {
  background: var(--surface); border-radius: var(--r);
  padding: 1.4rem; box-shadow: var(--raise);
}
.card h3 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700;
  color: var(--brand); background: var(--brand-soft);
  padding: .25rem .7rem; border-radius: 999px; margin-bottom: .9rem;
}
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }

.pill {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 999px;
  background: var(--surface); color: var(--muted); box-shadow: var(--raise);
}
.pill.soon { background: var(--accent); color: #fff; }
.pill.on   { background: var(--brand-soft); color: var(--brand); }

/* ─── قهرمان ─────────────────────────────────────────────── */
.hero { padding: 4rem 0 3rem; }
.hero h1 { max-width: 20ch; }
.hero .lead { font-size: 1.2rem; margin-bottom: 1.8rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-note { font-size: .875rem; color: var(--muted); }

/* سه لایه — شبکهٔ نشانه‌ایِ صفحهٔ اصلی */
.layers { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.layer {
  background: var(--surface); border-radius: var(--r); padding: 1.4rem;
  box-shadow: var(--raise); position: relative; overflow: hidden;
}
.layer::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0;
  height: 3px; background: var(--brand);
}
.layer .k { font-size: .78rem; font-weight: 900; letter-spacing: .08em; color: var(--brand); }
.layer .q { font-weight: 700; margin: .3rem 0 .5rem; }

/* ─── فهرستِ امکانات ─────────────────────────────────────── */
.feat {
  display: block; background: var(--surface); border-radius: var(--r);
  padding: 1.3rem; box-shadow: var(--raise); color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease;
}
.feat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--raise-lg); }
.feat .ico { font-size: 1.7rem; line-height: 1; }
.feat h3 { margin: .6rem 0 .3rem; font-size: 1.05rem; }
.feat p { color: var(--ink-2); font-size: .92rem; margin: 0; }
.feat .pill { margin-top: .7rem; }

/* ─── فهرستِ نکته‌ها ─────────────────────────────────────── */
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.points li { background: var(--surface); border-radius: var(--r); padding: 1.1rem 1.3rem; box-shadow: var(--raise); }
.points b { display: block; margin-bottom: .2rem; }
.points span { color: var(--ink-2); font-size: .94rem; }

/* ─── قیمت ───────────────────────────────────────────────── */
.plans { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); align-items: start; }
.plan { background: var(--surface); border-radius: var(--r); padding: 1.5rem; box-shadow: var(--raise); position: relative; }
.plan.pop { box-shadow: var(--raise-lg); outline: 2px solid var(--brand); }
.plan .tag {
  position: absolute; top: -11px; inset-inline-start: 1.2rem;
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700;
  padding: .18rem .7rem; border-radius: 999px;
}
.plan h3 { font-size: 1.3rem; margin-bottom: .1rem; }
.price { font-size: 1.55rem; font-weight: 900; margin: .5rem 0 .1rem; }
.price small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .4rem; font-size: .92rem; }
.plan li::before { content: "✓"; color: var(--brand); font-weight: 900; margin-inline-end: .45rem; }
.plan .mods { display: flex; flex-wrap: wrap; gap: .3rem; margin: .8rem 0; }
.plan .mods span { font-size: .78rem; background: var(--bg); padding: .18rem .5rem; border-radius: 999px; color: var(--ink-2); }

/* ─── جدول ───────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; box-shadow: var(--raise); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .93rem; }
th, td { padding: .75rem 1rem; text-align: start; }
thead th { background: var(--bg); font-weight: 800; }
tbody tr + tr td { box-shadow: inset 0 1px 0 var(--line); }

/* ─── نوشته‌ها ───────────────────────────────────────────── */
.posts { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.post-card {
  background: var(--surface); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--raise); color: var(--ink); display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .14s ease;
}
.post-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--raise-lg); }
.post-card img { width: 100%; height: 168px; object-fit: cover; display: block; }
.post-card .in { padding: 1.1rem 1.25rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.post-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.post-card p { color: var(--ink-2); font-size: .92rem; flex: 1; }
.meta { font-size: .8rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; }

/* متنِ مقاله — تنها جایی که HTML بیرونی رندر می‌شود */
.prose { max-width: 74ch; margin: 0 auto; font-size: 1.05rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-sm); box-shadow: var(--raise); }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  margin: 1.4rem 0; padding: .9rem 1.2rem; background: var(--surface);
  border-radius: var(--r-sm); border-inline-start: 3px solid var(--brand);
  box-shadow: var(--raise);
}
.prose code {
  background: var(--bg); padding: .1rem .35rem; border-radius: 5px;
  font-size: .9em; font-family: ui-monospace, monospace; direction: ltr;
  display: inline-block;
}
.prose pre {
  background: var(--bg); padding: 1rem; border-radius: var(--r-sm);
  overflow-x: auto; direction: ltr; text-align: left; box-shadow: var(--inset);
}
.prose table { min-width: 0; }
.prose a { text-decoration: underline; }

.tags { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1.2rem 0; }
.tags a { font-size: .82rem; background: var(--surface); padding: .25rem .7rem; border-radius: 999px; box-shadow: var(--raise); color: var(--ink-2); }
.tags a:hover { text-decoration: none; color: var(--brand); }

/* ─── پرسش‌های پرتکرار (بدونِ جاوااسکریپت) ───────────────── */
.faq { display: grid; gap: .7rem; }
.faq details { background: var(--surface); border-radius: var(--r); box-shadow: var(--raise); }
.faq summary {
  cursor: pointer; padding: 1rem 1.3rem; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 900; }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 1.3rem 1.1rem; color: var(--ink-2); }

/* ─── نقشهٔ راه ──────────────────────────────────────────── */
.road { display: grid; gap: 1rem; }
.road-item { background: var(--surface); border-radius: var(--r); padding: 1.2rem 1.4rem; box-shadow: var(--raise); }
.road-item .hd { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .3rem; }
.road-item h3 { margin: 0; font-size: 1.05rem; }

/* ─── فرم ────────────────────────────────────────────────── */
form.contact { display: grid; gap: .9rem; max-width: 620px; }
label { font-weight: 700; font-size: .92rem; display: block; margin-bottom: .3rem; }
input, textarea, select {
  width: 100%; padding: .7rem .9rem; border-radius: var(--r-sm); border: 0;
  background: var(--raised); color: var(--ink); font-family: inherit; font-size: 1rem;
  box-shadow: var(--inset);
}
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 150px; resize: vertical; line-height: 1.8; }
/* ⚠️ تلهٔ ربات: برای آدم نامرئی، برای ربات پرکردنی. با `display:none`
   بعضی ربات‌ها ردش می‌کنند، پس این‌طور پنهان می‌شود. */
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.note { padding: 1rem 1.2rem; border-radius: var(--r); background: var(--brand-soft); color: var(--brand-2); }
.note.warn { background: #fdf1e3; color: #8a5a1c; }
@media (prefers-color-scheme: dark) { .note.warn { background: #2f2517; color: #e0b579; } }

/* ─── پاورقی ────────────────────────────────────────────── */
.ftr { margin-top: 3rem; padding: 2.5rem 0 1.5rem; background: var(--surface); box-shadow: inset 0 1px 0 var(--line); }
.ftr-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ftr-brand { grid-column: span 2; max-width: 34ch; }
.ftr-col h3 { font-size: .95rem; margin-bottom: .7rem; }
.ftr-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.ftr-col a { color: var(--ink-2); font-size: .9rem; }
.ftr-btm { margin-top: 2rem; padding-top: 1.2rem; box-shadow: inset 0 1px 0 var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ftr-btm p { margin: 0; font-size: .875rem; }

/* ─── موبایل ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hdr-in { flex-wrap: wrap; min-height: 58px; }
  .nav-wrap { order: 3; flex-basis: 100%; }
  .nav-wrap > summary {
    display: block; cursor: pointer; list-style: none;
    padding: .4rem .7rem; border-radius: var(--r-sm);
    background: var(--surface); box-shadow: var(--raise);
    width: max-content; margin: 0 0 .6rem;
  }
  .nav-wrap > summary::-webkit-details-marker { display: none; }
  .nav { flex-direction: column; padding-bottom: .8rem; }
  .hdr-cta { margin-inline-start: auto; }
  .hdr-cta .ghost { display: none; }
  .ftr-brand { grid-column: span 1; }
  section { padding: 2.5rem 0; }
}

/* ⚠️ چاپ و «حالتِ مطالعه» هم باید سالم باشند — بعضی ابزارهای
   استخراجِ محتوا از همین مسیر می‌خوانند. */
@media print {
  .hdr, .ftr, .hero-cta, .skip { display: none; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ─── فهرستِ مطالب ──────────────────────────────────────── */
.toc {
  max-width: 74ch; margin: 0 auto 2rem; padding: 1.1rem 1.4rem;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--raise);
}
.toc b { display: block; margin-bottom: .5rem; font-size: .95rem; }
.toc ol { margin: 0; padding-inline-start: 1.3rem; font-size: .93rem; }
.toc li { margin-bottom: .3rem; }
.toc li.l3 { margin-inline-start: 1rem; list-style: circle; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--brand); }

/* تیترِ لنگردار: با پرشِ داخلی زیرِ سرصفحهٔ چسبان نرود */
.prose h2, .prose h3 { scroll-margin-top: 84px; }
