/* =========================================================
   SP FLOORING SERVICES
   PROJECT GALLERY
   ========================================================= */


/* =========================================================
   HERO
   ========================================================= */

.gallery-hero {
    position: relative;
    overflow: hidden;
    padding:
        calc(var(--header-height) + 76px) 0 72px;
    color: #fff;
    background: #070908;
}

.gallery-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .15;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px,
            transparent 1px),
        linear-gradient(90deg,
            rgba(255, 255, 255, .05) 1px,
            transparent 1px);
    background-size: 58px 58px;
    mask-image:
        linear-gradient(to bottom,
            #000,
            transparent 95%);
}

.gallery-hero::after {
    content: "";
    position: absolute;
    width: 720px;
    height: 720px;
    right: -350px;
    top: -320px;
    border-radius: 50%;
    background:
        radial-gradient(circle,
            rgba(146, 214, 50, .13),
            transparent 68%);
    pointer-events: none;
}

.gallery-hero__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns:
        minmax(0, .8fr) minmax(520px, 1.2fr);
    align-items: center;
    gap: clamp(55px, 7vw, 110px);
}

.gallery-hero__copy {
    max-width: 700px;
}

.gallery-hero__copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(58px, 7vw, 100px);
    line-height: .91;
    letter-spacing: -.065em;
}

.gallery-hero__copy h1 span {
    display: block;
    color: rgba(255, 255, 255, .3);
}

.gallery-hero__copy>p {
    max-width: 610px;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, .58);
    font-size: 17px;
    line-height: 1.8;
}

.gallery-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}


/* =========================================================
   HERO IMAGE COLLAGE
   ========================================================= */

.gallery-hero__media {
    min-width: 0;
    display: grid;
    grid-template-columns:
        minmax(0, 1.45fr) minmax(180px, .55fr);
    gap: 12px;
    height: 555px;
}

.gallery-hero__main,
.gallery-hero__small {
    position: relative;
    overflow: hidden;
    background: #111611;
    border: 1px solid rgba(255, 255, 255, .09);
}

.gallery-hero__main {
    border-radius: 28px;
}

.gallery-hero__side {
    min-width: 0;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.gallery-hero__small {
    border-radius: 20px;
}

.gallery-hero__main img,
.gallery-hero__small img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
        transform .7s cubic-bezier(.2, .7, .2, 1);
}

.gallery-hero__main:hover img,
.gallery-hero__small:hover img {
    transform: scale(1.025);
}

.gallery-hero__main::after,
.gallery-hero__small::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gallery-hero__main::after {
    background:
        linear-gradient(180deg,
            transparent 50%,
            rgba(4, 7, 4, .76));
}

.gallery-hero__small::after {
    background:
        linear-gradient(180deg,
            transparent 45%,
            rgba(4, 7, 4, .67));
}

.gallery-hero__image-caption {
    position: absolute;
    z-index: 2;
    left: 28px;
    right: 28px;
    bottom: 27px;
}

.gallery-hero__image-caption span,
.gallery-hero__image-caption strong {
    display: block;
}

