/* ==========================================================================
   مكتب فايد للاستشارات الهندسية — فرع جدة
   Fayed Engineering Consultancy — Jeddah Branch
   Stylesheet — v1.0
   ملاحظة: تم بناء كل التنسيقات بخصائص CSS المنطقية (Logical Properties)
   لكي يعمل الملف نفسه مع العربية (RTL) والإنجليزية (LTR) دون تكرار.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. المتغيرات / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* الألوان الأساسية */
  --navy-900: #071A31;
  --navy-800: #0B2545;
  --navy-700: #13315C;
  --navy-600: #1B4570;
  --navy-50:  #EEF3F9;

  --gold-600: #A8842F;
  --gold-500: #C4A052;
  --gold-400: #D9BC7A;
  --gold-50:  #FBF6EA;

  --ink:      #101828;
  --body:     #475467;
  --muted:    #667085;
  --line:     #E4E7EC;
  --line-soft:#F2F4F7;
  --surface:  #FFFFFF;
  --surface-2:#F8FAFC;
  --sand:     #F7F4ED;

  --success:  #12805C;
  --danger:   #B42318;

  /* أسطح تتبدّل مع الوضع الليلي */
  --bg:        #FFFFFF;   /* خلفية الصفحة */
  --header-bg: rgba(255, 255, 255, .92);
  --ok-bg:     #E7F6F0;
  --ok-line:   #A6E3CD;
  --err-bg:    #FEF3F2;
  --err-line:  #FDA29B;

  color-scheme: light;

  /* الخطوط */
  --font-base: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* المقاسات */
  --container: 1200px;
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* الظلال */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-md: 0 8px 24px rgba(11, 37, 69, .08);
  --shadow-lg: 0 20px 48px rgba(11, 37, 69, .12);

  /* الحركة */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .3s;

  /* الهيدر */
  --header-h: 78px;
}

/* --------------------------------------------------------------------------
   2. إعادة الضبط / Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;

  /* نحجز مكان شريط التمرير دائماً. بدون ذلك، عند قفل التمرير لفتح قائمة
     الجوال يختفي الشريط فيتغيّر عرض المستند وينزاح الدرج خارج الشاشة —
     ويظهر الخلل في الوضع العربي تحديداً لأن الشريط يكون على اليسار.
     على الهواتف لا أثر لهذه الخاصية لأن شريط التمرير عائم بعرض صفر. */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.75;
  color: var(--body);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

