.portfolio-section {
    width: 100%;
    padding: 80px 0 60px;
    overflow: hidden;
    background-color: var(--theme-bg);
    transition: background-color 0.3s ease;
}

.portfolio-carousel {
    position: relative;
    width: 100%;
}

.portfolio-carousel__stage {
    position: relative;
    width: 100%;
}

.embla__viewport {
    width: 100%;
    overflow: hidden;
}

.embla__container {
    display: flex;
    margin: 0 0 0 -8px;
    padding: 0;
    list-style: none;
    touch-action: pan-y pinch-zoom;
}

.embla__slide {
    flex: 0 0 20%;
    min-width: 0;
    padding-left: 8px;
    box-sizing: border-box;
}

/* ================================
   Card
   ================================ */
.portfolio-card {
    list-style: none;
}

.portfolio-card__link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #1a1a1a;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    outline: none;
}

[data-theme="light"] .portfolio-card__link {
    background-color: #d0d0d0;
}

.portfolio-card__link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.portfolio-card__link:hover {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.portfolio-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.portfolio-card__link:hover .portfolio-card__img {
    transform: scale(1.04);
    filter: grayscale(0);
}

.portfolio-card__title {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ================================
   Next button
   ================================ */
.portfolio-carousel__next {
    position: absolute;
    top: 50%;
    right: var(--space-tablet);
    z-index: 10;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .portfolio-carousel__next {
    background-color: #090909;
    color: #fff;
}

.portfolio-carousel__next:hover {
    background-color: var(--theme-hero-bg);
    transform: translateY(-50%) scale(1.05);
}

.portfolio-carousel__next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.portfolio-carousel__next-icon {
    width: 28px;
    height: 28px;
}

/* ================================
   Dots
   ================================ */
.portfolio-carousel__dots {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 0 16px;
}

.embla__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    background-color: #2a2a2a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

[data-theme="light"] .embla__dot {
    background-color: #ccc;
}

.embla__dot:hover {
    background-color: #4a4a4a;
}

[data-theme="light"] .embla__dot:hover {
    background-color: #888;
}

.embla__dot--selected {
    background-color: #fff;
    transform: scale(1.1);
}

[data-theme="light"] .embla__dot--selected {
    background-color: #090909;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 1199.98px) {
    .embla__slide {
        flex: 0 0 25%;
    }
}

@media (max-width: 991.98px) {
    .embla__slide {
        flex: 0 0 33.3333%;
    }
    .portfolio-carousel__next {
        width: 60px;
        height: 60px;
        right: 24px;
    }
}

@media (max-width: 767.98px) {
    .portfolio-section {
        padding: 30px 0 40px;
    }
    .embla__container {
        margin-left: -6px;
    }
    .embla__slide {
        flex: 0 0 60%;
        padding-left: 6px;
    }
    .portfolio-carousel__next {
        width: 52px;
        height: 52px;
        right: 16px;
    }
    .portfolio-card__title {
        left: 14px;
        right: 14px;
        bottom: 14px;
        font-size: 0.85rem;
    }
    .portfolio-carousel__dots {
        margin-top: 18px;
    }
}

@media (max-width: 479.98px) {
    .embla__slide {
        flex: 0 0 75%;
    }
}