/* ==========================================================
   DESKTOP HERO
========================================================== */
.stage {
    position: relative;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    color: #fff;
}
@media(max-width:959px) {
    .stage.desktop-only {
        display: none;
    }
}
.bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.bg-slide {
    position: absolute;
    inset: 0;
    background-position: center;
    opacity: 0;
    transition: opacity .8s ease;
}
.bg-slide.active {
    opacity: 1;
}
.bg-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            90deg,
            rgba(5, 7, 13, .88) 0%,
            rgba(5, 7, 13, .70) 28%,
            rgba(5, 7, 13, .35) 55%,
            rgba(5, 7, 13, 0) 100%
        ),
        linear-gradient(
            180deg,
            rgba(5, 7, 13, .10) 0%,
            rgba(5, 7, 13, .45) 60%,
            rgba(5, 7, 13, .92) 100%
        );
}
.content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 48px 64px 0;
    display: flex;
}
#panel {
    overflow-anchor: none;
}
.rail {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 14px;
}
.rail-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 64px 32px;
    box-sizing: border-box;
}

/* --- THUMBNAILS --- */
.thumb {
    position: relative;
    flex-shrink: 0;
    width: 180px;
    height: 102px;
    border-radius: 14px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    opacity: .65;
    border: 2px solid transparent;
    transform: scale(.96);
    transition:
        transform .55s cubic-bezier(.16, 1, .3, 1),
        opacity .45s ease,
        border-color .45s ease,
        box-shadow .55s ease;
    transform-origin: center;
}
.rail:hover .thumb {
    transform: scale(.92);
    opacity: .45;
}
.thumb.active {
    transform: scale(1);
    opacity: 1;
    border-color: #2f8bff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}
.rail:hover .thumb.active {
    transform: scale(.97);
    opacity: .75;
}
.rail:hover .thumb:hover {
    transform: scale(1.06);
    opacity: 1;
    border-color: #2f8bff;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(255, 255, 255, .08);
    z-index: 10;
}

/* hover title reveal on each thumb */
.thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 65%);
    display: flex;
    align-items: flex-end;
    padding: 10px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}
.thumb-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transform: translateY(8px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.thumb:hover .thumb-overlay,
.thumb.active .thumb-overlay {
    opacity: 1;
}
.thumb:hover .thumb-title,
.thumb.active .thumb-title {
    transform: translateY(0);
}

.progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, .2);
    overflow: hidden;
    z-index: 2; /* stays above thumb-overlay */
}
.progress::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
}
.progress.run::after {
    animation: railProgress 6s linear forwards;
}
@keyframes railProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ==========================================================
   MOBILE CARD STACK
========================================================== */
.mobile-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 32px 0 32px 16px;
    box-sizing: border-box;
}
@media (max-width: 959px) {
    .mobile-stage {
        display: flex;
    }
}

.card-viewport {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
}

.card {
    position: absolute;
    left: 50%;
    top: 0;
    width: calc(100% - 56px);
    height: 100%;
    border-radius: 22px;
    overflow: hidden;
    background: #151515;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .45);
    will-change: transform, opacity, filter;
    transition: transform .5s cubic-bezier(.22, 1, .36, 1), filter .5s ease, opacity .4s ease;
}

.card.dragging {
    transition: none;
}

.dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
.dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    transition: background .3s ease, transform .3s ease;
}
.dots i.active {
    background: #fff;
    transform: scale(1.3);
}

.hint {
    margin-top: 14px;
    font-size: 12px;
    color: #9aa4b8;
    text-align: center;
}

/* ---------------- card content, scoped to mobile ---------------- */
@media (max-width: 959px) {
    .card .service-card {
        width: 100%;
        height: 100%;
        background: #181818;
        border-radius: 0;
        overflow: visible;
    }

    .card .panel {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .card .service-bg {
        flex: 1;
        position: relative;
        overflow: hidden;
    }

    .card .service-img {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
    }

    .card .service-bg::after {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(
                to top,
                rgba(0, 0, 0, .98) 0%,
                rgba(0, 0, 0, .82) 22%,
                rgba(0, 0, 0, .35) 48%,
                rgba(0, 0, 0, .05) 72%,
                transparent 100%
            );
    }

    .card .info {
        z-index: 3;
        padding: 24px;
    }

    .card .info .m-txt {
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .card .info > div:last-child {
        color: #d5d5d5;
        line-height: 1.4;
        font-size: 14px;
    }

    .card .keywords {
        margin-top: 10px;
        font-size: 13px;
        font-weight: 600;
        color: rgba(255, 255, 255, .85);
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card .keywords .sep {
        color: rgba(255, 255, 255, .4);
        font-weight: 400;
    }

    .card .banner {
        max-width: none;
        width: 100%;
        border-radius: 0;
        background: #151515;
        padding: 16px;
        border-top: 1px solid rgba(255, 255, 255, .08);
        flex-shrink: 0;
    }

    .card .app-icon {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================
   AALAM SERVICE CARD
========================================================== */
.hero-service,
.service-card {
    width: 760px;
    overflow: hidden;
}

.service-card .panel {
    width: 100%;
    cursor: pointer;
}

.service-bg {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.service-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform .6s;
}

.service-card:hover .service-img {
    transform: scale(1.05);
}

.info {
    position: relative;
    z-index: 2;
    width: 100%;
    color: #fff;
    padding: 28px;
}

.info .m-txt {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 14px;
}

.info>div:last-child {
    font-size: 15px;
    line-height: 1.7;
    color: #d6dbe6;
    max-width: 460px;
}

/* footer */
.banner {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--clr-bg-l2);
    border-radius: 18px;
    max-width: 400px;
}

.app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

/* ==========================================================
   DESKTOP HERO KEYWORDS (Hotstar Style)
========================================================== */
@media (min-width: 960px) {
    .hero-service {
        overflow: visible;
    }

    .hero-service .service-bg {
        overflow: visible;
    }

    .hero-service .banner {
        background: transparent !important;
        max-width: 460px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px;
    }

    .hero-service .banner > span {
        width: 100%;
    }

    .hero-service .keywords {
        width: calc(100vw - 128px);
        max-width: none;
        font-size: 16px;
        font-weight: 700;
        color: #ffffff;
        margin-top: 18px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        letter-spacing: 0.3px;
    }

    .hero-service .keywords .sep {
        color: rgba(255, 255, 255, 0.4);
        font-weight: 400;
    }
}
