/* Scoped to .vs-gallery - Default background is radial gradient matching reference */
.et_pb_module.vs-gallery,
.vs-gallery {
    --bg: #06050e;
    --pink: #ff2fb9;
    --violet: #8b3dff;
    --muted: #c9c6e6;
    --cw: clamp(250px, min(calc(35vw - 40px), 82vh), 590px);
    --k: 1;
    --ch: calc(var(--cw) * 0.8);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(40px, 5vw, 72px) 0 clamp(32px, 4vw, 56px);
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #fff;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--bg);
    background-image: radial-gradient(120% 90% at 50% 20%, #0b0a1e 0%, var(--bg) 65%) !important;
}

.vs-gallery * {
    box-sizing: border-box;
}

/* Base background layer (disabled/hidden to let .vs-gallery background handle it directly) */
.vs-bg-base {
    display: none !important;
}

/* Custom Background Active: Hide ambient glow ONLY when a background image, custom gradient, or video is present.
   (When only background color is set, the glow and spheres remain, and the color updates dynamically via --bg) */
.vs-gallery.vs-has-custom-media .vs-glow,
.vs-gallery.vs-has-bg-image .vs-glow,
.vs-gallery[style*="background-image"]:not([style*="radial-gradient"]) .vs-glow,
.vs-gallery:has(.et_pb_section_video_bg) .vs-glow,
.vs-gallery:has(.et_parallax_bg) .vs-glow,
.vs-gallery:has(.et_pb_background_pattern) .vs-glow,
.vs-gallery:has(.et_pb_background_mask) .vs-glow {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Divi native background elements (video, parallax, pattern, mask) */
.vs-gallery .et_pb_section_video_bg,
.vs-gallery .et_parallax_bg,
.vs-gallery .et_pb_background_pattern,
.vs-gallery .et_pb_background_mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.vs-gallery .et_pb_section_video_bg video,
.vs-gallery .et_pb_section_video_bg iframe,
.vs-gallery .et_pb_section_video_bg .mejs-container {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}

/* When custom video background is present, make sure it is not hidden by sphere glows */
.vs-gallery.vs-has-video,
.vs-gallery:has(.et_pb_section_video_bg) {
    background-image: none !important;
}

.vs-gallery.vs-has-video .vs-bg,
.vs-gallery:has(.et_pb_section_video_bg video) .vs-bg,
.vs-gallery:has(.et_pb_section_video_bg) .vs-bg {
    display: none !important;
}

/* ===== background: same look as the reference – dark base + rim-lit spheres + soft glows (no dots / lines) ===== */
.vs-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.vs-head,
.vs-stage,
.vs-thumbs,
.vs-time {
    position: relative;
    z-index: 3;
}

.vs-sph {
    position: absolute;
    border-radius: 50%;
    opacity: 0.42;
    z-index: 2;
    will-change: transform, filter;
    animation:
        vsFloat var(--t, 11s) ease-in-out infinite alternate,
        vsRim calc(var(--t, 11s) * 0.8) ease-in-out infinite alternate;
}

@keyframes vsFloat {
    from {
        transform: translate3d(0, -10px, 0);
    }
    to {
        transform: translate3d(0, 12px, 0);
    }
}

@keyframes vsRim {
    from {
        filter: brightness(0.92);
    }
    to {
        filter: brightness(1.18);
    }
}

/* top-left pink sphere, lit on its lower-right edge */
.vs-sph.a {
    --t: 12s;
    width: clamp(150px, 18vw, 270px);
    aspect-ratio: 1;
    left: calc(clamp(150px, 18vw, 270px) / -1.9);
    top: 12%;
    background: radial-gradient(circle at 28% 22%, #0c0620 0%, #2a0b4d 45%, #8a1a8f 80%, #e02bb0 100%);
    box-shadow:
        inset -14px -16px 34px rgba(255, 63, 196, 0.75),
        0 0 60px rgba(255, 47, 185, 0.22);
}

/* right violet sphere, lit on its left edge */
.vs-sph.b {
    --t: 14s;
    width: clamp(130px, 15vw, 230px);
    aspect-ratio: 1;
    right: calc(clamp(130px, 15vw, 230px) / -1.7);
    top: 16%;
    animation-delay: -4s;
    background: radial-gradient(circle at 78% 62%, #0d0630 0%, #2a1b8f 55%, #5a37e0 100%);
    box-shadow:
        inset 14px 8px 34px rgba(139, 90, 255, 0.85),
        0 0 60px rgba(100, 60, 255, 0.25);
}

/* bottom-left magenta sphere, lit on its upper-right edge */
.vs-sph.c {
    --t: 13s;
    width: clamp(170px, 19vw, 290px);
    aspect-ratio: 1;
    left: calc(clamp(170px, 19vw, 290px) / -2);
    bottom: -3%;
    animation-delay: -7s;
    background: radial-gradient(circle at 20% 80%, #1a0630 0%, #6d1280 50%, #c4189f 85%, #ff2fb9 100%);
    box-shadow:
        inset -16px 16px 40px rgba(255, 47, 185, 0.8),
        0 0 70px rgba(255, 47, 185, 0.25);
}

/* bottom-right deep purple sphere, lit on its upper-left edge */
.vs-sph.d {
    --t: 15s;
    width: clamp(220px, 28vw, 430px);
    aspect-ratio: 1;
    right: calc(clamp(220px, 28vw, 430px) / -3.2);
    bottom: calc(clamp(220px, 28vw, 430px) / -2.2);
    animation-delay: -2s;
    background: radial-gradient(circle at 75% 80%, #07041a 0%, #150c4a 55%, #3a22b0 100%);
    box-shadow:
        inset 18px 18px 60px rgba(120, 70, 255, 0.55),
        0 0 80px rgba(80, 50, 220, 0.25);
}

/* soft top-right glow */
.vs-glow {
    position: absolute;
    right: -6%;
    top: -18%;
    width: 46%;
    height: 42%;
    border-radius: 50%;
    background: #6a1fa8;
    filter: blur(90px);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
    animation: vsGlow 9s ease-in-out infinite alternate;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

@keyframes vsGlow {
    from {
        opacity: 0.2;
    }
    to {
        opacity: 0.34;
    }
}

/* ===== heading ===== */
.vs-head {
    padding: 0 20px;
    max-width: 760px;
    margin: 0 auto;
}

.vs-badge {
    display: inline-block;
    padding: 9px 26px;
    border-radius: 99px;
    font-size: 12px;
    letter-spacing: 0.22em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.vs-title {
    margin: 18px 0 14px;
    font-size: clamp(38px, 6.4vw, 76px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.vs-title .g {
    display: inline-block;
    background: linear-gradient(90deg, #d84bff, var(--pink), #d84bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: vsShine 5s linear infinite;
    will-change: background-position, filter;
}

@keyframes vsShine {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: -200% 50%;
    }
}

@keyframes vsHueShift {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

@keyframes vsTextPulse {
    0% {
        filter: brightness(0.9) drop-shadow(0 0 2px rgba(255, 47, 185, 0.2));
        opacity: 0.88;
    }
    100% {
        filter: brightness(1.25) drop-shadow(0 0 16px rgba(255, 47, 185, 0.6));
        opacity: 1;
    }
}

.vs-sub {
    margin: 0 auto;
    font-size: clamp(14px, 1.7vw, 18px);
    line-height: 1.7;
    color: var(--muted);
    max-width: 560px;
}

.vs-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.vs-gallery.is-in .vs-reveal,
.vs-gallery.vs-initialized .vs-reveal,
body.et-fb .vs-reveal,
.et-fb .vs-reveal,
.et-fb-root-ancestor .vs-reveal,
.d5-app .vs-reveal,
.d5-canvas .vs-reveal,
[data-vb-id] .vs-reveal,
.et_fb_preview_active .vs-reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* ===== 3D stage ===== */
.vs-stage {
    position: relative;
    height: calc(var(--ch) + 70px);
    margin-top: clamp(26px, 4vw, 48px);
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
}

.vs-stage.drag {
    cursor: grabbing;
}

.vs-track {
    position: absolute;
    inset: 0;
}

.vs-card {
    --x: 0;
    --z: 0px;
    --r: 0deg;
    --s: 1;
    --o: 1;
    --sh: 0;
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--cw);
    height: var(--ch);
    margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2);
    border-radius: var(--vs-card-radius, 18px);
    overflow: hidden;
    border: var(--vs-card-border-w, 1px) solid var(--vs-inactive-border, rgba(255, 255, 255, 0.16));
    background: var(--vs-card-bg, #14113a);
    transform: perspective(1500px) translateX(calc(var(--cw) * var(--x, 0) * var(--k, 1))) translateZ(var(--z, 0px)) rotateY(var(--r, 0deg)) scale(var(--s, 1));
    opacity: var(--o, 1);
    transition:
        transform 0.85s cubic-bezier(0.22, 0.8, 0.22, 1),
        opacity 0.6s,
        box-shadow 0.6s;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    cursor: pointer;
}

/* FIX: soft side shade is a plain overlay (replaces filter:brightness + the leaking ::after sweep) */
.vs-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: var(--vs-side-shade, #07061a);
    opacity: var(--sh);
    transition: opacity 0.6s;
}

.vs-card.active {
    border-color: var(--vs-active-border, rgba(255, 120, 220, 0.6));
    box-shadow:
        0 0 0 1px var(--vs-active-glow, rgba(255, 47, 185, 0.35)),
        0 0 70px var(--vs-active-glow, rgba(255, 47, 185, 0.3)),
        0 30px 80px rgba(0, 0, 0, 0.6);
    cursor: zoom-in;
}

.vs-card img {
    width: 100%;
    height: 100%;
    object-fit: var(--vs-card-fit, cover);
    display: block;
    transform: scale(1.08);
    transition: transform 6s ease-out;
}

.vs-card.active img {
    transform: scale(1);
}

.vs-card.hide {
    pointer-events: none;
    visibility: hidden;
    transition:
        transform 0.85s cubic-bezier(0.22, 0.8, 0.22, 1),
        opacity 0.6s,
        visibility 0s 0.6s;
}

/* FIX: shine lives in its own clipped layer and only exists on the active card */
.vs-shine {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    display: none;
    border-radius: inherit;
}

.vs-card.active .vs-shine {
    display: block;
}

.vs-shine::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 50%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-15deg);
    opacity: 0;
}

.vs-card.sweep .vs-shine::after {
    animation: vsSweep 1.1s ease 0.2s;
}

@keyframes vsSweep {
    0% {
        left: -60%;
        opacity: 1;
    }

    100% {
        left: 130%;
        opacity: 1;
    }
}

.vs-gallery.paused .vs-dash.on i,
.vs-gallery.paused .vs-arc {
    animation-play-state: paused;
}

/* arrows + timer ring */
.vs-arrow {
    position: absolute;
    top: 50%;
    z-index: 30;
    width: 62px;
    height: 62px;
    margin-top: -31px;
    border-radius: 50%;
    border: 1px solid var(--vs-arrow-border, rgba(255, 255, 255, 0.28));
    background: var(--vs-arrow-bg, rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(6px);
    color: var(--vs-arrow-color, #ffffff);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.vs-arrow:hover {
    background: var(--vs-arrow-hover-bg, #ff2fb9);
    border-color: var(--vs-arrow-hover-border, #ff2fb9);
    color: var(--vs-arrow-hover-color, #ffffff);
    box-shadow: 0 0 28px var(--vs-arrow-hover-glow, rgba(255, 47, 185, 0.6));
    transform: scale(1.08);
}

.vs-arrow.prev {
    left: clamp(8px, 1.8vw, 28px);
}

.vs-arrow.next {
    right: clamp(8px, 1.8vw, 28px);
}

.vs-arrow svg.i {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.vs-timer {
    position: absolute;
    inset: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.vs-timer circle {
    fill: none;
    stroke-width: 2.5;
}

.vs-arc {
    stroke: var(--pink);
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 0 4px var(--pink));
}

.vs-arc.run {
    animation: vsArc var(--dur, 5s) linear forwards;
}

@keyframes vsArc {
    to {
        stroke-dashoffset: 0;
    }
}

/* thumbs */
.vs-thumbs {
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    margin: clamp(12px, 1.6vw, 22px) auto 0;
    padding: 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}

.vs-thumbs::-webkit-scrollbar {
    display: none;
}

.vs-thumb {
    flex: none;
    width: clamp(58px, 7vw, 108px);
    aspect-ratio: 1.4;
    padding: 0;
    border-radius: var(--vs-thumb-radius, 9px);
    overflow: hidden;
    border: 1px solid var(--vs-thumb-inactive-border, rgba(255, 255, 255, 0.12));
    background: var(--vs-card-bg, #14113a);
    cursor: pointer;
    opacity: var(--vs-thumb-opacity, 0.6);
    transition: 0.4s;
    transform: scale(0.92);
}

.vs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: var(--vs-card-fit, cover);
    display: block;
}

.vs-thumb:first-child {
    margin-left: auto;
}

.vs-thumb:last-child {
    margin-right: auto;
}

.vs-thumb:hover {
    opacity: 1;
    transform: scale(0.98);
}

.vs-thumb.on {
    opacity: 1;
    transform: scale(1.06);
    border-color: var(--vs-thumb-active-border, var(--pink));
}

/* timeline: counter + segmented progress */
.vs-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px auto 0;
    padding: 0 20px;
    width: 100%;
    max-width: 640px;
}

.vs-count {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.06em;
    min-width: 72px;
    font-variant-numeric: tabular-nums;
}

.vs-count em {
    font-style: normal;
    color: var(--pink);
}

.vs-count span {
    color: var(--muted);
    font-weight: 500;
}

.vs-prog {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.vs-dash {
    flex: 1;
    min-width: 0;
    height: 5px;
    border-radius: 5px;
    background: var(--vs-prog-track, rgba(255, 255, 255, 0.18));
    position: relative;
    overflow: hidden;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.vs-dash:hover {
    background: var(--vs-prog-track-hover, rgba(255, 255, 255, 0.38));
}

.vs-dash i {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--violet), var(--pink));
    transform: scaleX(0);
    transform-origin: left;
    box-shadow: 0 0 12px var(--pink);
}

.vs-dash.done i {
    transform: scaleX(1);
}

.vs-dash.on i {
    animation: vsFill var(--dur, 5s) linear forwards;
}

@keyframes vsFill {
    to {
        transform: scaleX(1);
    }
}

/* lightbox */
.vs-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    background: rgba(5, 4, 18, 0.92);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
    padding: 4vw;
}

.vs-lb.open {
    opacity: 1;
    visibility: visible;
}

.vs-lb figure {
    margin: 0;
    max-width: min(1100px, 100%);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: center;
}

.vs-lb.open figure {
    transform: none;
}

.vs-lb img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 14px;
    box-shadow: 0 0 80px rgba(255, 47, 185, 0.3);
}

.vs-lb button {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.vs-lb button:hover {
    background: var(--pink);
}

.vs-gallery button:focus-visible,
.vs-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* small laptops / landscape tablets */
@media (max-width: 1200px) {
    .vs-title {
        font-size: clamp(36px, 5.6vw, 60px);
    }
}

/* tablets: arrows move under the stage, cards peek closer together */
@media (max-width: 820px) {
    .vs-gallery {
        --cw: min(66vw, 480px);
        --k: 0.78;
    }

    .vs-arrow {
        width: 46px;
        height: 46px;
        margin-top: -23px;
        top: auto;
        bottom: -6px;
    }

    .vs-arrow.prev {
        left: calc(50% - 120px);
    }

    .vs-arrow.next {
        right: calc(50% - 120px);
    }

    .vs-stage {
        height: calc(var(--ch) + 40px);
        margin-bottom: 34px;
    }

    .vs-thumbs {
        gap: 10px;
    }

    .vs-glow {
        width: 70%;
    }
}

/* phones */
@media (max-width: 480px) {
    .vs-gallery {
        --cw: 74vw;
        --k: 0.7;
        padding-top: 36px;
    }

    .vs-badge {
        font-size: 11px;
        padding: 8px 20px;
    }

    .vs-sub {
        font-size: 14px;
        line-height: 1.6;
    }

    .vs-time {
        gap: 10px;
    }

    .vs-count {
        min-width: 58px;
        font-size: 13px;
    }

    .vs-prog {
        gap: 5px;
    }

    .vs-thumb {
        width: 56px;
    }
}

/* short laptop screens (e.g. 1366x650 browser area) */
@media (min-width: 821px) and (max-height: 760px) {
    .vs-title {
        font-size: clamp(34px, 4.4vw, 56px);
        margin: 12px 0 8px;
    }

    .vs-sub {
        line-height: 1.5;
    }

    .vs-gallery {
        padding-top: 34px;
    }

    .vs-stage {
        margin-top: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .vs-gallery *,
    .vs-gallery *::after {
        animation: none !important;
        transition-duration: 0.01s !important;
    }

    .vs-reveal {
        opacity: 1;
        transform: none;
    }
}