/* تحسينات اللمس: إزالة تأخير النقر ووميض التظليل الأزرق على أندرويد */
a, button, [role="button"], input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5 {
  color: var(--ink);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* منع الوميض أثناء تحميل اللغة.
   شبكة أمان: إن تعطّل الجافاسكربت أو تأخّر، تظهر الصفحة تلقائياً بعد ١.٢ ثانية
   بدلاً من أن تبقى بيضاء إلى الأبد. */
html:not([data-lang-ready]) body {
  opacity: 0;
  animation: reveal-fallback 0s 1.2s forwards;
}
@keyframes reveal-fallback { to { opacity: 1; } }
body { transition: opacity .2s var(--ease); }

/* --------------------------------------------------------------------------
   3. أدوات مساعدة / Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 999;
  background: var(--navy-800);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: inset-block-start var(--dur) var(--ease);
}
.skip-link:focus { inset-block-start: 0; }

/* حلقة التركيز — مهمة للوصولية */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.section { padding-block: clamp(64px, 8vw, 110px); }
.section--tight { padding-block: clamp(48px, 6vw, 78px); }
.section--alt { background: var(--surface-2); }
.section--sand { background: var(--sand); }

.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   4. الأزرار / Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary {
  background: var(--navy-800);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--navy-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--gold {
  background: var(--gold-500);
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}
.btn--gold:hover {
  background: var(--gold-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--navy-800);
  background: var(--navy-50);
}

.btn--light {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
  backdrop-filter: blur(6px);
}
.btn--light:hover { background: rgba(255, 255, 255, .22); }

.btn--wide { width: 100%; }
.btn--sm { padding: 10px 20px; font-size: 14px; }

/* --------------------------------------------------------------------------
   5. الهيدر والتنقل / Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

/* الشريط العلوي */
.topbar {
  background: var(--navy-800);
  color: rgba(255, 255, 255, .82);
  font-size: 13.5px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  flex-wrap: wrap;
}
.topbar__list { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color var(--dur) var(--ease);
}
.topbar__item:hover { color: var(--gold-400); }
.topbar__item svg { width: 15px; height: 15px; opacity: .75; }
.topbar__item span { direction: ltr; unicode-bidi: embed; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

/* الشعار */
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark { width: 46px; height: 46px; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-800);
  letter-spacing: -.02em;
}
.brand__tag {
  font-size: 11.5px;
  color: var(--gold-600);
  font-weight: 600;
  letter-spacing: .02em;
}

/* القائمة */
.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--body);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__link:hover { color: var(--navy-800); background: var(--navy-50); }
.nav__link.is-active { color: var(--navy-800); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  inset-block-end: 2px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 22px; height: 3px;
  background: var(--gold-500);
  border-radius: 3px;
}
html[dir="rtl"] .nav__link.is-active::after { transform: translateX(50%); }

.nav__actions { display: flex; align-items: center; gap: 10px; }

/* زر تبديل اللغة */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
  transition: all var(--dur) var(--ease);
}
.lang-switch:hover { border-color: var(--navy-800); background: var(--navy-50); }
.lang-switch svg { width: 16px; height: 16px; }

/* زر تبديل المظهر (فاتح / ليلي) */
.theme-toggle {
  width: 44px; height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--navy-800);
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { border-color: var(--navy-800); background: var(--navy-50); }
.theme-toggle svg { width: 20px; height: 20px; }

/* القمر يظهر في الوضع الفاتح، والشمس في الوضع الليلي */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* زر القائمة للجوال */
.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  position: relative;
  width: 20px; height: 2px;
  background: var(--navy-800);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  width: 20px; height: 2px;
  background: var(--navy-800);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.nav-toggle span::before { inset-block-start: -6px; }
.nav-toggle span::after  { inset-block-start: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { inset-block-start: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { inset-block-start: 0; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. القسم الرئيسي / Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 45%, var(--navy-700) 100%);
  color: #fff;
  overflow: hidden;
  padding-block: clamp(70px, 9vw, 130px);
}

/* شبكة هندسية زخرفية */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset-block-start: -180px;
  inset-inline-end: -160px;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(196, 160, 82, .17) 0%, transparent 68%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(36px, 5vw, 70px);
  align-items: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  background: rgba(196, 160, 82, .14);
  border: 1px solid rgba(196, 160, 82, .32);
  border-radius: var(--radius-pill);
  color: var(--gold-400);
  font-size: 13.5px;
  font-weight: 700;
  margin-block-end: 22px;
}
.hero__eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(196, 160, 82, .25);
}

.hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.6vw, 55px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-block-end: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold-400);
  position: relative;
}

.hero__lead {
  font-size: clamp(16px, 1.7vw, 19px);
  color: rgba(255, 255, 255, .8);
  max-width: 60ch;
  margin-block-end: 34px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-block-end: 40px; }

.hero__points { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.hero__point {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  color: rgba(255, 255, 255, .82);
  font-weight: 500;
}
.hero__point svg { width: 19px; height: 19px; color: var(--gold-400); flex-shrink: 0; }

/* بطاقة النموذج السريع */
.hero__card {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 34px);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
}
.hero__card h3 {
  color: #fff;
  font-size: 21px;
  margin-block-end: 6px;
}
.hero__card p {
  font-size: 14.5px;
  color: rgba(255, 255, 255, .68);
  margin-block-end: 22px;
}

/* --------------------------------------------------------------------------
   7. شريط الاعتمادات / Trust bar
   -------------------------------------------------------------------------- */
