/* ALC v3.4 — مسرح الهوية في الهيرو (CSS-driven؛ يعمل بلا JavaScript؛ يتجمّد مع تقليل الحركة)
   الجدول الزمني (ثوانٍ): 0.0 شبكة | 0.35 شعاع | 1.1 حلقة | 1.5 حروف | 2.5 مسح شريطي | 3.0 خط ونص | 3.4 استقرار + خمول */
.alc-hid-col { display: block; }
.alc-hid { position: relative; width: 100%; aspect-ratio: 640 / 440; max-width: none; }
[dir="ltr"] .alc-hid { margin-inline-start: 0; margin-inline-end: auto; }
.alc-hid-tilt { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
[dir="rtl"] .alc-hid-tilt { animation: alc-hid-float 7s ease-in-out infinite; }
[dir="ltr"] .alc-hid-tilt { animation: alc-hid-float-ltr 7s ease-in-out infinite; }
.alc-hid.is-pointer .alc-hid-tilt { animation: none; }
@keyframes alc-hid-float { 0%,100% { transform: perspective(1100px) rotateY(-8deg) rotateX(4deg) translateY(0); } 50% { transform: perspective(1100px) rotateY(-8deg) rotateX(4deg) translateY(-12px); } }
@keyframes alc-hid-float-ltr { 0%,100% { transform: perspective(1100px) rotateY(8deg) rotateX(4deg) translateY(0); } 50% { transform: perspective(1100px) rotateY(8deg) rotateX(4deg) translateY(-12px); } }
.alc-hid-svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* 1) الشبكة: خطوط تُرسم */
.alc-hid-grid .g { stroke-opacity: .2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.alc-hid-grid .g { animation: alc-hid-draw 1s cubic-bezier(.2,.7,.2,1) forwards; }
.alc-hid-grid .g:nth-child(1){animation-delay:.00s}.alc-hid-grid .g:nth-child(2){animation-delay:.06s}.alc-hid-grid .g:nth-child(3){animation-delay:.12s}.alc-hid-grid .g:nth-child(4){animation-delay:.18s}.alc-hid-grid .g:nth-child(5){animation-delay:.24s}
.alc-hid-grid .g:nth-child(6){animation-delay:.10s}.alc-hid-grid .g:nth-child(7){animation-delay:.16s}.alc-hid-grid .g:nth-child(8){animation-delay:.22s}.alc-hid-grid .g:nth-child(9){animation-delay:.28s}.alc-hid-grid .g:nth-child(10){animation-delay:.34s}
.alc-hid-grid .g, .alc-hid-track, .alc-hid-rule, .alc-hid-seal .ring, .alc-hid-seal .ring2 { stroke-dasharray: 1; stroke-dashoffset: 1; }
@keyframes alc-hid-draw { to { stroke-dashoffset: 0; } }
.alc-hid-corners path { stroke-opacity: 0; animation: alc-hid-in .5s .5s ease forwards; }
@keyframes alc-hid-in { to { stroke-opacity: .7; opacity: 1; } }

/* 2) الشعاع: الخط يُرسم ورأس مضيء يسير على المسار */
.alc-hid-track { stroke-opacity: .22; stroke-dasharray: 1; stroke-dashoffset: 1; animation: alc-hid-draw 1.2s .35s cubic-bezier(.4,0,.2,1) forwards; }
.alc-hid-beamline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: alc-hid-draw 1.2s .35s cubic-bezier(.4,0,.2,1) forwards, alc-hid-beam-settle 1s 3.4s forwards; }
@keyframes alc-hid-beam-settle { to { stroke-width: 1.5; opacity: .85; } }
.alc-hid-head { offset-path: path('M40 352 H220 L292 280 H512'); offset-rotate: 0deg; offset-distance: 0%; opacity: 0;
  animation: alc-hid-head 1.2s .35s cubic-bezier(.4,0,.2,1) forwards, alc-hid-head-idle 9s 4.5s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes alc-hid-head { 0% { offset-distance: 0%; opacity: 1; } 95% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes alc-hid-head-idle { 0%, 74% { offset-distance: 0%; opacity: 0; } 76% { opacity: .9; } 98% { opacity: .9; } 100% { offset-distance: 100%; opacity: 0; } }
.alc-hid-sparks circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.alc-hid-sparks .s1 { animation: alc-hid-spark .5s .85s ease-out forwards; }
.alc-hid-sparks .s2 { animation: alc-hid-spark .5s 1.1s ease-out forwards; }
.alc-hid-sparks .s3 { animation: alc-hid-spark .6s 1.5s ease-out forwards, alc-hid-pulse 3s 3.6s ease-in-out infinite; }
@keyframes alc-hid-spark { 0% { opacity: 1; transform: scale(.4); } 60% { opacity: 1; transform: scale(2.4); } 100% { opacity: .9; transform: scale(1); } }
@keyframes alc-hid-pulse { 0%,100% { opacity: .9; transform: scale(1); } 50% { opacity: .5; transform: scale(1.6); } }
.alc-hid-dims path { stroke-opacity: 0; animation: alc-hid-dims .6s 1.6s ease forwards; }
@keyframes alc-hid-dims { to { stroke-opacity: .5; } }

.alc-hid-halo { opacity: 0; animation: alc-hid-in-op 1.2s 2.2s ease forwards; }
.alc-hid-sweep { opacity: 0; animation: alc-hid-in-op .01s 3.2s forwards; }
/* 3) حلقة الختم */
.alc-hid-seal .ring  { stroke-opacity: .9; animation: alc-hid-draw 1.1s 1.1s cubic-bezier(.4,0,.2,1) forwards; }
.alc-hid-seal .ring2 { stroke-opacity: .5; animation: alc-hid-draw 1.1s 1.25s cubic-bezier(.4,0,.2,1) forwards; }
.alc-hid-seal .ticks { opacity: 0; transform-box: fill-box; transform-origin: center; animation: alc-hid-in-op .8s 2.1s ease forwards, alc-hid-spin 90s 2.1s linear infinite; }
@keyframes alc-hid-in-op { to { opacity: 1; } }
@keyframes alc-hid-spin { to { transform: rotate(360deg); } }

/* 4) الحروف: لوح ينزلق فوق الحرف ثم ينسحب كاشفاً عنه */
.alc-hid-letters .l { opacity: 0; animation: alc-hid-in-op .01s forwards; }
.alc-hid-letters .la { animation-delay: 1.78s; } .alc-hid-letters .ll { animation-delay: 1.96s; } .alc-hid-letters .lc { animation-delay: 2.14s; }
.alc-hid-letters .slab { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: alc-hid-slab .56s cubic-bezier(.7,0,.2,1) forwards; }
[dir="rtl"] .alc-hid-letters .slab { transform-origin: right center; }
.alc-hid-letters .sa { animation-delay: 1.5s; } .alc-hid-letters .sl { animation-delay: 1.68s; } .alc-hid-letters .sc { animation-delay: 1.86s; }
@keyframes alc-hid-slab { 0% { transform: scaleX(0); transform-origin: left center; } 50% { transform: scaleX(1); transform-origin: left center; } 50.01% { transform-origin: right center; } 100% { transform: scaleX(0); transform-origin: right center; } }
[dir="rtl"] .alc-hid-letters .slab { animation-name: alc-hid-slab-rtl; }
@keyframes alc-hid-slab-rtl { 0% { transform: scaleX(0); transform-origin: right center; } 50% { transform: scaleX(1); transform-origin: right center; } 50.01% { transform-origin: left center; } 100% { transform: scaleX(0); transform-origin: left center; } }
.alc-hid-letters text { paint-order: stroke; }

/* 5) المسح الشريطي */
.alc-hid-bands { opacity: 0; transform: skewX(-18deg) translateX(-120px); animation: alc-hid-bands .75s 2.5s cubic-bezier(.7,0,.2,1) forwards; mix-blend-mode: screen; }
[dir="rtl"] .alc-hid-bands { animation-name: alc-hid-bands-rtl; }
@keyframes alc-hid-bands { 0% { opacity: 1; transform: skewX(-18deg) translateX(-120px); } 90% { opacity: 1; } 100% { opacity: 0; transform: skewX(-18deg) translateX(900px); } }
@keyframes alc-hid-bands-rtl { 0% { opacity: 1; transform: skewX(18deg) translateX(900px); } 90% { opacity: 1; } 100% { opacity: 0; transform: skewX(18deg) translateX(-120px); } }

/* 6) الخط والنصوص الصغيرة */
.alc-hid-rule { stroke-dasharray: 1; stroke-dashoffset: 1; animation: alc-hid-draw .7s 3s cubic-bezier(.2,.7,.2,1) forwards; }
.alc-hid-tag, .alc-hid-sub { opacity: 0; animation: alc-hid-up .7s 3.15s cubic-bezier(.2,.7,.2,1) forwards; transform: translateY(8px); }
.alc-hid-sub { animation-delay: 3.3s; }
@keyframes alc-hid-up { to { opacity: 1; transform: translateY(0); } }

/* زر إعادة التشغيل (JS فقط) */
.alc-hid-replay { display: none; position: absolute; inset-inline-end: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--h-dark, rgba(246,242,234,.14)); color: var(--fd3, #9aa3ad); background: rgba(15,22,32,.5); align-items: center; justify-content: center; cursor: pointer; transition: color .18s, border-color .18s; }
[data-m2-js] .alc-hid-replay { display: inline-flex; }
.alc-hid-replay:hover, .alc-hid-replay:focus-visible { color: var(--gold, #B39B6E); border-color: var(--gold-40, rgba(179,155,110,.4)); outline: none; }

/* الجوال: المسرح يظهر مصغّراً تحت النص (كان مخفياً) */
@media (max-width: 980px) {
  #hero .hero-deco-3d.alc-hid-col { display: block !important; margin-top: -18px; margin-bottom: 8px; }
  .alc-hid { max-width: 420px; margin-inline: auto; }
  .alc-hid-tilt { animation: none !important; transform: none !important; }
}
/* العبارات المتغيرة: كشف حركي (clip) بدل الانزلاق البسيط */
[data-m2-js] .alc-rot.is-live .alc-rot-item { clip-path: inset(0% 0% 0% 0%); transition: opacity .55s var(--ease), transform .55s var(--ease), clip-path .55s var(--ease); }
[data-m2-js] .alc-rot.is-live .alc-rot-item:not(.is-on):not(.is-out) { clip-path: inset(100% 0% 0% 0%); }
[data-m2-js] .alc-rot.is-live .alc-rot-item.is-out { clip-path: inset(0% 0% 100% 0%); }

/* تقليل الحركة: الحالة النهائية فوراً */
@media (prefers-reduced-motion: reduce) {
  .alc-hid *, .alc-hid-tilt { animation: none !important; transition: none !important; }
  .alc-hid-grid .g, .alc-hid-track, .alc-hid-beamline, .alc-hid-rule, .alc-hid-seal .ring, .alc-hid-seal .ring2 { stroke-dashoffset: 0 !important; }
  .alc-hid-corners path { stroke-opacity: .7; } .alc-hid-dims path { stroke-opacity: .5; }
  .alc-hid-seal .ticks, .alc-hid-letters .l, .alc-hid-tag, .alc-hid-sub { opacity: 1 !important; transform: none !important; }
  .alc-hid-sparks circle { opacity: .9; } .alc-hid-halo { opacity: 1; } .alc-hid-head, .alc-hid-bands, .alc-hid-letters .slab, .alc-hid-sweep { display: none; }
  .alc-hid-replay { display: none !important; }
}
