/* =========================================================
   باي — الأساس المشترك (الرموز، الخطوط، الشريط، التذييل، الأزرار)
   كل الصفحات تحمّله. الحركات: transform/opacity فقط.
   ========================================================= */

/* ---------- الخطوط (مستضافة محلياً، subset) ---------- */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/plex-arabic-400.cd75f4cb48.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+200C-200F, U+00AB, U+00BB; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/plex-arabic-600.22a2aa1ca5.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+200C-200F, U+00AB, U+00BB; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/plex-arabic-700.4fafb88916.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+200C-200F, U+00AB, U+00BB; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/plex-latin-400.d4fd0d1c9a.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00B7, U+2010-2015, U+2018-201D, U+2022, U+2026, U+2190-2193, U+2713; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/plex-latin-600.9fd0dd078d.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00B7, U+2010-2015, U+2018-201D, U+2022, U+2026, U+2190-2193, U+2713; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/plex-latin-700.b839e54cf8.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+00B7, U+2010-2015, U+2018-201D, U+2022, U+2026, U+2190-2193, U+2713; }

/* ---------- الرموز ---------- */
:root {
  color-scheme: light;

  --blue: #2563EB;
  --blue-600: #1D4ED8;
  --blue-400: #6E97F2;
  --sky: #60A5FA;
  --amber: #FFB020;
  --green: #10B981;
  --green-deep: #0C7A3E;
  --red: #DC2626;
  --navy: #0B1B4D;

  --bg: #FFFFFF;
  --bg-2: #FFFFFF;
  --bg-alt: #EEF3FF;
  --ink: #0B1B4D;
  --ink-2: #26345F;
  --muted: #64748B;
  --line: rgba(11, 27, 77, .11);
  --line-2: rgba(11, 27, 77, .06);
  --card: #FFFFFF;
  --card-2: #F4F7FF;
  --glass: rgba(255, 255, 255, .78);
  --accent-text: #2563EB;
  --glow: rgba(37, 99, 235, .14);
  --shadow: 0 1px 2px rgba(37, 99, 235, .06), 0 10px 28px -12px rgba(37, 99, 235, .22);
  --shadow-lg: 0 2px 6px rgba(37, 99, 235, .06), 0 32px 64px -28px rgba(37, 99, 235, .38);

  --font: "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --wrap: 1180px;
  --gut: 20px;
  --hdr-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
/* على الأزرق الفاتح #EEF3FF يُغمَّق الرمادي قليلاً ليبقى التباين 4.5:1 فأكثر */
.on-alt { --muted: #55637A; }
/* ألوان مشتقّة (غير ألوان الهوية) تُحسب في oklch حيث يُدعم: تدرّج أنعم بلا انزياح نحو الرمادي */
@supports (color: color-mix(in oklch, red, blue)) {
  :root {
    --blue-600: color-mix(in oklch, var(--blue) 86%, var(--navy));
    --blue-400: color-mix(in oklch, var(--blue) 68%, white);
    --card-2: color-mix(in oklch, var(--blue) 4%, white);
    --glow: color-mix(in oklch, var(--blue) 16%, transparent);
  }
}
/* نصوص الوصف: أصغر من العناوين بوضوح، لا تنزل عن 15px (موبايل) و16px (حاسوب)، وسطرها لا يتجاوز ~60 حرفاً */
:root { --desc: clamp(.9375rem, .9rem + .2vw, 1rem); }
.desc { font-size: var(--desc); line-height: 1.8; max-inline-size: 60ch; }

/* ---------- إعادة تعيين ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr-h) + 20px); }
body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--ink-2);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.3; text-wrap: balance; }
h3, h4 { line-height: 1.45; }
.num, [dir="ltr"] { font-variant-numeric: tabular-nums; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 200; padding: 10px 18px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; transform: translateY(-200%); transition: transform .2s; }
.skip:focus { transform: none; }

/* ---------- الانتقال بين الصفحات (View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
.brand { view-transition-name: brand; }

/* ---------- مؤشّر تقدّم التمرير ---------- */
.progress {
  position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 120;
  background: var(--blue);
  transform: scaleX(var(--scroll, 0)); transform-origin: right center;
  pointer-events: none;
}
[dir="ltr"] .progress { transform-origin: left center; }
@supports (animation-timeline: scroll()) {
  .progress { transform: scaleX(0); animation: progress-grow linear both; animation-timeline: scroll(root block); }
  @keyframes progress-grow { to { transform: scaleX(1); } }
}

/* ---------- الشريط العلوي الزجاجي ---------- */
.hdr { position: fixed; top: 0; inset-inline: 0; z-index: 100; padding-top: 12px; pointer-events: none; }
.hdr-bar {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--hdr-h);
  padding-inline: 18px 10px;
  border-radius: 22px;
  border: 1px solid transparent;
  transition: height .45s var(--ease-out), background-color .35s, border-color .35s, box-shadow .35s, max-width .45s var(--ease-out);
  max-width: var(--wrap);
  margin-inline: auto;
}
.hdr.is-stuck .hdr-bar {
  height: 56px;
  max-width: 920px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brand .bmark { height: 34px; transition: height .45s var(--ease-out); }
.hdr.is-stuck .brand .bmark { height: 28px; }

/* ---------- الشعار المشطور: نفس الرمز مرتين، كل نسخة مقصوصة على جهة من الخط المائل ---------- */
.bmark { position: relative; display: inline-block; aspect-ratio: 110 / 160; height: 34px; }
.bmark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bmark .b-top { clip-path: polygon(0 0, 100% 0, 100% 31.75%, 0 62.03%); }
.bmark .b-bot { clip-path: polygon(0 62.03%, 100% 31.75%, 100% 100%, 0 100%); }
/* الالتحام: العلوي من اليمين والسفلي من اليسار مع ارتداد خفيف */
@media (prefers-reduced-motion: no-preference) {
  .bmark-join .b-top { animation: b-top-in .85s cubic-bezier(.34, 1.56, .64, 1) both; }
  .bmark-join .b-bot { animation: b-bot-in .85s cubic-bezier(.34, 1.56, .64, 1) both; }
  .bmark-late .b-top, .bmark-late .b-bot { animation-delay: 1.05s; }
  @keyframes b-top-in { from { transform: translate3d(70%, 0, 0); opacity: 0; } 60% { opacity: 1; } }
  @keyframes b-bot-in { from { transform: translate3d(-70%, 0, 0); opacity: 0; } 60% { opacity: 1; } }
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; padding: 10px 14px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; color: var(--muted);
  transition: color .25s, background-color .25s;
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); background: var(--line-2); }
.hdr-end { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 14px; place-items: center; }
.menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .35s var(--ease-out), opacity .2s; }
.menu-btn span + span { margin-top: 5px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .hdr-end .hdr-cta { display: none; }
  .nav {
    position: absolute; top: calc(100% + 10px); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top center;
    transition: opacity .25s, transform .35s var(--ease-out), visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 14px 16px; font-size: 1.05rem; border-radius: 14px; }
}

