/* Cloud Call Center product page — borderless 3D hero + motion stage */
.ccaas-hero-3d {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1rem;
    overflow: visible;
}

.ccaas-hero-3d__stage {
    position: relative;
    width: min(28rem, 96vw);
    height: min(24rem, 78vw);
    perspective: 920px;
    transform-style: preserve-3d;
}

.ccaas-hero-3d__platform {
    position: absolute;
    left: 50%;
    bottom: 4%;
    width: 76%;
    height: 3.5rem;
    margin-left: -38%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.48) 0%, rgba(167, 139, 250, 0.16) 38%, rgba(56, 189, 248, 0.08) 58%, transparent 74%);
    filter: blur(1px);
    transform: rotateX(78deg);
    pointer-events: none;
}

.ccaas-hero-3d__orbit-path {
    position: absolute;
    top: 56%;
    left: 50%;
    width: 94%;
    height: 35%;
    margin: -17.5% 0 0 -47%;
    border: 1px dashed rgba(56, 189, 248, 0.32);
    border-radius: 50%;
    transform: rotateX(72deg);
    box-shadow:
        0 0 28px rgba(56, 189, 248, 0.1),
        inset 0 0 24px rgba(167, 139, 250, 0.06);
    pointer-events: none;
}

.ccaas-hero-3d__orbit-system {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    pointer-events: none;
}

.ccaas-hero-3d__orbit-spin {
    --orbit-count: 8;
    position: absolute;
    top: 56%;
    left: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateX(72deg);
}

.ccaas-hero-3d__node {
    --orbit-r: 11.5rem;
    --node-color: #1d5ed2;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transform: rotateZ(calc(var(--i) * 360deg / var(--orbit-count))) translateX(var(--orbit-r)) rotateZ(calc(var(--i) * -360deg / var(--orbit-count)));
    animation: ccaas3dNodeOrbit 42s linear infinite;
}

.ccaas-hero-3d__node-face {
    display: block;
    transform-style: preserve-3d;
    transform: rotateX(-72deg);
}

.ccaas-hero-3d__node-cap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    margin: -1.55rem 0 0 -1.55rem;
    border-radius: 999px;
    color: #fff;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.35) 18%, transparent 42%),
        linear-gradient(155deg, color-mix(in srgb, var(--node-color) 18%, #fff) 0%, var(--node-color) 58%, color-mix(in srgb, var(--node-color) 72%, #0f172a) 100%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.72),
        inset 0 -4px 10px rgba(15, 23, 42, 0.1);
    transform: translateZ(10px);
}

.ccaas-hero-3d__node-cap i {
    font-size: 1.05rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.98);
}

@keyframes ccaas3dNodeOrbit {
    to {
        transform: rotateZ(calc(var(--i) * 360deg / var(--orbit-count) + 360deg)) translateX(var(--orbit-r)) rotateZ(calc(var(--i) * -360deg / var(--orbit-count) - 360deg));
    }
}

.ccaas-hero-3d__cloud {
    position: absolute;
    top: 7%;
    left: 50%;
    z-index: 4;
    width: 15rem;
    height: 10rem;
    transform: translateX(-50%);
    animation: ccaas3dCloudFloat 5.5s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 22px 36px rgba(14, 165, 233, 0.22));
}

.ccaas-hero-3d__cloud-glow {
    position: absolute;
    inset: 8% 4% 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 58%, rgba(125, 211, 252, 0.42) 0%, rgba(167, 139, 250, 0.16) 42%, transparent 72%);
    filter: blur(10px);
    pointer-events: none;
}

.ccaas-hero-3d__cloud-blob {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.42) 16%, transparent 38%),
        linear-gradient(148deg, rgba(240, 249, 255, 0.98) 0%, rgba(186, 230, 253, 0.94) 38%, rgba(56, 189, 248, 0.82) 72%, rgba(14, 165, 233, 0.72) 100%);
    box-shadow:
        inset 0 10px 22px rgba(255, 255, 255, 0.58),
        inset 0 -10px 24px rgba(14, 165, 233, 0.16),
        0 10px 24px rgba(14, 165, 233, 0.14);
}

