:root {
    --pxp-bg: #0a0a0a;
    --pxp-card: #141414;
    --pxp-accent: #D3EC8E;
    --pxp-text: #ffffff;
    --pxp-muted: #c9c9c9;
}

html.px-portfolio-open,
body.px-portfolio-open {
    overflow: hidden !important;
}

.px-portfolio-popup,
.px-portfolio-popup * {
    box-sizing: border-box;
}

.px-portfolio-popup {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    visibility: hidden;
    pointer-events: none;
}

.px-portfolio-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    opacity: 0;
    transition: opacity .45s ease;
}

.px-portfolio-popup__panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(78px, 9vw, 120px) clamp(18px, 5vw, 74px) 70px;
    color: var(--pxp-text);
    background:
        radial-gradient(circle at 90% 5%, rgba(211, 236, 142, .1), transparent 27%),
        linear-gradient(145deg, #141414 0%, var(--pxp-bg) 45%, #070707 100%);
    clip-path: circle(0 at calc(100% - 48px) 45px);
    -webkit-clip-path: circle(0 at calc(100% - 48px) 45px);
    transition:
        clip-path .85s cubic-bezier(.76, 0, .24, 1),
        -webkit-clip-path .85s cubic-bezier(.76, 0, .24, 1);
}

.px-portfolio-popup.is-open {
    visibility: visible;
    pointer-events: auto;
}

.px-portfolio-popup.is-open .px-portfolio-popup__backdrop {
    opacity: 1;
}

.px-portfolio-popup.is-open .px-portfolio-popup__panel {
    clip-path: circle(160vmax at calc(100% - 48px) 45px);
    -webkit-clip-path: circle(160vmax at calc(100% - 48px) 45px);
}

#pxPortfolioLightbox .px-portfolio-lightbox__close,
.px-portfolio-popup .px-portfolio-popup__close {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 5;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, .25) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .07) !important;
    background-color: rgba(255, 255, 255, .07) !important;
    color: #ffffff !important;
    padding: 0 !important;
    min-width: 54px !important;
    max-width: 54px !important;
    cursor: pointer;
    opacity: 0;
    transform: scale(.55) rotate(-90deg);
    transition:
        opacity .4s ease .35s,
        transform .55s cubic-bezier(.34, 1.56, .64, 1) .35s,
        background-color .25s ease;
}

.px-portfolio-popup.is-open .px-portfolio-popup__close {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.px-portfolio-popup .px-portfolio-popup__close:hover,
.px-portfolio-popup .px-portfolio-popup__close:focus {
    background: var(--pxp-accent) !important;
    background-color: var(--pxp-accent) !important;
    border-color: var(--pxp-accent) !important;
    color: #303030 !important;
}

.px-portfolio-popup .px-portfolio-popup__close::before,
.px-portfolio-popup .px-portfolio-popup__close::after {
    display: none !important;
    content: none !important;
}

.px-portfolio-popup .px-portfolio-popup__close span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 2px;
    background: #fff !important;
}

.px-portfolio-popup__close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.px-portfolio-popup__close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.px-portfolio-popup .px-portfolio-popup__close:hover span,
.px-portfolio-popup .px-portfolio-popup__close:focus span {
    background: #303030 !important;
}

.px-portfolio-popup__header {
    width: min(1500px, 100%);
    margin: 0 auto 38px;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .5s ease .45s, transform .5s ease .45s;
}

.px-portfolio-popup.is-open .px-portfolio-popup__header {
    opacity: 1;
    transform: translateY(0);
}

.px-portfolio-popup__eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--pxp-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.px-portfolio-popup__header h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 6vw, 78px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -2.8px;
}

.px-portfolio-popup__grid {
    width: min(1500px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: clamp(13px, 1.7vw, 25px);
}

.px-portfolio-popup__item {
    grid-column: span 4;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: var(--pxp-card);
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity .55s ease,
        transform .55s cubic-bezier(.22, 1, .36, 1),
        border-color .25s ease;
}

.px-portfolio-popup.is-open .px-portfolio-popup__item {
    opacity: 1;
    transform: translateY(0);
}

.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(1) { transition-delay: .48s; }
.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(2) { transition-delay: .54s; }
.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(3) { transition-delay: .60s; }
.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(4) { transition-delay: .66s; }
.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(5) { transition-delay: .72s; }
.px-portfolio-popup.is-open .px-portfolio-popup__item:nth-child(6) { transition-delay: .78s; }

.px-portfolio-popup__item--portrait {
    grid-row: span 2;
}

.px-portfolio-popup__item--wide {
    grid-column: span 8;
}

.px-portfolio-popup__image-button {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 260px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    cursor: zoom-in;
}

.px-portfolio-popup__item--portrait .px-portfolio-popup__image-button {
    min-height: 560px;
}

.px-portfolio-popup__image-button img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: inherit;
    object-fit: cover;
    transition: transform .5s ease;
}

.px-portfolio-popup__item:hover {
    border-color: rgba(211, 236, 142, .45);
}

.px-portfolio-popup__item:hover img {
    transform: scale(1.025);
}

.px-portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    display: grid;
    place-items: center;
    padding: 30px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility 0s linear .25s;
}

.px-portfolio-lightbox.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.px-portfolio-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .9);
}

.px-portfolio-lightbox img {
    position: relative;
    z-index: 2;
    max-width: min(1500px, 96vw);
    max-height: 92vh;
    object-fit: contain;
    border-radius: 12px;
}

.px-portfolio-lightbox__close {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: #151515;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .px-portfolio-popup__item {
        grid-column: span 6;
    }

    .px-portfolio-popup__item--wide {
        grid-column: span 12;
    }
}

@media (max-width: 700px) {
    .px-portfolio-popup__panel {
        padding: 88px 15px 40px;
    }

    .px-portfolio-popup__close {
        top: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .px-portfolio-popup__header {
        margin-bottom: 25px;
    }

    .px-portfolio-popup__header h2 {
        letter-spacing: -1.5px;
    }

    .px-portfolio-popup__grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
    }

    .px-portfolio-popup__item,
    .px-portfolio-popup__item--wide,
    .px-portfolio-popup__item--portrait,
    .px-portfolio-popup__item--square {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        aspect-ratio: 4 / 3;
        overflow: hidden !important;
    }

    .px-portfolio-popup__item--portrait {
        aspect-ratio: 3 / 4;
    }

    .px-portfolio-popup__item--wide {
        aspect-ratio: 16 / 10;
    }

    .px-portfolio-popup__image-button,
    .px-portfolio-popup__item--portrait .px-portfolio-popup__image-button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .px-portfolio-popup__image-button img {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .px-portfolio-popup__panel,
    .px-portfolio-popup *,
    .px-portfolio-lightbox {
        transition-duration: .01ms !important;
        transition-delay: 0s !important;
    }
}

/* Elementor global color protection */
#pxPortfolioLightbox .px-portfolio-lightbox__close {
    background: #151515 !important;
    background-color: #151515 !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    color: #ffffff !important;
    padding: 0 !important;
}
#pxPortfolioLightbox .px-portfolio-lightbox__close:hover,
#pxPortfolioLightbox .px-portfolio-lightbox__close:focus {
    background: var(--pxp-accent) !important;
    background-color: var(--pxp-accent) !important;
    border-color: var(--pxp-accent) !important;
    color: #303030 !important;
}
