/* ==========================================================
   motion.css — الحركة والأنميشن (يعمل مع glass.css)
   لإيقاف كل الحركة: احذف سطر motion.css و motion.js من index.html
   ========================================================== */
body.glass { --t0: 1.5s; }

/* ---------- شاشة الافتتاح بالشعار ---------- */
.intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 45%, #fff 0%, #f1e6fb 60%, #e4d0f6 100%);
  animation: intro-out .8s cubic-bezier(.7, 0, .3, 1) 1.5s forwards; }
.intro img { position: relative; width: min(58vw, 250px); height: auto; animation: logo-in 1.1s cubic-bezier(.2, .9, .3, 1.25) both, logo-glow 1.6s ease-in-out .3s; }
.intro__ring { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 3px solid rgba(159, 103, 184, .5); animation: ring 1.6s ease-out .2s both; }
.intro__ring--2 { animation-delay: .55s; border-color: rgba(224, 72, 143, .4); }
@keyframes logo-in { from { opacity: 0; transform: scale(.55) rotate(-8deg); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes logo-glow { 50% { filter: drop-shadow(0 0 26px rgba(159, 103, 184, .75)); } }
@keyframes ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(6); opacity: 0; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; transform: scale(1.08); } }

/* ---------- شريط تقدّم التمرير ---------- */
.scroll-progress { position: fixed; z-index: 120; top: 0; inset-inline: 0; height: 4px; transform-origin: right center; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #9f67b8, #e0488f, #7c3cf0); box-shadow: 0 0 12px rgba(224, 72, 143, .6); }

/* ---------- توهّج يتبع المؤشر ---------- */
.cursor-glow { position: fixed; z-index: 0; top: 0; left: 0; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(170, 110, 255, .22), rgba(255, 140, 200, .12) 45%, transparent 70%); opacity: 0; transition: opacity .4s; }
.cursor-glow.on { opacity: 1; }

/* ---------- خلفية إضافية تتحرك ---------- */
body.glass::after { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(28% 28% at 78% 62%, rgba(150, 120, 255, .25), transparent 70%), radial-gradient(26% 26% at 22% 38%, rgba(255, 160, 205, .25), transparent 70%);
  animation: aurora2 32s ease-in-out infinite alternate; }
@keyframes aurora2 { to { transform: translate3d(-5%, 4%, 0) rotate(-6deg) scale(1.08); } }

/* ---------- الشعار في الهيدر ---------- */
.brand { display: inline-flex; }
.brand img { transform-origin: 50% 60%; animation: logo-bob 5s ease-in-out 2.2s infinite; filter: drop-shadow(0 4px 10px rgba(107, 47, 158, .25)); }
.brand:hover img { animation: logo-spin .9s var(--g-spring, ease) 1; }
@keyframes logo-bob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3px) rotate(-3deg); } 75% { transform: translateY(2px) rotate(3deg); } }
@keyframes logo-spin { from { transform: rotate(0); } 60% { transform: rotate(380deg) scale(1.2); } to { transform: rotate(360deg); } }
body.glass .site-header { animation: header-in .9s cubic-bezier(.2, .9, .3, 1) calc(var(--t0) + .1s) both; }
@keyframes header-in { from { opacity: 0; translate: 0 -40px; } }

/* ---------- الهيرو ---------- */
.hero h1 .w { display: inline-block; animation: word-up .9s cubic-bezier(.2, .9, .3, 1.15) calc(var(--t0) + var(--i) * .09s) both; }
@keyframes word-up { from { opacity: 0; transform: translateY(46px) rotate(5deg) scale(.9); filter: blur(8px); } }
.hero__lead { animation: fade-up .9s ease calc(var(--t0) + .8s) both; }
.hero__actions { animation: fade-up .9s ease calc(var(--t0) + 1s) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(26px); } }
.hero__media { animation: media-float 7s ease-in-out calc(var(--t0) + 1.2s) infinite alternate; }
@keyframes media-float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-14px) rotate(.8deg); } }
.hero__arch img { animation: kenburns 16s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.14) translate(-2%, -1%); } }
body.glass .license-badge { animation: badge-pop .8s cubic-bezier(.34, 1.56, .64, 1) calc(var(--t0) + 1.4s) both, badge-bob 4.5s ease-in-out calc(var(--t0) + 2.4s) infinite; }
@keyframes badge-pop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } }
@keyframes badge-bob { 50% { transform: translateY(-7px); } }
.hero__orbs i:nth-child(1) { animation-name: g-float, orb-glow; }
.hero__orbs i:nth-child(1), .hero__orbs i:nth-child(2), .hero__orbs i:nth-child(3) { animation-timing-function: ease-in-out; }
@keyframes orb-glow { 50% { filter: brightness(1.18) saturate(1.2); } }
body.glass .hero__grid { animation: hero-card-in 1s cubic-bezier(.2, .9, .3, 1) calc(var(--t0) - .2s) both; }
@keyframes hero-card-in { from { opacity: 0; transform: translateY(40px) scale(.96); } }