.hdr:has(.nav.is-open) .hdr-bar { background: var(--bg-2); border-color: var(--line); box-shadow: var(--shadow); }

/* ---------- الأزرار ---------- */
.btn {
  --mx: 0px; --my: 0px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.3; white-space: nowrap;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform .35s var(--ease-out), box-shadow .3s, background-color .3s, color .3s, border-color .3s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translate3d(var(--mx), var(--my), 0) scale(.97); }
.btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .65);
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--blue-600);
  opacity: 0; transition: opacity .35s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-ghost { color: var(--ink); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--blue-400); }
.btn-sm { min-height: 44px; padding: 8px 18px; font-size: .95rem; }
.btn-wa { color: #fff; background: #0C7A3E; box-shadow: 0 10px 26px -12px rgba(12, 122, 62, .9); }
.btn-wa:hover { background: #0A6A36; }

/* تموّج عند الضغط */
.ripple {
  position: absolute; z-index: -1; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: currentColor; opacity: .28; pointer-events: none;
  animation: ripple .65s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(40); opacity: 0; } }

/* رابط بخط سفلي متحوّل */
.link { position: relative; font-weight: 600; color: var(--accent-text); }
.link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -2px; height: 2px; border-radius: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left center; transition: transform .35s var(--ease-out);
}
.link:hover::after { transform: scaleX(1); transform-origin: right center; }

/* ---------- عناصر مشتركة ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: .875rem; font-weight: 600; color: var(--accent-text);
  background: var(--bg-alt);
  border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent);
}
.eyebrow .dot, .eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 25%, transparent); }
.on-alt .eyebrow { background: #fff; }
.grad { color: var(--blue); }

/* ظهور عند التمرير (JS يضيف .in؛ بلا JS يبقى ظاهراً) */
.js [data-reveal] { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
.js [data-reveal="scale"] { transform: scale(.94); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- التذييل ---------- */
.ftr { --muted: #55637A; position: relative; margin-top: 0; padding: 72px 0 32px; background: var(--bg-alt); color: var(--muted); overflow: hidden; }
.ftr::before { content: ""; position: absolute; inset-inline: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .35), transparent); }
.ftr-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.ftr-brand img { height: 56px; width: auto; }
.ftr-brand p { margin-top: 18px; max-width: 30ch; color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.ftr h3 { color: var(--ink); font-size: 1rem; margin-bottom: 14px; }
.ftr li + li { margin-top: 2px; }
.ftr li a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; transition: color .25s, transform .35s var(--ease-out); }
.ftr li a:hover, .ftr li a[aria-current="page"] { color: var(--blue); transform: translateX(-4px); }
.ftr li a svg { width: 18px; height: 18px; color: var(--blue); }
.ftr-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 24px; font-size: .92rem; }
@media (max-width: 860px) { .ftr-grid { grid-template-columns: 1fr 1fr; } .ftr-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .ftr-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- نسخة هادئة ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .progress { animation: none; transform: scaleX(var(--scroll, 0)); }
}
/* أجهزة ضعيفة: لا ضبابية حيّة */
.lite .hdr.is-stuck .hdr-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg-2); }
