.arch-home #portfolio .arch-track {
    --card-gap: clamp(10px, 1.25vw, 22px);
    gap: var(--card-gap);
    align-items: flex-start;
}

.arch-home #portfolio .arch-track .arch-project {
    flex: 0 0 calc((100% - 5 * var(--card-gap)) / 6);
    min-width: 0;
    margin: 0;
}

.arch-home #portfolio .arch-project .arch-frame {
    height: auto;
    aspect-ratio: 4 / 3;
}

.arch-home #portfolio .arch-caption {
    font-size: clamp(.8rem, 1.05vw, 1.05rem);
    gap: 6px;
    overflow-wrap: anywhere;
}

.arch-home #portfolio :is(.arch-project-category, .arch-project-service-label) {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 7px;
    font-size: .68rem;
    overflow-wrap: anywhere;
}



@media (max-width: 1099px) {
    .arch-home #portfolio .arch-track .arch-project {
        flex-basis: calc((100% - 2 * var(--card-gap)) / 3);
    }
}

@media (max-width: 600px) {
    .arch-home #portfolio .arch-track .arch-project {
        flex-basis: calc((100% - var(--card-gap)) / 2);
    }
}

/* Portfolio: six card shapes */
.arch-home #portfolio .arch-track .arch-project .arch-frame {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    clip-path: none;
}

.arch-home #portfolio .arch-project:nth-child(6n + 1) .arch-frame {
    clip-path: polygon(0 0, 89% 0, 100% 15%, 100% 100%, 0 100%);
}

.arch-home #portfolio .arch-project:nth-child(6n + 2) .arch-frame {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%, 0 84%);
}

.arch-home #portfolio .arch-project:nth-child(6n + 3) .arch-frame {
    border-radius: 0 26% 0 0 / 0 34% 0 0;
}

.arch-home #portfolio .arch-project:nth-child(6n + 4) .arch-frame {
    border-radius: 0 0 0 26% / 0 0 0 34%;
}

.arch-home #portfolio .arch-project:nth-child(6n + 5) .arch-frame {
    clip-path: polygon(0 0, 90% 0, 100% 14%, 100% 100%, 10% 100%, 0 86%);
}

.arch-home #portfolio .arch-project:nth-child(6n + 6) .arch-frame {
    border-radius: 50% 50% 0 0 / 36% 36% 0 0;
}

.arch-home #portfolio .arch-project:nth-child(6n + 6)
:is(.arch-project-category, .arch-project-service-label) {
    top: 13%;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 70%;
    text-align: center;
}

/* Arch.az portfolio two rows */
@media (min-width: 761px) {
    .arch-home #portfolio .arch-track {
        --card-gap: clamp(14px, 1.6vw, 24px);
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, auto);
        grid-auto-columns: calc((100% - var(--card-gap)) / 2);
        align-items: start;
        align-content: start;
        gap: var(--card-gap);
    }

    .arch-home #portfolio .arch-track .arch-project {
        display: block;
        min-width: 0;
        margin: 0;
        scroll-snap-align: start;
    }

    .arch-home #portfolio .arch-track .arch-project .arch-frame {
        height: clamp(160px, 16vw, 250px);
        aspect-ratio: auto;
    }

    .arch-home #portfolio .arch-caption {
        padding-block: 10px 4px;
    }
}

@media (min-width: 1100px) {
    .arch-home #portfolio .arch-track {
        --available: calc(100% - 2 * var(--card-gap));
        grid-auto-columns:
            calc(var(--available) * .30)
            calc(var(--available) * .40)
            calc(var(--available) * .30);
    }
}

.arch-home #portfolio .arch-track:focus-visible {
    outline: 2px solid #deb991;
    outline-offset: 5px;
}

/* Arch.az: architectural portfolio frames */
.arch-home #portfolio .arch-track .arch-project .arch-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--frame-radius, 0);
    clip-path: var(--frame-cut, none);
}

.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 1) {
    --frame-cut: polygon(0 16%, 38% 0, 100% 0, 100% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 2) {
    --frame-radius: 50% 50% 0 0 / 36% 36% 0 0;
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 3) {
    --frame-cut: polygon(0 0, 86% 0, 86% 13%, 100% 13%, 100% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 4) {
    --frame-radius: 0 0 28% 0 / 0 0 38% 0;
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 5) {
    --frame-cut: polygon(0 0, 100% 0, 100% 79%, 82% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 6) {
    --frame-cut: polygon(0 0, 100% 0, 100% 100%, 17% 100%, 0 77%);
}

.arch-home #portfolio .arch-track .arch-project
:is(.arch-project-category, .arch-project-service-label) {
    top: auto;
    bottom: 12px;
    left: 12px;
    transform: none;
    width: max-content;
    max-width: calc(100% - 32px);
    text-align: left;
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 6)
:is(.arch-project-category, .arch-project-service-label) {
    left: 20%;
    max-width: 72%;
}

@media (min-width: 761px) {
    .arch-home #portfolio .arch-track .arch-project .arch-frame {
        height: clamp(185px, 17vw, 315px);
    }
}

/* Arch.az: asymmetric portfolio composition */
@media (min-width: 1100px) {
    .arch-home #portfolio .arch-track {
        --available: calc(100% - 2 * var(--card-gap));
        grid-auto-columns:
            calc(var(--available) * .37)
            calc(var(--available) * .27)
            calc(var(--available) * .36);
        grid-template-rows: auto auto;
        row-gap: clamp(16px, 2vw, 28px);
    }

    .arch-home #portfolio .arch-track .arch-project {
        --photo-height: clamp(205px, 15vw, 280px);
        width: var(--card-width, 100%);
        justify-self: var(--card-align, start);
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(odd) {
        align-self: end;
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 1),
    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 4),
    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 6) {
        --photo-height: clamp(270px, 20vw, 370px);
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 2) {
        --card-width: 82%;
        --card-align: end;
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 5) {
        --card-width: 88%;
    }

    .arch-home #portfolio .arch-track .arch-project .arch-frame {
        height: var(--photo-height);
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 2) .arch-frame {
        border-radius: 50% 50% 0 0 / 52% 52% 0 0;
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(6n + 4) .arch-frame {
        border-radius: 0;
        clip-path: polygon(0 0, 100% 0, 100% 88%, 84% 100%, 0 100%);
    }
}

