.portfolio-frame {
    min-height: calc(100vh - 36px);
}

.portfolio-page {
    padding-top: clamp(20px, 3vw, 38px);
}

.portfolio-heading {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: end;
    gap: 35px;
    padding: clamp(24px, 4vw, 55px) 0 34px;
}

.portfolio-title-block>.eyebrow,
.project-heading-main>.eyebrow {
    color: #737680;
}

.portfolio-title-block h1 {
    margin-top: 18px;
    font-size: clamp(3.5rem, 7.2vw, 7rem);
    font-weight: 500;
    line-height: 0.87;
}

.portfolio-title-block h1 span {
    color: #786bbd;
}

.portfolio-intro-block {
    max-width: 350px;
    justify-self: end;
    padding-bottom: 5px;
}

.portfolio-index {
    color: #737680;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.portfolio-intro {
    margin-top: 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.portfolio-filter-note {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: #71747b;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.portfolio-filter-note>span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portfolio-filter-note i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #82a990;
}

.portfolio-filter-note b {
    margin-left: 6px;
    color: var(--ink);
    font-size: 12px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 14px;
}

.portfolio-card {
    min-width: 0;
}

.portfolio-card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
}

.portfolio-image-frame {
    position: relative;
    height: clamp(200px, 23vw, 305px);
    overflow: hidden;
    border-radius: 19px;
    background: #e9e8ed;
}

.portfolio-image-frame::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(8 13 18 / 8%), transparent 38%);
    content: "";
    pointer-events: none;
}

.portfolio-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 550ms cubic-bezier(.2, .7, .2, 1);
}

.portfolio-card-link:hover .portfolio-image-frame img {
    transform: scale(1.035);
}

.portfolio-card-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 13px 2px 2px;
}

.portfolio-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #787b82;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.portfolio-card-copy h2 {
    margin-top: 10px;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    font-weight: 500;
    letter-spacing: -0.05em;
}

.portfolio-card-copy>p {
    max-width: 370px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.portfolio-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    color: var(--ink);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.portfolio-card-action>span {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 1px solid #d4d4d8;
    border-radius: 50%;
    font-size: 15px;
    transition: color 180ms ease, background 180ms ease;
}

.portfolio-card-link:hover .portfolio-card-action>span {
    border-color: var(--ink);
    background: var(--ink);
    color: white;
}

.portfolio-cta {
    position: relative;
    margin-top: clamp(70px, 9vw, 125px);
    padding: clamp(26px, 5vw, 60px);
    overflow: hidden;
    border-radius: 27px;
    background: var(--lilac);
}

.portfolio-cta-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-top: 25px;
}

.portfolio-cta-content h2 {
    font-size: clamp(3rem, 7.3vw, 6.5rem);
    font-weight: 500;
    line-height: 0.85;
}

.portfolio-cta-content h2 span {
    color: #786bbd;
}

.portfolio-cta-content>div {
    max-width: 265px;
}

.portfolio-cta-content>div>p {
    color: #4e4b59;
    font-size: 11px;
    line-height: 1.6;
}

.portfolio-cta-content .pill-button {
    margin-top: 17px;
}

.project-frame {
    min-height: calc(100vh - 36px);
}

.project-page,
.portfolio-not-found {
    padding-top: clamp(20px, 3vw, 38px);
}

.project-page[hidden],
.portfolio-not-found[hidden] {
    display: none;
}

.project-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: #70737b;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    transition: color 180ms ease;
}

.project-back-link:hover {
    color: var(--ink);
}

.project-back-link span {
    font-size: 15px;
}

.project-heading {
    display: grid;
    grid-template-columns: 1fr minmax(230px, 0.55fr);
    align-items: end;
    gap: 30px;
    padding-bottom: 26px;
}

.project-heading-main h1 {
    max-width: 900px;
    margin-top: 13px;
    font-size: clamp(3rem, 7vw, 7rem);
    font-weight: 500;
    line-height: 0.88;
    overflow-wrap: anywhere;
}

.project-heading-aside {
    justify-self: end;
    max-width: 360px;
}

