/* ==========================================================================
   lux-stage.css — «مسرح» سينمائي مرتبط بالتمرير + إطارات ضخمة
   --------------------------------------------------------------------------
   يُحمَّل فقط في الصفحات التي تحتوي عنصر [data-lux-stage] (الصفحة الرئيسية
   وصفحة هبوط الاستطلاع). لا يُحمَّل في لوحة التحكم إطلاقًا، فلا يمكن أن
   يمسّ تخطيط الإدارة.

   قاعدة السلامة: كل ما هنا بصري بحت (أبعاد/ألوان/حركة) ولا يعتمد على أي
   معرّف يقرأه منطق التطبيق. حذف الملف يُعيد الصفحة إلى شكلها السابق فقط.
   ========================================================================== */

/* ==========================================================================
   1. المسرح: قسم طويل + طبقة لاصقة = تمرير يُشغّل الرسم (Scroll Scrub)
   ========================================================================== */
.lux-stage {
  position: relative;
  /* مساحة التمرير هي «مدّة الفيديو»: كل 100vh ≈ مقطع من التتابع */
  height: 230vh;
  margin-bottom: var(--sp-8, 32px);
}

.lux-stage__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border-radius: 40px;
  /* إطار ضخم متعدّد الحلقات — «حواف ضخمة» بلا صور */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    inset 0 0 0 14px rgba(255, 255, 255, .035),
    inset 0 0 0 15px rgba(255, 255, 255, .10),
    inset 0 0 140px rgba(4, 10, 28, .75),
    0 50px 120px -40px rgba(2, 8, 24, .95);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(37, 99, 235, .20), transparent 60%),
    linear-gradient(180deg, rgba(8, 14, 34, .72), rgba(5, 10, 26, .92));
}

.lux-stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

/* أركان معدنية رقيقة = إحساس عدسة/كادر رسمي */
.lux-stage__sticky::before,
.lux-stage__sticky::after {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  z-index: 3;
  pointer-events: none;
  border-color: rgba(56, 189, 248, .55);
  border-style: solid;
  border-width: 0;
}
.lux-stage__sticky::before {
  top: 26px; inset-inline-start: 26px;
  border-top-width: 2px; border-inline-start-width: 2px;
  border-start-start-radius: 18px;
}
.lux-stage__sticky::after {
  bottom: 26px; inset-inline-end: 26px;
  border-bottom-width: 2px; border-inline-end-width: 2px;
  border-end-end-radius: 18px;
}

/* ---------- واجهة النص فوق المسرح ---------- */
.lux-stage__ui {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  padding: var(--sp-8, 32px) var(--sp-6, 24px);
  text-align: center;
  pointer-events: none; /* لا يحجب شيئًا؛ الأزرار خارج المسرح */
}
.lux-stage__ui .row { justify-content: center; pointer-events: auto; }

.lux-stage__eyebrow {
  margin: 0 0 var(--sp-3, 12px);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #8fd3ff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lux-stage__eyebrow::before,
.lux-stage__eyebrow::after {
  content: "";
  width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 211, 255, .9));
}
.lux-stage__eyebrow::after { transform: scaleX(-1); }

.lux-stage__title {
  margin: 0;
  font-size: clamp(1.9rem, 5.2vw, 3.5rem);
  line-height: 1.12;
}

