/* ==========================================================================
   Yugan slider — dependency-free carousel used for project + client cards.
   Markup contract:
     [data-slider]            root, carries data-autoplay / data-rows / data-per-view*
       [data-slider-viewport] clipping window
         [data-slider-track]  CSS grid, columns flow horizontally
       [data-slider-prev/next] optional buttons
       [data-slider-dots]     optional dot container (filled by JS)
   ========================================================================== */

.ys-slider {
    position: relative;
    --ys-gap: 1.5rem;
    --ys-per-view: 1;
    --ys-rows: 1;
}

@media (max-width: 639px) {
    .ys-slider {
        --ys-gap: 1rem;
    }
}

/* Padding keeps card hover-lift and glow from being clipped; the matching
   negative margin stops that padding from shifting the section layout. */
.ys-slider__viewport {
    overflow: hidden;
    padding: 14px 2px 30px;
    margin: -14px -2px -30px;
    touch-action: pan-y;
}

.ys-slider__track {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--ys-rows), auto);
    grid-auto-columns: calc((100% - (var(--ys-per-view) - 1) * var(--ys-gap)) / var(--ys-per-view));
    gap: var(--ys-gap);
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* will-change is scoped to the drag, where transforms update every frame.
   Leaving it on permanently would pin a compositor layer holding every card
   image for the life of the page. */
.ys-slider__track.is-dragging {
    transition: none;
    will-change: transform;
}

/* Grid items stretch so both rows of a double-row slider line up. */
.ys-slider__track > * {
    min-width: 0;
    height: 100%;
}

/* ── Controls ─────────────────────────────────────────────────────────── */

.ys-slider__controls {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Nothing to scroll at this breakpoint — hide the chrome entirely. */
.ys-slider--static .ys-slider__controls {
    display: none;
}

.ys-slider__btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(168, 85, 247, 0.35);
    background: rgba(124, 58, 237, 0.12);
    color: #C4B5FD;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease,
                transform 0.3s ease, box-shadow 0.3s ease;
}

.ys-slider__btn:hover {
    border-color: #A855F7;
    background: rgba(168, 85, 247, 0.22);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(168, 85, 247, 0.28);
}

.ys-slider__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35);
}

.ys-slider__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 55%;
}

.ys-slider__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.3);
    cursor: pointer;
    transition: width 0.35s ease, background 0.35s ease;
}

.ys-slider__dot:hover {
    background: rgba(168, 85, 247, 0.6);
}

.ys-slider__dot.is-active {
    width: 26px;
    background: linear-gradient(90deg, #7C3AED, #A855F7);
}

.ys-slider__dot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35);
}

@media (max-width: 639px) {
    .ys-slider__btn {
        width: 40px;
        height: 40px;
    }

    .ys-slider__controls {
        margin-top: 1.5rem;
        gap: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ys-slider__track {
        transition: none;
    }
}
