/* =========================================================
   ثيم «على أثرهم» — أزرق ملكي + ذهبي
   عدّل المتغيرات هنا لتغيير شكل الموقع كله
   ========================================================= */
:root {
  /* الأزرق */
  --navy-950: #041a3d;
  --navy-900: #062555;
  --royal-800: #0a3a80;
  --royal-700: #0f4fa8;
  --royal-600: #1565c0;
  --royal-500: #2b7fde;
  --sky-300:  #8ec5ff;
  --sky-100:  #e2efff;
  --sky-50:   #f4f8ff;

  /* الذهبي */
  --gold-200: #fbe9ae;
  --gold-400: #ecc35a;
  --gold-500: #d9a93a;
  --gold-700: #a87a1e;
  --gold-gradient: linear-gradient(180deg, #fdf0bf 0%, #ecc35a 45%, #c8922a 100%);

  --text:   #12233d;
  --muted:  #5a6b85;
  --bg:     #ffffff;
  --border: #d5e3f6;

  /* الخطوط */
  --font-body:    "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-heading: "Amiri", "Tajawal", serif;
  --font-display: "Aref Ruqaa", "Amiri", serif;

  /* القياسات */
  --container: 1160px;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(6, 37, 85, 0.12);
  --shadow-lg: 0 24px 60px rgba(6, 37, 85, 0.22);
  --header-h: 76px;

  /* زخرفة هندسية خفيفة للخلفيات الداكنة */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.055'%3E%3Crect x='22' y='22' width='40' height='40'/%3E%3Crect x='22' y='22' width='40' height='40' transform='rotate(45 42 42)'/%3E%3C/g%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

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

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.4; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--royal-600); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }

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

:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-block;
  padding: 11px 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: var(--gold-gradient);
  color: var(--navy-900);
  box-shadow: 0 8px 24px rgba(217, 169, 58, .35);
}
.btn-gold:hover { box-shadow: 0 12px 30px rgba(217, 169, 58, .5); }
.btn-primary { background: var(--royal-600); color: #fff; box-shadow: 0 8px 22px rgba(21, 101, 192, .3); }
.btn-primary:hover { background: var(--royal-700); }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------- الشريط العلوي ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  color: #fff;
  transition: background .3s, box-shadow .3s, height .3s, transform .35s ease;
}
/* يختفي عند النزول ويرجع عند الصعود (main.js) */
.site-header.nav-hidden { transform: translateY(-105%); }
.site-header:focus-within { transform: none; }
.site-header.scrolled {
  background: rgba(6, 37, 85, .94);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(4, 26, 61, .35);
  border-bottom: 1px solid rgba(236, 195, 90, .35);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-mark {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--royal-500), var(--royal-800));
  border: 2px solid var(--gold-400);
  color: var(--gold-200);
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 4px rgba(236, 195, 90, .15);
}
/* مخطوطة «على أثرهم» مكان الاسم */
.brand-logo {
  height: 54px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(4, 26, 61, .6));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 16px; }