.trustbar {
  background: var(--navy-900);
  border-block-start: 1px solid rgba(255, 255, 255, .08);
  padding-block: 26px;
}
.trustbar__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.trustbar__item {
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(255, 255, 255, .82);
}
.trustbar__item svg {
  width: 30px; height: 30px;
  color: var(--gold-500);
  flex-shrink: 0;
}
.trustbar__item strong {
  display: block;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}
.trustbar__item span { font-size: 12.5px; color: rgba(255, 255, 255, .55); }

/* --------------------------------------------------------------------------
   8. عناوين الأقسام / Section headings
   -------------------------------------------------------------------------- */
.sec-head { max-width: 720px; margin-block-end: clamp(38px, 5vw, 58px); }
.sec-head--center { margin-inline: auto; text-align: center; }

.sec-head__eyebrow {
  display: inline-block;
  color: var(--gold-600);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-block-end: 12px;
}
.sec-head h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.25;
  letter-spacing: -.025em;
  margin-block-end: 14px;
}
.sec-head p {
  font-size: clamp(15px, 1.6vw, 17.5px);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   9. الخدمات / Services
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.svc-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--dur) var(--ease);
  overflow: hidden;
  height: 100%;
}
.svc-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--gold-500), var(--navy-700));
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .4s var(--ease);
}
.svc-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}
.svc-card:hover::before { transform: scaleX(1); }

.svc-card__icon {
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy-50);
  color: var(--navy-700);
  margin-block-end: 20px;
  transition: all var(--dur) var(--ease);
}
.svc-card__icon svg { width: 28px; height: 28px; }
.svc-card:hover .svc-card__icon {
  background: var(--navy-800);
  color: var(--gold-400);
}

.svc-card h3 { font-size: 19px; margin-block-end: 10px; }
.svc-card p { font-size: 14.8px; color: var(--muted); }

.svc-card__list { margin-block-start: 16px; display: grid; gap: 8px; }
.svc-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  color: var(--body);
}
.svc-card__list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-block-start: 9px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   9.b قيم المكتب / Values chips
   -------------------------------------------------------------------------- */
.values-block { margin-block-start: clamp(40px, 5vw, 60px); }

.values-title {
  text-align: center;
  font-size: clamp(20px, 2.4vw, 26px);
  margin-block-end: 26px;
}

.values {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.value-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  transition: all var(--dur) var(--ease);
}
.value-chip:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}
.value-chip svg {
  width: 18px;
  height: 18px;
  color: var(--gold-600);
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .value-chip { padding: 11px 18px; font-size: 14.5px; }
}

/* --------------------------------------------------------------------------
   10. الإحصائيات / Stats
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat { text-align: center; padding: 26px 16px; }
.stat__num {
  font-size: clamp(34px, 4.5vw, 50px);
  font-weight: 800;
  color: var(--navy-800);
  line-height: 1;
  letter-spacing: -.03em;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  direction: ltr;
}
.stat__num sup {
  font-size: .45em;
  color: var(--gold-600);
  font-weight: 800;
}
.stat__label {
  margin-block-start: 10px;
  font-size: 14.5px;
  color: var(--muted);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   11. عن المكتب / About split
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
.split--wide-start { grid-template-columns: 1.1fr .9fr; }

/* يعكس ترتيب العمودين بصرياً دون تغيير ترتيبهما في HTML —
   نستخدمه لتبادل جهة الصورة بين الأقسام المتتالية. */
.split--swap > :first-child { order: 2; }

