/* Portfolio stage — lista e dettaglio progetto */
body.body-stage .stage-about-portfolio.stage-portfolio-page.stage-section {
    padding-top: calc(var(--stage-space-section-y) + var(--stage-navbar-height, 4.25rem));
    padding-bottom: var(--stage-space-section-y);
}

body.body-stage .stage-portfolio-page__title {
    max-width: 18ch;
}

body.body-stage .stage-portfolio-page__head-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

body.body-stage .stage-portfolio-page__head-aside.stage-copy-flow > .stage-about-portfolio__text + .stage-portfolio-page__actions {
    margin-top: var(--stage-space-cta);
}

body.body-stage .stage-portfolio-page__actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-page__head-aside {
        padding-top: 0.35rem;
    }
}

body.body-stage .stage-portfolio-page__grid {
    margin-top: var(--stage-space-layout);
}

body.body-stage .stage-about-project-card__media img {
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.body-stage .stage-about-project-card--link:hover .stage-about-project-card__media img,
body.body-stage .stage-about-project-card--link:focus-visible .stage-about-project-card__media img {
    transform: scale(1.05);
}

body.body-stage .stage-about-project-card__body {
    transition: background 0.28s ease, transform 0.32s ease;
}

body.body-stage [data-stage-portfolio-grid] .stage-about-project-card--link {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    transition:
        opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 620ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    transition-delay: var(--stage-portfolio-reveal-delay, 0ms);
    will-change: opacity, transform;
}

body.body-stage [data-stage-portfolio-grid].is-revealed .stage-about-project-card--link {
    opacity: 1;
    transform: translateY(0) scale(1);
}

body.body-stage [data-stage-portfolio-grid].is-revealed .stage-about-project-card--link:hover,
body.body-stage [data-stage-portfolio-grid].is-revealed .stage-about-project-card--link:focus-visible {
    transform: translateY(-3px) scale(1);
}

body.body-stage .stage-portfolio-page-process__grid > li {
    display: contents;
}

body.body-stage .stage-portfolio-page__empty {
    margin-top: var(--stage-space-layout);
    align-items: flex-start;
}

body.body-stage .stage-portfolio-page__empty-text {
    margin: 0;
    color: rgba(0, 0, 0, 0.72);
}

body.body-stage .stage-portfolio-statement {
    padding-block: var(--stage-space-layout);
    background-color: var(--color-stage-bg);
}

body.body-stage .stage-portfolio-statement__inner {
    max-width: 52rem;
    margin-inline: auto;
    text-align: center;
}

body.body-stage .stage-portfolio-statement__title {
    margin: 0;
    font-size: clamp(1.45rem, 2.8vw, 2.15rem);
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 400;
    color: #111;
}

body.body-stage .stage-portfolio-page-metrics {
    background: #fff;
}

body.body-stage .stage-portfolio-page-process {
    background: var(--color-stage-bg);
}

body.body-stage .stage-portfolio-page-process__inner {
    display: flex;
    flex-direction: column;
}

body.body-stage .stage-portfolio-page-process__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-page-process__head {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        column-gap: var(--stage-space-layout);
    }
}

body.body-stage .stage-portfolio-page-process__title {
    margin: 0;
    font-size: var(--stage-fs-h2);
    line-height: 1.08;
    max-width: 16ch;
}

body.body-stage .stage-portfolio-page-process__lede {
    margin: 0;
    max-width: 40ch;
    color: rgba(0, 0, 0, 0.72);
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-page-process__lede {
        padding-top: 0.35rem;
    }
}

body.body-stage .stage-portfolio-page-process__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--stage-space-text);
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-page-process__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: clamp(1.25rem, 2.5vw, 2rem);
        row-gap: clamp(1.5rem, 2.5vw, 2.25rem);
    }
}

body.body-stage .stage-portfolio-process-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--stage-space-text);
    min-height: 100%;
    padding: clamp(1.15rem, 2vw, 1.35rem);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

body.body-stage .stage-portfolio-process-card__icon {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 999px;
    border: 1px solid var(--color-primary-500);
    color: var(--color-primary-500);
    background-color: #fff;
    line-height: 0;
    flex-shrink: 0;
}

