.home-portfolio {
    padding: 72px 0;
    overflow: hidden;
    position: relative;
}

.home-portfolio .container {
    position: relative;
    z-index: 2;
}

.home-portfolio .section-head {
    margin-bottom: 34px;
    align-items: center;
}

.home-portfolio .section-head h2 {
    margin-top: 22px;
    margin-bottom: 22px;
}

.home-portfolio .section-head p {
    max-width: 760px;
}

.home-portfolio .section-head__actions {
    display: flex;
    align-items: center;
}

.portfolio-gallery-full {
    width: 83%;
    margin: 0 auto;
    padding: 0 18px;
    position: relative;
}

.portfolio-gallery-full:has(.portfolio-gallery-track) {
    width: 100%;
}

.portfolio-gallery-full:has(.portfolio-gallery-empty) {
    width: 83%;
}

.portfolio-gallery-fade {
    display: none;
}

.portfolio-gallery-track {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    transition: grid-template-columns 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-gallery-item {
    min-width: 0;
    transition:
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.65s ease,
        filter 0.65s ease;
}

.portfolio-gallery-card {
    position: relative;
    display: block;
    height: 420px;
    border-radius: 26px;
    overflow: hidden;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.portfolio-gallery-card__bg,
.portfolio-gallery-card__overlay,
.portfolio-gallery-card__content {
    position: absolute;
    inset: 0;
}

.portfolio-gallery-card__bg {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition:
        transform 1.15s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.95s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.65s ease;
    filter: grayscale(1) contrast(1.04) brightness(0.82);
}

.portfolio-gallery-card__overlay {
    background:
        linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.18) 34%, rgba(0,0,0,0.88) 100%);
    opacity: 0.9;
    transition: opacity 0.55s ease;
}

.portfolio-gallery-card__content {
    inset: auto 0 0 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    z-index: 2;
    transform: translateY(18px);
    opacity: 0;
    transition:
        transform 0.45s ease,
        opacity 0.45s ease;
}

.portfolio-gallery-card__tag {
    min-height: 34px;
    padding: 0 14px;
    width: fit-content;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: rgba(182, 212, 51, 0.14);
    border: 1px solid rgba(182, 212, 51, 0.14);
    color: #d9f26b;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.portfolio-gallery-card h3 {
    color: #ffffff;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.portfolio-gallery-item.is-active .portfolio-gallery-card__content,
.portfolio-gallery-item:hover .portfolio-gallery-card__content {
    transform: translateY(0);
    opacity: 1;
}

.portfolio-gallery-item.is-active .portfolio-gallery-card__bg,
.portfolio-gallery-item:hover .portfolio-gallery-card__bg {
    transform: scale(1.04);
    filter: grayscale(0) contrast(1) brightness(1);
}

.portfolio-gallery-item.is-active .portfolio-gallery-card__overlay,
.portfolio-gallery-item:hover .portfolio-gallery-card__overlay {
    opacity: 0.72;
}

.portfolio-gallery-track.is-hovering .portfolio-gallery-item:not(.is-active) {
    opacity: 0.97;
}

.portfolio-gallery-track.is-hovering .portfolio-gallery-item:not(.is-active) .portfolio-gallery-card__bg {
    filter: grayscale(1) contrast(1.02) brightness(0.74);
}

.portfolio-gallery-empty {
    min-height: 260px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 26px;
    padding: 34px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    background: transparent;
    box-shadow: none;
}

.portfolio-gallery-empty__icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.42);
    font-size: 1.2rem;
    background: transparent;
}

.portfolio-gallery-empty__content {
    display: grid;
    gap: 10px;
    max-width: 560px;
}

.portfolio-gallery-empty__content h3 {
    margin: 0;
    color: #f5f5f5;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.portfolio-gallery-empty__content p {
    margin: 0;
    color: rgba(255,255,255,0.64);
    font-size: 1rem;
    line-height: 1.7;
}

.portfolio-gallery-card--01 .portfolio-gallery-card__bg {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08)),
        url('https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80');
}

.portfolio-gallery-card--02 .portfolio-gallery-card__bg {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08)),
        url('https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=1200&q=80');
}

.portfolio-gallery-card--03 .portfolio-gallery-card__bg {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08)),
        url('https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=1400&q=80');
}

.portfolio-gallery-card--04 .portfolio-gallery-card__bg {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08)),
        url('https://images.unsplash.com/photo-1522542550221-31fd19575a2d?auto=format&fit=crop&w=1400&q=80');
}

.portfolio-gallery-card--05 .portfolio-gallery-card__bg {
    background-image:
        linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.08)),
        url('https://images.unsplash.com/photo-1496171367470-9ed9a91ea931?auto=format&fit=crop&w=1400&q=80');
}