.project-lead {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.project-heading-aside .pill-button {
    min-height: 36px;
    margin-top: 16px;
    padding: 0 13px;
    font-size: 9px;
}

.project-hero {
    position: relative;
    height: clamp(300px, 52vw, 650px);
    margin: 0;
    overflow: hidden;
    border-radius: 24px;
    background: #e8e7ed;
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.project-hero figcaption {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 15px;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 999px;
    background: rgb(9 17 22 / 62%);
    color: white;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.1em;
    backdrop-filter: blur(12px);
}

.project-hero figcaption i {
    margin-left: 7px;
    font-size: 13px;
    font-style: normal;
}

.project-overview {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: clamp(35px, 9vw, 130px);
    padding: clamp(50px, 8vw, 105px) 0;
    border-bottom: 1px solid var(--line);
}

.project-overview-heading .eyebrow {
    color: #737680;
}

.project-overview-heading h2 {
    margin-top: 14px;
    font-size: clamp(2rem, 3.7vw, 3.6rem);
    font-weight: 500;
    line-height: 0.95;
}

.project-overview-heading h2 span {
    color: #786bbd;
}

.project-overview-content>p {
    max-width: 690px;
    color: #444850;
    font-size: clamp(14px, 1.7vw, 18px);
    line-height: 1.65;
}

.project-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 30px 0 0;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.project-facts>div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.project-facts dt {
    color: #797c83;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project-facts dd {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
}

.project-stories {
    display: flex;
    flex-direction: column;
    gap: clamp(50px, 8vw, 105px);
    padding: clamp(50px, 7vw, 90px) 0;
}

.project-story {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: clamp(28px, 7vw, 100px);
}

.project-story-reverse {
    grid-template-columns: 0.9fr 1.1fr;
}

.project-story-image {
    position: relative;
    height: clamp(250px, 38vw, 490px);
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
}

.project-story-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
}

.project-story-image figcaption {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 9px 12px;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 999px;
    background: rgb(255 255 255 / 82%);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
}

.project-story-copy {
    max-width: 440px;
    padding: 15px 0;
}

.project-story-eyebrow {
    color: #737680;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.project-story-copy h2 {
    margin-top: 17px;
    font-size: clamp(2.2rem, 4.3vw, 4.5rem);
    font-weight: 500;
    line-height: 0.95;
}

.project-story-copy>p:last-child {
    margin-top: 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.project-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.project-neighbor {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.project-neighbor-next {
    align-items: flex-end;
    text-align: right;
}

.project-neighbor>span {
    color: #777981;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.project-neighbor strong {
    font-family: var(--font-display);
    font-size: clamp(13px, 1.7vw, 18px);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.project-grid-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #d3d3d8;
    border-radius: 999px;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.08em;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.project-grid-link:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: white;
}

.portfolio-not-found {
    display: flex;
    min-height: min(62vh, 650px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-bottom: 30px;
}

.portfolio-not-found>.eyebrow {
    color: #737680;
}

.portfolio-not-found h1 {
    margin-top: 17px;
    font-size: clamp(3.2rem, 7vw, 6.8rem);
    font-weight: 500;
    line-height: 0.9;
}

.portfolio-not-found>p:not(.eyebrow) {
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
}

.portfolio-not-found .pill-button {
    margin-top: 20px;
}

@media (min-width: 1500px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 30px 18px;
    }
}

@media (max-width: 1080px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 25px 14px;
    }

    .portfolio-image-frame {
        height: clamp(225px, 32vw, 340px);
    }

    .project-heading {
        grid-template-columns: 1fr minmax(220px, 0.7fr);
    }

    .project-story,
    .project-story-reverse {
        gap: 32px;
    }
}

@media (max-width: 720px) {
    .portfolio-frame {
        min-height: calc(100vh - 24px);
    }

    .portfolio-page,
    .project-page,
    .portfolio-not-found {
        padding-top: 12px;
    }

    .portfolio-heading {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 24px 0 25px;
    }

    .portfolio-title-block h1 {
        font-size: clamp(3.6rem, 13vw, 5.5rem);
    }

    .portfolio-intro-block {
        max-width: 440px;
        justify-self: start;
    }

    .portfolio-intro {
        margin-top: 9px;
    }

    .portfolio-intro-block .text-link {
        margin-top: 14px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .portfolio-image-frame {
        height: clamp(230px, 67vw, 390px);
        border-radius: 17px;
    }

    .portfolio-card-copy h2 {
        font-size: 1.6rem;
    }

    .portfolio-cta {
        margin-top: 65px;
        padding: 25px 21px;
        border-radius: 22px;
    }

    .portfolio-cta-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
    }

    .portfolio-cta-content h2 {
        font-size: clamp(4rem, 14vw, 5.7rem);
    }

    .project-back-link {
        margin-bottom: 20px;
    }

    .project-heading {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-bottom: 20px;
    }

    .project-heading-main h1 {
        font-size: clamp(3.1rem, 12vw, 5.3rem);
    }

    .project-heading-aside {
        justify-self: start;
    }

    .project-hero {
        height: clamp(260px, 85vw, 480px);
        border-radius: 18px;
    }

    .project-hero figcaption {
        right: 9px;
        bottom: 9px;
        left: 9px;
        padding: 10px 12px;
        font-size: 6px;
    }

    .project-overview {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 45px 0;
    }

    .project-facts {
        margin-top: 22px;
    }

    .project-stories {
        gap: 44px;
        padding: 42px 0;
    }

    .project-story,
    .project-story-reverse {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .project-story-reverse .project-story-copy {
        order: 2;
    }

    .project-story-reverse .project-story-image {
        order: 1;
    }

    .project-story-image {
        height: clamp(230px, 70vw, 370px);
        border-radius: 17px;
    }

    .project-story-copy h2 {
        margin-top: 12px;
        font-size: clamp(2.2rem, 9vw, 3.5rem);
    }

    .project-story-copy>p:last-child {
        margin-top: 12px;
        font-size: 11px;
    }

    .project-navigation {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 15px 0;
    }

    .project-grid-link {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
    }

    .project-neighbor {
        grid-row: 2;
    }

    .project-neighbor strong {
        font-size: 12px;
    }

    .portfolio-not-found {
        min-height: 50vh;
    }
}

@media (max-width: 420px) {
    .portfolio-filter-note {
        font-size: 6px;
    }

    .project-facts {
        gap: 12px;
    }
}