/* ==========================================================================
   الموقع الشخصي — نظام التصميم الأساسي
   يعمل للعربية (RTL) والإنجليزية (LTR) من ملف واحد عبر الخصائص المنطقية
   ========================================================================== */

:root {
  /* الهوية */
  --navy: #000722;
  --navy-800: #030d33;
  --navy-700: #061447;
  --navy-600: #0a1d5e;
  --accent: #4c7dff;
  --accent-soft: #9fb8ff;
  --accent-dim: rgba(76, 125, 255, 0.16);

  --white: #ffffff;
  --paper: #f6f8fc;
  --paper-2: #eef2f9;
  --ink: #0b1020;
  --ink-2: #3a4360;
  --ink-3: #6b7594;
  --line: rgba(0, 7, 34, 0.1);
  --line-light: rgba(255, 255, 255, 0.14);

  /* مقاسات */
  --container: 1240px;
  --header-h: 84px;
  --radius: 18px;
  --radius-lg: 28px;

  /* ظلال */
  --shadow-sm: 0 2px 10px rgba(0, 7, 34, 0.06);
  --shadow: 0 18px 50px rgba(0, 7, 34, 0.1);
  --shadow-lg: 0 40px 90px rgba(0, 7, 34, 0.18);

  /* خطوط */
  --font-ar: "Cairo", "Segoe UI", system-ui, sans-serif;
  --font-en: "Cairo", "Segoe UI", system-ui, sans-serif;
  --font: var(--font-ar);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[lang="en"] {
  --font: var(--font-en);
}

/* ---------- أساسيات ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--white);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.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: 200;
  background: var(--white);
  color: var(--navy);
  padding: 12px 20px;
  border-radius: 12px;
  transition: inset-block-start 0.25s var(--ease);
}
.skip-link:focus { inset-block-start: 16px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ==========================================================================
   الهيدر والقائمة العلوية
   ========================================================================== */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), height 0.4s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 7, 34, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line-light);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.site-header.is-stuck { height: 70px; }
.site-header.is-stuck::before { opacity: 1; }

.header-inner {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* الشعار */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  flex-shrink: 0;
}
.brand__mark {
  width: auto;
  height: 44px;
  flex-shrink: 0;
  transition: transform 0.5s var(--ease);
}
.brand:hover .brand__mark { transform: scale(1.07); }
.site-header.is-stuck .brand__mark { height: 38px; }

/* الشعار الكامل (الرمز + الاسم) في الفوتر */
.brand--lockup { display: inline-block; }
.brand__lockup {
  height: 132px;
  width: auto;
  transition: transform 0.45s var(--ease);
}
.brand--lockup:hover .brand__lockup { transform: scale(1.03); }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-weight: 800; font-size: 17px; letter-spacing: 0.01em; }
.brand__role { font-size: 11.5px; color: var(--accent-soft); letter-spacing: 0.06em; }

/* التنقل */
.nav { margin-inline-start: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}

.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav__link:hover,
.nav__item.is-open > .nav__link { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.nav__link.is-current { color: var(--white); }
.nav__link.is-current::after {
  content: "";
  position: absolute;
  inset-block-end: 2px;
  inset-inline: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}

.nav__caret {
  width: 10px; height: 10px;
  transition: transform 0.3s var(--ease);
}
.nav__item.is-open .nav__caret { transform: rotate(180deg); }

/* القائمة المنسدلة الكبيرة */
.nav__item { position: relative; }

.mega {
  position: absolute;
  inset-block-start: calc(100% + 14px);
  inset-inline-start: 50%;
  transform: translateX(var(--mega-shift, -50%)) translateY(14px);
  width: min(760px, calc(100vw - 48px));
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 22px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0.3s;
}
html[dir="rtl"] .mega { transform: translateX(calc(var(--mega-shift, -50%) * -1)) translateY(14px); }

.nav__item.is-open .mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(var(--mega-shift, -50%)) translateY(0);
}
html[dir="rtl"] .nav__item.is-open .mega { transform: translateX(calc(var(--mega-shift, -50%) * -1)) translateY(0); }

.mega__group { padding: 6px; }
.mega__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper);
  margin-block-end: 6px;
}
.mega__title svg { width: 16px; height: 16px; color: var(--accent); }