.gallery-hero__image-caption span {
    margin-bottom: 6px;
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.gallery-hero__image-caption strong {
    max-width: 390px;
    color: #fff;
    font-size: 24px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.gallery-hero__small>span {
    position: absolute;
    z-index: 2;
    left: 18px;
    bottom: 17px;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}


/* =========================================================
   HERO FOOTER
   ========================================================= */

.gallery-hero__footer {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 140px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    border-left: 1px solid rgba(255, 255, 255, .1);
}

.gallery-hero__footer span {
    padding: 19px 22px;
    color: rgba(255, 255, 255, .46);
    border-right: 1px solid rgba(255, 255, 255, .1);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.gallery-hero__footer span:first-child {
    color: var(--green);
}


/* =========================================================
   GALLERY SECTION
   ========================================================= */

.gallery-section {
    overflow: hidden;
    background: #f5f6f2;
}

.gallery-section__header {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) minmax(320px, .55fr);
    gap: clamp(40px, 7vw, 100px);
    align-items: end;
}

.gallery-section .section-title {
    max-width: 780px;
    color: #151a14;
}

.gallery-section .section-title span {
    display: block;
    color: #8b9188;
}

.gallery-section__intro {
    justify-self: end;
}

.gallery-section__intro p {
    max-width: 520px;
    margin: 0;
    color: #666d63;
    font-size: 15px;
    line-height: 1.8;
}


/* =========================================================
   FILTERS
   ========================================================= */

.gallery-filters {
    display: flex;
    gap: 8px;
    margin: 48px 0 32px;
    padding-bottom: 4px;
}

.gallery-filter {
    appearance: none;
    min-width: 138px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px;
    color: #4f564d;
    background: #fff;
    border: 1px solid #dce1d9;
    border-radius: 100px;
    cursor: pointer;
    font: inherit;
    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.gallery-filter:hover {
    transform: translateY(-2px);
    border-color: rgba(146, 214, 50, .7);
}

.gallery-filter span {
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.gallery-filter small {
    color: #92988f;
    font-size: 9px;
    font-weight: 900;
}

.gallery-filter.is-active {
    color: #0d120c;
    background: var(--green);
    border-color: var(--green);
}

.gallery-filter.is-active small {
    color: rgba(13, 18, 12, .57);
}

.gallery-mobile-hint {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #838a80;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
}

.gallery-mobile-hint i {
    color: var(--green-dark);
    font-style: normal;
}


/* =========================================================
   PROJECT GRID
   ========================================================= */

.project-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 14px;
}

.project-card {
    appearance: none;
    position: relative;
    min-width: 0;
    min-height: 430px;
    display: block;
    overflow: hidden;
    padding: 0;
    color: #fff;
    background: #111511;
    border: 0;
    border-radius: 22px;
    cursor: pointer;
    text-align: left;
    font: inherit;
    isolation: isolate;
}

.project-card--wide {
    grid-column: span 7;
}

.project-card--standard {
    grid-column: span 5;
}

.project-card--half {
    grid-column: span 6;
}

.project-card__image {
    position: absolute;
    inset: 0;
}

.project-card__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
        transform .65s cubic-bezier(.2, .7, .2, 1),
        filter .35s ease;
}

.project-card:hover .project-card__image img,
.project-card:focus-visible .project-card__image img {
    transform: scale(1.035);
}

.project-card__overlay {
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(4, 7, 4, .02) 25%,
            rgba(4, 7, 4, .16) 52%,
            rgba(4, 7, 4, .88) 100%);
    pointer-events: none;
}

.project-card::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: inherit;
    pointer-events: none;
    transition: border-color .25s ease;
}

.project-card:hover::after,
.project-card:focus-visible::after {
    border-color: rgba(146, 214, 50, .45);
}

.project-card__content {
    position: absolute;
    z-index: 2;
    left: 27px;
    right: 27px;
    bottom: 25px;
}

.project-card__content>span {
    display: block;
    margin-bottom: 7px;
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.project-card__content h3 {
    max-width: 540px;
    margin: 0;
    color: #fff;
    font-size: clamp(23px, 2.4vw, 34px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.project-card__content small {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 800;
}

.project-card__content small i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #0c110b;
    background: var(--green);
    border-radius: 50%;
    font-style: normal;
    transition: transform .25s ease;
}

.project-card:hover .project-card__content small i {
    transform: rotate(45deg);
}

.project-card:focus {
    outline: none;
}

.project-card:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 4px;
}

.project-card[hidden] {
    display: none !important;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.gallery-empty {
    margin-top: 25px;
    padding: 45px;
    text-align: center;
    background: #fff;
    border: 1px solid #dfe4dc;
    border-radius: 20px;
}

.gallery-empty strong {
    display: block;
    color: #171c16;
    font-size: 20px;
}

.gallery-empty p {
    margin: 8px 0 0;
    color: #737a70;
}


/* =========================================================
   MESSAGE
   ========================================================= */

.gallery-message__grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) minmax(320px, .65fr);
    gap: clamp(50px, 8vw, 110px);
    align-items: end;
}