.ccaas-hero-3d__cloud-blob--base {
    top: 3.6rem;
    left: 50%;
    z-index: 1;
    width: 12.8rem;
    height: 5.4rem;
    margin-left: -6.4rem;
    background:
        radial-gradient(circle at 50% 28%, rgba(224, 242, 254, 0.92) 0%, rgba(125, 211, 252, 0.78) 52%, rgba(56, 189, 248, 0.62) 100%);
    box-shadow:
        inset 0 -14px 28px rgba(14, 165, 233, 0.2),
        0 16px 32px rgba(14, 165, 233, 0.18);
}

.ccaas-hero-3d__cloud-blob--main {
    top: 2.1rem;
    left: 50%;
    z-index: 3;
    width: 10.8rem;
    height: 6.2rem;
    margin-left: -5.4rem;
}

.ccaas-hero-3d__cloud-blob--l {
    top: 3.4rem;
    left: 0.35rem;
    z-index: 2;
    width: 5.2rem;
    height: 3.9rem;
    opacity: 0.96;
}

.ccaas-hero-3d__cloud-blob--r {
    top: 2.7rem;
    right: 0.15rem;
    z-index: 2;
    width: 5.8rem;
    height: 4.2rem;
    opacity: 0.94;
}

.ccaas-hero-3d__cloud-blob--ll {
    top: 4.6rem;
    left: 1.6rem;
    z-index: 2;
    width: 4.1rem;
    height: 3rem;
    opacity: 0.9;
}

.ccaas-hero-3d__cloud-blob--rr {
    top: 4.2rem;
    right: 1.4rem;
    z-index: 2;
    width: 4.4rem;
    height: 3.1rem;
    opacity: 0.88;
}

.ccaas-hero-3d__cloud-blob--peak {
    top: 0.55rem;
    left: 50%;
    z-index: 4;
    width: 5.6rem;
    height: 3.5rem;
    margin-left: -2.8rem;
    background:
        radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.98) 0%, rgba(224, 242, 254, 0.72) 38%, rgba(125, 211, 252, 0.82) 100%);
}

.ccaas-hero-3d__cloud-blob--highlight {
    top: 1.35rem;
    left: 3.1rem;
    z-index: 5;
    width: 2.6rem;
    height: 1.7rem;
    background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.2) 70%, transparent 100%);
    box-shadow: none;
    opacity: 0.85;
}

.ccaas-hero-3d__cloud-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.98);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45),
        0 3px 14px rgba(14, 165, 233, 0.5),
        0 8px 20px rgba(167, 139, 250, 0.22);
    transform: translate(-50%, -56%);
    filter: drop-shadow(0 4px 8px rgba(14, 165, 233, 0.28));
}

@keyframes ccaas3dCloudFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* Motion stage */
.ccaas-how-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 40rem;
}

.ccaas-motion-stage {
    position: relative;
    min-height: 24rem;
    --motion-caption-reserve: 2.75rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background:
        radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.14), transparent 36%),
        radial-gradient(circle at 12% 78%, rgba(6, 182, 212, 0.12), transparent 34%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    contain: layout style paint;
    isolation: isolate;
}

.ccaas-motion-stage__progress {
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: rgba(148, 163, 184, 0.2);
    z-index: 3;
    overflow: hidden;
}

.ccaas-motion-stage__progress-fill {
    display: block;
    height: 100%;
    width: calc((var(--ccaas-step, 0) + 1) * 25%);
    background: linear-gradient(90deg, #06b6d4, #1d5ed2);
    transition: width 0.45s ease;
}

.ccaas-motion-stage[data-active-step="0"] { --ccaas-step: 0; }
.ccaas-motion-stage[data-active-step="1"] { --ccaas-step: 1; }
.ccaas-motion-stage[data-active-step="2"] { --ccaas-step: 2; }
.ccaas-motion-stage[data-active-step="3"] { --ccaas-step: 3; }

.ccaas-motion-stage__caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 0.65rem 1rem;
    min-height: var(--motion-caption-reserve, 2.75rem);
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 58%, rgba(255, 255, 255, 0.88) 82%, transparent);
    pointer-events: none;
    z-index: 10;
}

.ccaas-scene {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.25rem 2rem calc(var(--motion-caption-reserve, 2.75rem) + 1.25rem);
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.98);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
    will-change: opacity, transform;
}

.ccaas-scene.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    pointer-events: auto;
}

.ccaas-motion-stage.is-paused .ccaas-scene *,
.ccaas-scene:not(.is-active) * {
    animation-play-state: paused !important;
}