.mega__links { list-style: none; margin: 0; padding: 0; }
.mega__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--ink-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), padding-inline-start 0.2s var(--ease);
}
.mega__link:hover {
  background: var(--accent-dim);
  color: var(--navy);
  padding-inline-start: 18px;
}
.mega__link .tag {
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 2px 9px;
}

/* أدوات الهيدر */
.header-tools { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-light);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lang-switch:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.lang-switch svg { width: 15px; height: 15px; }

.burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-light);
  position: relative;
}
.burger span {
  position: absolute;
  inset-inline: 12px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}
.burger span:nth-child(1) { inset-block-start: 15px; }
.burger span:nth-child(2) { inset-block-start: 21px; }
.burger span:nth-child(3) { inset-block-start: 27px; }
body.nav-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   قائمة الجوال
   ========================================================================== */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--navy);
  padding: calc(var(--header-h) + 16px) 24px 40px;
  overflow-y: auto;
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease), visibility 0.35s;
}
body.nav-open .mobile-nav { opacity: 1; visibility: visible; transform: translateY(0); }
body.nav-open { overflow: hidden; }

.mobile-nav__item { border-block-end: 1px solid var(--line-light); }
.mobile-nav__link,
.mobile-nav__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 4px;
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  text-align: start;
}
.mobile-nav__toggle svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.mobile-nav__item.is-open .mobile-nav__toggle svg { transform: rotate(180deg); }

.mobile-nav__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
.mobile-nav__item.is-open .mobile-nav__panel { grid-template-rows: 1fr; }
.mobile-nav__panel > div { overflow: hidden; }

.mobile-nav__sub { list-style: none; margin: 0; padding: 0 0 14px; }
.mobile-nav__sub-title {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  padding: 12px 4px 4px;
  font-weight: 700;
}
.mobile-nav__sub a {
  display: block;
  padding: 11px 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15.5px;
  border-inline-start: 2px solid var(--line-light);
}
.mobile-nav__sub a:hover { color: var(--white); border-inline-start-color: var(--accent); }

/* ==========================================================================
   الواجهة الرئيسية (Hero)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: calc(var(--header-h) + 60px) 90px;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}

/* طبقات الخلفية المتحركة */
.hero__bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}
.hero__orb--1 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(76, 125, 255, 0.55), transparent 65%);
  inset-block-start: -180px; inset-inline-end: -140px;
}
.hero__orb--2 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(159, 184, 255, 0.35), transparent 65%);
  inset-block-end: -200px; inset-inline-start: -120px;
  animation-delay: -6s;
}
.hero__orb--3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(0, 200, 255, 0.22), transparent 65%);
  inset-block-start: 38%; inset-inline-start: 42%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(40px, -35px, 0) scale(1.08); }
  66% { transform: translate3d(-30px, 30px, 0) scale(0.95); }
}

