/* Portfolio — editorial redesign */
.portfolio-page {
    --portfolio-ink: #211218;
    --portfolio-wine: #18090e;
    --portfolio-rose: #f23665;
    --portfolio-paper: #f7f2ef;
    --portfolio-line: rgba(55, 26, 37, 0.12);
    background: var(--portfolio-paper);
    color: var(--portfolio-ink);
}

.portfolio-page .hero-portfolio {
    min-height: min(860px, 100svh);
    display: flex;
    align-items: center;
    padding: 9rem 0 6rem !important;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(18, 7, 11, 0.97) 0%, rgba(18, 7, 11, 0.9) 42%, rgba(18, 7, 11, 0.48) 72%, rgba(18, 7, 11, 0.68) 100%),
        url('../img/momentos/junto1.webp') center 38% / cover no-repeat;
}

.portfolio-page .hero-portfolio::before {
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    background:
        radial-gradient(circle at 18% 40%, rgba(242, 54, 101, 0.17), transparent 34%),
        linear-gradient(180deg, rgba(24, 9, 14, 0.18), rgba(24, 9, 14, 0.7));
    z-index: -1;
}

.portfolio-page .hero-portfolio::after {
    top: 7.5rem;
    right: clamp(1.5rem, 5vw, 5rem);
    bottom: 4rem;
    left: auto;
    width: 1px;
    height: auto;
    border-radius: 0;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.32), transparent);
}

.portfolio-page .hero-grid-lines {
    opacity: 0.45;
    background-size: 96px 96px;
    mask-image: linear-gradient(90deg, #000, transparent 70%);
}

.portfolio-page .hero-portfolio > .relative {
    width: min(1220px, 100%);
    max-width: none;
    margin: 0 auto;
    padding-inline: clamp(1.5rem, 5vw, 4rem);
    text-align: left;
}

.portfolio-page .hero-portfolio > .relative > div:first-child {
    justify-content: flex-start;
    margin-bottom: 1.75rem;
}

.portfolio-page .hero-portfolio h1 {
    max-width: 780px;
    margin-bottom: 1.75rem;
    font-size: clamp(3.25rem, 7vw, 6.75rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.98;
    text-wrap: balance;
}

.portfolio-page .hero-portfolio h1 span {
    color: #ff7899;
    font-weight: 400;
}

.portfolio-page .hero-portfolio .accent-line {
    width: 7rem;
    margin: 0 0 1.75rem;
    transform-origin: left;
    background: linear-gradient(90deg, var(--portfolio-rose), transparent);
}

.portfolio-page .hero-portfolio > .relative > p {
    max-width: 650px;
    margin: 0 0 3.25rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.8;
}

.portfolio-page .hero-portfolio > .relative > div:last-child {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-content: initial;
    gap: 0;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.portfolio-page .hero-portfolio > .relative > div:last-child > div {
    padding: 0 1.5rem;
    text-align: left;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.portfolio-page .hero-portfolio > .relative > div:last-child > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.portfolio-featured {
    position: relative;
    padding: clamp(1rem, 2.5vw, 2rem) !important;
    background: var(--portfolio-wine) !important;
}

.portfolio-featured::before {
    content: 'HISTÓRIAS EM IMAGENS';
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 0.25rem;
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.35em;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left top;
}

.portfolio-featured > div {
    max-width: 1380px;
    padding: 0 !important;
}

.portfolio-page .mosaic-grid {
    grid-template-rows: repeat(2, clamp(230px, 29vw, 390px));
    gap: clamp(0.45rem, 1vw, 0.85rem);
}

.portfolio-page .mosaic-item {
    border-radius: 0.35rem;
    isolation: isolate;
}

.portfolio-page .mosaic-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 2;
}

.portfolio-page .mosaic-item img {
    filter: saturate(0.9) contrast(1.03);
}

.portfolio-page .mosaic-overlay {
    opacity: 1;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(20, 8, 12, 0.88), transparent 58%);
    transform: translateY(0.6rem);
    transition: transform 0.45s ease, background 0.45s ease;
}

.portfolio-page .mosaic-item:hover .mosaic-overlay {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(20, 8, 12, 0.94), rgba(20, 8, 12, 0.08) 70%);
}

.portfolio-gallery {
    position: relative;
    padding: clamp(5.5rem, 9vw, 9rem) 0 !important;
    background:
        radial-gradient(circle at 85% 10%, rgba(242, 54, 101, 0.07), transparent 28%),
        var(--portfolio-paper) !important;
}

.portfolio-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 4rem;
    background: rgba(242, 54, 101, 0.4);
}