/* الشرائح النصية تتبادل مع تقدّم التمرير (يضبطها js/lux-stage.js) */
.lux-caps {
  position: relative;
  margin-top: var(--sp-5, 20px);
  min-height: 5.6em;
}
.lux-cap {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--lux-ease, ease), transform .55s var(--lux-ease, ease);
  color: #c3d3f2;
  font-size: clamp(.95rem, 1.9vw, 1.08rem);
  line-height: 1.75;
}
.lux-cap.is-on { opacity: 1; transform: none; }
.lux-cap strong { color: #fff; }

/* مؤشّر «الفيديو»: شريط مراحل صغير */
.lux-chapters {
  position: absolute;
  bottom: 92px;
  inset-inline: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  justify-content: center;
  pointer-events: none;
}
.lux-chapters span {
  width: 46px; height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
  position: relative;
}
.lux-chapters span::after {
  content: "";
  position: absolute; inset: 0;
  width: var(--fill, 0%);
  background: linear-gradient(90deg, var(--lux-azure, #2563eb), var(--lux-cyan, #22d3ee));
  box-shadow: 0 0 12px rgba(56, 189, 248, .8);
  transition: width .18s linear;
}

/* تلميح التمرير */
.lux-hint {
  position: absolute;
  bottom: 34px;
  inset-inline: 0;
  z-index: 3;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7f93bb;
  pointer-events: none;
  transition: opacity .4s ease;
}
.lux-hint__dot {
  display: block;
  width: 22px; height: 34px;
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 14px;
  position: relative;
}
.lux-hint__dot::after {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  margin-inline-start: -2px;
  border-radius: 3px;
  background: var(--lux-cyan, #22d3ee);
  box-shadow: 0 0 10px rgba(34, 211, 238, .9);
  animation: luxWheel 1.8s var(--lux-ease, ease) infinite;
}
@keyframes luxWheel {
  0%, 100% { transform: translateY(0); opacity: 1; }
  60%      { transform: translateY(12px); opacity: .2; }
}
.lux-stage.is-ended .lux-hint { opacity: 0; }

/* ==========================================================================
   2. الإطار الضخم لأي بطاقة رئيسية
   ========================================================================== */
.lux-frame {
  position: relative;
  padding: 16px;
  border-radius: 34px;
  margin-inline: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .14),
    0 0 0 12px rgba(255, 255, 255, .028),
    0 0 0 13px rgba(255, 255, 255, .075),
    0 44px 100px -42px rgba(2, 8, 24, .95);
}
/* حلقة ضوء تدور حول الإطار — حركة «حيّة» رسمية لا صاخبة */
.lux-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--lux-spin, 0deg),
    rgba(56, 189, 248, 0) 0deg,
    rgba(56, 189, 248, .85) 60deg,
    rgba(37, 99, 235, .25) 130deg,
    rgba(255, 255, 255, 0) 210deg,
    rgba(201, 162, 39, .55) 300deg,
    rgba(56, 189, 248, 0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: luxSpin 9s linear infinite;
  pointer-events: none;
}
@property --lux-spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes luxSpin { to { --lux-spin: 360deg; } }
/* بديل للمتصفحات بلا @property: نُدوّر العنصر نفسه بدل الزاوية */
@supports not (background: conic-gradient(from var(--x, 0deg), red, blue)) {
  .lux-frame::before { animation: none; }
}

.lux-frame > .card,
.lux-frame > .landing,
.lux-frame > .ps-landing {
  border-radius: 22px !important;
  margin: 0;
}

/* ==========================================================================
   3. كتلة «هل يهمّك المزيد؟» — دعوة اختيارية لا تُلزم أحدًا
   ========================================================================== */
.lux-invite {
  margin-top: var(--sp-6, 24px);
  padding: var(--sp-6, 24px);
  border-radius: 24px;
  border: 1px dashed rgba(255, 255, 255, .22);
  background: linear-gradient(180deg, rgba(37, 99, 235, .10), rgba(255, 255, 255, .03));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lux-invite__q {
  margin: 0;
  font-family: var(--font-heading, inherit);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: #fff;
}
.lux-invite__note {
  margin: var(--sp-2, 8px) 0 var(--sp-4, 16px);
  font-size: .9rem;
  color: #a7b8da;
}
.lux-invite__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3, 12px);
}
.lux-invite__grid {
  display: grid;
  gap: var(--sp-4, 16px);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: var(--sp-5, 20px);
}
.lux-mini {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2, 8px);
  padding: var(--sp-5, 20px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .055);
  transition: transform .3s var(--lux-ease, ease), border-color .3s ease, box-shadow .3s ease;
}
.lux-mini:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, .55);
  box-shadow: 0 18px 40px -18px rgba(37, 99, 235, .7);
}
.lux-mini h3 { margin: 0; font-size: 1rem; color: #fff; }
.lux-mini p  { margin: 0; font-size: .875rem; color: #a7b8da; }
.lux-mini .btn { align-self: flex-start; margin-top: auto; }
.lux-mini__tag {
  align-self: flex-start;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8fd3ff;
}

/* ==========================================================================
   4. نبض حيّ خفيف للأزرار الرئيسية (بلا إزعاج)
   ========================================================================== */
.lux-pulse { position: relative; }
.lux-pulse::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(56, 189, 248, .5);
  opacity: 0;
  animation: luxPulse 3.4s var(--lux-ease, ease) infinite;
  pointer-events: none;
}
@keyframes luxPulse {
  0%   { opacity: .75; transform: scale(.96); }
  70%  { opacity: 0;   transform: scale(1.09); }
  100% { opacity: 0;   transform: scale(1.09); }
}

/* ==========================================================================
   5. تقليل الحركة + الشاشات الصغيرة
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .lux-stage { height: auto; }
  .lux-stage__sticky { position: static; height: auto; min-height: 0; padding: var(--sp-10, 48px) 0; }
  .lux-cap { position: static; inset: auto; opacity: 1; transform: none; }
  .lux-caps { min-height: 0; display: grid; gap: var(--sp-3, 12px); }
  .lux-hint, .lux-chapters { display: none; }
  .lux-frame::before, .lux-pulse::before, .lux-hint__dot::after { animation: none; }
}

@media (max-width: 700px) {
  .lux-stage { height: 200vh; }
  .lux-stage__sticky {
    border-radius: 26px;
    min-height: 460px;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .16),
      inset 0 0 0 8px rgba(255, 255, 255, .035),
      inset 0 0 0 9px rgba(255, 255, 255, .10),
      inset 0 0 90px rgba(4, 10, 28, .75),
      0 30px 70px -30px rgba(2, 8, 24, .95);
  }
  .lux-stage__sticky::before,
  .lux-stage__sticky::after { width: 46px; height: 46px; }
  .lux-stage__sticky::before { top: 14px; inset-inline-start: 14px; }
  .lux-stage__sticky::after { bottom: 14px; inset-inline-end: 14px; }
  .lux-caps { min-height: 8.2em; }
  .lux-frame {
    padding: 10px;
    border-radius: 24px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .14),
      0 0 0 7px rgba(255, 255, 255, .03),
      0 0 0 8px rgba(255, 255, 255, .075),
      0 30px 70px -34px rgba(2, 8, 24, .95);
  }
  .lux-frame > .card,
  .lux-frame > .landing,
  .lux-frame > .ps-landing { border-radius: 16px !important; }
  .lux-invite__actions .btn { width: 100%; justify-content: center; }
  .lux-chapters { bottom: 76px; }
}