.hero__grid {
  position: absolute;
  inset: -2px;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 78%);
  animation: gridDrift 40s linear infinite;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: 68px 68px; }
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-light);
  background: rgba(255, 255, 255, 0.05);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  margin-block-end: 26px;
}
.eyebrow .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(76, 125, 255, 0.7);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 125, 255, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(76, 125, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 125, 255, 0); }
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 66px);
  line-height: 1.2;
  margin-block-end: 24px;
}
.hero h1 .shine {
  background: linear-gradient(100deg, #ffffff 10%, var(--accent-soft) 40%, #ffffff 70%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite;
}
@keyframes shine {
  to { background-position: -250% center; }
}

.hero__lead {
  font-size: clamp(16px, 1.7vw, 20px);
  color: rgba(255, 255, 255, 0.76);
  max-width: 58ch;
  margin-block-end: 38px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn svg { width: 17px; height: 17px; transition: transform 0.3s var(--ease); }
html[dir="rtl"] .btn svg { transform: scaleX(-1); }

.btn--primary {
  background: linear-gradient(120deg, var(--accent), #6f97ff);
  color: var(--white);
  box-shadow: 0 14px 34px rgba(76, 125, 255, 0.4);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(76, 125, 255, 0.5); }
.btn--primary:hover svg { transform: translateX(4px); }
html[dir="rtl"] .btn--primary:hover svg { transform: scaleX(-1) translateX(4px); }

.btn--ghost {
  border: 1px solid var(--line-light);
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-3px); }

.btn--dark {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
}
.btn--dark:hover { transform: translateY(-3px); }

/* البطاقة الزجاجية في الواجهة */
.hero__card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-light);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 32px;
  animation: cardFloat 7s ease-in-out infinite;
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.hero__card h2 {
  font-size: 18px;
  margin-block-end: 22px;
  color: var(--white);
}
.hero__stats { display: grid; gap: 18px; }
.stat { display: flex; align-items: baseline; gap: 12px; }
.stat__num {
  font-size: 34px;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { font-size: 14.5px; color: rgba(255, 255, 255, 0.66); }

.hero__scroll {
  position: absolute;
  inset-block-end: 26px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
}
.hero__scroll .line {
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, transparent, var(--accent-soft));
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.4); opacity: 0.3; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* ==========================================================================
   الأقسام العامة
   ========================================================================== */
.section { padding-block: clamp(70px, 9vw, 130px); position: relative; }
.section--paper { background: var(--paper); }
.section--dark { background: var(--navy); color: var(--white); }

.section-head { max-width: 760px; margin-block-end: 54px; }
.section-head--center { margin-inline: auto; text-align: center; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-block-end: 14px;
}
.kicker::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.section--dark .kicker { color: var(--accent-soft); }
.section--dark .kicker::before { background: var(--accent-soft); }

.section-title { font-size: clamp(27px, 3.6vw, 44px); margin-block-end: 16px; }
.section-desc { color: var(--ink-2); font-size: 17.5px; }
.section--dark .section-desc { color: rgba(255, 255, 255, 0.7); }

/* ==========================================================================
   الركائز الأربع
   ========================================================================== */
.pillar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(34px, 6vw, 84px);
  padding-block: clamp(46px, 6vw, 78px);
  border-block-end: 1px solid var(--line);
}
.pillar:last-child { border-block-end: 0; }
.pillar:nth-child(even) .pillar__visual { order: -1; }

.pillar__index {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-block-end: 12px;
}
.pillar h3 { font-size: clamp(24px, 2.8vw, 34px); margin-block-end: 16px; }
.pillar p { color: var(--ink-2); margin-block-end: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-block-end: 26px; list-style: none; padding: 0; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.chips li:hover { transform: translateY(-3px); border-color: var(--accent); }
.chips li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--navy);
  border-block-end: 2px solid var(--accent-dim);
  padding-block-end: 4px;
  transition: gap 0.25s var(--ease), border-color 0.25s var(--ease);
}
.text-link:hover { gap: 14px; border-block-end-color: var(--accent); }
.text-link svg { width: 15px; height: 15px; }
html[dir="rtl"] .text-link svg { transform: scaleX(-1); }

/* الرسوم المتحركة لكل ركيزة */
.pillar__visual {
  position: relative;
  aspect-ratio: 1 / 0.82;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--navy), var(--navy-700));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.pillar__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(76, 125, 255, 0.35), transparent 60%);
}
.pillar__visual svg { width: 76%; height: auto; position: relative; z-index: 1; }

/* أعمدة المحاسبة */
.bar { transform-origin: bottom; animation: barGrow 2.6s var(--ease) infinite alternate; }
.bar:nth-child(2) { animation-delay: 0.25s; }
.bar:nth-child(3) { animation-delay: 0.5s; }
.bar:nth-child(4) { animation-delay: 0.75s; }
.bar:nth-child(5) { animation-delay: 1s; }
@keyframes barGrow {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1); }
}

/* حلقات الحوكمة */
.orbit { transform-origin: 100px 100px; animation: spin 14s linear infinite; }
.orbit--rev { animation-direction: reverse; animation-duration: 20s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* رادار المخاطر */
.radar-sweep { transform-origin: 100px 100px; animation: spin 4s linear infinite; }
.ping { animation: ping 2.6s ease-out infinite; transform-origin: center; }
.ping:nth-child(2) { animation-delay: 0.9s; }
.ping:nth-child(3) { animation-delay: 1.8s; }
@keyframes ping {
  0% { opacity: 0; r: 2; }
  40% { opacity: 1; }
  100% { opacity: 0; r: 9; }
}

/* قائمة الامتثال */
.tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 3.2s var(--ease) infinite; }
.tick:nth-child(2) { animation-delay: 0.4s; }
.tick:nth-child(3) { animation-delay: 0.8s; }
@keyframes draw {
  0% { stroke-dashoffset: 40; }
  35%, 85% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 40; }
}