.portfolio-gallery > div {
    max-width: 1280px;
}

.portfolio-gallery .text-center.mb-14 {
    margin-bottom: 2.75rem;
}

.portfolio-gallery h2 {
    color: var(--portfolio-ink);
    font-size: clamp(2.6rem, 5vw, 4.75rem);
    font-weight: 500;
    letter-spacing: -0.035em;
}

.portfolio-page #filters {
    position: sticky;
    z-index: 20;
    top: 5.75rem;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 3.75rem;
    padding: 0.55rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    border: 1px solid rgba(48, 24, 33, 0.09);
    border-radius: 999px;
    background: rgba(255, 252, 250, 0.9);
    box-shadow: 0 14px 40px rgba(42, 18, 27, 0.09);
    backdrop-filter: blur(18px);
    scrollbar-width: none;
}

.portfolio-page #filters::-webkit-scrollbar {
    display: none;
}

.portfolio-page .filter-pill {
    min-height: 2.75rem;
    padding: 0.7rem 1.25rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #78636b;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    box-shadow: none;
}

.portfolio-page .filter-pill:hover {
    border: 0;
    background: rgba(242, 54, 101, 0.08);
}

.portfolio-page .filter-pill.active {
    background: var(--portfolio-wine);
    color: #fff;
    box-shadow: 0 8px 24px rgba(24, 9, 14, 0.18);
}

.portfolio-page .masonry {
    column-gap: clamp(1rem, 2vw, 1.75rem);
}

.portfolio-page .masonry .gallery-item {
    margin-bottom: clamp(1rem, 2vw, 1.75rem);
}

.portfolio-page .gallery-item {
    border-radius: 0.45rem;
    background: #eadfda;
    box-shadow: 0 1px 0 rgba(31, 14, 20, 0.05);
}

.portfolio-page .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 70px rgba(42, 18, 27, 0.16);
}

.portfolio-page .gallery-overlay {
    opacity: 1;
    padding: 1.75rem;
    background: linear-gradient(to top, rgba(18, 7, 11, 0.88), transparent 58%);
    transform: translateY(0.35rem);
}

.portfolio-page .gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.portfolio-page .gallery-view-icon {
    top: 1.25rem;
    right: 1.25rem;
    left: auto;
    width: 2.65rem;
    height: 2.65rem;
    border: 1px solid rgba(255, 255, 255, 0.36);
    background: rgba(24, 9, 14, 0.35);
    transform: translateY(-0.5rem);
    backdrop-filter: blur(12px);
}

.portfolio-page .gallery-item:hover .gallery-view-icon {
    transform: translateY(0);
    background: var(--portfolio-rose);
}

.portfolio-trust {
    padding: clamp(5rem, 8vw, 7rem) 0 !important;
    background: #eee3df !important;
}

.portfolio-trust > div {
    max-width: 1180px;
}

.portfolio-trust .grid {
    gap: 1rem;
}

.portfolio-trust .grid > div {
    align-items: flex-start;
    min-height: 265px;
    padding: 2.5rem;
    text-align: left;
    border: 1px solid rgba(56, 29, 39, 0.09);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.66);
    transition: transform 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.portfolio-trust .grid > div:hover {
    transform: translateY(-5px);
    background: #fff;
    box-shadow: 0 22px 55px rgba(54, 27, 37, 0.09);
}

.portfolio-trust .trust-float {
    animation: none;
    border-radius: 50%;
}

.portfolio-trust h3 {
    font-size: 1.45rem;
    font-weight: 500;
}

.portfolio-trust p {
    color: #75626a;
}

.portfolio-cta {
    padding: clamp(5.5rem, 10vw, 9rem) 0 !important;
    background: var(--portfolio-wine);
}