body.body-stage .stage-portfolio-process-card__icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

body.body-stage .stage-portfolio-process-card__eyebrow {
    margin: 0;
    font-size: var(--stage-fs-caption);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary-500);
}

body.body-stage .stage-portfolio-process-card__title,
body.body-stage .stage-portfolio-process-card__text {
    margin: 0;
}

body.body-stage .stage-portfolio-process-card__title {
    font-size: var(--stage-fs-h3);
    line-height: 1.12;
    max-width: 16ch;
}

body.body-stage .stage-portfolio-process-card__text {
    color: rgba(0, 0, 0, 0.72);
    max-width: 42ch;
}

@media (prefers-reduced-motion: reduce) {
    body.body-stage .stage-about-project-card__media img,
    body.body-stage .stage-about-project-card__body,
    body.body-stage [data-stage-portfolio-grid] .stage-about-project-card--link {
        transition: none;
        will-change: auto;
    }

    body.body-stage [data-stage-portfolio-grid] .stage-about-project-card--link {
        opacity: 1;
        transform: none;
    }
}

body.body-stage .stage-about-project-card--link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.body-stage .stage-about-project-card--link:hover,
body.body-stage .stage-about-project-card--link:focus-visible {
    color: inherit;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: color-mix(in srgb, var(--color-primary-500) 20%, rgba(0, 0, 0, 0.08));
}

body.body-stage .stage-about-project-card--link:hover .stage-about-project-card__body,
body.body-stage .stage-about-project-card--link:focus-visible .stage-about-project-card__body {
    background: rgba(12, 14, 20, 0.74);
}

body.body-stage .stage-portfolio-project {
    background: #fff;
    --stage-portfolio-eyebrow-title-gap: clamp(1.125rem, 2.5vw, 1.5rem);
    --stage-portfolio-title-meta-gap: clamp(0.5rem, 1.1vw, 0.75rem);
}

body.body-stage .stage-portfolio-project.stage-section {
    padding-top: calc(var(--stage-space-section-y) + var(--stage-navbar-height, 4.25rem));
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

body.body-stage .stage-portfolio-project.stage-section + .stage-about-portfolio.stage-section {
    padding-top: clamp(2rem, 4vw, 3rem);
}

body.body-stage .stage-portfolio-project__inner {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4.5vw, 3.5rem);
}

body.body-stage .stage-portfolio-project__hero.stage-copy-flow > .stage-template-detail__breadcrumb + .stage-portfolio-project__hero-row {
    margin-top: clamp(1rem, 2.5vw, 1.5rem);
}

body.body-stage .stage-portfolio-project__hero-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 2.5rem);
    align-items: center;
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-project__hero-row--with-media {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: clamp(2rem, 3.5vw, 3rem);
    }
}

/* Coppie correlate: riduce il gap globale dell'inner */
body.body-stage .stage-portfolio-project__hero + .stage-portfolio-project__meta {
    margin-top: calc(-0.75rem - 1vw);
}

body.body-stage .stage-portfolio-project__intro + .stage-portfolio-project__gallery {
    margin-top: calc(-1rem - 1.5vw);
}

body.body-stage .stage-portfolio-project__block + .stage-portfolio-project__feature-media {
    margin-top: calc(-0.75rem - 1vw);
}

body.body-stage .stage-portfolio-project__feature-media + .stage-portfolio-project__block {
    margin-top: calc(-0.5rem - 0.75vw);
}

body.body-stage .stage-portfolio-project__hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

body.body-stage .stage-portfolio-project__hero-copy.stage-copy-flow > .section-basic__brand + .stage-portfolio-project__title {
    margin-top: var(--stage-portfolio-eyebrow-title-gap);
}

body.body-stage .stage-portfolio-project__hero-copy.stage-copy-flow > .stage-portfolio-project__title + .stage-portfolio-project__subtitle {
    margin-top: var(--stage-portfolio-title-meta-gap);
}