.gallery-message__grid .section-title {
    color: #fff;
}

.gallery-message__copy p {
    margin: 0;
    color: rgba(255, 255, 255, .54);
    font-size: 16px;
    line-height: 1.8;
}

.gallery-message__copy>a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.gallery-message__copy>a span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #0b1009;
    background: var(--green);
    border-radius: 50%;
    transition: transform .25s ease;
}

.gallery-message__copy>a:hover span {
    transform: rotate(45deg);
}


/* =========================================================
   CTA
   ========================================================= */

.cta-band__copy {
    max-width: 570px;
    margin: 15px 0 0;
    color: #666d63;
    font-size: 14px;
    line-height: 1.7;
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

body.gallery-lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .25s ease,
        visibility .25s ease;
}

.gallery-lightbox.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 2, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-lightbox__panel {
    position: relative;
    z-index: 2;
    width: min(calc(100% - 48px), 1500px);
    height: min(calc(100vh - 48px), 980px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 22px;
    color: #fff;
    background: #080b08;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 28px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
}

.gallery-lightbox__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 0 0 18px;
}

.gallery-lightbox__meta span,
.gallery-lightbox__meta strong {
    display: block;
}

.gallery-lightbox__meta span {
    margin-bottom: 5px;
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.gallery-lightbox__meta strong {
    color: #fff;
    font-size: 17px;
    letter-spacing: -.015em;
}

.gallery-lightbox__close {
    appearance: none;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    cursor: pointer;
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
    transition:
        color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.gallery-lightbox__close:hover {
    color: #0b1009;
    background: var(--green);
    transform: rotate(90deg);
}


/* =========================================================
   LIGHTBOX STAGE
   ========================================================= */

.gallery-lightbox__stage {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns:
        54px minmax(0, 1fr) 54px;
    gap: 15px;
    align-items: center;
}

.gallery-lightbox__image-wrap {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #050705;
    border-radius: 19px;
}

.gallery-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-lightbox__nav {
    appearance: none;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.gallery-lightbox__nav:hover {
    color: #0b1009;
    background: var(--green);
    border-color: var(--green);
    transform: scale(1.05);
}


/* =========================================================
   LIGHTBOX FOOTER
   ========================================================= */

.gallery-lightbox__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 2px 0;
}

.gallery-lightbox__counter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .68);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
}

.gallery-lightbox__counter i {
    color: rgba(255, 255, 255, .25);
    font-style: normal;
}

.gallery-lightbox__swipe {
    display: none;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, .44);
    font-size: 10px;
    font-weight: 800;
}

.gallery-lightbox__swipe span {
    color: var(--green);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .gallery-hero__grid {
        grid-template-columns:
            minmax(0, .9fr) minmax(440px, 1.1fr);
        gap: 45px;
    }

    .gallery-hero__media {
        height: 500px;
    }

    .project-card {
        min-height: 390px;
    }

}