.brand-text small { color: var(--gold-400); font-size: 12.5px; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  position: relative;
  color: #e3eefc;
  padding: 8px 14px;
  font-size: 15.5px;
  font-weight: 500;
  transition: color .2s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 2px; right: 14px; left: 14px;
  height: 2px;
  background: var(--gold-400);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .25s;
}
.main-nav a:hover, .main-nav a.active { color: #fff; }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }

.main-nav .nav-cta {
  margin-inline-start: 10px;
  padding: 7px 22px;
  border: 1.5px solid var(--gold-400);
  border-radius: 999px;
  color: var(--gold-200);
}
.main-nav .nav-cta::after { display: none; }
.main-nav .nav-cta:hover, .main-nav .nav-cta.active { background: var(--gold-400); color: var(--navy-900); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 6px;
}
.nav-toggle span { height: 2px; background: #fff; border-radius: 2px; }

/* ---------- الواجهة الرئيسية ---------- */
.hero {
  position: relative;
  overflow: hidden;
  scroll-margin-top: var(--header-h);
  color: #fff;
  padding-top: calc(var(--header-h) + 30px);
  background:
    var(--pattern),
    radial-gradient(circle at 76% 42%, #2c74ca 0%, #1a5fb6 22%, #0f4a9c 45%, var(--royal-800) 68%, var(--navy-900) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 20px;
}

/* اللوحة: تذوب أطرافها في الخلفية */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin-inline: auto;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: radial-gradient(circle, rgba(170, 215, 255, .45) 0%, rgba(120, 180, 245, .18) 40%, transparent 65%);
  pointer-events: none;
}
.hero-visual img {
  position: relative;
  width: 100%;
  -webkit-mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 76%, transparent 100%);
}

.hero-kicker { margin-bottom: 14px; }
.hero-kicker span {
  display: inline-block;
  padding: 3px 18px;
  border: 1px solid rgba(236, 195, 90, .6);
  border-radius: 999px;
  color: var(--gold-200);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  background: rgba(4, 26, 61, .25);
}
.hero h1 {
  font-size: clamp(36px, 5vw, 62px);
  margin-bottom: 0;
  text-shadow: 0 4px 24px rgba(4, 26, 61, .45);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 10px rgba(4, 26, 61, .45));
}
.hero-swoosh { display: block; width: min(320px, 80%); margin: -4px 0 18px; }
.hero-swoosh path { fill: var(--gold-400); }
.hero-lead { max-width: 520px; color: #dceafb; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* شريط الأرقام */
.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 26px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(4, 26, 61, .3);
}
.hero-stats li {
  padding: 20px 14px;
  text-align: center;
  border-inline-start: 1px solid rgba(255, 255, 255, .16);
}
.hero-stats li:first-child { border-inline-start: 0; }
.hero-stats strong {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.3;
  color: var(--gold-400);
}
.hero-stats span { color: #d5e5f9; font-size: 14.5px; }

.hero-wave { display: block; width: 100%; height: 90px; margin-top: 10px; }
.wave-fill { fill: var(--bg); }
.wave-gold { fill: none; stroke: var(--gold-400); stroke-width: 2.5; opacity: .9; }

/* ---------- الأقسام ---------- */
.section { padding: 90px 0; }
.section-tint { background: linear-gradient(180deg, var(--sky-50), #eaf2ff); }
.section-dark {
  color: #fff;
  background:
    var(--pattern),
    radial-gradient(circle at 50% 0%, var(--royal-700), var(--royal-800) 45%, var(--navy-900) 100%);
}

.section-head { text-align: center; margin-bottom: 52px; }
.kicker {
  display: block;
  color: var(--gold-700);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.section-head h2 {
  font-size: clamp(30px, 4vw, 44px);
  color: var(--royal-800);
  margin: 0;
}
.section-dark .kicker { color: var(--gold-400); }
.section-dark .section-head h2 { color: #fff; }

/* فاصل زخرفي: خط – معيّن – خط */
.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.ornament::before, .ornament::after {
  content: "";
  width: 70px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}
.ornament::before { transform: scaleX(-1); }
.ornament i {
  width: 11px; height: 11px;
  background: var(--gold-500);
  transform: rotate(45deg);
  box-shadow: 0 0 0 4px rgba(217, 169, 58, .2);
}

/* ---------- نبذة ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text .lead {
  font-family: var(--font-heading);
  font-size: 23px;
  line-height: 1.9;
  color: var(--royal-800);
  padding-inline-start: 18px;
  border-inline-start: 4px solid var(--gold-500);
}
.about-text p:not(.lead) { color: #33435c; }

.facts {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 30px 28px 14px;
  border-radius: var(--radius);
  background: var(--pattern), linear-gradient(160deg, var(--royal-600), var(--royal-800) 60%, var(--navy-900));
  box-shadow: var(--shadow-lg);
}
.facts::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 5px;
  background: var(--gold-gradient);
}
.facts h3 { font-size: 24px; color: var(--gold-200); margin-bottom: 8px; }
.facts li {
  display: flex; flex-direction: column;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--sky-300); font-size: 14px; }
.facts strong { font-size: 17px; }

/* ---------- لوحة يوم الشهيد ---------- */
.banner { padding: 0 0 90px; }
.banner-frame {
  position: relative;
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  outline: 1px solid rgba(217, 169, 58, .55);
  outline-offset: 6px;
}
.banner-frame img { width: 100%; }
.banner-frame figcaption {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  padding: 18px 28px;
  color: #dceafb;
  background: linear-gradient(90deg, var(--navy-900), var(--royal-800));
}
.banner-frame figcaption strong {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.5;
  color: var(--gold-400);
}

/* حركة السلايد على اللوحة: تبدأ عند وصول القارئ لها (.visible من main.js)
   الصورة مقسومة بقناعين يتداخلان في المنتصف (منطقة زرقاء فارغة) */
.banner-stage {
  position: relative;
  overflow: hidden;
  background: #0d66c2; /* نفس أزرق خلفية الصورة حتى لا يظهر خط القسمة */
}
.banner-layer { display: block; width: 100%; }
.banner-portrait {
  -webkit-mask-image: linear-gradient(to right, transparent 44%, #000 52%);
          mask-image: linear-gradient(to right, transparent 44%, #000 52%);
}
.banner-calligraphy {
  position: absolute;
  inset: 0;
  height: 100%;
  -webkit-mask-image: linear-gradient(to right, #000 44%, transparent 52%);
          mask-image: linear-gradient(to right, #000 44%, transparent 52%);
}
/* لمعة تمر على اللوحة بعد اكتمال الانزلاق */
.banner-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .38) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none;
}

.js .banner-portrait   { opacity: 0; transform: translateX(14%) scale(1.06); }
.js .banner-calligraphy { opacity: 0; transform: translateX(-14%); }
.js .banner-frame figcaption > * { opacity: 0; transform: translateY(18px); }

.js .banner-frame.visible .banner-layer {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s ease-out, transform 1.6s cubic-bezier(.2, .7, .2, 1);
}
.js .banner-frame.visible .banner-portrait    { transition-delay: .25s; }
.js .banner-frame.visible .banner-calligraphy { transition-delay: .7s; }
.js .banner-frame.visible .banner-stage::after { animation: banner-shine 1.4s ease-in-out 2.2s forwards; }
.js .banner-frame.visible figcaption > * {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease-out 1.7s, transform .8s ease-out 1.7s;
}
.js .banner-frame.visible figcaption > span { transition-delay: 1.95s; }

@keyframes banner-shine { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .js .banner-layer, .js .banner-frame figcaption > * { opacity: 1; transform: none; }
  .banner-stage::after { display: none; }
}

/* ---------- الخط الزمني ---------- */
.timeline { position: relative; max-width: 980px; margin-inline: auto; }
.timeline::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  right: 50%;
  width: 2px;
  margin-right: -1px;
  background: linear-gradient(180deg, var(--gold-500), var(--royal-500) 15%, var(--royal-500) 85%, var(--gold-500));
}
.timeline li {
  position: relative;
  width: 50%;
  padding-bottom: 30px;
}
.timeline li:nth-child(odd)  { padding-inline-end: 46px; }
.timeline li:nth-child(even) { margin-inline-start: 50%; padding-inline-start: 46px; }

/* النقطة على الخط */
.timeline li::before {
  content: "";
  position: absolute;
  top: 26px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--royal-600);
  box-shadow: 0 0 0 5px rgba(43, 127, 222, .18);
  z-index: 1;
}
.timeline li:nth-child(odd)::before  { left: -9px; }
.timeline li:nth-child(even)::before { right: -9px; }
.timeline li:last-child::before { border-color: var(--gold-500); box-shadow: 0 0 0 5px rgba(217, 169, 58, .25); }

.tl-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tl-year {
  display: inline-block;
  background: var(--sky-100);
  color: var(--royal-700);
  font-weight: 800; font-size: 14px;
  padding: 1px 16px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tl-card h3 { color: var(--royal-800); font-size: 24px; margin-bottom: .15em; }
.tl-card p { color: var(--muted); margin: 0; }

.tl-card-gold {
  color: #fff;
  border: 0;
  background: var(--pattern), linear-gradient(150deg, var(--royal-700), var(--navy-900));
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(236, 195, 90, .7);
}
.tl-card-gold .tl-year { background: var(--gold-gradient); color: var(--navy-900); }
.tl-card-gold h3 { color: var(--gold-200); }
.tl-card-gold p { color: #d5e5f9; }

/* ---------- البطاقات ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
}
.card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 4px;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card:hover::before { transform: scaleX(1); }
.card-icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--royal-500), var(--royal-800));
  color: var(--gold-200);
  margin-bottom: 20px;
  box-shadow: 0 10px 22px rgba(21, 101, 192, .3);
}
.card-icon svg { width: 30px; height: 30px; }
.card h3 { font-size: 22px; color: var(--royal-800); }
.card p { color: var(--muted); margin: 0; font-size: 15.5px; }

/* ---------- الأقوال ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 26px;
}
.quote {
  position: relative;
  margin: 0;
  padding: 44px 32px 30px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.quote-mark {
  position: absolute;
  top: -22px; right: 28px;
  width: 48px; height: 48px;
  padding: 10px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--navy-900);
  box-shadow: 0 8px 20px rgba(4, 26, 61, .4);
}
.quote p { font-family: var(--font-heading); font-size: 24px; line-height: 1.9; }
.quote cite { color: var(--gold-400); font-style: normal; font-size: 14.5px; }
.quote cite::before { content: "— "; }

/* ---------- المعرض ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* المربعة تأخذ عمودين (٣ بالصف) والعريضة ثلاثة (٢ بالصف) */
  gap: 18px;
}
.gallery-item { grid-column: span 2; }
.gallery-item img { object-position: center 20%; }
.gallery-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--royal-800);
  aspect-ratio: 1;
  box-shadow: var(--shadow);
  font: inherit;
}
.gallery-wide { grid-column: span 3; aspect-ratio: 2 / 1; }
.gallery-wide img { object-position: center; }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.gallery-item:hover img { transform: scale(1.06); }

/* --- حركة المعرض --- */
/* 1) انكشاف بمسحة من الأعلى بالتتابع (بدل الظهور العادي) */
/* المسحة على الصورة نفسها لا على الزر، حتى يبقى الزر مرئياً لمراقب التمرير */
.js .gallery-item.reveal { transform: none; transition: opacity .5s ease-out; }
.js .gallery-item.reveal img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s cubic-bezier(.65, 0, .25, 1) .1s;
}
.js .gallery-item.reveal.visible img { clip-path: inset(0 0 0 0); }
.js .gallery-item:nth-child(2), .js .gallery-item:nth-child(2) img { transition-delay: .2s; }
.js .gallery-item:nth-child(3), .js .gallery-item:nth-child(3) img { transition-delay: .4s; }
.js .gallery-item:nth-child(5), .js .gallery-item:nth-child(5) img { transition-delay: .2s; }

/* 2) تكبير بطيء مستمر بعد الانكشاف */
.js .gallery-item.visible img { animation: ken-burns 16s ease-in-out infinite alternate; }
.js .gallery-item:nth-child(even).visible img { animation-name: ken-burns-alt; animation-duration: 19s; }
@keyframes ken-burns     { from { transform: scale(1.14) translate(1.5%, 1%); } to { transform: scale(1.02); } }
@keyframes ken-burns-alt { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1.5%, -1%); } }

/* 3) لمعة عند المرور بالماوس */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%);
  transform: translateX(-100%);
  pointer-events: none;
}
.gallery-item:hover::after { transform: translateX(100%); transition: transform .9s ease-in-out; }