body.body-stage .stage-portfolio-project__hero-media {
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.body-stage .stage-portfolio-project__hero-media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

body.body-stage .stage-portfolio-project__title {
    margin: 0;
    font-size: var(--stage-fs-h1);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: min(28ch, 100%);
}

body.body-stage .stage-portfolio-project__subtitle {
    margin: 0;
    max-width: 48ch;
    font-size: var(--stage-fs-p);
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.68);
}

body.body-stage .stage-portfolio-project__meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    padding: clamp(1.15rem, 2.5vw, 1.65rem) 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-project__meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body.body-stage .stage-portfolio-project__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

body.body-stage .stage-portfolio-project__meta-item dt {
    margin: 0;
    font-size: var(--stage-fs-caption);
    color: rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.body-stage .stage-portfolio-project__meta-item dd {
    margin: 0;
    font-size: var(--stage-fs-h5);
}

body.body-stage .stage-portfolio-project__section-title {
    margin: 0;
    font-size: var(--stage-fs-h2);
    line-height: 1.1;
    max-width: 24ch;
}

body.body-stage .stage-portfolio-project__rich-text {
    max-width: 52rem;
    line-height: 1.62;
    color: rgba(0, 0, 0, 0.78);
}

body.body-stage .stage-portfolio-project__rich-text > :first-child {
    margin-top: 0;
}

body.body-stage .stage-portfolio-project__rich-text > :last-child {
    margin-bottom: 0;
}

body.body-stage .stage-portfolio-project__rich-text p + p {
    margin-top: 1rem;
}

body.body-stage .stage-portfolio-project__gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.85rem, 2vw, 1.25rem);
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-project__gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(1.25rem, 2.5vw, 2rem);
        row-gap: clamp(1rem, 2vw, 1.5rem);
    }
}

body.body-stage .stage-portfolio-project__gallery-item,
body.body-stage .stage-portfolio-project__feature-media {
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.body-stage .stage-portfolio-project__gallery-item img,
body.body-stage .stage-portfolio-project__feature-media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

body.body-stage .stage-portfolio-project__block {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.75rem, 2vw, 1rem);
}

@media (min-width: 56.26rem) {
    body.body-stage .stage-portfolio-project__block {
        grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
        align-items: start;
        column-gap: clamp(2rem, 4vw, 3.5rem);
        row-gap: 0;
    }

    body.body-stage .stage-portfolio-project__block .stage-portfolio-project__section-title {
        padding-top: 0.15rem;
    }
}

body.body-stage .stage-portfolio-project__intro.stage-copy-flow > .section-basic__brand + .stage-portfolio-project__section-title {
    margin-top: var(--stage-portfolio-eyebrow-title-gap);
}

body.body-stage .stage-portfolio-project__intro.stage-copy-flow > .stage-portfolio-project__section-title + .stage-portfolio-project__rich-text {
    margin-top: var(--stage-portfolio-title-meta-gap);
}

body.body-stage .stage-portfolio-project__conclusion.stage-copy-flow > .stage-portfolio-project__section-title + .stage-portfolio-project__rich-text {
    margin-top: var(--stage-portfolio-title-meta-gap);
}

body.body-stage .stage-portfolio-project__conclusion.stage-copy-flow > .stage-portfolio-project__rich-text + .stage-portfolio-project__cta-row {
    margin-top: var(--stage-space-cta);
}

body.body-stage .stage-portfolio-project__feedback {
    margin: 0;
    padding: clamp(1.35rem, 2.8vw, 2rem);
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--color-primary-500) 18%, rgba(0, 0, 0, 0.08));
    background: color-mix(in srgb, var(--color-primary-500) 4%, #fff);
}

body.body-stage .stage-portfolio-project__feedback-label {
    margin: 0;
    font-size: var(--stage-fs-caption);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary-500);
}

body.body-stage .stage-portfolio-project__feedback-text {
    margin: clamp(0.65rem, 1.5vw, 0.85rem) 0 0;
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    line-height: 1.45;
    max-width: 48ch;
    color: rgba(0, 0, 0, 0.82);
}

body.body-stage .stage-portfolio-project__feedback-author {
    margin: 0.75rem 0 0;
    font-size: var(--stage-fs-caption);
    color: rgba(0, 0, 0, 0.62);
}

