/* ============================================
   وكالة المحمودي - الهيرو القصصي (hero-story.css)
   ثلاثة مشاهد تتبدل مع السكرول بأسلوب Apple،
   بنفس ألوان الهوية ومتغيراتها — لا ألوان جديدة.
   يعمل بالتناغم مع hero-story.js
   ============================================ */

/* === الهيكل: قسم طويل + نافذة لاصقة === */
.hero-story {
  position: relative;
  height: 180vh; /* مساحة السرد: متناسبة وسلسة للغاية وبدون أي عائق أو ثقل في التصفح */
  background: var(--bg);
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

/* === المشاهد === */
.hero-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-top: 80px; /* مساحة النافبار */
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
}
.hero-scene.scene-intro { opacity: 1; } /* افتراضي آمن بدون JS */
.hero-scene.is-active { pointer-events: auto; }

.hero-scene-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  width: 100%;
}

/* === النصوص === */
.hero-copy { position: relative; z-index: 2; }
.story-title {
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.28;
  margin-bottom: 22px;
  text-wrap: balance;
}
.story-title span { color: var(--primary); }
.story-title .w { display: inline-block; }
.hero-copy p {
  font-size: clamp(15px, 1.25vw, 18px);
  color: var(--text-light);
  max-width: 52ch;
  line-height: 1.9;
  margin-bottom: 32px;
}

/* === الصور === */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-visual img {
  max-height: 60vh;
  object-fit: contain;
  animation: float 6s ease-in-out infinite;
}
.scene-marketing .hero-visual img { max-height: 48vh; }

/* شرائح مدارية حول الكوكب (مشهد التسويق) */
.orbit-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(90, 47, 88, 0.12);
  white-space: nowrap;
  animation: floatSlow 7s ease-in-out infinite;
}
[data-theme="dark"] .orbit-chip { color: var(--text); }
.orbit-chip i { font-size: 12px; }
.chip-1 { top: 10%;  inset-inline-end: 6%;  animation-delay: -1s; }
.chip-2 { bottom: 14%; inset-inline-start: 4%; animation-delay: -3s; }
.chip-3 { top: 22%;  inset-inline-start: 0;  animation-delay: -5s; }
.chip-4 { bottom: 6%; inset-inline-end: 12%; animation-delay: -2s; animation-duration: 8s; }

/* حبوب التقنية (مشهد الحلول) */
.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 30px;
}
.tech-pills span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid rgba(90, 47, 88, 0.22);
  background: rgba(90, 47, 88, 0.05);
}
[data-theme="dark"] .tech-pills span {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

/* === مؤشر تقدم القصة (نقاط جانبية) === */
.hero-progress {
  position: absolute;
  inset-inline-end: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
}
.hp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50px;
  background: transparent;
  border: 1.5px solid var(--primary);
  opacity: 0.45;
  transition: all 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}
.hp-dot.active {
  height: 26px;
  background: var(--primary);
  opacity: 1;
  box-shadow: 0 0 14px rgba(90, 47, 88, 0.45);
}
[data-theme="dark"] .hp-dot { border-color: var(--primary-light); }
[data-theme="dark"] .hp-dot.active {
  background: var(--primary-light);
  box-shadow: 0 0 14px rgba(122, 79, 120, 0.6);
}

/* === إشارة السكرول === */
.hero-scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-light);
  z-index: 3;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.hero-scroll-cue i {
  color: var(--primary);
  animation: cueBounce 2s ease-in-out infinite;
}
@keyframes cueBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(7px); opacity: 0.55; }
}

/* === الجوال: سرد حركي مخصص للشاشات الصغيرة مع تثبيت سلس === */
@media (max-width: 768px) {
  .hero-story { height: 320vh; }
  .hero-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    min-height: 520px;
    overflow: hidden;
  }
  .hero-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding-top: 60px;
  }
  .hero-scene.scene-marketing,
  .hero-scene.scene-tech {
    display: flex !important;
  }
  .hero-scene-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
  }
  .hero-visual { order: -1; }
  .hero-visual img { max-height: 28vh; }
  .scene-marketing .hero-visual img { max-height: 24vh; }
  .story-title { font-size: clamp(26px, 7vw, 36px); margin-bottom: 12px; }
  .hero-copy p { font-size: 13.5px; margin: 0 auto 16px; max-width: 90%; }
  .hero-buttons { justify-content: center; gap: 8px; }
  .hero-buttons .btn { padding: 9px 18px; font-size: 13px; }
  .hero-stats { justify-content: center; gap: 16px; margin-top: 14px; }
  .tech-pills { justify-content: center; margin-bottom: 16px; }
  .tech-pills span { font-size: 12px; padding: 6px 12px; }
  .orbit-chip { display: none; }
  .hero-progress { inset-inline-end: 10px; }
  .hero-scroll-cue { bottom: 12px; }
  .hero-scroll-cue span { display: none; }
}

/* === شاشات قصيرة جداً: لا نخنق المحتوى === */
@media (max-height: 620px) {
  .hero-stats { display: none; }
  .hero-visual img { max-height: 44vh; }
}

/* === تقليل الحركة: قصة ساكنة مكدسة — كل المحتوى ظاهر بلا تثبيت === */
@media (prefers-reduced-motion: reduce) {
  .hero-story { height: auto; }
  .hero-sticky { position: relative; height: auto; min-height: 0; overflow: visible; }
  .hero-scene {
    position: relative;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    padding: 90px 0 50px;
  }
  .hero-visual img { animation: none; }
  .orbit-chip { animation: none; }
  .hero-progress, .hero-scroll-cue { display: none; }
  .hero-scroll-cue i { animation: none; }
}

/* Button Press Feedback for Hero Section */
.hero-buttons .btn {
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s, color 0.3s;
}
.hero-buttons .btn:active {
  transform: scale(0.97) !important;
}