/* =========================================================
   اللوحة السينمائية (صورة الجموع والرايات)
   ========================================================= */
.cinema {
  position: relative;
  overflow: hidden;
  height: clamp(340px, 46vw, 640px);
  background: var(--navy-900);
  color: #fff;
  isolation: isolate;
}
.js .cinema.reveal { opacity: 1; transform: none; } /* تبقى ثابتة، والحركة لعناصرها الداخلية */

.cinema-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 80% center; /* إبقاء الصورة الشخصية ظاهرة على الشاشات الضيقة */
  transform-origin: 70% 40%;
  animation: cinema-pan 24s ease-in-out infinite alternate;
}
@keyframes cinema-pan {
  from { transform: scale(1.03); }
  to   { transform: scale(1.14) translateX(2%); }
}

/* تعتيم خفيف جهة النص + شعاع ضوء يمر كل فترة */
.cinema::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(4, 26, 61, .6) 0%, rgba(4, 26, 61, .15) 45%, transparent 65%);
}
.cinema::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 236, 170, .22) 50%, transparent 58%);
  transform: translateX(-100%);
  animation: cinema-ray 9s ease-in-out 2s infinite;
  pointer-events: none;
}
@keyframes cinema-ray {
  0%   { transform: translateX(-100%); }
  35%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* الذرات الذهبية: كل ذرة span مع متغيرات عشوائية من main.js */
.cinema-dust { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.cinema-dust span {
  position: absolute;
  bottom: -12px;
  left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cf 0%, var(--gold-400) 45%, transparent 70%);
  opacity: 0;
  animation: dust-rise var(--d) linear var(--delay) infinite;
}
@keyframes dust-rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: var(--o); }
  80%  { opacity: var(--o); }
  100% { transform: translate(var(--drift), calc(-1 * clamp(340px, 46vw, 640px) - 30px)); opacity: 0; }
}

