/* هُوية «شاملتي» — تشترك فيها صفحات الموقع.
   الألوان مقيسةٌ من صورة الترويسة نفسها: طرفُها #0F5A57 وأيمنُها #246A50. */

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./assets/fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --teal: #0f5a57;
  --green: #246a50;
  --gold: #ecc97f;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eaf1ee;
  --line: #d5e2dc;
  --ink: #16211e;
  --ink-2: #5b6b66;
  --ink-3: #8a9a95;
  --warn: #8a6412;
  --display: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --body: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, Consolas, "Courier New", monospace;
  --pad: clamp(20px, 5vw, 56px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold: #e6c079;
    --bg: #0e1614;
    --surface: #14201e;
    --surface-2: #1b2b28;
    --line: #263a36;
    --ink: #e3ede9;
    --ink-2: #9ab0aa;
    --ink-3: #74857f;
    --warn: #d9a940;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; text-wrap: balance; }

a { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: #58bda6; } }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 var(--pad) 80px; }

/* ── الترويسة ── */
.site-head {
  background: var(--teal) url("./assets/header-bg.png") center / cover no-repeat;
  padding: 26px var(--pad);
  border-bottom: 1px solid color-mix(in srgb, var(--green) 55%, #000);
}
.site-head .row { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-head img { height: 58px; width: auto; display: block; flex: none; }
.site-head h1 { margin: 0; font-size: 22px; color: #fff; line-height: 1.4; }
.site-head h1 .t { font-size: 14px; font-weight: 500; color: var(--gold); margin-inline-start: 8px; }
.site-head h1 .t::before { content: "|"; color: rgba(255,255,255,.3); margin-inline-end: 8px; font-weight: 400; }
.site-head .by { margin: 3px 0 0; font-size: 13px; color: rgba(255,255,255,.75); }
.site-nav { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a {
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 15px; border-radius: 8px; background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.26);
}
.site-nav a:hover { background: rgba(255,255,255,.22); }
.site-nav a.cta { background: var(--gold); color: #23201b; border-color: var(--gold); }

/* رقمُ الإصدار تحت زرّ التحميل — خبرٌ لا دعوة، فيُهمَس ولا يُصاح. */
.ver {
  margin: 13px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.7;
}
.ver b {
  font-family: var(--display); font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  display: inline-block;
}

/* ── أرقامٌ في الصفحة الأولى ──
   حقيقيّةٌ كلُّها: التنزيلاتُ من غيت هَب، والكتبُ من عدّ المكتبة. */
.stats {
  display: flex; gap: 14px; flex-wrap: wrap; margin: 28px 0 0;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 22px; min-width: 150px; flex: 0 1 auto;
}
.stat[hidden] { display: none !important; }
.stat b {
  display: block; font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 4vw, 34px); line-height: 1.2; color: var(--teal);
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }

/* ── عناصر مشتركة ── */
section { margin: 44px 0; }
h2 { font-size: clamp(19px, 3vw, 24px); margin: 0 0 8px; }
h3 { font-size: 17px; margin: 26px 0 6px; }
p { margin: 0 0 14px; max-width: 68ch; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 62ch; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--teal); color: #fff; text-decoration: none;
  padding: 13px 28px; border-radius: 10px; font-weight: 700; font-size: 16px;
  border: 0; cursor: pointer;
}
.btn:hover { background: var(--green); }
.btn.gold { background: var(--gold); color: #23201b; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid .card h3 { margin: 0 0 6px; font-size: 16px; }
.grid .card p { margin: 0; font-size: 15px; color: var(--ink-2); }

.note {
  border: 1px solid var(--line); border-inline-start: 3px solid var(--warn);
  background: var(--surface); border-radius: 6px; padding: 15px 18px; margin: 0 0 15px;
}
.note strong { color: var(--ink); }
.note p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.note p + p { margin-top: 8px; }

code { font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; }

.steps { counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; position: relative; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; inset-inline-start: -14px; top: 18px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0 0 10px; color: var(--ink-2); font-size: 15.5px; }
.step p:last-child { margin-bottom: 0; }
.step img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
@media (max-width: 720px) { .step::before { inset-inline-start: auto; inset-inline-end: -10px; } }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
th, td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; background: var(--surface-2); }
td { color: var(--ink-2); }

footer.site {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 26px var(--pad);
  color: var(--ink-3); font-size: 13.5px;
}
footer.site .row { max-width: 900px; margin: 0 auto; display: flex; gap: 16px;
  flex-wrap: wrap; justify-content: space-between; align-items: flex-start; line-height: 2; }
footer.site .from { margin-top: 2px; }
footer.site .from a { color: var(--teal); font-weight: 600; text-decoration: none; }
footer.site .from a:hover { text-decoration: underline; }
footer.site .rights { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