.split__media { position: relative; }
.split__media img,
.split__media .ph {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* صندوق نائب عن الصورة (Placeholder) */
.ph {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background:
    linear-gradient(135deg, var(--navy-800), var(--navy-600)),
    var(--navy-800);
  color: rgba(255, 255, 255, .5);
  font-size: 13px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 34px 34px;
}
.ph span { position: relative; z-index: 1; }

/* بطاقة الخبرة العائمة */
.split__badge {
  position: absolute;
  inset-block-end: -26px;
  inset-inline-start: -26px;
  background: var(--gold-500);
  color: var(--navy-900);
  padding: 22px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.split__badge strong { display: block; font-size: 34px; line-height: 1; font-weight: 800; }
.split__badge span { font-size: 13px; font-weight: 700; }

.split__body h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -.025em;
  margin-block-end: 18px;
}
.split__body > p { margin-block-end: 16px; font-size: 16px; }

.check-list { display: grid; gap: 14px; margin-block: 26px; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-size: 15.5px;
  color: var(--body);
}
.check-list svg {
  width: 23px; height: 23px;
  color: var(--gold-600);
  flex-shrink: 0;
  margin-block-start: 3px;
}
.check-list strong { color: var(--ink); font-weight: 700; }

/* --------------------------------------------------------------------------
   12. خطوات العمل / Process
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  transition: all var(--dur) var(--ease);
}
.step:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.step__num {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-400);
  font-size: 18px;
  font-weight: 800;
  margin-block-end: 18px;
  direction: ltr;
}
.step h3 { font-size: 18px; margin-block-end: 8px; }
.step p { font-size: 14.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   13. المشاريع / Projects
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-block-end: 40px;
}
.filter-btn {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--body);
  transition: all var(--dur) var(--ease);
}
.filter-btn:hover { border-color: var(--navy-800); color: var(--navy-800); }
.filter-btn.is-active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.proj-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur) var(--ease);
  background: var(--navy-800);
}
.proj-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }
.proj-card.is-hidden { display: none; }

.proj-card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.proj-card__media img,
.proj-card__media .ph {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  transition: transform .6s var(--ease);
}
.proj-card:hover .proj-card__media img { transform: scale(1.07); }

.proj-card__body {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  padding: 26px 24px 22px;
  background: linear-gradient(to top, rgba(7, 26, 49, .96) 12%, rgba(7, 26, 49, .72) 55%, transparent 100%);
  color: #fff;
}
.proj-card__type {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-400);
  letter-spacing: .05em;
  margin-block-end: 6px;
}
.proj-card__body h3 { color: #fff; font-size: 18.5px; margin-block-end: 5px; }
.proj-card__meta { font-size: 13.5px; color: rgba(255, 255, 255, .68); }

/* --------------------------------------------------------------------------
   14. لماذا نحن / Why us
   -------------------------------------------------------------------------- */
.why-card {
  display: flex;
  gap: 18px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all var(--dur) var(--ease);
  height: 100%;
}
.why-card:hover { border-color: var(--gold-400); box-shadow: var(--shadow-md); }
.why-card__icon {
  width: 50px; height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--gold-50);
  color: var(--gold-600);
}
.why-card__icon svg { width: 26px; height: 26px; }
.why-card h3 { font-size: 17.5px; margin-block-end: 7px; }
.why-card p { font-size: 14.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   15. آراء العملاء / Testimonials
   -------------------------------------------------------------------------- */
.quote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.quote-card__stars { display: flex; gap: 3px; margin-block-end: 16px; }
.quote-card__stars svg { width: 18px; height: 18px; color: var(--gold-500); }
.quote-card blockquote {
  font-size: 15.5px;
  color: var(--body);
  line-height: 1.85;
  flex: 1;
  margin-block-end: 22px;
}
.quote-card__author {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--line-soft);
}
.quote-card__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-400);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
}
.quote-card__author strong { display: block; font-size: 15px; color: var(--ink); }
.quote-card__author span { font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------------------
   16. الأسئلة الشائعة / FAQ
   -------------------------------------------------------------------------- */
.faq { max-width: 860px; margin-inline: auto; display: grid; gap: 14px; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}
.faq__item.is-open { border-color: var(--navy-600); box-shadow: var(--shadow-sm); }

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 26px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: start;
  transition: color var(--dur) var(--ease);
}
.faq__q:hover { color: var(--navy-700); }
.faq__icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-50);
  color: var(--navy-700);
  transition: all var(--dur) var(--ease);
}
.faq__icon svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.faq__item.is-open .faq__icon { background: var(--navy-800); color: #fff; }
.faq__item.is-open .faq__icon svg { transform: rotate(45deg); }

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease);
}
.faq__item.is-open .faq__a { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p {
  padding: 0 26px 24px;
  font-size: 15px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   17. شريط الدعوة للتواصل / CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  background: linear-gradient(120deg, var(--navy-900), var(--navy-700));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(38px, 5vw, 62px);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset-block-start: -120px;
  inset-inline-end: -100px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(196, 160, 82, .2), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 {
  color: #fff;
  font-size: clamp(24px, 3.2vw, 36px);
  margin-block-end: 12px;
  letter-spacing: -.02em;
}
.cta-band p { color: rgba(255, 255, 255, .78); font-size: 16.5px; max-width: 58ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* --------------------------------------------------------------------------
   18. صفحة داخلية — ترويسة / Page header
   -------------------------------------------------------------------------- */
.page-head {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding-block: clamp(54px, 7vw, 90px);
  overflow: hidden;
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, #000, transparent 75%);
}
.page-head__inner { position: relative; z-index: 1; }
.page-head h1 {
  color: #fff;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -.025em;
  margin-block-end: 14px;
}
.page-head p {
  color: rgba(255, 255, 255, .76);
  font-size: clamp(15px, 1.7vw, 18px);
  max-width: 68ch;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .6);
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { transition: color var(--dur) var(--ease); }
.breadcrumb a:hover { color: var(--gold-400); }
.breadcrumb__sep { opacity: .5; }
html[dir="rtl"] .breadcrumb__sep { transform: scaleX(-1); }

/* --------------------------------------------------------------------------
   19. نموذج التواصل / Forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.field label .req { color: var(--danger); }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
  transition: all var(--dur) var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: #98A2B3; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 4px rgba(19, 49, 92, .1);
}
.field textarea { resize: vertical; min-height: 130px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  background-size: 18px;
  padding-inline-end: 16px;
  padding-inline-start: 44px;
}
html[dir="ltr"] .field select { background-position: right 16px center; padding-inline-start: 16px; padding-inline-end: 44px; }

/* حقول داخل الخلفية الداكنة */
.hero__card .field label { color: rgba(255, 255, 255, .85); }
.hero__card .field input,
.hero__card .field textarea,
.hero__card .field select {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
  color: #fff;
}
.hero__card .field input::placeholder,
.hero__card .field textarea::placeholder { color: rgba(255, 255, 255, .45); }
.hero__card .field input:focus,
.hero__card .field textarea:focus,
.hero__card .field select:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 4px rgba(196, 160, 82, .18);
}
.hero__card .field select option { color: var(--ink); }

/* حقل مصيدة السبام (مخفي) */
.hp-field {
  position: absolute !important;
  inset-inline-start: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form__note { font-size: 13px; color: var(--muted); }
.hero__card .form__note { color: rgba(255, 255, 255, .55); }

.form__status {
  display: none;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
}
.form__status.is-visible { display: block; }
.form__status--ok { background: #E7F6F0; color: var(--success); border: 1px solid #A6E3CD; }
.form__status--err { background: #FEF3F2; color: var(--danger); border: 1px solid #FDA29B; }

/* --------------------------------------------------------------------------
   20. بطاقات التواصل / Contact cards
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}

.info-card {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all var(--dur) var(--ease);
}
.info-card:hover { border-color: var(--navy-600); box-shadow: var(--shadow-md); }
.info-card__icon {
  width: 50px; height: 50px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  color: var(--navy-700);
}
.info-card__icon svg { width: 24px; height: 24px; }
.info-card h3 { font-size: 16px; margin-block-end: 5px; }
.info-card p, .info-card a { font-size: 15px; color: var(--muted); }
.info-card a:hover { color: var(--navy-700); }
.info-card .ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  line-height: 0;
}
.map-frame iframe { width: 100%; height: 420px; border: 0; }

/* --------------------------------------------------------------------------
   21. التذييل / Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, .68);
  padding-block-start: clamp(52px, 6vw, 76px);
  font-size: 14.8px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-block-end: 46px;
}
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__tag { color: var(--gold-500); }
.footer__about { margin-block: 18px 22px; line-height: 1.85; }

.footer h4 {
  color: #fff;
  font-size: 16px;
  margin-block-end: 20px;
  position: relative;
  padding-block-end: 12px;
}
.footer h4::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 34px; height: 2.5px;
  background: var(--gold-500);
  border-radius: 2px;
}

.footer__links { display: grid; gap: 12px; }
.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: all var(--dur) var(--ease);
}
.footer__links a::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-500);
  opacity: .55;
  transition: all var(--dur) var(--ease);
}
.footer__links a:hover { color: #fff; padding-inline-start: 5px; }
.footer__links a:hover::before { opacity: 1; }

.footer__contact { display: grid; gap: 16px; }
.footer__contact li { display: flex; gap: 12px; align-items: flex-start; }
.footer__contact svg {
  width: 19px; height: 19px;
  color: var(--gold-500);
  flex-shrink: 0;
  margin-block-start: 4px;
}
.footer__contact a:hover { color: #fff; }
.footer__contact .ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

.socials { display: flex; gap: 10px; margin-block-start: 22px; }
.socials a {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .8);
  transition: all var(--dur) var(--ease);
}
.socials a:hover { background: var(--gold-500); color: var(--navy-900); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }

.footer__bottom {
  border-block-start: 1px solid rgba(255, 255, 255, .1);
  padding-block: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.8px;
  color: rgba(255, 255, 255, .5);
}
.footer__bottom a:hover { color: var(--gold-400); }

/* --------------------------------------------------------------------------
   22. أزرار عائمة / Floating actions
   -------------------------------------------------------------------------- */
.fab-stack {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fab {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  transition: all var(--dur) var(--ease);
}
.fab svg { width: 27px; height: 27px; }
.fab:hover { transform: scale(1.08); }

.fab--wa { background: #25D366; color: #fff; }
.fab--wa::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: pulse 2.4s infinite;
}
.fab--wa { position: relative; }

.fab--top {
  background: var(--navy-800);
  color: #fff;
  width: 46px; height: 46px;
  opacity: 0;
  visibility: hidden;
}
.fab--top svg { width: 21px; height: 21px; }
.fab--top.is-visible { opacity: 1; visibility: visible; }

@keyframes pulse {
  0%   { transform: scale(1);    opacity: .9; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* --------------------------------------------------------------------------
   23. حركة الظهور عند التمرير / Scroll reveal
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   24. صفحة 404
   -------------------------------------------------------------------------- */
.err-page {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 80px;
}
.err-page__code {
  font-size: clamp(84px, 15vw, 168px);
  font-weight: 800;
  line-height: 1;
  color: var(--navy-800);
  letter-spacing: -.04em;
  direction: ltr;
}
.err-page__code span { color: var(--gold-500); }
.err-page h1 { font-size: clamp(24px, 3.4vw, 34px); margin-block: 16px 12px; }
.err-page p { font-size: 16.5px; color: var(--muted); margin-block-end: 30px; max-width: 52ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   25. الاستجابة / Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__card { max-width: 560px; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .trustbar__inner { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }

  .topbar { display: none; }

  .nav-toggle { display: inline-flex; }

  /* درج التنقل للجوال */
  .nav {
    position: fixed;
    inset-block-start: var(--header-h);
    inset-inline-end: 0;
    inset-block-end: 0;
    z-index: 101; /* فوق غطاء التعتيم (99) حتى تبقى الروابط قابلة للنقر */
    /* نستخدم % لا vw: وحدة vw تشمل عرض شريط التمرير بينما الحاوية المرجعية
       للعنصر الثابت لا تشمله، فينتج فرق يزيح الدرج على أجهزة سطح المكتب. */
    width: min(88%, 340px);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--surface);
    border-inline-start: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 24px 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    visibility: hidden;
  }
  html[dir="rtl"] .nav { transform: translateX(-100%); }

  /* ملاحظة: قاعدة html[dir="rtl"] .nav أعلى أولوية من .nav.is-open،
     لذا لا بدّ من قاعدة فتح مكافئة لها في الاتجاهين وإلا فُتح الدرج
     خارج الشاشة في الوضع العربي. */
  .nav.is-open,
  html[dir="rtl"] .nav.is-open { transform: translateX(0); visibility: visible; }

  .nav__link { padding: 14px 16px; font-size: 16px; border-block-end: 1px solid var(--line-soft); border-radius: 0; }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { color: var(--navy-800); background: var(--navy-50); }

  .nav__cta { margin-block-start: 18px; }
  .nav .btn { width: 100%; }

  /* غطاء التعتيم */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 26, 49, .5);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--dur) var(--ease);
  }
  .nav-overlay.is-open { opacity: 1; visibility: visible; }

  .split, .split--wide-start { grid-template-columns: 1fr; }
  .split__media { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; text-align: center; }
  .cta-band__actions { justify-content: center; }
  .cta-band p { margin-inline: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .split__badge { inset-inline-start: 16px; inset-block-end: -20px; padding: 16px 22px; }
  .split__badge strong { font-size: 27px; }
}

/* --------------------------------------------------------------------------
   أداء الأجهزة المحمولة (أندرويد / آيفون)
   --------------------------------------------------------------------------
   ثلاثة أشياء تُسبّب تهنيج التمرير على أجهزة أندرويد المتوسطة تحديداً:

   1) backdrop-filter: يجبر المتصفح على إعادة رسم ما خلف العنصر في كل إطار
      أثناء التمرير. الهيدر ثابت أعلى الشاشة، فالتكلفة مستمرة. نستبدله
      بخلفية معتمة — الفرق البصري لا يكاد يُلحظ على شاشة صغيرة.

   2) الحلقة النابضة حول زر واتساب: حركة لا نهائية تمنع المتصفح من الخمول
      وتستهلك البطارية طوال بقاء الصفحة مفتوحة.

   3) الشبكة الهندسية مع mask-image: طبقة مقنّعة كبيرة مكلفة على معالج الرسوم.
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .site-header { backdrop-filter: none; background: var(--bg); }
  .hero__card  { backdrop-filter: none; background: rgba(255, 255, 255, .1); }
  .btn--light  { backdrop-filter: none; }
  .nav-overlay { backdrop-filter: none; background: rgba(7, 26, 49, .62); }

  .fab--wa::after { display: none; }

  .hero::before,
  .page-head::before { display: none; }

  /* إلغاء تأثيرات الرفع عند اللمس — لا معنى لها بلا مؤشر فأرة */
  .svc-card:hover, .step:hover, .proj-card:hover,
  .why-card:hover, .info-card:hover,
  .btn--primary:hover, .btn--gold:hover {
    transform: none;
  }
}

/* على الشاشات الضيقة يُختصر زر اللغة إلى أيقونة فقط لإفساح المجال */
@media (max-width: 620px) {
  .lang-switch [data-lang-label] { display: none; }
  .lang-switch { width: 44px; height: 44px; padding: 0; justify-content: center; }
}

@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .trustbar__inner { grid-template-columns: 1fr; }
  .brand__mark { width: 40px; height: 40px; }
  .brand__name { font-size: 16px; }
  .brand__tag { font-size: 10.5px; }
  .hero__cta .btn { width: 100%; }
  .fab-stack { inset-block-end: 16px; inset-inline-end: 16px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { justify-content: center; text-align: center; }
}

/* --------------------------------------------------------------------------
   26. الوضع الليلي / Dark mode
   --------------------------------------------------------------------------
   يُفعَّل عبر السمة data-theme="dark" على عنصر <html>.
   يضبطها سكربت صغير في <head> قبل الرسم لمنع وميض الشاشة البيضاء،
   ويحفظ اختيار المستخدم، وإن لم يختر شيئاً يتبع إعداد نظام تشغيله.

   ملاحظة تصميمية: ألوان الهوية (navy / gold) تبقى ثابتة لأن الهيرو والتذييل
   وشريط الاعتمادات داكنة أصلاً في الوضعين — نبدّل الأسطح والنصوص فقط.
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #0B1622;
  --surface:   #132234;   /* البطاقات والحقول */
  --surface-2: #0F1D2C;   /* الأقسام البديلة */
  --sand:      #101E2E;
  --header-bg: rgba(11, 22, 34, .92);

  --ink:       #E9EEF5;
  --body:      #B3C0D1;
  --muted:     #8A9AAE;

  --line:      #24384F;
  --line-soft: #1A2B3E;

  --navy-50:   #17293C;   /* خلفية أيقونات فاتحة سابقاً */
  --gold-50:   #2A2313;

  --ok-bg:     #0E2B22;
  --ok-line:   #1E5C48;
  --err-bg:    #2E1614;
  --err-line:  #7A2E28;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .38);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, .45);
}

/* نصوص وأيقونات كانت تعتمد اللون الكحلي الداكن — تصبح فاتحة */
:root[data-theme="dark"] .brand__name,
:root[data-theme="dark"] .nav__link:hover,
:root[data-theme="dark"] .nav__link.is-active,
:root[data-theme="dark"] .lang-switch,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .btn--ghost,
:root[data-theme="dark"] .stat__num,
:root[data-theme="dark"] .err-page__code { color: var(--ink); }

:root[data-theme="dark"] .lang-switch:hover,
:root[data-theme="dark"] .theme-toggle:hover,
:root[data-theme="dark"] .btn--ghost:hover { border-color: var(--gold-500); }

:root[data-theme="dark"] .nav-toggle span,
:root[data-theme="dark"] .nav-toggle span::before,
:root[data-theme="dark"] .nav-toggle span::after { background: var(--ink); }

/* أيقونات البطاقات: الرقاقة داكنة، فالرمز يصبح ذهبياً ليظل مقروءاً */
:root[data-theme="dark"] .svc-card__icon,
:root[data-theme="dark"] .info-card__icon,
:root[data-theme="dark"] .faq__icon,
:root[data-theme="dark"] .why-card__icon,
:root[data-theme="dark"] .value-chip svg { color: var(--gold-400); }

:root[data-theme="dark"] .svc-card:hover .svc-card__icon { background: var(--navy-700); }
:root[data-theme="dark"] .faq__item.is-open .faq__icon { background: var(--navy-600); }

/* أزرار وعناصر تحتاج تباينًا أعلى على الخلفية الداكنة */
:root[data-theme="dark"] .btn--primary { background: var(--navy-600); }
:root[data-theme="dark"] .btn--primary:hover { background: #24558A; }
:root[data-theme="dark"] .filter-btn.is-active {
  background: var(--navy-600);
  border-color: var(--navy-600);
}
:root[data-theme="dark"] .fab--top { background: var(--navy-600); }

/* حالات النموذج */
:root[data-theme="dark"] .form__status--ok  { background: var(--ok-bg);  color: #4ADE9E; border-color: var(--ok-line); }
:root[data-theme="dark"] .form__status--err { background: var(--err-bg); color: #FF8A80; border-color: var(--err-line); }

/* سهم القائمة المنسدلة يصبح فاتحاً */
:root[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A9AAE' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* الخريطة أشدّ سطوعاً من محيطها ليلاً — نخفّف وهجها قليلاً */
:root[data-theme="dark"] .map-frame iframe { filter: brightness(.85) contrast(1.05); }

/* --------------------------------------------------------------------------
   27. تفضيلات المستخدم والطباعة
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .site-header, .fab-stack, .site-footer, .nav-overlay, .cta-band { display: none !important; }
  body { color: #000; }
  .hero, .page-head { background: none !important; color: #000; }
  .hero h1, .page-head h1 { color: #000; }
}