.cinema-text {
  position: absolute;
  z-index: 3;
  left: clamp(22px, 7vw, 120px);
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}
.cinema-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 100px);
  line-height: 1.5;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 14px rgba(4, 26, 61, .7));
}
.cinema-sub {
  margin: 0;
  font-weight: 700;
  font-size: clamp(15px, 2vw, 22px);
  letter-spacing: 3px;
  color: var(--sky-300);
}
.js .cinema-title { opacity: 0; transform: translateX(-60px); }
.js .cinema-sub   { opacity: 0; transform: translateY(16px); }
.js .cinema.visible .cinema-title,
.js .cinema.visible .cinema-sub {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s ease-out .3s, transform 1.4s cubic-bezier(.2, .7, .2, 1) .3s;
}
.js .cinema.visible .cinema-sub { transition-delay: 1.1s; }

/* صورة أعلى صفحة السيرة: انكشاف + طفو خفيف + هالة تنبض */
.bio-portrait {
  position: relative;
  max-width: 440px;
  margin: 0 auto 44px;
}
.bio-portrait::before {
  content: "";
  position: absolute;
  inset: -7%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 195, 90, .45), rgba(43, 127, 222, .18) 45%, transparent 68%);
  animation: halo-pulse 5s ease-in-out infinite;
}
.bio-portrait img {
  position: relative;
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  outline: 1px solid rgba(217, 169, 58, .6);
  outline-offset: 6px;
  animation: gentle-float 7s ease-in-out infinite;
}
.js .bio-portrait.reveal { transform: scale(.92); transition: opacity 1s ease-out, transform 1.3s cubic-bezier(.2, .7, .2, 1); }
.js .bio-portrait.reveal.visible { transform: none; }
@keyframes halo-pulse   { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes gentle-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
  .cinema::before { background: linear-gradient(0deg, rgba(4, 26, 61, .8) 0%, rgba(4, 26, 61, .2) 45%, transparent 70%); }
  .cinema-text { left: 0; right: 0; top: auto; bottom: 26px; transform: none; }
  .js .cinema-title { transform: translateY(30px); }
}

