/* ==========================================================================
   Animated service explainer scenes
   Base styles = finished picture; keyframes add the motion.
   ========================================================================== */
.scene { position: relative; width: 100%; }
.scene svg { width: 100%; height: auto; display: block; overflow: visible; }
.scene svg * { transform-box: fill-box; transform-origin: center; }
.scene { --d: 7s; }

/* palette */
.scene .p   { fill: #0f1528; stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.scene .p2  { fill: #151d36; }
.scene .ln  { fill: rgba(255, 255, 255, .16); }
.scene .ln2 { fill: rgba(255, 255, 255, .08); }
.scene .ac  { fill: url(#sg); }
.scene .ac2 { fill: url(#sg2); }
.scene .ok  { fill: #34d399; }
.scene .hr  { stroke: rgba(255, 255, 255, .1); }
.scene .st  { fill: none; stroke: url(#sg); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.scene .st2 { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.scene .wire { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 1.5; stroke-dasharray: 3 4; }
.scene .glowbg { fill: url(#sglow); }
.scene text { font-family: Inter, system-ui, sans-serif; }
.scene .tx     { fill: #e8ecf6; font-size: 11px; font-weight: 600; }
.scene .tx-s   { fill: #9aa4bd; font-size: 9px; font-weight: 500; }
.scene .tx-xs  { fill: #9aa4bd; font-size: 7.5px; font-weight: 500; }
.scene .tx-xs-w{ fill: rgba(255,255,255,.85); font-size: 8px; font-weight: 600; }
.scene .tx-b   { fill: #fff; font-size: 9px; font-weight: 700; }
.scene .tx-dark{ fill: #060912; font-size: 8.5px; font-weight: 700; }
.scene .tx-ok  { fill: #34d399; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.scene .tx-bad { fill: #fca5a5; font-size: 8px; font-weight: 700; }
.scene .tx-big { fill: #fff; font-size: 14px; font-weight: 800; }
.scene .tx-q   { fill: #e8ecf6; font-size: 10px; }
.scene .tx-link{ fill: #c4b5fd; font-size: 9px; font-weight: 700; }
.scene .tx-domain { fill: #fff; font-size: 13px; font-weight: 700; }
.scene .tx-amt { fill: #fff; font-size: 15px; font-weight: 800; }
.scene .tx-card{ fill: #fff; font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.scene .g-logo { fill: #fff; font-size: 13px; font-weight: 800; }
.scene .brand  { fill: #fff; font-size: 12px; font-weight: 800; letter-spacing: .25em; }
.scene .aa     { fill: #fff; font-size: 30px; font-weight: 700; font-family: Sora, Inter, sans-serif; }

/* ---------- generic motions ---------- */
.scene .a-in   { animation: s-in var(--d) var(--t, 0s) infinite both; }
.scene .a-late { animation: s-late var(--d) var(--t, 0s) infinite both; }
.scene .a-pop  { animation: s-pop var(--d) var(--t, 0s) infinite both; }
.scene .grow-x { transform-origin: left center; animation: s-grow-x var(--d) var(--t, 0s) infinite both; }
.scene .draw   { stroke-dasharray: 100; animation: s-draw var(--d) var(--t, 0s) infinite both; }
.scene .blink  { animation: s-blink 1.2s infinite; }
.scene .spin-slow { animation: s-spin 30s linear infinite; }
.scene .ring-pulse { fill: none; stroke: #7c5cff; stroke-width: 2; animation: s-ring 2.6s ease-out infinite; }

@keyframes s-in   { 0% { opacity: 0; transform: translateY(10px) scale(.96); } 8%, 82% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; transform: none; } }
@keyframes s-late { 0% { opacity: 0; transform: scale(.6); } 8% { opacity: 1; transform: scale(1.08); } 12%, 45% { opacity: 1; transform: none; } 52%, 100% { opacity: 0; } }
@keyframes s-pop  { 0% { opacity: 0; transform: scale(0); } 6% { opacity: 1; transform: scale(1.25); } 10%, 80% { opacity: 1; transform: none; } 90%, 100% { opacity: 0; transform: scale(.6); } }
@keyframes s-grow-x { 0% { transform: scaleX(0); } 10%, 82% { transform: scaleX(1); } 92%, 100% { transform: scaleX(0); } }
@keyframes s-draw { 0% { stroke-dashoffset: 100; } 22%, 82% { stroke-dashoffset: 0; } 94%, 100% { stroke-dashoffset: 100; } }
@keyframes s-blink { 50% { opacity: .25; } }
@keyframes s-spin { to { transform: rotate(360deg); } }
@keyframes s-ring { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- web development ---------- */
.scene .wd-cur { animation: wd-cur var(--d) infinite both; }
.scene .wd-rip { fill: none; stroke: #22d3ee; stroke-width: 2; opacity: 0; animation: wd-rip var(--d) infinite; }
@keyframes wd-cur { 0%, 28% { transform: translate(70px, 50px); opacity: 0; } 34% { opacity: 1; } 46% { transform: translate(0, 0); } 49% { transform: scale(.85); } 52%, 80% { transform: none; opacity: 1; } 88%, 100% { opacity: 0; } }
@keyframes wd-rip { 0%, 48% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; } 62%, 100% { opacity: 0; transform: scale(2.2); } }

/* ---------- e-commerce ---------- */
.scene .ec-fly { opacity: 0; animation: ec-fly var(--d) infinite; }
@keyframes ec-fly { 0%, 22% { opacity: 0; transform: none; } 26% { opacity: 1; transform: scale(1.05); } 46% { opacity: 1; transform: translate(122px, -52px) scale(.18); } 48%, 100% { opacity: 0; transform: translate(122px, -52px) scale(.18); } }
.scene .ec-badge { animation: ec-badge var(--d) infinite both; }
@keyframes ec-badge { 0%, 46% { transform: scale(0); } 52% { transform: scale(1.4); } 56%, 92% { transform: scale(1); } 100% { transform: scale(0); } }
.scene .cart { animation: ec-cart var(--d) infinite; }
@keyframes ec-cart { 46% { transform: none; } 50% { transform: rotate(-12deg) scale(1.1); } 54% { transform: rotate(8deg); } 58% { transform: none; } }
.scene .btn-pulse { fill: #7c5cff; animation: ec-btn var(--d) infinite; }
@keyframes ec-btn { 16%, 30% { fill: #7c5cff; } 22% { fill: #22d3ee; transform: scale(1.2); } }
.scene .ec-bar { transform-origin: left center; animation: ec-bar var(--d) infinite both; }
@keyframes ec-bar { 0%, 58% { transform: scaleX(0); } 74%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.scene .ec-paid { animation: ec-paid var(--d) infinite both; }
@keyframes ec-paid { 0%, 74% { opacity: 0; transform: scale(.5); } 78% { opacity: 1; transform: scale(1.1); } 82%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- graphics ---------- */
.scene .pen-move { animation: gr-pen var(--d) infinite both; }
@keyframes gr-pen { 0% { transform: translate(142px, 50px); opacity: 1; } 6% { transform: translate(176px, 70px); } 10% { transform: translate(176px, 108px); } 14% { transform: translate(142px, 128px); } 18% { transform: translate(108px, 108px); } 22% { transform: translate(108px, 70px); } 26% { transform: translate(142px, 50px); } 30% { transform: translate(124px, 104px); } 36% { transform: translate(142px, 94px); } 42% { transform: translate(160px, 104px); opacity: 1; } 48%, 100% { transform: translate(200px, 150px); opacity: 0; } }

/* ---------- seo ---------- */
.scene .type-clip { transform-origin: left center; animation: s-type var(--d) infinite both; }
@keyframes s-type { 0% { transform: scaleX(0); } 22%, 90% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.scene .seo-other { animation: seo-down var(--d) infinite both; }
.scene .seo-ours { animation: seo-up var(--d) infinite both; }
@keyframes seo-down { 0%, 30% { transform: none; } 50%, 90% { transform: translateY(34px); } 100% { transform: none; } }
@keyframes seo-up { 0%, 30% { transform: none; } 50%, 90% { transform: translateY(-102px); } 100% { transform: none; } }
.scene .seo-one { animation: seo-one var(--d) infinite both; }
@keyframes seo-one { 0%, 48% { opacity: 0; transform: scale(.3) rotate(-30deg); } 54% { opacity: 1; transform: scale(1.2); } 58%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.scene .seo-star { animation: s-pop var(--d) 3.6s infinite both; }

/* ---------- content ---------- */
.scene .float-up { animation: c-float 2.8s var(--t, 0s) infinite both; }
@keyframes c-float { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1.1); } }

/* ---------- pr ---------- */
.scene .wave { fill: none; stroke: rgba(124, 92, 255, .6); stroke-width: 2; animation: pr-wave 2.7s var(--t, 0s) ease-out infinite both; }
@keyframes pr-wave { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.scene .lightup { animation: pr-light 3s var(--t, 0s) infinite both; }
@keyframes pr-light { 0%, 85% { filter: none; } 92% { filter: drop-shadow(0 0 8px rgba(34, 211, 238, .9)); transform: scale(1.04); } 100% { filter: none; } }

/* ---------- hosting ---------- */
.scene .led { animation: h-led 1.1s var(--t, 0s) infinite; }
@keyframes h-led { 50% { opacity: .2; } }
.scene .ekg { fill: none; stroke: #34d399; stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 100; animation: h-ekg 2.6s linear infinite; filter: drop-shadow(0 0 4px rgba(52, 211, 153, .7)); }
@keyframes h-ekg { 0% { stroke-dashoffset: 100; } 70%, 100% { stroke-dashoffset: 0; } }

/* ---------- security ---------- */
.scene .lock-snap { animation: sec-lock 3.6s infinite; }
@keyframes sec-lock { 0%, 40% { transform: none; } 45% { transform: scale(1.15); } 50%, 100% { transform: none; } }
.scene .blocked { opacity: 0; animation: sec-blocked 3.6s var(--t, 0s) infinite; }
@keyframes sec-blocked { 0%, 44% { opacity: 0; transform: scale(.6); } 48% { opacity: 1; transform: scale(1.1); } 52%, 70% { opacity: 1; transform: none; } 80%, 100% { opacity: 0; } }

/* ---------- cloud ---------- */
.scene .cloud-bob { animation: cl-bob 4s ease-in-out infinite; }
@keyframes cl-bob { 50% { transform: translateY(-5px); } }
.scene .bar-grow { transform-origin: bottom center; animation: cl-bar 3.5s var(--t, 0s) ease-in-out infinite both; }
@keyframes cl-bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- payments ---------- */
.scene .card-tap { animation: psp-card var(--d) infinite both; }
@keyframes psp-card { 0%, 10% { transform: none; } 26% { transform: translate(118px, 70px) rotate(-8deg) scale(.82); } 36% { transform: translate(118px, 66px) rotate(-8deg) scale(.82); } 50%, 100% { transform: none; } }
.scene .pay-wait { animation: psp-wait var(--d) infinite both; }
@keyframes psp-wait { 0%, 30% { opacity: 0; } 32%, 46% { opacity: 1; } 48%, 100% { opacity: 0; } }
.scene .pay-ok { opacity: 0; animation: psp-ok var(--d) infinite both; }
@keyframes psp-ok { 0%, 47% { opacity: 0; transform: scale(.4); } 51% { opacity: 1; transform: scale(1.15); } 54%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.scene .coin { opacity: 0; animation: psp-coin var(--d) var(--t, 0s) infinite both; }
@keyframes psp-coin { 0%, 54% { opacity: 0; transform: translateX(-30px); } 58% { opacity: 1; } 70% { opacity: 1; transform: translateX(26px) scale(.7); } 72%, 100% { opacity: 0; transform: translateX(26px) scale(.7); } }

/* ---------- delivery ---------- */
.scene .map line { stroke: rgba(255, 255, 255, .05); }
.scene .route { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 8; }
.scene .route-done { fill: none; stroke: url(#sg); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100; animation: dl-route var(--d) linear infinite both; }
@keyframes dl-route { 0% { stroke-dashoffset: 100; } 70%, 96% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; } }
.scene .pin-drop { transform-origin: bottom center; animation: dl-pin 2s ease-in-out infinite; }
@keyframes dl-pin { 50% { transform: translateY(-5px); } }
.scene .note1 { animation: dl-n1 var(--d) infinite both; }
@keyframes dl-n1 { 0%, 4% { opacity: 0; transform: translateY(-8px); } 8%, 62% { opacity: 1; transform: none; } 68%, 100% { opacity: 0; } }
.scene .note2 { animation: dl-n2 var(--d) infinite both; }
@keyframes dl-n2 { 0%, 70% { opacity: 0; transform: translateY(10px) scale(.9); } 74% { opacity: 1; transform: scale(1.05); } 78%, 95% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- brand management ---------- */
.scene .node-bob { animation: bm-bob 3s var(--t, 0s) ease-in-out infinite; }
@keyframes bm-bob { 50% { transform: translateY(-4px); } }
.scene .tick-pop { animation: s-pop 2.2s var(--t, 0s) infinite both; }

@media (prefers-reduced-motion: reduce) {
  .scene *, .scene *::before { animation: none !important; }
  .scene .ec-fly, .scene .wd-rip, .scene .pay-wait, .scene .coin, .scene .note1, .scene .pen-move { opacity: 0 !important; }
  .scene .pay-ok, .scene .blocked { opacity: 1 !important; }
}
