/* Keep complete artwork visible, and let long page captures scroll naturally. */
.project-display img {
    object-fit: contain;
    object-position: center;
}

.project-display-desktop.project-display-page {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #a5a7b0 #10121b;
}

.project-display-desktop.project-display-page img {
    height: auto;
    object-position: top center;
}

.case-image-frame {
    max-height: none;
    overflow: visible;
}

.case-photo img {
    display: block;
}

/* The repository's earlier portfolio layout uses these selectors. */
.portfolio-shot-frame img {
    object-fit: contain;
    object-position: center;
}

.portfolio-work-card:hover .portfolio-shot-frame img {
    transform: none;
}

.portfolio-shot-frame.portfolio-shot-frame-page {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
}

.portfolio-shot-frame.portfolio-shot-frame-page img {
    height: auto;
    object-position: top center;
}

.portfolio-gallery {
    align-items: start;
}

.portfolio-gallery img {
    height: auto;
    object-fit: contain;
}

.project-display-desktop picture {
    display: block;
    width: 100%;
    height: 100%;
}

.portfolio-heading-mobile,
.portfolio-description-mobile {
    display: none;
}

@media (max-width: 750px) {
    .main-wrapper:has(.portfolio-index) {
        padding-top: 88px;
    }

    .main-wrapper:has(.portfolio-index) .aw-page-trail {
        display: none;
    }

    .portfolio-header {
        padding: 24px 20px 28px;
        text-align: left;
    }

    .portfolio-header h1 {
        margin: 0;
        font-size: clamp(32px, 9vw, 40px);
        font-weight: 600;
        line-height: 1.12;
        letter-spacing: -0.045em;
        text-wrap: balance;
    }

    .portfolio-header p {
        margin: 12px 0 0;
        max-width: 34ch;
        font-size: 15px;
        line-height: 1.6;
        text-align: left;
    }

    .portfolio-heading-desktop,
    .portfolio-description-desktop {
        display: none;
    }

    .portfolio-heading-mobile,
    .portfolio-description-mobile {
        display: inline;
    }

    .portfolio-index {
        padding-inline: 20px !important;
    }

    .portfolio-index > nav {
        gap: 6px !important;
        margin-bottom: 24px !important;
    }

    .portfolio-index > nav .btn {
        min-height: 44px;
        padding: 10px 8px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: none;
    }

    .portfolio-index > nav .btn-primary {
        background: var(--text-main, #24262b);
        border-color: var(--text-main, #24262b);
        color: var(--bg-surface-solid, #f6f7f8);
    }

    .case-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .portfolio-index .case-grid .case-card {
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: visible;
        box-shadow: none;
    }

    .portfolio-index .case-grid .case-card:hover,
    .portfolio-index .case-grid .case-card:active {
        transform: none;
        box-shadow: none;
    }

    .case-card .project-device-scene,
    .case-hero .project-device-scene {
        aspect-ratio: auto;
        min-height: 0;
        border-radius: 16px;
        border: 1px solid var(--border-solid, #dde0e3);
        background: var(--bg-surface-solid, #f6f7f8);
    }

    .case-hero .project-device-scene {
        margin: 24px 0 0;
    }

    .project-device-scene .project-device-photo,
    .project-device-scene .project-display-mobile {
        display: none;
    }

    .project-device-scene .project-display-desktop,
    .project-device-scene .project-display-desktop.project-display-page {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
        border-radius: inherit;
        background: transparent;
    }

    .project-device-scene .project-display-desktop picture {
        height: auto;
    }

    .project-device-scene .project-display-desktop img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        filter: none;
    }

    .project-device-scene .project-display::after,
    .case-card .project-device-scene::after {
        content: none;
    }

    .case-grid .case-card .case-copy {
        padding: 16px 0 0;
    }

    .case-grid .case-card .case-labels span {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: var(--text-muted, #717780);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
    }

    .case-grid .case-card .case-labels span:nth-child(n + 2) {
        display: none;
    }

    .case-grid .case-card h3 {
        margin: 9px 0 10px;
        font-size: 22px;
        font-weight: 600;
        line-height: 1.22;
        letter-spacing: -0.035em;
        text-wrap: balance;
    }

    .case-grid .case-card p {
        margin: 0 0 18px;
        font-size: 15px;
        line-height: 1.6;
        text-wrap: pretty;
    }

    .case-grid .case-card .case-bottom {
        justify-content: flex-start;
        padding-top: 14px;
        font-size: 13px;
        line-height: 1.5;
    }

    .case-grid .case-card .case-bottom > span {
        display: none;
    }

    .case-grid .case-card .case-bottom strong {
        color: var(--text-main, #24262b);
        font-weight: 600;
    }

    .project-preview-pending {
        min-height: 220px;
    }
}

@media (max-width: 360px) {
    .portfolio-index > nav {
        gap: 4px !important;
    }

    .portfolio-index > nav .btn {
        padding-inline: 6px;
    }
}