@media (prefers-reduced-motion: reduce) {
  .js .gallery-item.reveal img { clip-path: none; }
  .js .gallery-item.visible img, .cinema-img, .cinema::after, .bio-portrait::before, .bio-portrait img { animation: none; }
  .cinema-dust { display: none; }
  .js .cinema-title, .js .cinema-sub { opacity: 1; transform: none; }
}
.gallery-item span {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 18px 14px;
  color: #fff;
  font-weight: 700;
  text-align: start;
  background: linear-gradient(180deg, transparent, rgba(4, 26, 61, .85));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s;
}
.gallery-item:hover span, .gallery-item:focus-visible span { opacity: 1; transform: none; }

/* عارض الصور */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(4, 26, 61, .9); backdrop-filter: blur(4px); }
.lightbox img {
  max-width: 94vw; max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: -18px; left: -18px;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--navy-900);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* ---------- التواصل ---------- */
.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  max-width: 980px;
  margin-inline: auto;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.contact-info {
  padding: 44px 36px;
  color: #dceafb;
  background: var(--pattern), linear-gradient(160deg, var(--royal-600), var(--royal-800) 55%, var(--navy-900));
}
.contact-info h3 { font-size: 30px; color: var(--gold-200); }

.contact-form { display: grid; gap: 18px; padding: 40px 36px; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; color: var(--royal-800); font-size: 15.5px; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-weight: 400;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--sky-50);
  color: var(--text);
  resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--royal-500);
  box-shadow: 0 0 0 4px rgba(43, 127, 222, .15);
  background: #fff;
}
.contact-form .btn { justify-self: start; }
.form-note { margin: 0; font-size: 15px; color: var(--royal-700); min-height: 1.5em; }
.form-note.error { color: #b3261e; }

/* =========================================================
   الصفحات الداخلية (السيرة / المؤلفات)
   ========================================================= */
[hidden] { display: none !important; }

.btn-outline { border-color: var(--royal-600); color: var(--royal-700); }
.btn-outline:hover { background: var(--royal-600); color: #fff; }

.page-cta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: 48px;
}

/* ترويسة الصفحة */
.page-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding-top: calc(var(--header-h) + 54px);
  background:
    var(--pattern),
    radial-gradient(circle at 50% 10%, #2468bd 0%, var(--royal-700) 35%, var(--royal-800) 65%, var(--navy-900) 100%);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.5;
  margin: 0;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 10px rgba(4, 26, 61, .45));
}
.page-hero p { color: #dceafb; font-size: 19px; margin: 0; }
.breadcrumb {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 3px 18px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(4, 26, 61, .25);
  font-size: 14.5px;
  color: var(--gold-200);
}
.breadcrumb a { color: #dceafb; }
.breadcrumb a:hover { color: #fff; }

.section-top-tight { padding-top: 40px; }

/* ---------- صفحة السيرة ---------- */
.bio-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
.bio-side {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 24px;
}
.toc {
  display: grid;
  padding: 22px 22px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sky-50);
}
.toc h2 { font-size: 22px; color: var(--royal-800); margin-bottom: 8px; }
.toc a {
  padding: 7px 14px;
  color: var(--muted);
  font-weight: 500;
  border-inline-start: 3px solid var(--border);
  transition: color .2s, border-color .2s, background .2s;
}
.toc a:hover { color: var(--royal-700); }
.toc a.active {
  color: var(--royal-800);
  font-weight: 700;
  border-color: var(--gold-500);
  background: #fff;
}

.chapter {
  padding-bottom: 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.chapter h2 {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(26px, 3vw, 34px);
  color: var(--royal-800);
  margin-bottom: .5em;
}
.chapter-num {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--royal-500), var(--royal-800));
  color: var(--gold-200);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(21, 101, 192, .28);
}
.chapter p { color: #33435c; font-size: 18px; line-height: 2.1; }
.chapter p:last-child { margin-bottom: 0; }

.chapter-gold {
  padding: 30px 32px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: var(--pattern), linear-gradient(150deg, var(--royal-700), var(--navy-900));
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(236, 195, 90, .7);
}
.chapter-gold h2 { color: var(--gold-200); }
.chapter-gold .chapter-num { background: var(--gold-gradient); color: var(--navy-900); box-shadow: none; }
.chapter-gold p { color: #dceafb; }

/* ---------- صفحة ألبوم الصور ---------- */
.album-note { text-align: center; color: var(--muted); margin-bottom: 30px; }
.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 14px;
}
.album-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--sky-100);
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}
.album-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s;
}
.album-item:hover img, .album-item:focus-visible img { transform: scale(1.09); filter: brightness(1.08); }
.album-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 var(--gold-400);
  transition: box-shadow .3s;
  pointer-events: none;
}
.album-item:hover::after, .album-item:focus-visible::after { box-shadow: inset 0 0 0 3px var(--gold-400); }