.ccaas-step-btn {
    width: 100%;
    text-align: right;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ccaas-step-btn.is-active {
    border-color: rgba(14, 165, 233, 0.55);
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.12);
    transform: translateX(-2px);
}

.ccaas-step-btn__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.ccaas-step-btn.is-active .ccaas-step-btn__num {
    background: #0ea5e9;
    color: #fff;
}

.ccaas-flow-arrow {
    width: 2.5rem;
    height: 2px;
    background: linear-gradient(90deg, #cbd5e1, #0ea5e9);
    position: relative;
    flex-shrink: 0;
}

.ccaas-flow-arrow::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.45rem;
    height: 0.45rem;
    border-left: 2px solid #0ea5e9;
    border-bottom: 2px solid #0ea5e9;
    transform: translateY(-50%) rotate(45deg);
}

@keyframes ccaasArrowFlow {
    0%, 100% { opacity: 0.45; transform: scaleX(0.9); }
    50% { opacity: 1; transform: scaleX(1); }
}

.ccaas-flow-arrow--active {
    transform-origin: center;
    animation: ccaasArrowFlow 1.5s ease-in-out infinite;
}

.ccaas-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 800;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

@keyframes ccaasPhoneRing {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
    70% { transform: scale(1.01); box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); }
}

.ccaas-phone-ring {
    animation: ccaasPhoneRing 2.4s ease-in-out infinite;
}

.ccaas-ivr-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.65rem;
    color: #e2e8f0;
}

.ccaas-ivr-option__key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.35rem;
    background: rgba(14, 165, 233, 0.25);
    color: #7dd3fc;
    font-weight: 800;
    font-size: 0.6rem;
}

.ccaas-scene.is-active .ccaas-ivr-option {
    opacity: 0;
    animation: ccaasReveal 0.35s ease forwards;
}

.ccaas-scene.is-active .ccaas-ivr-option:nth-child(1) { animation-delay: 0.1s; }
.ccaas-scene.is-active .ccaas-ivr-option:nth-child(2) { animation-delay: 0.35s; }
.ccaas-scene.is-active .ccaas-ivr-option:nth-child(3) { animation-delay: 0.6s; }