.portfolio-cta > .absolute:first-child {
    background:
        radial-gradient(circle at 80% 30%, rgba(242, 54, 101, 0.2), transparent 28%),
        linear-gradient(135deg, #18090e, #2b1018 58%, #18090e);
}

.portfolio-cta > .absolute:nth-child(2) {
    opacity: 0.08;
}

.portfolio-cta > .relative {
    max-width: 1080px;
}

.portfolio-cta h2 {
    font-weight: 500;
    letter-spacing: -0.025em;
}

.portfolio-cta .grid > div:last-child a {
    border-radius: 0.35rem;
}

@media (min-width: 1024px) {
    .portfolio-cta .grid > div:last-child {
        align-items: flex-end;
        transform: translateX(clamp(4rem, 10vw, 12rem));
    }

    .portfolio-cta .grid > div:last-child a {
        width: min(100%, 20rem);
        padding: 0.95rem 1rem !important;
    }
}

.portfolio-page .lightbox {
    background: rgba(17, 7, 10, 0.96);
}

.portfolio-page .lightbox img {
    border-radius: 0.25rem;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

.portfolio-page .lightbox-close,
.portfolio-page .lightbox-nav {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

@media (max-width: 1023px) {
    .portfolio-page .hero-portfolio {
        min-height: 820px;
        background-position: 58% center;
    }

    .portfolio-page .mosaic-grid {
        grid-template-rows: repeat(3, 260px);
    }
}

@media (max-width: 767px) {
    .portfolio-page .site-header {
        top: max(0.5rem, env(safe-area-inset-top));
    }

    .portfolio-page .site-header .header-inner {
        width: 100%;
        padding-inline: 0;
    }

    .portfolio-page .site-header .header-actions {
        display: flex;
        margin-left: auto;
        margin-right: 0.55rem;
    }

    .portfolio-page .site-header .mobile-menu-btn {
        display: flex;
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
        flex: 0 0 2.5rem;
        flex-shrink: 0;
    }

    .portfolio-page .site-header .logo img {
        width: 2.25rem;
        height: 2.25rem;
        flex-basis: 2.25rem;
        border-radius: 50%;
    }

    .portfolio-page .site-header .logo-text {
        font-size: 0.8rem;
        letter-spacing: 0.055em;
    }

    .portfolio-page .hero-portfolio {
        min-height: 760px;
        align-items: flex-end;
        padding: 8.5rem 0 3rem !important;
        background-position: 62% center;
    }

    .portfolio-page .hero-portfolio::before {
        background: linear-gradient(180deg, rgba(18, 7, 11, 0.46), rgba(18, 7, 11, 0.94) 72%);
    }

    .portfolio-page .hero-portfolio h1 {
        width: 100%;
        max-width: calc(100vw - 3rem);
        font-size: clamp(2.75rem, 12vw, 3.35rem);
        line-height: 1.02;
    }

    .portfolio-page .hero-portfolio > .relative > p {
        width: 100%;
        max-width: calc(100vw - 3rem);
        margin-bottom: 2rem;
        font-size: 0.95rem;
        overflow-wrap: anywhere;
    }

    .portfolio-page .hero-portfolio > .relative > div:last-child {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.75rem 0;
    }

    .portfolio-page .hero-portfolio > .relative > div:last-child > div {
        padding: 0.75rem;
    }

    .portfolio-page .hero-portfolio > .relative > div:last-child > div:nth-child(3) {
        border-left: 0;
    }

    .portfolio-page .mosaic-grid {
        grid-template-rows: repeat(3, 190px);
    }

    .portfolio-featured::before {
        display: none;
    }

    .portfolio-page #filters {
        width: 100%;
        top: 4.7rem;
        border-radius: 0.4rem;
    }

    .portfolio-trust .grid > div {
        min-height: 0;
        padding: 2rem;
    }

    .portfolio-page .lightbox-nav {
        top: auto;
        bottom: 1.25rem;
        transform: none;
    }

    .portfolio-page .lightbox-prev { left: 1.25rem; }
    .portfolio-page .lightbox-next { right: 1.25rem; }
    .portfolio-page .lightbox-caption { bottom: 5.5rem; }
}

/* Editorial commitment section */
.portfolio-trust {
    padding: clamp(6.5rem, 10vw, 9rem) 0 !important;
    background:
        radial-gradient(circle at 14% 12%, rgba(242, 54, 101, 0.07), transparent 25%),
        #f2e9e5 !important;
}

.portfolio-trust > div {
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
    align-items: start;
    gap: clamp(3.5rem, 8vw, 7rem);
}

.portfolio-trust__intro {
    position: sticky;
    top: 8rem;
    text-align: left;
}

.portfolio-trust__intro > span {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--portfolio-rose);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.portfolio-trust__intro > span::before {
    content: '';
    width: 2.5rem;
    height: 1px;
    background: currentColor;
}

.portfolio-trust__intro h2 {
    margin-bottom: 1.5rem;
    color: var(--portfolio-ink);
    font-family: var(--font-serif);
    font-size: clamp(2.65rem, 4.6vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.portfolio-trust__intro h2 em {
    color: var(--portfolio-rose);
    font-weight: 400;
}

.portfolio-trust__intro p {
    max-width: 29rem;
    color: #756168;
    font-size: 0.98rem;
    line-height: 1.8;
}

.portfolio-trust .grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.portfolio-trust .grid > div {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    gap: 0.35rem 1.5rem;
    padding: 2.35rem 3.5rem 2.35rem 0;
    text-align: left;
    border: 0;
    border-top: 1px solid rgba(56, 29, 39, 0.14);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.portfolio-trust .grid > div:last-child {
    border-bottom: 1px solid rgba(56, 29, 39, 0.14);
}

.portfolio-trust .grid > div::after {
    position: absolute;
    top: 2.55rem;
    right: 0;
    color: rgba(43, 21, 29, 0.28);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.24em;
}

.portfolio-trust .grid > div:nth-child(1)::after { content: '01'; }
.portfolio-trust .grid > div:nth-child(2)::after { content: '02'; }
.portfolio-trust .grid > div:nth-child(3)::after { content: '03'; }

.portfolio-trust .grid > div:hover {
    background: transparent;
    box-shadow: none;
}

.portfolio-trust .trust-float {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 3.6rem;
    height: 3.6rem;
    margin: 0;
    border: 1px solid rgba(242, 54, 101, 0.2);
    border-radius: 50%;
    background: rgba(242, 54, 101, 0.075);
}

.portfolio-trust .trust-float .material-symbols-outlined {
    font-size: 1.45rem;
}

.portfolio-trust h3 {
    grid-column: 2;
    margin: 0;
    padding-right: 2rem;
    color: var(--portfolio-ink);
    font-size: clamp(1.45rem, 2.3vw, 1.85rem);
    font-weight: 500;
    line-height: 1.25;
}

.portfolio-trust .grid > div > p {
    grid-column: 2;
    max-width: 35rem;
    color: #7a656d;
    font-size: 0.9rem;
    line-height: 1.75;
}

@media (max-width: 900px) {
    .portfolio-trust > div {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .portfolio-trust__intro {
        position: static;
    }
}

@media (max-width: 520px) {
    .portfolio-trust .grid > div {
        grid-template-columns: 3.25rem minmax(0, 1fr);
        gap: 0.4rem 1rem;
        padding-right: 2.25rem;
    }

    .portfolio-trust .trust-float {
        width: 3rem;
        height: 3rem;
    }
}

/* Progressive motion and conversion details */
.portfolio-motion .hero-portfolio {
    --hero-x: 0px;
    --hero-y: 0px;
    --hero-shift: 0px;
    background-position: calc(50% + var(--hero-x)) calc(38% + var(--hero-y) + var(--hero-shift));
    transition: background-position 0.35s ease-out;
}

.portfolio-scroll-cue {
    position: absolute;
    z-index: 6;
    right: clamp(1.5rem, 5vw, 5rem);
    bottom: 3.4rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.56);
    cursor: pointer;
}

.portfolio-scroll-cue span {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
}

.portfolio-scroll-cue i {
    position: relative;
    width: 1px;
    height: 3.5rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}

.portfolio-scroll-cue i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, #ff7195, transparent);
    animation: portfolioCue 2.2s ease-in-out infinite;
}

@keyframes portfolioCue {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}

.portfolio-motion [data-motion] {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s cubic-bezier(.2,.75,.25,1) var(--motion-delay, 0ms),
        transform 0.8s cubic-bezier(.2,.75,.25,1) var(--motion-delay, 0ms),
        box-shadow 0.45s ease;
}

.portfolio-motion [data-motion].motion-visible {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-motion .gallery-item.motion-visible:hover {
    transform: translateY(-5px);
}

.portfolio-motion .portfolio-trust .grid > div.motion-visible:hover {
    transform: translateX(8px);
}

.portfolio-motion .gallery-item::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.2), transparent 34%);
    transition: opacity 0.35s ease;
}

.portfolio-motion .gallery-item:hover::after {
    opacity: 1;
}

.portfolio-motion .gallery-overlay {
    z-index: 2;
}

.portfolio-motion .gallery-view-icon {
    z-index: 3;
}

.portfolio-motion .mosaic-overlay {
    background:
        radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.12), transparent 36%),
        linear-gradient(to top, rgba(20, 8, 12, 0.88), transparent 58%);
}