/* ظهور الصور: تكبير خفيف مع تتابع بين أعمدة الصف */
.js .album-item.reveal { transform: translateY(24px) scale(.94); }
.js .album-item.reveal.visible { transform: none; }
.js .album-item:nth-child(4n+2) { transition-delay: .08s; }
.js .album-item:nth-child(4n+3) { transition-delay: .16s; }
.js .album-item:nth-child(4n+4) { transition-delay: .24s; }

/* أزرار التنقل داخل العارض */
.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 30px; line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-prev { right: 16px; }
.lightbox-next { left: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--gold-500); color: var(--navy-900); }
.lightbox-counter {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: #dceafb;
  font-size: 14px;
  direction: ltr;
}

/* ---------- صفحة المقال ---------- */
.toc .toc-sub { padding-inline-start: 30px; font-size: 15px; }

.prose .chapter p, .prose .trait p { text-align: justify; }

/* شرائح معلومات الولادة */
.fact-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.fact-chips li {
  display: flex; flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold-500);
  border-radius: 14px;
  background: var(--sky-50);
}
.fact-chips span { color: var(--muted); font-size: 13.5px; }
.fact-chips strong { color: var(--royal-800); font-size: 17px; }

/* الفقرة الافتتاحية (بدون حرف أول كبير لأنه يقطع اتصال الحروف العربية) */
.prose .chapter p.dropcap {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--royal-800);
}

/* سلسلة النسب */
.lineage {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 0;
  margin-top: 26px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--pattern), linear-gradient(150deg, var(--royal-700), var(--navy-900));
  box-shadow: var(--shadow);
}
.lineage li {
  display: flex; align-items: center;
  color: #e3eefc;
  font-family: var(--font-heading);
  font-size: 19px;
}
.lineage li + li::before {
  content: "بن";
  margin-inline: 12px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(236, 195, 90, .18);
  color: var(--gold-400);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
}
.lineage .lineage-main { color: var(--gold-200); font-weight: 700; font-size: 22px; }

/* فقرة مميّزة داخل النص */
.prose .chapter p.highlight {
  position: relative;
  margin: 30px 0;
  padding: 26px 30px;
  border-radius: var(--radius);
  border-inline-start: 5px solid var(--gold-500);
  background: linear-gradient(135deg, var(--sky-100), var(--sky-50));
  color: var(--royal-800);
  font-family: var(--font-heading);
  font-size: 23px;
  line-height: 2;
  text-align: start;
}

/* الخصائص المرقّمة */
.trait {
  position: relative;
  margin-bottom: 26px;
  padding: 34px 34px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header-h) + 20px);
  overflow: hidden;
}
.trait::before {
  content: "";
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 4px;
  background: var(--gold-gradient);
}
.trait-num {
  position: absolute;
  top: -18px; left: 18px;
  font-family: var(--font-heading);
  font-size: 150px;
  font-weight: 700;
  line-height: 1;
  color: var(--sky-100);
  pointer-events: none;
}
.trait h3 {
  position: relative;
  font-size: clamp(25px, 3vw, 32px);
  color: var(--royal-800);
  margin-bottom: .5em;
  padding-inline-start: 16px;
  border-inline-start: 4px solid var(--gold-500);
}
.trait p { position: relative; color: #33435c; font-size: 18px; line-height: 2.1; }
.trait > p:last-child { margin-bottom: 0; }

/* الآيات القرآنية */
.verse {
  position: relative;
  margin: 22px 0;
  padding: 24px 26px 18px;
  text-align: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--pattern), linear-gradient(150deg, var(--royal-700), var(--navy-900));
  box-shadow: inset 0 0 0 1.5px rgba(236, 195, 90, .55);
}
.verse .basmala { display: block; color: var(--sky-300); font-family: var(--font-heading); font-size: 16px; margin-bottom: 4px; }
.verse p {
  margin: 0 0 8px;
  color: var(--gold-200);
  font-family: var(--font-heading);
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 2.1;
  text-align: center;
}
.verse cite { color: var(--sky-300); font-style: normal; font-size: 14px; }

