/* Animated product scenes on the home page (app/views/landing_product_scenes/{cloud,it,voip}.php,
   docs/landing.md#products): the «خدمات ابری» showcase and the three-slide IT / telephony carousels. Each scene is an
   SVG drawn light-on-graphite and sits on a .dx-scene panel (home.css). Scene animations (.ps-*) run
   only while the scene is on screen (.is-live) and are switched off for prefers-reduced-motion.
   Loaded only by landing.php. */

.ps-svg { display: block; width: 100%; height: 100%; }

/* ---------- scene primitives (.ps-*) ---------- */
.ps-svg * { transform-box: fill-box; transform-origin: center; }
.ps-label { font-family: var(--font-ui); font-size: 15px; font-weight: 700; }
.ps-small { font-size: 11px; font-weight: 600; }

.ps-flow { fill: none; stroke: #9de2e8; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 2 10; animation: ps-dash 1.6s linear infinite; animation-delay: var(--d, 0s); opacity: .9; }
.ps-flow.is-cyan  { stroke: #15c3d2; }
.ps-flow.is-pink  { stroke: #b9eaee; }
.ps-flow.is-green { stroke: #48cbd7; }
.ps-flow.is-amber { stroke: #fbbf24; }
.ps-flow.is-rev { animation-direction: reverse; }
@keyframes ps-dash { to { stroke-dashoffset: -48; } }

.ps-breathe { animation: ps-breathe 6s ease-in-out infinite; }
@keyframes ps-breathe { 0%, 100% { opacity: .7; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
.ps-float { animation: ps-float 5s ease-in-out infinite; }
@keyframes ps-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.ps-blink { animation: ps-blink 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes ps-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.ps-beat { animation: ps-beat 2s ease-in-out infinite; }
@keyframes ps-beat { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); } 50% { transform: scale(1.06); filter: drop-shadow(0 0 12px rgba(255, 255, 255, .25)); } }
.ps-spin { animation: ps-spin 6s linear infinite; }
.ps-spin.is-rev { animation-direction: reverse; animation-duration: 4s; }
.ps-spin-slow { animation: ps-spin 22s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }
.ps-spin-slow.is-rev { animation-direction: reverse; animation-duration: 34s; }

.ps-ping { fill: none; stroke: #9de2e8; stroke-width: 2; opacity: 0; animation: ps-ping 3.2s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes ps-ping { 0% { opacity: .9; transform: scale(1); } 40%, 100% { opacity: 0; transform: scale(1.8); } }

/* cloud */
.ps-globe { animation: ps-globe 4s ease-in-out infinite; }
@keyframes ps-globe { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.15); } }
.ps-fill { transform-origin: bottom; animation: ps-fill 5s ease-in-out infinite; }
@keyframes ps-fill { 0%, 100% { transform: scaleY(.25); } 60% { transform: scaleY(.9); } }


.ps-ping-soft { animation: ps-ping-soft 3s ease-out infinite; }
@keyframes ps-ping-soft { 0% { opacity: .6; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.25); } }

/* shared rings (VoIP) and soft pings */
.ps-ring { fill: none; stroke: #fbbf24; stroke-width: 2; opacity: 0; animation: ps-ring 2.4s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes ps-ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2.1); } }
.ps-eq { transform-origin: center; animation: ps-eq .9s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes ps-eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }


/* Scene animations run only while on screen. Off screen (and before the observer fires) every
   element shows its plain, fully drawn state, so a scene is never caught half-hidden. */
.dx-scene:not(.is-live) * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .dx-scene * { animation: none !important; } }

/* =====================================================================================
   Scene carousels (IT / telephony panels, docs/landing.md#it-and-telephony-carousels).
   Each slide is a 440×250 SVG whose story is one-shot keyframes (fill-mode both) on a 7 s clock plus a
   few loops; only the active slide animates, so its story replays from the start each time it comes on.
   ===================================================================================== */
.dx-scene.is-car { aspect-ratio: 440 / 250; }
.pc-slides { position: absolute; inset: 0; }
.pc-slide {
  position: absolute; inset: 0; opacity: 0; transform: translateX(-6%) scale(.97); pointer-events: none;
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.pc-slide.is-active { opacity: 1; transform: none; }
.pc-slide:not(.is-active) * { animation: none !important; }
.pc-bar {
  position: absolute; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 14px 10px; background: linear-gradient(180deg, rgba(20, 23, 25, 0), rgba(20, 23, 25, .82) 55%);
}
.pc-title { margin: 0; display: flex; align-items: center; font-size: 12.5px; font-weight: 700; color: #e6eced; min-width: 0; }
.pc-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-dots { display: flex; gap: 2px; flex: none; }
.pc-dot { width: 26px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.pc-dot i { display: block; width: 7px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .32); position: relative; overflow: hidden; transition: width .35s ease, background .35s ease; }
.pc-dot:hover i { background: rgba(255, 255, 255, .6); }
.pc-dot:focus-visible { outline: none; }
.pc-dot:focus-visible i { outline: 2px solid #9de9ef; outline-offset: 3px; }
/* The active dot is a pill whose fill is the 7 s clock; its animationend advances the slide. */
.pc-dot.is-active i { width: 24px; background: rgba(255, 255, 255, .22); }
.pc-dot.is-active i::after { content: ""; position: absolute; inset: 0; transform-origin: 100% 50%; background: #6fd6df; animation: pc-clock 7s linear both; }
#product-voip .pc-dot.is-active i::after { background: #fbbf24; }
@keyframes pc-clock { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Paused while hovered/focused and while the panel is off screen (the clock is on a pseudo-element,
   which the scene's off-screen `* { animation: none }` rule does not reach). */
.dx-scene.is-car.is-hold .pc-dot i::after, .dx-scene.is-car:not(.is-live) .pc-dot i::after { animation-play-state: paused; }

/* primitives */
.pc-svg .pc-latin { font-family: var(--font-num), system-ui, sans-serif; font-weight: 700; direction: ltr; unicode-bidi: plaintext; }
.pc-link { fill: none; stroke: rgba(111, 214, 223, .28); stroke-width: 1.8; }
.pc-link.is-amber { stroke: rgba(251, 191, 36, .28); }
.pc-pkt { fill: none; stroke: #9de9ef; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 100; opacity: 0; filter: drop-shadow(0 0 3px rgba(17, 184, 197, .9)); animation: pc-pkt var(--t, 1.8s) linear infinite; animation-delay: var(--d, 0s); }
.pc-pkt.is-amber { stroke: #fde68a; filter: drop-shadow(0 0 3px rgba(245, 158, 11, .9)); }
.pc-pkt.is-dim { stroke-width: 2; stroke-dasharray: 4 100; }
.pc-pkt.is-rev { animation-direction: reverse; }
@keyframes pc-pkt { 0% { stroke-dashoffset: 6; opacity: 0; } 10%, 88% { opacity: 1; } 100% { stroke-dashoffset: -100; opacity: 0; } }
.pc-in { animation: pc-in .7s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0s); }
@keyframes pc-in { from { opacity: 0; transform: scale(.6); } }
.pc-rise { animation: pc-rise .8s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0s); }
@keyframes pc-rise { from { opacity: 0; transform: translateY(30px) scale(.8); } }
.pc-draw { stroke-dasharray: 100; animation: pc-draw 1s ease both; animation-delay: var(--d, 0s); }
@keyframes pc-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.pc-draw-link { stroke-dasharray: 100; animation: pc-draw 1.1s ease both; animation-delay: var(--d, 0s); }
.pc-fill { transform-origin: 100% 50%; animation: pc-fill 1.2s cubic-bezier(.4, 0, .2, 1) both; animation-delay: var(--d, 0s); }
.pc-fill.is-slow { animation-duration: 4.6s; }
@keyframes pc-fill { from { transform: scaleX(0); } }
.pc-grow { transform-origin: 50% 100%; animation: pc-grow .9s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: var(--d, 0s); }
@keyframes pc-grow { from { transform: scaleY(0); } }
.pc-gauge { transform: rotate(-90deg); stroke-dasharray: 100; animation: pc-gauge 1.8s cubic-bezier(.4, 0, .2, 1) both; animation-delay: var(--d, 0s); }
@keyframes pc-gauge { from { stroke-dashoffset: 100; } to { stroke-dashoffset: var(--v); } }
.pc-wave { opacity: 0; animation: pc-wave 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes pc-wave { 0%, 100% { opacity: .15; } 40% { opacity: 1; } }
.pc-scan { animation: pc-scan 3.2s ease-in-out infinite; }
@keyframes pc-scan { 50% { transform: translateY(150px); } }
.pc-rec { animation: pc-rec 1.1s steps(2, jump-none) infinite; }
@keyframes pc-rec { 50% { opacity: .15; } }
.pc-dash-run { animation: pc-dash-run .8s linear infinite; }
@keyframes pc-dash-run { to { stroke-dashoffset: -16; } }

/* IT 1: the branch link fails at 2 s, is worked on, and is back at 4.6 s (7 s clock). */
.pc-fault-link { animation: pc-fault-link 7s linear both; }
@keyframes pc-fault-link {
  0%, 27% { stroke: rgba(111, 214, 223, .28); stroke-dasharray: none; }
  29%, 36%, 44%, 52%, 60% { stroke: #f59e0b; stroke-dasharray: 5 4; }
  32%, 40%, 48%, 56% { stroke: rgba(245, 158, 11, .35); stroke-dasharray: 5 4; }
  65%, 100% { stroke: rgba(111, 214, 223, .75); stroke-dasharray: none; }
}
.pc-fault-pkt { animation-name: pc-pkt, pc-fault-hide; animation-duration: var(--t, 1.8s), 7s; animation-iteration-count: infinite, 1; animation-timing-function: linear; animation-fill-mode: none, both; }
@keyframes pc-fault-hide { 0%, 27% { visibility: visible; } 28%, 64% { visibility: hidden; } 65%, 100% { visibility: visible; } }
.pc-fault-badge, .pc-fix, .pc-ok { opacity: 0; }
.pc-fault-badge { animation: pc-fault-badge 7s ease both; }
@keyframes pc-fault-badge { 0%, 28% { opacity: 0; transform: scale(.4); } 31% { opacity: 1; transform: scale(1.15); } 34%, 44% { opacity: 1; transform: none; } 47%, 100% { opacity: 0; transform: scale(.6); } }
.pc-fix { animation: pc-fix 7s ease both; }
@keyframes pc-fix { 0%, 45% { opacity: 0; transform: scale(.5); } 48% { opacity: 1; transform: scale(1.1) rotate(-14deg); } 52% { transform: rotate(14deg); } 56% { transform: rotate(-14deg); } 60% { opacity: 1; transform: rotate(10deg); } 64%, 100% { opacity: 0; transform: scale(.6); } }
.pc-ok { animation: pc-ok 7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pc-ok { 0%, 64% { opacity: 0; transform: scale(.3); } 68% { opacity: 1; transform: scale(1.2); } 72%, 100% { opacity: 1; transform: none; } }

/* IT 3: threats fly in and burst on the firewall ring; spinners wait until each task is ticked. */
.pc-threat { opacity: 0; animation: pc-threat 2.8s cubic-bezier(.5, 0, .9, .6) infinite; animation-delay: var(--d, 0s); }
@keyframes pc-threat { 0% { opacity: 0; transform: translate(var(--tx), var(--ty)); } 12% { opacity: 1; } 62% { opacity: 1; transform: none; } 66%, 100% { opacity: 0; transform: scale(0); } }
.pc-burst { opacity: 0; animation: pc-burst 2.8s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes pc-burst { 0%, 60% { opacity: 0; transform: scale(.3); } 63% { opacity: 1; transform: scale(.6); } 85%, 100% { opacity: 0; transform: scale(2.4); } }
.pc-wait { animation: ps-spin .9s linear infinite, pc-hide .2s ease forwards; animation-delay: 0s, var(--d, 0s); }
@keyframes pc-hide { to { opacity: 0; } }

/* VoIP 1: ringing (0–40%), the route scans 101 then lights 102 (28%), 102 rings, connects at 46%. */
.pc-ringing, .pc-shake-call { animation: pc-ringing 7s linear both; }
@keyframes pc-ringing { 0%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
.pc-shake-call { animation: pc-shake 7s ease both; }
@keyframes pc-shake { 0%, 40% { transform: rotate(0); } 2%, 6%, 10%, 18%, 22%, 26%, 34%, 38% { transform: rotate(-12deg); } 4%, 8%, 12%, 20%, 24%, 28%, 36% { transform: rotate(12deg); } 14%, 30% { transform: none; } 42%, 100% { transform: none; } }
.pc-route-scan { animation: pc-route-scan 7s linear both; }
@keyframes pc-route-scan { 0%, 18% { stroke: rgba(251, 191, 36, .28); } 21%, 25% { stroke: rgba(251, 191, 36, .8); } 28%, 100% { stroke: rgba(251, 191, 36, .28); } }
.pc-route { animation: pc-route 7s linear both; }
@keyframes pc-route { 0%, 27% { stroke: rgba(251, 191, 36, .28); stroke-width: 1.8; } 30%, 100% { stroke: rgba(253, 230, 138, .9); stroke-width: 2.4; } }
.pc-route-pkt { animation-name: pc-pkt, pc-show-after; animation-duration: var(--t, 1s), 7s; animation-iteration-count: infinite, 1; animation-fill-mode: none, both; }
@keyframes pc-show-after { 0%, 29% { visibility: hidden; } 30%, 100% { visibility: visible; } }
.pc-shake-ext { animation: pc-shake-ext 7s ease both; }
@keyframes pc-shake-ext { 0%, 30% { transform: none; } 32%, 36%, 40% { transform: rotate(-14deg); } 34%, 38%, 42% { transform: rotate(14deg); } 44%, 100% { transform: none; } }
.pc-ext-frame { animation: pc-ext-frame 7s ease both; }
@keyframes pc-ext-frame { 0%, 29% { stroke: rgba(251, 191, 36, .45); fill: #1c1408; } 31%, 100% { stroke: #fbbf24; fill: #2d1f08; } }
.pc-status-a { animation: pc-status-a 7s ease both; }
@keyframes pc-status-a { 0%, 44% { opacity: 1; } 47%, 100% { opacity: 0; } }
.pc-status-b { opacity: 0; animation: pc-status-b 7s ease both; }
@keyframes pc-status-b { 0%, 45% { opacity: 0; transform: translateY(6px); } 49%, 100% { opacity: 1; transform: none; } }
.pc-talk { opacity: 0; animation: pc-talk 7s ease both; }
@keyframes pc-talk { 0%, 46% { opacity: 0; transform: translateY(10px); } 52%, 100% { opacity: 1; transform: none; } }

/* VoIP 2: the welcome types in (RTL, from the right); the menu highlights 1, 2, 3, then holds on 2;
   the transfer shows; callers move up the queue. */
.pc-type { transform-origin: 100% 50%; animation: pc-type 1.6s steps(24, end) both; animation-delay: .5s; }
@keyframes pc-type { from { transform: scaleX(0); } }
.pc-menu-hl { opacity: 0; }
.pc-menu-hl.is-1 { animation: pc-hl-1 7s ease both; }
.pc-menu-hl.is-2 { animation: pc-hl-2 7s ease both; }
.pc-menu-hl.is-3 { animation: pc-hl-3 7s ease both; }
@keyframes pc-hl-1 { 0%, 30% { opacity: 0; } 33%, 40% { opacity: .3; } 43%, 100% { opacity: 0; } }
@keyframes pc-hl-3 { 0%, 42% { opacity: 0; } 45%, 52% { opacity: .3; } 55%, 100% { opacity: 0; } }
@keyframes pc-hl-2 { 0%, 54% { opacity: 0; } 57%, 61% { opacity: .3; } 62% { opacity: .9; } 66%, 100% { opacity: .9; } }
.pc-menu-t.is-2 { animation: pc-hl-t 7s ease both; }
@keyframes pc-hl-t { 0%, 61% { fill: #fef3c7; } 64%, 100% { fill: #1c1408; } }
.pc-transfer { opacity: 0; animation: pc-transfer 7s ease both; }
@keyframes pc-transfer { 0%, 64% { opacity: 0; transform: translateY(6px); } 70%, 100% { opacity: 1; transform: none; } }
.pc-queue { opacity: 0; animation: pc-queue 4.4s cubic-bezier(.45, 0, .55, 1) infinite; animation-delay: var(--d, 0s); }
@keyframes pc-queue { 0% { opacity: 0; transform: translateX(10px); } 10% { opacity: 1; } 25% { transform: translateX(-30px); } 45% { transform: translateX(-60px); } 65% { transform: translateX(-100px); } 85% { opacity: 1; transform: translateX(-136px); } 100% { opacity: 0; transform: translateX(-140px) scale(.4); } }

/* reduced motion: every slide's story is shown in its finished state and nothing loops */
@media (prefers-reduced-motion: reduce) {
  .pc-slide { transition: none; }
  .pc-dot.is-active i::after { animation: none; transform: none; } /* no clock, so no autoplay */
  .pc-fault-badge, .pc-fix, .pc-threat, .pc-burst, .pc-wait, .pc-pkt, .pc-ringing, .pc-status-a, .pc-queue { display: none; }
  .pc-ok, .pc-status-b, .pc-talk, .pc-transfer { opacity: 1; }
  .pc-menu-hl.is-2 { opacity: .9; }
}