/* شرارات متطايرة في الهيرو */
.spark { position: absolute; z-index: -1; left: var(--x); bottom: -12px; width: var(--s); height: var(--s); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff, rgba(255, 255, 255, .15) 70%); opacity: 0; animation: spark-rise var(--dur) linear var(--del) infinite; }
@keyframes spark-rise { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: .9; } 85% { opacity: .6; } 100% { opacity: 0; transform: translate(var(--dx), -620px) scale(1.2); } }

/* ---------- شريط الخدمات المتحرك ---------- */
.marquee { overflow: hidden; padding-block: .6rem 1.2rem; direction: ltr;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: .9rem; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__i { direction: rtl; display: inline-flex; align-items: center; gap: .6rem; padding: .55rem 1.2rem; border-radius: 999px; font-weight: 600; color: var(--plum-800); white-space: nowrap;
  background: var(--g-card, rgba(255, 255, 255, .6)); border: 1px solid var(--g-line, #fff); box-shadow: var(--g-shadow); }
.marquee__i::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, #9f67b8, #e0488f); box-shadow: 0 0 10px rgba(224, 72, 143, .6); }
.marquee__i:nth-child(even) { background: linear-gradient(135deg, rgba(107, 47, 158, .9), rgba(139, 79, 208, .9)); color: #fff; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- عناوين الأقسام ---------- */
body.glass .section-title { background-size: 220% 100%; animation: shimmer 6s linear infinite; }
body.glass .section--plum .section-title { animation: none; }
@keyframes shimmer { to { background-position: -220% 0; } }
.section-title::after { content: ""; display: block; width: 56px; height: 5px; margin-top: .55rem; border-radius: 5px; background: linear-gradient(90deg, #9f67b8, #e0488f); animation: bar 3.4s ease-in-out infinite; }
@keyframes bar { 50% { width: 130px; } }

/* ---------- عناصر تتحرك باستمرار ---------- */
.card__icon { animation: bob 4.6s ease-in-out calc(var(--i, 0) * -.7s) infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
body.glass .trust__list svg { animation: bob 5s ease-in-out calc(var(--i, 0) * -1s) infinite; }
body.glass .service__book { animation: nudge 5s ease-in-out calc(var(--i, 0) * -.9s) infinite; }
@keyframes nudge { 0%, 88%, 100% { scale: 1; rotate: 0deg; } 92% { scale: 1.1; rotate: -3deg; } 96% { scale: 1.05; rotate: 2deg; } }
.chip { animation: chip-float 5s ease-in-out calc(var(--i, 0) * -.45s) infinite; }
@keyframes chip-float { 50% { translate: 0 -4px; } }
body.glass .wa-float { animation: g-pulse 3.2s ease-in-out infinite, wiggle 7s ease-in-out 3s infinite; }
@keyframes wiggle { 0%, 90%, 100% { rotate: 0deg; } 92% { rotate: -8deg; } 94% { rotate: 8deg; } 96% { rotate: -5deg; } 98% { rotate: 3deg; } }
body.glass .gallery__track img { transition: transform .8s var(--g-ease); }
body.glass .gallery__track figure { overflow: hidden; }
body.glass .gallery__track figure:hover img { transform: scale(1.06); }
body.glass .dept__arch img { animation: kenburns 18s ease-in-out infinite alternate; }

/* ---------- الشريط السفلي ---------- */
@media (max-width: 860px) {
  .dock { animation: dock-in .9s cubic-bezier(.2, .9, .3, 1.2) calc(var(--t0) + .6s) both; }
  .dock a.is-active svg { animation: dock-bounce 1.8s ease-in-out infinite; }
  .dock .dock__wa { animation: wa-beat 2.4s ease-in-out infinite; }
}
@keyframes dock-in { from { translate: 0 120px; opacity: 0; } }
@keyframes dock-bounce { 50% { transform: translateY(-4px) scale(1.12); } }
@keyframes wa-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  .intro, .cursor-glow, .spark, .scroll-progress { display: none !important; }
  .hero h1 .w, .hero__lead, .hero__actions, body.glass .hero__grid, body.glass .site-header { animation: none !important; opacity: 1 !important; }
}
@media print { .intro, .cursor-glow, .scroll-progress, .marquee { display: none !important; } }