/* ==========================================================================
   بطاقات أقسام الموقع
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 22px;
}

.card {
  position: relative;
  padding: 34px 28px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-light);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset-block-start: -60%;
  inset-inline-start: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(circle at center, rgba(76, 125, 255, 0.28), transparent 60%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.card:hover {
  transform: translateY(-8px);
  border-color: rgba(159, 184, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
}
.card:hover::before { opacity: 1; }

.card__icon {
  position: relative;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(76, 125, 255, 0.18);
  color: var(--accent-soft);
  margin-block-end: 20px;
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { position: relative; font-size: 20px; margin-block-end: 10px; color: var(--white); }
.card p { position: relative; font-size: 15px; color: rgba(255, 255, 255, 0.66); }
.card__more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 18px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-soft);
}
.card__more svg { width: 14px; height: 14px; }
html[dir="rtl"] .card__more svg { transform: scaleX(-1); }

/* ==========================================================================
   شريط الدعوة
   ========================================================================== */
.cta {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px);
  background: linear-gradient(130deg, var(--navy), var(--navy-600));
  color: var(--white);
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(76, 125, 255, 0.4), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(159, 184, 255, 0.28), transparent 45%);
}
.cta > * { position: relative; }
.cta h2 { font-size: clamp(25px, 3.4vw, 40px); margin-block-end: 16px; }
.cta p { color: rgba(255, 255, 255, 0.76); max-width: 62ch; margin-inline: auto; margin-block-end: 32px; }
.cta .btn--primary { background: var(--white); color: var(--navy); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); }

/* ==========================================================================
   القائمة السفلية
   ========================================================================== */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  padding-block: 70px 0;
  border-block-start: 1px solid var(--line-light);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 42px;
  padding-block-end: 50px;
}
.footer h4 {
  color: var(--white);
  font-size: 15px;
  margin-block-end: 18px;
  letter-spacing: 0.02em;
}
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.footer-list a { font-size: 15px; transition: color 0.2s var(--ease), padding-inline-start 0.25s var(--ease); }
.footer-list a:hover { color: var(--white); padding-inline-start: 6px; }

.footer-about p { font-size: 15px; margin-block: 18px 22px; max-width: 42ch; }

.contact-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  margin-block-end: 12px;
  direction: ltr;
  justify-content: flex-start;
}
html[dir="rtl"] .contact-line { flex-direction: row-reverse; justify-content: flex-end; }
.contact-line svg { width: 17px; height: 17px; color: var(--accent-soft); flex-shrink: 0; }
.contact-line a:hover { color: var(--white); }

.social { display: flex; gap: 10px; margin-block-start: 20px; }
.social a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line-light);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), color 0.3s var(--ease);
}
.social a:hover { background: var(--accent); color: var(--white); transform: translateY(-3px); }
.social svg { width: 18px; height: 18px; }

.footer-bottom {
  border-block-start: 1px solid var(--line-light);
  padding-block: 24px 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}
.footer-bottom a:hover { color: var(--white); }

/* شارة مؤقتة للمحتوى غير الجاهز */
.is-soon { position: relative; opacity: 0.85; }
.is-soon::after {
  content: attr(data-soon);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  margin-inline-start: 8px;
}

/* ==========================================================================
   حركات الظهور عند التمرير
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="zoom"] { transform: scale(0.93); }

/* شريط تقدّم القراءة أعلى الصفحة */
.progress-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: var(--origin, left);
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  z-index: 110;
}
html[dir="rtl"] .progress-bar { --origin: right; }

/* ==========================================================================
   الاستجابة للأجهزة
   ========================================================================== */