@keyframes ccaasReveal {
    from { opacity: 0; transform: translate3d(0, 6px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.ccaas-queue-agent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    min-width: 3.5rem;
}

.ccaas-queue-agent--busy {
    border-color: rgba(14, 165, 233, 0.4);
    background: #f0f9ff;
}

.ccaas-queue-bar {
    height: 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.ccaas-queue-bar__fill {
    display: block;
    height: 100%;
    width: 65%;
    background: linear-gradient(90deg, #06b6d4, #0ea5e9);
    animation: ccaasQueueFill 2s ease-in-out infinite;
}

@keyframes ccaasQueueFill {
    0%, 100% { width: 45%; }
    50% { width: 78%; }
}

.ccaas-crm-card {
    border-radius: 0.75rem;
    border: 1px solid rgba(14, 165, 233, 0.3);
    background: #f0f9ff;
    padding: 0.65rem;
}

.ccaas-pulse-line {
    transform-origin: center;
    animation: ccaasPulseLine 1.6s ease-in-out infinite;
}

@keyframes ccaasPulseLine {
    0%, 100% { opacity: 0.35; transform: scaleX(0.92); }
    50% { opacity: 1; transform: scaleX(1); }
}

.ccaas-motion-stage .ccaas-scene > * {
    width: 100%;
    max-width: min(17.5rem, 72%);
    margin-inline: auto;
}

@media (max-width: 639px) {
    .ccaas-hero-3d__stage {
        width: min(22rem, 94vw);
        height: min(19rem, 68vw);
    }

    .ccaas-hero-3d__cloud {
        width: 11.5rem;
        height: 7.6rem;
    }

    .ccaas-hero-3d__cloud-blob--base {
        width: 9.6rem;
        height: 4.1rem;
        margin-left: -4.8rem;
    }

    .ccaas-hero-3d__cloud-blob--main {
        width: 8.1rem;
        height: 4.7rem;
        margin-left: -4.05rem;
    }

    .ccaas-hero-3d__cloud-blob--l { width: 3.9rem; height: 2.9rem; }
    .ccaas-hero-3d__cloud-blob--r { width: 4.4rem; height: 3.1rem; }
    .ccaas-hero-3d__cloud-blob--ll { width: 3.1rem; height: 2.3rem; }
    .ccaas-hero-3d__cloud-blob--rr { width: 3.3rem; height: 2.4rem; }
    .ccaas-hero-3d__cloud-blob--peak {
        width: 4.2rem;
        height: 2.6rem;
        margin-left: -2.1rem;
    }

    .ccaas-hero-3d__cloud-icon { font-size: 1.9rem; }

    .ccaas-hero-3d__node { --orbit-r: 8.5rem; }

    .ccaas-hero-3d__node-cap {
        width: 2.55rem;
        height: 2.55rem;
        margin: -1.275rem 0 0 -1.275rem;
    }

    .ccaas-hero-3d__node-cap i { font-size: 0.88rem; }

    .ccaas-motion-stage { min-height: 21rem; }

    .ccaas-motion-stage__caption {
        background: linear-gradient(to top, rgba(255, 255, 255, 0.52) 38%, rgba(255, 255, 255, 0.18) 72%, transparent);
    }

    .ccaas-scene {
        align-items: center;
        justify-content: center;
        padding: 1rem;
        padding-bottom: calc(var(--motion-caption-reserve, 2.75rem) + 0.65rem);
    }

    .ccaas-motion-stage .ccaas-scene > * {
        max-width: min(14.25rem, 88%);
        transform-origin: center center;
    }

    #ccaas-scene-2 > *,
    #ccaas-scene-3 > * {
        max-width: min(16rem, 94%);
    }
}

@media (min-width: 640px) {
    .ccaas-hero-3d__stage {
        width: min(30rem, 92vw);
        height: min(26rem, 72vw);
    }

    .ccaas-hero-3d__cloud {
        width: 16.5rem;
        height: 10.8rem;
    }

    .ccaas-hero-3d__cloud-blob--base {
        width: 14rem;
        height: 5.9rem;
        margin-left: -7rem;
    }

    .ccaas-hero-3d__cloud-blob--main {
        width: 11.8rem;
        height: 6.8rem;
        margin-left: -5.9rem;
    }

    .ccaas-hero-3d__cloud-icon { font-size: 2.75rem; }

    .ccaas-hero-3d__node { --orbit-r: 12.5rem; }

    .ccaas-hero-3d__node-cap {
        width: 3.25rem;
        height: 3.25rem;
        margin: -1.625rem 0 0 -1.625rem;
    }

    .ccaas-motion-stage { min-height: 26rem; }

    .ccaas-scene {
        padding: 2.5rem 2.5rem calc(var(--motion-caption-reserve, 2.75rem) + 1.25rem);
    }

    .ccaas-motion-stage .ccaas-scene > * {
        max-width: min(20rem, 78%);
    }
}

@media (min-width: 1024px) {
    .ccaas-hero-3d__stage {
        width: 32rem;
        height: 28rem;
    }

    .ccaas-hero-3d__node { --orbit-r: 13.5rem; }

    .ccaas-motion-stage { min-height: 30rem; }

    .ccaas-scene {
        padding: 3rem 3.25rem calc(var(--motion-caption-reserve, 2.75rem) + 1.5rem);
    }

    .ccaas-motion-stage .ccaas-scene > * {
        max-width: min(22rem, 82%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ccaas-how-section { content-visibility: visible; }
    .ccaas-scene { transition: none !important; transform: none !important; }
    .ccaas-motion-stage__progress-fill { transition: none !important; }
    .ccaas-hero-3d__orbit-spin {
        transform: translate(-50%, -50%) rotateX(72deg);
    }

    .ccaas-hero-3d__node {
        animation: none !important;
        transform: rotateZ(calc(var(--i) * 360deg / var(--orbit-count))) translateX(var(--orbit-r)) rotateZ(calc(var(--i) * -360deg / var(--orbit-count)));
    }

    .ccaas-hero-3d__node-face {
        transform: rotateX(-72deg);
    }

    .ccaas-hero-3d__cloud {
        animation: none !important;
        transform: translateX(-50%);
    }
    .ccaas-phone-ring,
    .ccaas-flow-arrow--active,
    .ccaas-pulse-line,
    .ccaas-queue-bar__fill,
    .ccaas-scene.is-active .ccaas-ivr-option {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