.portfolio-motion .filter-pill {
    will-change: transform;
}

.portfolio-motion .filter-pill:focus-visible {
    outline: 2px solid var(--portfolio-rose);
    outline-offset: 3px;
}

.portfolio-motion .gallery-item:focus-visible {
    outline: 3px solid var(--portfolio-rose);
    outline-offset: 5px;
}

.portfolio-motion .lightbox.open img {
    animation: portfolioLightboxIn 0.55s cubic-bezier(.2,.75,.25,1) both;
}

@keyframes portfolioLightboxIn {
    from { opacity: 0; transform: scale(0.965); }
    to { opacity: 1; transform: scale(1); }
}

.portfolio-page .conversion-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: center;
}

.portfolio-page .conversion-note .material-symbols-outlined {
    color: #73dca0;
    font-size: 1rem;
    font-variation-settings: 'FILL' 1;
}

@media (max-width: 767px) {
    .portfolio-motion .hero-portfolio {
        background-position: calc(62% + var(--hero-x)) calc(50% + var(--hero-y) + var(--hero-shift));
    }

    .portfolio-scroll-cue {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-page *,
    .portfolio-page *::before,
    .portfolio-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Gallery: interactive infinite image field */
.portfolio-gallery.has-infinite-field #filters,
.portfolio-gallery.has-infinite-field #gallery {
    display: none !important;
}

.portfolio-infinite-field {
    position: relative;
    width: 100vw;
    min-height: 100svh;
    height: 100svh;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.6rem;
    background:
        radial-gradient(circle at 50% 46%, rgba(242, 54, 101, 0.18), transparent 46%),
        #19090f;
    box-shadow: 0 28px 70px rgba(42, 18, 27, 0.16);
    isolation: isolate;
    cursor: grab;
    touch-action: pan-y;
}

.portfolio-infinite-field::before,
.portfolio-infinite-field::after {
    content: '';
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.portfolio-infinite-field::before {
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-infinite-field::after {
    inset: 0;
    background: linear-gradient(90deg, rgba(25, 9, 15, 0.22), transparent 17%, transparent 83%, rgba(25, 9, 15, 0.22));
}

.portfolio-infinite-field.is-dragging {
    cursor: grabbing;
}

.portfolio-infinite-field:focus-visible {
    outline: 2px solid var(--portfolio-rose);
    outline-offset: 4px;
}

.portfolio-infinite-field canvas {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 639px) {
    .portfolio-infinite-field {
        min-height: 100svh;
        height: 100svh;
        border-radius: 0.4rem;
    }
}

/* ========================================================================== 
   Portfolio photo experience — GSAP / ScrollTrigger / Flip
   ========================================================================== */
.portfolio-photo-motion .portfolio-featured {
    padding: 0 !important;
    overflow: clip;
    background:
        radial-gradient(circle at 82% 18%, rgba(242, 54, 101, 0.13), transparent 28%),
        linear-gradient(145deg, #12070b 0%, #200b12 52%, #13070b 100%) !important;
}

.portfolio-featured > .portfolio-featured__stage {
    width: 100%;
    max-width: 1440px !important;
    margin-inline: auto;
    padding: clamp(5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 5rem) clamp(3rem, 5vw, 4.5rem) !important;
}

.portfolio-featured__header,
.portfolio-gallery__intro {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
    align-items: end;
    gap: clamp(2rem, 7vw, 7rem);
}

.portfolio-featured__header {
    position: relative;
    z-index: 4;
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
    color: #fff;
}

.portfolio-featured__eyebrow,
.portfolio-gallery__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    color: #ff668d;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.portfolio-featured__eyebrow::before,
.portfolio-gallery__eyebrow::before {
    content: '';
    width: 2.5rem;
    height: 1px;
    background: currentColor;
}

.portfolio-featured__eyebrow b,
.portfolio-gallery__eyebrow b {
    color: rgba(255, 255, 255, 0.36);
    font-weight: 700;
    letter-spacing: 0.16em;
}

.portfolio-featured__header h2,
.portfolio-gallery__intro h2 {
    max-width: 850px;
    color: #fff;
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 5.5vw, 5.8rem);
    font-weight: 500;
    letter-spacing: -0.052em;
    line-height: 0.94;
}

.portfolio-featured__header h2 em,
.portfolio-gallery__intro h2 span {
    color: #ff668d;
    font-weight: 400;
}

.portfolio-featured__header > p,
.portfolio-gallery__intro > p {
    max-width: 31rem;
    color: rgba(255, 255, 255, 0.56);
    font-size: clamp(0.88rem, 1.2vw, 1rem);
    line-height: 1.8;
}

.portfolio-featured__viewport {
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.portfolio-featured__footer {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: auto minmax(6rem, 1fr) auto;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.portfolio-featured__footer strong,
.portfolio-featured__footer strong b {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
}

.portfolio-featured__progress {
    height: 1px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

.portfolio-featured__progress i {
    display: block;
    width: 100%;
    height: 100%;
    background: #ff4777;
    transform: scaleX(0);
    transform-origin: left center;
}

.mosaic-card__motion,
.mosaic-card__surface,
.gallery-card__motion,
.gallery-card__surface {
    position: relative;
    width: 100%;
    height: 100%;
}

.mosaic-card__motion,
.gallery-card__motion {
    overflow: hidden;
    border-radius: inherit;
    will-change: transform, opacity, clip-path;
}

.mosaic-card__surface,
.gallery-card__surface {
    isolation: isolate;
    overflow: hidden;
    border-radius: inherit;
    background: #281118;
    transform-style: preserve-3d;
    will-change: transform;
}

.mosaic-card__image-shell,
.gallery-card__image-shell {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    transition: transform 0.85s cubic-bezier(.2, .75, .25, 1), filter 0.7s ease;
    will-change: transform;
}

.mosaic-card__image-shell img,
.gallery-card__image-shell img {
    width: 100%;
    height: 110%;
    margin-top: -5%;
    object-fit: cover;
    will-change: transform;
}

.portfolio-photo-motion .mosaic-overlay,
.portfolio-photo-motion .gallery-overlay {
    z-index: 2;
}

.portfolio-photo-motion .mosaic-item,
.portfolio-photo-motion .gallery-item {
    isolation: isolate;
    overflow: visible;
}

.portfolio-photo-motion .mosaic-item::before,
.portfolio-photo-motion .gallery-item::before {
    content: attr(data-sequence);
    position: absolute;
    z-index: 6;
    top: 1rem;
    left: 1rem;
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(19, 7, 11, 0.25);
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.portfolio-photo-motion .mosaic-item::after {
    z-index: 5;
    border-color: rgba(255, 255, 255, 0.13);
    border-radius: inherit;
}

.portfolio-photo-motion .mosaic-item:hover .mosaic-card__image-shell,
.portfolio-photo-motion .gallery-item:hover .gallery-card__image-shell {
    transform: scale(1.035);
}

/* Desktop: pinned horizontal editorial story */
@media (min-width: 960px) {
    .portfolio-photo-motion.portfolio-rail-enabled .portfolio-featured__stage {
        height: 100svh;
        max-width: none !important;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        padding-top: clamp(5.5rem, 9vh, 7.5rem) !important;
        padding-bottom: clamp(1.5rem, 3vh, 2.5rem) !important;
        overflow: hidden;
    }

    .portfolio-photo-motion.portfolio-rail-enabled .portfolio-featured__header {
        margin-bottom: clamp(1.3rem, 2.5vh, 2.3rem);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .portfolio-featured__header h2 {
        font-size: clamp(2.7rem, 4.6vw, 5.3rem);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .portfolio-featured__viewport {
        height: 100%;
        overflow: visible;
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-grid {
        width: max-content;
        height: 100%;
        display: flex;
        grid-template: none;
        gap: clamp(0.85rem, 1.4vw, 1.35rem);
        padding-right: 7vw;
        transform: translate3d(0, 0, 0);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item {
        width: clamp(330px, 34vw, 560px);
        height: 100%;
        flex: 0 0 auto;
        grid-area: auto;
        border-radius: 0.4rem;
        opacity: 0.5;
        transition: opacity 0.75s ease;
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:nth-child(1),
    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:nth-child(5) {
        width: clamp(440px, 44vw, 720px);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:nth-child(3),
    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:nth-child(6) {
        width: clamp(300px, 29vw, 470px);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item.is-active {
        opacity: 1;
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-card__image-shell {
        filter: saturate(0.52) brightness(0.72);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item.is-active .mosaic-card__image-shell,
    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:hover .mosaic-card__image-shell {
        filter: saturate(0.96) brightness(1);
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-overlay {
        opacity: 0.45;
        transform: translateY(0.8rem);
        transition: opacity 0.65s ease, transform 0.65s ease;
    }

    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item.is-active .mosaic-overlay,
    .portfolio-photo-motion.portfolio-rail-enabled .mosaic-item:hover .mosaic-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet/mobile and reduced-motion fallback: editorial stacked grid */
.portfolio-photo-motion.portfolio-stack-enabled .mosaic-grid,
.portfolio-photo-motion--reduced .mosaic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: clamp(250px, 48vw, 430px);
    gap: clamp(0.7rem, 2vw, 1.15rem);
}

.portfolio-photo-motion.portfolio-stack-enabled .mosaic-item,
.portfolio-photo-motion--reduced .mosaic-item {
    display: block !important;
    grid-area: auto;
    border-radius: 0.4rem;
}

.portfolio-photo-motion.portfolio-stack-enabled .mosaic-item:first-child,
.portfolio-photo-motion--reduced .mosaic-item:first-child,
.portfolio-photo-motion.portfolio-stack-enabled .mosaic-item:last-child,
.portfolio-photo-motion--reduced .mosaic-item:last-child {
    grid-column: 1 / -1;
}

/* Gallery: dynamic editorial grid */
.portfolio-gallery__intro {
    margin-bottom: clamp(2.75rem, 5vw, 4.75rem);
}

.portfolio-gallery__intro h2 {
    color: var(--portfolio-ink);
}

.portfolio-gallery__intro h2 span {
    color: var(--portfolio-rose);
}

.portfolio-gallery__intro > p {
    color: #7b666e;
}

.portfolio-gallery__eyebrow b {
    color: rgba(48, 21, 31, 0.34);
}

.portfolio-photo-motion .masonry {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: 10px;
    gap: clamp(0.9rem, 1.55vw, 1.25rem);
    columns: auto;
}

.portfolio-photo-motion .masonry .gallery-item,
.portfolio-photo-motion .gallery-item {
    width: auto;
    min-width: 0;
    margin: 0;
    border-radius: 0.45rem;
    aspect-ratio: auto !important;
    background: #dfd0cb;
    box-shadow: none;
    transform: none;
    perspective: 1200px;
}

.portfolio-photo-motion .gallery-item:hover,
.portfolio-photo-motion .gallery-item.motion-visible:hover {
    box-shadow: none;
    transform: none;
}

.portfolio-photo-motion .gallery-layout--feature {
    grid-column: span 8;
    grid-row: span 17;
}

.portfolio-photo-motion .gallery-layout--portrait {
    grid-column: span 4;
    grid-row: span 17;
}

.portfolio-photo-motion .gallery-layout--standard {
    grid-column: span 4;
    grid-row: span 14;
}

.portfolio-photo-motion .gallery-layout--wide {
    grid-column: span 8;
    grid-row: span 14;
}

.portfolio-photo-motion .gallery-layout--tall {
    grid-column: span 4;
    grid-row: span 18;
}

.portfolio-photo-motion .gallery-layout--feature-alt {
    grid-column: span 8;
    grid-row: span 18;
}

.portfolio-photo-motion .gallery-card__surface {
    box-shadow: 0 20px 55px rgba(42, 18, 27, 0.08);
    transition: box-shadow 0.65s ease;
}

.portfolio-photo-motion .gallery-item:hover .gallery-card__surface {
    box-shadow: 0 30px 80px rgba(42, 18, 27, 0.22);
}

.portfolio-photo-motion .gallery-overlay {
    opacity: 1;
    padding: clamp(1.25rem, 2vw, 2rem);
    background: linear-gradient(to top, rgba(16, 6, 10, 0.9), rgba(16, 6, 10, 0.1) 64%, transparent);
    transform: translateY(0.3rem);
    transition: transform 0.6s cubic-bezier(.2, .75, .25, 1), background 0.6s ease;
}

.portfolio-photo-motion .gallery-item:hover .gallery-overlay {
    background: linear-gradient(to top, rgba(16, 6, 10, 0.94), rgba(16, 6, 10, 0.18) 68%, transparent);
    transform: translateY(0);
}

.portfolio-photo-motion .gallery-view-icon {
    z-index: 7;
    top: 1rem;
    right: 1rem;
    left: auto;
    width: 2.55rem;
    height: 2.55rem;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(18, 7, 11, 0.34);
    transform: translateY(-0.45rem) scale(0.92);
    backdrop-filter: blur(12px);
}

.portfolio-photo-motion .gallery-item:hover .gallery-view-icon,
.portfolio-photo-motion .gallery-item:focus-visible .gallery-view-icon {
    opacity: 1;
    background: var(--portfolio-rose);
    transform: translateY(0) scale(1);
}

.portfolio-photo-motion .gallery-item.hide {
    display: none !important;
}

@media (max-width: 959px) {
    .portfolio-featured > .portfolio-featured__stage {
        padding-top: clamp(5rem, 10vw, 7rem) !important;
    }

    .portfolio-featured__header,
    .portfolio-gallery__intro {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .portfolio-featured__header > p,
    .portfolio-gallery__intro > p {
        max-width: 38rem;
    }

    .portfolio-photo-motion .masonry {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-auto-rows: 9px;
    }

    .portfolio-photo-motion .gallery-layout--feature,
    .portfolio-photo-motion .gallery-layout--wide,
    .portfolio-photo-motion .gallery-layout--feature-alt {
        grid-column: span 8;
    }

    .portfolio-photo-motion .gallery-layout--portrait,
    .portfolio-photo-motion .gallery-layout--standard,
    .portfolio-photo-motion .gallery-layout--tall {
        grid-column: span 4;
    }
}

@media (max-width: 639px) {
    .portfolio-featured > .portfolio-featured__stage {
        padding: 1.85rem 0.8rem 3rem !important;
    }

    .portfolio-featured__header h2,
    .portfolio-gallery__intro h2 {
        font-size: clamp(2.6rem, 14vw, 4rem);
        line-height: 0.98;
    }

    .portfolio-featured__eyebrow::before,
    .portfolio-gallery__eyebrow::before {
        width: 2.1rem;
    }

    .portfolio-featured__eyebrow {
        margin-bottom: 0.875rem;
    }

    .portfolio-featured__header > p {
        color: rgba(255, 255, 255, 0.64);
    }

    .portfolio-photo-motion.portfolio-stack-enabled .mosaic-grid,
    .portfolio-photo-motion--reduced .mosaic-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: clamp(230px, 78vw, 340px);
        gap: 0.7rem;
    }

    .portfolio-photo-motion.portfolio-stack-enabled .mosaic-item:first-child,
    .portfolio-photo-motion--reduced .mosaic-item:first-child,
    .portfolio-photo-motion.portfolio-stack-enabled .mosaic-item:last-child,
    .portfolio-photo-motion--reduced .mosaic-item:last-child {
        grid-column: auto;
        min-height: 0;
    }

    .portfolio-featured__footer {
        grid-template-columns: auto minmax(3rem, 1fr) auto;
        gap: 0.75rem;
        font-size: 0.48rem;
        letter-spacing: 0.17em;
    }

    .portfolio-gallery > div {
        padding-inline: 1rem;
    }

    .portfolio-photo-motion .masonry {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 8px;
        gap: 0.85rem;
    }

    .portfolio-photo-motion .gallery-layout--feature,
    .portfolio-photo-motion .gallery-layout--portrait,
    .portfolio-photo-motion .gallery-layout--standard,
    .portfolio-photo-motion .gallery-layout--wide,
    .portfolio-photo-motion .gallery-layout--tall,
    .portfolio-photo-motion .gallery-layout--feature-alt {
        grid-column: 1 / -1;
    }

    .portfolio-photo-motion .gallery-layout--feature,
    .portfolio-photo-motion .gallery-layout--portrait {
        grid-row: span 19;
    }

    .portfolio-photo-motion .gallery-layout--standard,
    .portfolio-photo-motion .gallery-layout--wide {
        grid-row: span 15;
    }

    .portfolio-photo-motion .gallery-layout--tall,
    .portfolio-photo-motion .gallery-layout--feature-alt {
        grid-row: span 20;
    }

    .portfolio-photo-motion .gallery-overlay {
        padding: 1.35rem;
    }

    .portfolio-photo-motion .gallery-item::before,
    .portfolio-photo-motion .mosaic-item::before {
        top: 0.8rem;
        left: 0.8rem;
        width: 2rem;
        height: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-photo-motion .gallery-card__motion,
    .portfolio-photo-motion .mosaic-card__motion,
    .portfolio-photo-motion .gallery-card__surface,
    .portfolio-photo-motion .mosaic-card__surface,
    .portfolio-photo-motion .gallery-card__image-shell,
    .portfolio-photo-motion .mosaic-card__image-shell,
    .portfolio-photo-motion .gallery-card__image-shell img,
    .portfolio-photo-motion .mosaic-card__image-shell img {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        clip-path: none !important;
        will-change: auto !important;
    }
}