/* Arch.az: angled portfolio frames */
.arch-home #portfolio .arch-track .arch-project:nth-child(n) .arch-frame {
    border-radius: 0;
    clip-path: var(--portfolio-angle);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 1) {
    --portfolio-angle: polygon(0 0, 91% 0, 100% 17%, 100% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 2) {
    --portfolio-angle: polygon(8% 0, 100% 0, 100% 100%, 0 100%, 0 17%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 3) {
    --portfolio-angle: polygon(0 0, 100% 0, 100% 82%, 90% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 4) {
    --portfolio-angle: polygon(0 12%, 100% 0, 100% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 5) {
    --portfolio-angle: polygon(7% 0, 100% 0, 100% 86%, 92% 100%, 0 100%, 0 15%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(6n + 6) {
    --portfolio-angle: polygon(0 0, 94% 0, 100% 13%, 100% 87%, 94% 100%, 0 100%);
}
.arch-home #portfolio .arch-track .arch-project:nth-child(n)
:is(.arch-project-category, .arch-project-service-label) {
    top: auto;
    bottom: 10px;
    left: 10px;
    transform: none;
    max-width: calc(100% - 30px);
}

/* Arch.az: straighten portfolio photos */
.arch-home #portfolio .arch-track .arch-project:nth-child(n) .arch-frame {
    border-radius: 0;
    clip-path: polygon(
        var(--frame-top-left, 0 0),
        var(--frame-top-right, 100% 0),
        var(--frame-right-top, 100% 0),
        var(--frame-right-bottom, 100% 100%),
        var(--frame-bottom-right, 100% 100%),
        0 100%,
        var(--frame-left-top, 0 0)
    );
    transition: clip-path .55s cubic-bezier(.22, 1, .36, 1);
}
.arch-home #portfolio .arch-project:nth-child(6n + 1) {
    --frame-top-right: 91% 0;
    --frame-right-top: 100% 17%;
}
.arch-home #portfolio .arch-project:nth-child(6n + 2) {
    --frame-top-left: 8% 0;
    --frame-left-top: 0 17%;
}
.arch-home #portfolio .arch-project:nth-child(6n + 3) {
    --frame-right-bottom: 100% 82%;
    --frame-bottom-right: 90% 100%;
}
.arch-home #portfolio .arch-project:nth-child(6n + 4) {
    --frame-top-left: 0 12%;
    --frame-left-top: 0 12%;
}
.arch-home #portfolio .arch-project:nth-child(6n + 5) {
    --frame-top-left: 7% 0;
    --frame-left-top: 0 15%;
    --frame-right-bottom: 100% 86%;
    --frame-bottom-right: 92% 100%;
}
.arch-home #portfolio .arch-project:nth-child(6n + 6) {
    --frame-top-right: 94% 0;
    --frame-right-top: 100% 13%;
    --frame-right-bottom: 100% 87%;
    --frame-bottom-right: 94% 100%;
}
.arch-home #portfolio .arch-track .arch-project:nth-child(n):is(:hover, :focus-visible) .arch-frame {
    clip-path: polygon(0 0, 100% 0, 100% 0, 100% 100%, 100% 100%, 0 100%, 0 0);
}
.arch-home #portfolio .arch-project:hover .arch-frame img {
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .arch-home #portfolio .arch-track .arch-project:nth-child(n) .arch-frame {
        transition: none;
    }
}

/* Arch.az: aligned portfolio cards */
.arch-home #portfolio .arch-track .arch-project:nth-child(n) .arch-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
}

@media (min-width: 761px) {
    .arch-home #portfolio .arch-track {
        grid-auto-columns: calc((100% - var(--card-gap)) / 2);
        grid-template-rows: repeat(2, auto);
        align-items: start;
    }

    .arch-home #portfolio .arch-track .arch-project:nth-child(n) {
        width: 100%;
        margin: 0;
        align-self: start;
        justify-self: stretch;
    }
}

@media (min-width: 1100px) {
    .arch-home #portfolio .arch-track {
        grid-auto-columns: calc((100% - 2 * var(--card-gap)) / 3);
    }
}