@media (max-width: 900px) {

    .gallery-hero__grid {
        grid-template-columns: 1fr;
    }

    .gallery-hero__copy {
        max-width: 760px;
    }

    .gallery-hero__media {
        height: 560px;
    }

    .gallery-section__header,
    .gallery-message__grid {
        grid-template-columns: 1fr;
    }

    .gallery-section__intro {
        justify-self: start;
    }

    .project-card--wide,
    .project-card--standard,
    .project-card--half {
        grid-column: span 6;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .gallery-hero {
        padding:
            calc(var(--header-height) + 52px) 0 48px;
    }

    .gallery-hero__copy h1 {
        font-size: clamp(50px, 14vw, 70px);
    }

    .gallery-hero__copy>p {
        font-size: 16px;
    }

    .gallery-hero__actions {
        flex-direction: column;
    }

    .gallery-hero__actions .button {
        width: 100%;
        justify-content: center;
    }


    /* Hero images */

    .gallery-hero__media {
        grid-template-columns: 1fr;
        height: auto;
    }

    .gallery-hero__main {
        height: 470px;
        border-radius: 22px;
    }

    .gallery-hero__side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 190px;
    }

    .gallery-hero__small {
        border-radius: 17px;
    }

    .gallery-hero__footer {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 35px;
    }


    /* Filters become horizontally swipeable */

    .gallery-filters {
        width: calc(100vw - 24px);
        margin-left:
            calc((100vw - 100%) / -2 + 12px);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: inline proximity;
        padding:
            2px 12px 8px;
    }

    .gallery-filters::-webkit-scrollbar {
        display: none;
    }

    .gallery-filter {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .gallery-mobile-hint {
        display: flex;
    }


    /* Gallery */

    .project-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-card,
    .project-card--wide,
    .project-card--standard,
    .project-card--half {
        grid-column: 1 / -1;
        min-height: 410px;
        border-radius: 19px;
    }

    .project-card__content {
        left: 23px;
        right: 23px;
        bottom: 22px;
    }

    .project-card__content h3 {
        font-size: 27px;
    }


    /* Lightbox */

    .gallery-lightbox__panel {
        width: 100%;
        height: 100%;
        padding:
            max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
        border: 0;
        border-radius: 0;
    }

    .gallery-lightbox__top {
        padding:
            2px 4px 12px;
    }

    .gallery-lightbox__meta strong {
        font-size: 15px;
    }

    .gallery-lightbox__stage {
        position: relative;
        display: block;
        min-height: 0;
    }

    .gallery-lightbox__image-wrap {
        width: 100%;
        height: 100%;
        border-radius: 14px;
        touch-action: pan-y;
    }

    .gallery-lightbox__nav {
        position: absolute;
        z-index: 3;
        top: 50%;
        width: 42px;
        height: 42px;
        margin-top: -21px;
        background: rgba(8, 11, 8, .72);
        backdrop-filter: blur(7px);
    }

    .gallery-lightbox__nav--prev {
        left: 10px;
    }

    .gallery-lightbox__nav--next {
        right: 10px;
    }

    .gallery-lightbox__bottom {
        padding:
            13px 4px 0;
    }

    .gallery-lightbox__swipe {
        display: flex;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 520px) {

    .gallery-hero__copy h1 {
        font-size: 51px;
    }

    .gallery-hero__main {
        height: 410px;
    }

    .gallery-hero__side {
        grid-template-rows: 155px;
    }

    .gallery-hero__image-caption {
        left: 22px;
        right: 22px;
        bottom: 20px;
    }

    .gallery-hero__image-caption strong {
        font-size: 21px;
    }

    .gallery-hero__footer span {
        padding: 16px;
    }

    .gallery-filters {
        margin-top: 35px;
    }

    .gallery-filter {
        min-width: 126px;
        padding: 13px 15px;
    }

    .project-card,
    .project-card--wide,
    .project-card--standard,
    .project-card--half {
        min-height: 360px;
    }

    .project-card__content h3 {
        font-size: 24px;
    }

    .gallery-lightbox__close {
        width: 40px;
        height: 40px;
    }

    .gallery-lightbox__nav {
        width: 39px;
        height: 39px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 390px) {

    .gallery-hero__copy h1 {
        font-size: 45px;
    }

    .gallery-hero__main {
        height: 370px;
    }

    .gallery-hero__side {
        grid-template-rows: 135px;
    }

    .project-card,
    .project-card--wide,
    .project-card--standard,
    .project-card--half {
        min-height: 330px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

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

    .gallery-hero__main img,
    .gallery-hero__small img,
    .gallery-filter,
    .project-card__image img,
    .project-card::after,
    .project-card__content small i,
    .gallery-message__copy>a span,
    .gallery-lightbox,
    .gallery-lightbox__close,
    .gallery-lightbox__nav {
        transition: none;
    }

}