/* شاشات عريضة: القائمة المنسدلة على ثلاثة أعمدة حتى لا تطول */
@media (min-width: 1200px) {
  .mega {
    width: min(980px, calc(100vw - 48px));
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .nav, .lang-switch .label { display: none; }
  .burger { display: block; }
  .hero__inner { grid-template-columns: 1fr; gap: 42px; }
  .hero__card { max-width: 460px; }
  .pillar { grid-template-columns: 1fr; gap: 30px; }
  .pillar:nth-child(even) .pillar__visual { order: 0; }
  .pillar__visual { max-width: 460px; }
}

/* شاشات ضيقة جدًا: لا يخرج الهيدر عن حدود الشاشة */
@media (max-width: 400px) {
  .header-inner { gap: 10px; padding-inline: 14px; }
  .brand { min-width: 0; }
  .brand__mark { height: 34px; }
  .site-header.is-stuck .brand__mark { height: 30px; }
  .brand__lockup { height: 110px; }
  .brand__name { font-size: 15px; }
  .lang-switch { padding: 8px 11px; }
  .burger { width: 40px; height: 40px; flex-shrink: 0; }
  .burger span { inset-inline: 10px; }
  .burger span:nth-child(1) { inset-block-start: 13px; }
  .burger span:nth-child(2) { inset-block-start: 19px; }
  .burger span:nth-child(3) { inset-block-start: 25px; }
}

@media (max-width: 640px) {
  :root { --header-h: 72px; }
  body { font-size: 16px; }
  .container, .header-inner { padding-inline: 18px; }
  .brand__role { display: none; }
  .hero { min-height: auto; padding-block: calc(var(--header-h) + 54px) 70px; }
  .hero__scroll { display: none; }
  .hero__card { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .btn { width: 100%; justify-content: center; }
  .hero__actions { width: 100%; }

  /* على الجوال تكون الحركة رأسية فقط حتى لا تتجاوز العناصر عرض الشاشة */
  [data-reveal="right"],
  [data-reveal="left"] { transform: translateY(30px); }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   تنسيق الجوال المستقل — الهيدر والفوتر والرئيسية
   هذه المكوّنات تظهر في كل صفحة، وكل الصفحات تُحمّل main.css،
   فموضع قواعدها هنا لا في pages.css.
   ========================================================================== */

/* ---------- الفوتر على الجوال ---------- */
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block-end: 30px;
  }

  /* الشعار يحاذي بداية السطر مثل بقية الفوتر، وبحجم أصغر */
  .footer-about { text-align: start; }
  .brand--lockup { display: block; width: fit-content; }
  .brand__lockup { height: 92px; }
  .footer-about p { font-size: 14.5px; line-height: 1.85; margin-block: 14px 16px; max-width: none; }

  .social { margin-block-start: 14px; }
  .social a { width: 38px; height: 38px; border-radius: 10px; }

  /* الروابط في عمودين: يقصّر الفوتر نحو الربع */
  .footer h4 { font-size: 14px; margin-block-end: 12px; }
  .footer-list { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .footer-list a { font-size: 14.5px; }

  .contact-line { font-size: 14.5px; }

  /* شريط الحقوق: سطران مرتّبان بدل التفاف عشوائي */
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-block: 18px 24px;
    font-size: 13px;
  }
}

/* الشاشات الضيقة جدًا فقط: عمود واحد للروابط حتى لا تنكسر الكلمات */
@media (max-width: 360px) {
  .footer-list { grid-template-columns: 1fr; gap: 9px; }
  .brand__lockup { height: 80px; }
}

/* ---------- الصفحة الرئيسية على الجوال ---------- */
@media (max-width: 640px) {
  /* الهيرو لا يملأ الشاشة كاملة: يظهر طرف ما بعده فيعرف الزائر أن هناك محتوى */
  .hero { min-height: auto; }
  .pillar { padding-block: 34px; gap: 26px; }
  .subject-grid { grid-template-columns: 1fr; gap: 16px; }
  .subject { padding: 20px; }
  .group-title { font-size: 15px; margin-block: 30px 14px; }
}

/* ==========================================================================
   حركة الظهور: أفقية على الكمبيوتر فقط
   دخول العناصر من الجانب مصمَّم لتخطيط العمودين. وفي الشاشات الأضيق
   يصير التخطيط عمودًا واحدًا، فتُحدث الحركة الأفقية تمريرًا جانبيًا
   بمقدار إزاحتها أثناء التحميل.
   ========================================================================== */
@media (max-width: 1100px) {
  [data-reveal="right"],
  [data-reveal="left"] { transform: translateY(30px); }
}

/* حاجز أخير ضد أي تمرير أفقي عابر أثناء الحركات.
   نستخدم clip لا hidden لأن hidden يُعطّل position:sticky في فهرس الدرس. */
html, body { overflow-x: clip; }