@media (max-width: 991px) {
    .home-portfolio .section-head {
        text-align: center;
        justify-items: center;
        margin-bottom: 34px;
    }

    .home-portfolio .section-head > div {
        display: grid;
        justify-items: center;
        width: 100%;
    }

    .home-portfolio .section-head h2 {
        margin-top: 22px;
        margin-bottom: 20px;
        text-align: center;
    }

    .home-portfolio .section-head p {
        max-width: 100%;
        margin-inline: auto;
        text-align: center;
    }

    .home-portfolio .section-head__actions {
        width: 100%;
        justify-content: center;
        margin-top: 2px;
    }

    .home-portfolio .section-head__actions .btn {
        justify-content: center;
        text-align: center;
    }

    .portfolio-gallery-full,
    .portfolio-gallery-full:has(.portfolio-gallery-track),
    .portfolio-gallery-full:has(.portfolio-gallery-empty) {
        width: 80%;
        padding: 0;
    }

    .portfolio-gallery-track {
        grid-template-columns: 1fr;
        gap: 18px;
        width: 100%;
    }

    .portfolio-gallery-item {
        width: 100%;
    }

    .portfolio-gallery-item.is-active .portfolio-gallery-card__content,
    .portfolio-gallery-item:hover .portfolio-gallery-card__content {
        opacity: 1;
        transform: translateY(0);
    }

    .portfolio-gallery-card {
        width: 100%;
        height: 360px;
    }

    .portfolio-gallery-card__bg {
        filter: grayscale(0.4) contrast(1.02) brightness(0.9);
    }

    .portfolio-gallery-empty {
        width: 100%;
        min-height: 220px;
        padding: 28px 20px;
    }

    .portfolio-gallery-empty__icon {
        width: 60px;
        height: 60px;
        border-radius: 18px;
    }
}

@media (max-width: 575px) {
    .portfolio-gallery-full,
    .portfolio-gallery-full:has(.portfolio-gallery-track),
    .portfolio-gallery-full:has(.portfolio-gallery-empty) {
        width: 80%;
    }

    .portfolio-gallery-card {
        height: 320px;
        border-radius: 24px;
    }

    .portfolio-gallery-card__content {
        padding: 22px;
    }

    .portfolio-gallery-card h3 {
        font-size: 1.28rem;
    }
}

@media (min-width: 992px) {
    .home-portfolio .section-head {
        grid-template-columns: 1.12fr auto;
    }

    .portfolio-gallery-full:has(.portfolio-gallery-track) {
        width: 100%;
        padding: 0 22px;
    }

    .portfolio-gallery-full:has(.portfolio-gallery-empty) {
        width: 83%;
        padding: 0 22px;
    }

    .portfolio-gallery-fade {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        width: 120px;
        z-index: 4;
        pointer-events: none;
    }

    .portfolio-gallery-fade--left {
        left: 0;
        background: linear-gradient(90deg, #050505 0%, rgba(5, 5, 5, 0) 100%);
    }

    .portfolio-gallery-fade--right {
        right: 0;
        background: linear-gradient(270deg, #050505 0%, rgba(5, 5, 5, 0) 100%);
    }

    .portfolio-gallery-track {
        grid-template-columns: 1.45fr 1fr 1fr 1fr 1fr;
    }

    .portfolio-gallery-track.active-1 {
        grid-template-columns: 1.82fr 0.92fr 0.92fr 0.92fr 0.92fr;
    }

    .portfolio-gallery-track.active-2 {
        grid-template-columns: 0.92fr 1.82fr 0.92fr 0.92fr 0.92fr;
    }

    .portfolio-gallery-track.active-3 {
        grid-template-columns: 0.92fr 0.92fr 1.82fr 0.92fr 0.92fr;
    }

    .portfolio-gallery-track.active-4 {
        grid-template-columns: 0.92fr 0.92fr 0.92fr 1.82fr 0.92fr;
    }

    .portfolio-gallery-track.active-5 {
        grid-template-columns: 0.92fr 0.92fr 0.92fr 0.92fr 1.82fr;
    }

    .portfolio-gallery-card {
        height: 540px;
    }
}

@media (min-width: 1400px) {
    .portfolio-gallery-full:has(.portfolio-gallery-track) {
        width: 100%;
        padding: 0 28px;
    }

    .portfolio-gallery-full:has(.portfolio-gallery-empty) {
        width: 83%;
        padding: 0 28px;
    }

    .portfolio-gallery-fade {
        width: 150px;
    }

    .portfolio-gallery-card {
        height: 620px;
    }
}