@media (max-width: 900px) {
  .prose .chapter p, .prose .trait p { text-align: start; }
  .trait { padding: 30px 22px 22px; }
  .trait-num { font-size: 110px; }
  .prose .chapter p.highlight { padding: 22px; font-size: 21px; }
}

/* ---------- صفحة المؤلفات ---------- */
.filters {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-bottom: 40px;
}
.filter {
  font: inherit;
  font-weight: 700;
  font-size: 15.5px;
  padding: 7px 24px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--royal-700);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.filter:hover { border-color: var(--royal-500); }
.filter.active {
  background: var(--royal-600);
  border-color: var(--royal-600);
  color: #fff;
  box-shadow: 0 8px 20px rgba(21, 101, 192, .3);
}

.books { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.book { display: flex; flex-direction: column; }
.book-tag {
  align-self: flex-start;
  padding: 0 14px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--sky-100);
  color: var(--royal-700);
  font-size: 13px;
  font-weight: 700;
}
.book-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
}
.book-link { margin-top: auto; padding-top: 16px; font-weight: 700; }
.empty-note { text-align: center; color: var(--muted); padding: 30px 0; }

/* المصدر الذي ورد فيه العنوان */
.book-source {
  margin-top: auto;
  padding-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.book-source::before { content: "المصدر: "; color: var(--gold-700); font-weight: 700; }
.book p + .book-source { padding-top: 12px; }

.sources {
  margin-top: 56px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--gold-500);
  border-radius: var(--radius);
  background: var(--sky-50);
}
.sources h2 { font-size: 26px; color: var(--royal-800); margin-bottom: .2em; }
.sources p { color: var(--muted); font-size: 15.5px; }
.sources ul { display: grid; gap: 6px; }
.sources li { padding-inline-start: 18px; position: relative; overflow-wrap: anywhere; }
.sources li::before {
  content: "";
  position: absolute;
  top: .85em; right: 0;
  width: 7px; height: 7px;
  background: var(--gold-500);
  transform: rotate(45deg);
}
.sources a { font-weight: 500; }
.sources a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .page-hero { padding-top: calc(var(--header-h) + 30px); }
  .bio-layout { grid-template-columns: 1fr; gap: 32px; }
  .bio-side { position: static; }
  .bio-side .facts { display: none; }
  .chapter-gold { padding: 26px 22px; }
}

/* =========================================================
   شاشة البداية «على أثرهم»
   التوقيتات: الكتابة 2.3s ← الخط الذهبي ← العنوان الفرعي ← الاختفاء (من main.js)
   ========================================================= */
.splash { display: none; }

.splash-on:not(.splash-done) { overflow: hidden; }
.splash-on .splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background:
    var(--pattern),
    radial-gradient(circle at 50% 45%, #1f66bd 0%, var(--royal-700) 28%, var(--royal-800) 55%, var(--navy-950) 100%);
  transition: opacity .8s ease, transform .8s ease, visibility .8s;
}
.splash.hide { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; }

/* هالة الضوء خلف النص */
.splash-glow {
  position: absolute;
  top: 45%; left: 50%;
  width: min(900px, 130vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.6);
  background: radial-gradient(circle, rgba(170, 215, 255, .42) 0%, rgba(120, 180, 245, .14) 38%, transparent 62%);
  opacity: 0;
}

.splash-inner { position: relative; text-align: center; padding-inline: 16px; }

.splash-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(76px, 19vw, 210px);
  line-height: 1.45;
  filter: drop-shadow(0 6px 0 rgba(4, 26, 61, .55)) drop-shadow(0 14px 30px rgba(4, 26, 61, .6));
}
.splash-title span {
  display: inline-block;
  padding: 0 .12em;
  /* ذهبي + شريط لمعان يتحرك فوقه */
  background:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .95) 50%, transparent 58%) 200% 0 / 250% 100% no-repeat,
    linear-gradient(180deg, #fff3c4 0%, #f1cc63 40%, #c8922a 78%, #a87a1e 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  /* مخفي من اليسار: يظهر من اليمين لليسار مثل اتجاه الكتابة */
  clip-path: inset(-25% -5% -25% 105%);
}

.splash-swoosh {
  display: block;
  width: min(600px, 82vw);
  margin: -1.2vw auto 0;
  clip-path: inset(0 0 0 100%);
  filter: drop-shadow(0 4px 10px rgba(4, 26, 61, .5));
}
.splash-swoosh path { fill: var(--gold-400); }

.splash-sub {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 18px 0 0;
  color: var(--sky-300);
  font-weight: 700;
  font-size: clamp(17px, 2.6vw, 26px);
  letter-spacing: 1px;
  opacity: 0;
  transform: translateY(14px);
}
.splash-sub i {
  width: 8px; height: 8px;
  background: var(--gold-400);
  transform: rotate(45deg);
}