body.body-stage .stage-portfolio-project__conclusion {
    align-items: flex-start;
    max-width: 52rem;
    padding-top: clamp(0.5rem, 1.5vw, 1rem);
}

body.body-stage .stage-portfolio-project__cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.15rem;
    margin-top: 0;
}

body.body-stage .stage-portfolio-project + .stage-about-portfolio .stage-about-portfolio__inner {
    gap: clamp(1.75rem, 3.5vw, 2.75rem);
}

body.body-stage .stage-portfolio-project + .stage-about-portfolio .stage-about-portfolio__grid {
    margin-top: clamp(0.5rem, 1.5vw, 1rem);
}

@media (max-width: 56.25rem) {
    body.body-stage .stage-portfolio-project {
        --stage-portfolio-eyebrow-title-gap: 1rem;
        --stage-portfolio-title-meta-gap: 0.5rem;
        --stage-space-cta: 1.5rem;
    }

    body.body-stage .stage-portfolio-project.stage-section {
        padding-top: calc(clamp(2rem, 6vw, 2.75rem) + var(--stage-navbar-height, 4.25rem));
        padding-bottom: clamp(1.75rem, 5vw, 2.5rem);
    }

    body.body-stage .stage-portfolio-project.stage-section + .stage-about-portfolio.stage-section {
        padding-top: clamp(1.5rem, 4.5vw, 2.25rem);
        padding-bottom: var(--stage-space-section-y);
    }

    body.body-stage .stage-portfolio-project__inner {
        gap: clamp(1.5rem, 5.5vw, 2rem);
    }

    body.body-stage .stage-portfolio-project__hero.stage-copy-flow > .stage-template-detail__breadcrumb + .stage-portfolio-project__hero-row {
        margin-top: clamp(0.85rem, 3vw, 1.15rem);
    }

    body.body-stage .stage-portfolio-project__hero-row {
        gap: clamp(1.25rem, 5vw, 1.75rem);
    }

    body.body-stage .stage-portfolio-project__hero + .stage-portfolio-project__meta {
        margin-top: calc(-0.35rem - 0.5vw);
    }

    body.body-stage .stage-portfolio-project__intro + .stage-portfolio-project__gallery {
        margin-top: calc(-0.5rem - 1vw);
    }

    body.body-stage .stage-portfolio-project__block + .stage-portfolio-project__feature-media {
        margin-top: calc(-0.35rem - 0.5vw);
    }

    body.body-stage .stage-portfolio-project__feature-media + .stage-portfolio-project__block {
        margin-top: calc(-0.25rem - 0.35vw);
    }

    body.body-stage .stage-portfolio-project__title {
        max-width: 100%;
    }

    body.body-stage .stage-portfolio-project__section-title {
        max-width: 100%;
    }

    body.body-stage .stage-portfolio-project__meta {
        gap: 0.85rem 1rem;
        padding: 1rem 0;
    }

    body.body-stage .stage-portfolio-project__meta-item dd {
        font-size: var(--stage-fs-p);
    }

    body.body-stage .stage-portfolio-project__block {
        gap: clamp(0.65rem, 2.5vw, 0.85rem);
    }

    body.body-stage .stage-portfolio-project__gallery {
        gap: clamp(0.75rem, 2.5vw, 1rem);
    }

    body.body-stage .stage-portfolio-project__rich-text p + p {
        margin-top: 0.85rem;
    }

    body.body-stage .stage-portfolio-project__feedback {
        padding: 1.15rem 1rem;
    }

    body.body-stage .stage-portfolio-project__feedback-text {
        font-size: 1.05rem;
        max-width: 100%;
    }

    body.body-stage .stage-portfolio-project__conclusion {
        padding-top: 0.25rem;
    }

    body.body-stage .stage-portfolio-project__cta-row {
        gap: 0.75rem 1rem;
    }

    body.body-stage .stage-portfolio-project + .stage-about-portfolio .stage-about-portfolio__inner {
        gap: clamp(1.35rem, 4vw, 1.75rem);
    }

    body.body-stage .stage-portfolio-project + .stage-about-portfolio .stage-about-portfolio__grid {
        margin-top: 0.35rem;
    }
}
