/* كوين · الحركة.
   درس سفاري: الحالة النهائية هي الافتراضية في scenes.css، وحالة البداية تنضبط هنا بس،
   داخل @supports وتحت .is-motion. أي متصفح ما يدعم الحركة المربوطة بالتمرير يشوف الإطار النهائي.
   كل الحركة على opacity وtranslate وscale (والتمويه filter في كلمات العنوان كما في intro-loader الأصلية). */

@media (prefers-reduced-motion:no-preference){
@supports (animation-timeline:view()){

  /* ---------- الافتتاحية: 5.2 ثانية بالكثير، وتنتهي فوراً مع أول تمرير ---------- */
  /* البذرة 0 إلى 0.4: عتمة، والحجر صغير ينبض مرة وحدة في وسط الرمز */
  .intro-run .mark__stone{animation:q-seed 1.4s linear both,q-settle .6s 2s var(--ease-heavy) both}
  /* الرمز 1.4 إلى 2، والحجر يستقر في ركنه 2 إلى 2.6 */
  .intro-run .mark__body{animation:q-rise .6s 1.4s var(--ease-out) both}
  /* العنوان ثلاث ثوانٍ (2.2 إلى 5.2)، مرة وحدة:
     «البداية من» كلمة كلمة 2.2 إلى 2.8،
     الحجر الذهبي يدخل بعد ما يستقر حجر الرمز (2.7)، يمشي لين منتصف «حجر الزاوية» (3.8)، يوقف (4.3)، ويختفي (4.55)،
     و«حجر الزاوية» تطلع مكانه 4.35 إلى 5.2. والرمز فوق بمساحته الفاضية، فما يتزاحمان */
  .intro-run .s1__title .w>span{animation:q-word .45s var(--ease-out) both}
  .intro-run .s1__line:first-child .w:nth-child(1)>span{animation-delay:2.2s}
  .intro-run .s1__line:first-child .w:nth-child(2)>span{animation-delay:2.35s}
  .intro-run .s1__line--2 .w>span{animation-duration:.7s}
  .intro-run .s1__line--2 .w:nth-child(1)>span{animation-delay:4.35s}
  .intro-run .s1__line--2 .w:nth-child(2)>span{animation-delay:4.5s}
  .intro-run .s1__stone{animation:q-stone 1.85s 2.7s both}
  .intro-run .s1__cta{animation:q-up .3s 4.9s var(--ease-out) both}
  /* الضوء 0.4 إلى 1.4 في الإطار الثابت (لما WebGL مب شغال) */
  .intro-run .s1__still{animation:q-fade 1s .4s ease both}
  .intro-run quoin-morph-navbar,.intro-run quoin-progress{animation:q-fade .4s 2.2s ease both}

  /* ---------- المشهد 1 يطلع مع التمرير ---------- */
  .s1{view-timeline:--s1 block}
  .is-motion .s1__hero{animation:q-out linear both;animation-timeline:--s1;animation-range:contain 40% contain 90%}

  /* ---------- المشهد 2: البطاقة تدخل وتطلع ---------- */
  .s2{view-timeline:--s2 block}
  .is-motion .s2__card{animation:q-card linear both;animation-timeline:--s2;animation-range:contain 4% contain 100%}

  /* ---------- الختام ---------- */
  .fin{view-timeline:--fin block}
  .is-motion .fin__line{animation:q-card linear both;animation-timeline:--fin;animation-range:contain 10% contain 100%}

  /* ---------- ظهور بسيط للأقسام الطويلة ---------- */
  .is-motion .chart-card,.is-motion .door,.is-motion .measure{animation:q-enter linear both;animation-timeline:view(block);animation-range:entry 0% entry 60%}
}
}

/* 0 إلى 0.4 ثانية نبضة وحدة، ثم يكبر للمقاس الكامل لين 1.4 */
@keyframes q-seed{0%{opacity:0;scale:.3}16%{opacity:1;scale:.42}28.5%{opacity:1;scale:.32;animation-timing-function:cubic-bezier(.22,1,.36,1)}100%{opacity:1;scale:1}}
/* الحجر يبدأ في وسط الرمز وينزلق قطرياً لركنه، ويقف وقفة ثقيلة بلا ارتداد */
@keyframes q-settle{from{translate:calc((var(--S) - var(--s)) / -2) calc((var(--S) - var(--s)) / -2)}to{translate:0 0}}
@keyframes q-rise{from{opacity:0;scale:.96}to{opacity:1;scale:1}}
@keyframes q-word{from{opacity:0;filter:blur(8px);translate:0 .9em}to{opacity:1;filter:blur(0);translate:0 0}}
/* الحجر الذهبي في العنوان، 1.85 ثانية: يمشي 1.1 (59.5%)، يوقف 0.5 (لين 86.5%)، ويختفي 0.25.
   الإزاحة على المحور الفيزيائي، فتنضرب في --flip: في العربي يدخل من اليمين، وفي الإنجليزي من اليسار.
   --q-from المسافة لحافة الشاشة، يحسبها intro-loader قبل ما يبدأ (والافتراضي 60vw) */
@keyframes q-stone{
  0%{opacity:1;scale:1;translate:calc(var(--flip,1) * -1 * var(--q-from,60vw)) 0;animation-timing-function:cubic-bezier(.22,1,.36,1)}
  59.5%{opacity:1;scale:1;translate:0 0}
  86.5%{opacity:1;scale:1;translate:0 0;animation-timing-function:cubic-bezier(.4,0,1,1)}
  100%{opacity:0;scale:.55;translate:0 0}}
@keyframes q-fade{from{opacity:0}to{opacity:1}}
@keyframes q-up{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
@keyframes q-out{from{opacity:1;translate:0 0}to{opacity:0;translate:0 -48px}}
@keyframes q-card{0%{opacity:0;translate:0 32px}14%{opacity:1;translate:0 0}86%{opacity:1;translate:0 0}100%{opacity:0;translate:0 -24px}}
@keyframes q-enter{from{opacity:0;translate:0 28px}to{opacity:1;translate:0 0}}
