#landing.work-landing {
    --work-edge: clamp(20px, 3vw, 56px);
    --work-bg: #141316;
    position: relative;
    height: auto;
    min-height: 100svh;
    max-height: none;
    padding: 0;
    overflow: clip;
    background-color: var(--work-bg);
    color: #fff;
    transition: background-color 1.1s var(--ease-out-circ);
}

.work-landing #main2 {
    position: absolute;
    top: 0;
}

.work-landing .david-art-section[hidden] {
    display: none;
}

.work-landing #hello[data-shared-wordmark] {
    position: absolute;
}

.work-landing.has-work-selection #hello {
    z-index: 0;
}

.work-landing.has-work-selection #hello .work-logo-scale {
    transform: scale(var(--active-wordmark-scale));
}

.work-landing .summary-mobile {
    z-index: 2;
}

.work-landing.has-work-selection .nav,
.work-landing.has-work-selection .nav a,
.work-landing.has-work-selection .summary-mobile {
    mix-blend-mode: normal;
}

.work-landing #main.work-carousel {
    position: relative;
    z-index: 0 !important;
    min-height: 100svh;
}

.work-orbit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    align-items: center;
    gap: 20px;
    padding: 120px var(--work-edge) 100px;
}

.work-card {
    display: block;
    color: inherit;
}

.work-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 5px;
}

.work-card-images {
    display: block;
    position: relative;
    overflow: hidden;
}

.work-card img {
    display: block;
    width: 100%;
    pointer-events: none;
}

.work-card img.work-preview {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity .5s var(--ease-out-circ);
}

.work-card img.work-preview.is-visible {
    opacity: 1;
}

.work-card img.work-cover {
    transition: opacity .5s var(--ease-out-circ);
}

.work-card.is-previewing img.work-cover {
    opacity: 0;
}

.work-carousel.is-ready {
    height: max(540px, 100svh);
}

.is-ready .work-orbit {
    --orbit-bottom: clamp(100px, 14svh, 145px);
    display: block;
    position: absolute;
    inset: clamp(82px, 12svh, 132px) 0 calc(var(--orbit-bottom) + var(--orbit-nav-clearance, 0px));
    padding: 0;
    touch-action: pan-y pinch-zoom;
    cursor: url('main/cursorresize.png') 24 16, grab;
    user-select: none;
}

.is-ready .work-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--card-width);
    cursor: url('main/cursorhover.png') 0 31, pointer;
}

.work-landing.is-project-leaving .work-card:not([aria-describedby]) {
    opacity: 0 !important;
    transition: opacity var(--card-departure-duration, .32s) cubic-bezier(.83, 0, .17, 1) var(--departure-delay, 0ms);
    pointer-events: none !important;
}

.is-ready .work-card-images {
    height: var(--card-height);
}

.is-ready .work-cover {
    height: 100%;
    object-fit: contain;
}

.work-orbit.is-dragging,
.work-orbit.is-dragging .work-card {
    cursor: url('main/cursorresize.png') 24 16, grabbing;
}

.work-controls {
    position: absolute;
    bottom: max(clamp(56px, 8svh, 90px), env(safe-area-inset-bottom));
    right: calc(var(--nav-inline-padding) + var(--button-inline-padding));
    z-index: 2;
    display: flex;
    align-items: center;
}

.work-controls[hidden] {
    display: none;
}

.work-controls:not(.is-revealing) {
    visibility: hidden;
}

.work-controls.is-revealing button {
    animation: work-control-appear .32s var(--ease-out-circ) both;
}

.work-controls.is-revealing button + button {
    animation-delay: .12s;
}

@keyframes work-control-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.work-controls button {
    display: grid;
    width: 32px;
    height: 44px;
    place-items: center end;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.work-controls img {
    width: 16px;
    height: 16px;
    filter: invert(1);
    pointer-events: none;
    transition: transform .2s var(--ease-out-circ);
}

.work-controls [data-work-previous] {
    cursor: url('main/cursor-left.png') 16 16, pointer;
}

.work-controls [data-work-next] {
    cursor: url('main/cursor-right.png') 16 16, pointer;
}

.work-controls button:hover img {
    transform: scale(1.5);
}

.work-landing:has([data-work-project="works"][aria-describedby]) .work-controls img {
    filter: none;
}

.work-landing:has([data-work-project="works"][aria-describedby]) .nav a,
.work-landing:has([data-work-project="works"][aria-describedby]) .summary-mobile {
    color: var(--black) !important;
}

.work-controls button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 2px;
    color: inherit;
}

#cursor-label.work-caption {
    display: block;
    max-width: calc(100vw - 28px);
    transform: translate(var(--caption-x, 0), var(--caption-y, 0));
}

#cursor-label.work-caption.is-visible {
    opacity: 1;
}

#cursor-label.work-caption:not(.is-floating) {
    inset: auto auto clamp(104px, 13svh, 134px) clamp(20px, 3vw, 56px);
    transform: none;
    white-space: normal;
}

@media (min-width: 769px) {
    #cursor-label.work-caption.is-pinned:not(.is-floating) {
        inset: auto auto calc(100% - var(--caption-logo-top) + 32px) 48px;
        max-width: calc(100% - 96px);
    }
}

@media (max-width: 768px) {
    .work-landing {
        --card-departure-duration: .2s;
    }

    .work-landing.is-project-leaving .summary-mobile,
    body:has(#fader.fade-in) .work-landing .summary-mobile {
        opacity: 0;
        transition: opacity .24s var(--ease-out-circ);
    }

    @media (prefers-reduced-motion: reduce) {
        .work-landing.is-project-leaving .summary-mobile,
        body:has(#fader.fade-in) .work-landing .summary-mobile {
            transition: none;
        }
    }
    .is-ready .work-orbit {
        --orbit-bottom: 130px;
        top: 108px;
    }

    #cursor-label.work-caption {
        font-size: clamp(2.25rem, 9vw, 4rem);
        letter-spacing: -.08em;
        white-space: normal;
    }

    #cursor-label.work-caption.is-pinned:not(.is-floating) {
        inset: auto 24px calc(100% - var(--caption-logo-top) + 20px) 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #landing.work-landing,
    .work-landing #hello .work-logo-scale,
    #cursor-label.work-caption,
    .work-card img.work-cover,
    .work-card img.work-preview {
        transition: none;
    }

    .work-landing #hello #smiley {
        animation: none;
    }

    .work-controls.is-revealing button {
        animation: none;
    }

    .work-controls img {
        transition: none;
    }
}