.splash-skip {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .5);
  font-size: 13.5px;
  opacity: 0;
}

/* تبدأ الحركة بعد تحميل الخط (main.js يضيف .play) */
.splash.play .splash-glow   { animation: splash-glow 3.4s ease-out forwards; }
.splash.play .splash-title span {
  animation:
    splash-write 2.3s cubic-bezier(.65, 0, .3, 1) .3s forwards,
    splash-shine 1.7s ease-in-out 2.7s forwards;
}
.splash.play .splash-swoosh { animation: splash-wipe 1.1s cubic-bezier(.65, 0, .3, 1) 2s forwards; }
.splash.play .splash-sub    { animation: splash-rise .9s ease-out 3s forwards; }
.splash.play .splash-skip   { animation: splash-fade .6s ease-out 1.4s forwards; }

@keyframes splash-write { to { clip-path: inset(-25% -5% -25% -5%); } }
@keyframes splash-wipe  { to { clip-path: inset(0 0 0 0); } }
@keyframes splash-shine { to { background-position: -100% 0, 0 0; } }
@keyframes splash-rise  { to { opacity: 1; transform: none; } }
@keyframes splash-fade  { to { opacity: 1; } }
@keyframes splash-glow  { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .splash-title span, .splash-swoosh { clip-path: none; }
  .splash-sub, .splash-glow { opacity: 1; transform: none; }
  .splash-glow { transform: translate(-50%, -50%); }
  .splash.play * { animation: none !important; }
}

/* ---------- التذييل ---------- */
.site-footer {
  color: #c7d9f0;
  padding: 40px 0 30px;
  font-size: 15px;
  border-top: 4px solid transparent;
  border-image: var(--gold-gradient) 1;
  background: var(--pattern), linear-gradient(180deg, var(--navy-900), var(--navy-950));
}
.footer-inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 20px 30px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; line-height: 1.4; }
.footer-brand strong, .footer-brand small { display: block; }
.footer-brand small { color: var(--gold-400); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { color: #c7d9f0; transition: color .2s; }
.footer-nav a:hover { color: var(--gold-400); }
.copyright { margin: 0; width: 100%; padding-top: 18px; text-align: center; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }

/* توقيع المصمم في آخر التذييل */
.credit { display: block; margin-top: 6px; color: #9fb6d6; }
.credit strong { color: var(--gold-400); font-weight: 700; letter-spacing: .5px; }

/* ---------- زر العودة للأعلى ---------- */
.to-top {
  position: fixed;
  bottom: 24px; left: 24px;
  z-index: 50;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--navy-900);
  font-size: 20px; font-weight: 800;
  box-shadow: 0 10px 26px rgba(4, 26, 61, .35);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* ---------- حركة الظهور عند التمرير ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s, transform .7s; }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

/* ---------- الشاشات المتوسطة والصغيرة ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: var(--header-h); right: 0; left: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--navy-900);
    padding: 12px 22px 22px;
    border-bottom: 2px solid var(--gold-500);
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 14px; }
  .main-nav .nav-cta { margin: 10px 0 0; text-align: center; }
  .site-header:has(.main-nav.open) { background: var(--navy-900); }

  .hero {
    padding-top: calc(var(--header-h) + 6px);
    background:
      var(--pattern),
      radial-gradient(circle at 50% 24%, #2c74ca 0%, #1a5fb6 20%, #0f4a9c 40%, var(--royal-800) 62%, var(--navy-900) 100%);
  }
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .hero-visual { max-width: 420px; }
  .hero-text { text-align: center; }
  .hero-swoosh { margin-inline: auto; }
  .hero-lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); margin-top: 40px; }
  .hero-stats li:nth-child(3) { border-inline-start: 0; }
  .hero-stats li:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .16); }
  .hero-wave { height: 60px; }

  .section { padding: 64px 0; }
  .banner { padding-bottom: 64px; }
  .about-grid, .contact-panel { grid-template-columns: 1fr; }

  /* الخط الزمني بعمود واحد */
  .timeline::before { right: 9px; margin-right: 0; }
  .timeline li,
  .timeline li:nth-child(odd),
  .timeline li:nth-child(even) {
    width: 100%;
    margin-inline-start: 0;
    padding-inline: 42px 0;
  }
  .timeline li:nth-child(odd)::before,
  .timeline li:nth-child(even)::before { right: 0; left: auto; }

  .gallery { grid-template-columns: 1fr; }
  .gallery-item, .gallery-wide { grid-column: auto; }
  .gallery-item span { opacity: 1; transform: none; }

  .contact-info, .contact-form { padding: 32px 24px; }
  .footer-inner { justify-content: center; text-align: center; }
}
