* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.page-cover {
    font-family: 'Karla', sans-serif;
    background: #e6dfd4;
    color: #faf9f7;
    overflow: hidden;
}

.cover-video {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: #e6dfd4;
}

.cover-video__panel {
    position: absolute;
    overflow: hidden;
}

.cover-video video {
    display: block;
    max-width: none !important;
    max-height: none !important;
    appearance: none;
    -webkit-appearance: none;
}

.cover-video video::-webkit-media-controls,
.cover-video video::-webkit-media-controls-enclosure,
.cover-video video::-webkit-media-controls-panel,
.cover-video video::-webkit-media-controls-play-button,
.cover-video video::-webkit-media-controls-start-playback-button,
.cover-video video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

.cover-video__panel--full {
    top: 0;
    left: 0;
    bottom: 0;
    width: 46%;
    z-index: 1;
}

.cover-video__panel--full video {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    transform: scale(1.12);
    transform-origin: center bottom;
}

.cover-video__panel--zoom {
    top: 0;
    right: 0;
    bottom: 0;
    left: 46%;
    z-index: 0;
}

.cover-video__panel--zoom video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 128%;
    height: 128%;
    object-fit: cover;
    object-position: center center;
    transform: translate3d(-50%, -50%, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cover-video__still {
    display: none;
}

.cover-video__panel.is-video-fallback video {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.cover-video__panel.is-video-fallback .cover-video__still {
    display: block;
    position: absolute;
    z-index: 1;
    max-width: none !important;
    max-height: none !important;
}

.cover-video__panel--full.is-video-fallback .cover-video__still {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    transform: scale(1.12);
    transform-origin: center bottom;
}

.cover-video__panel--zoom.is-video-fallback .cover-video__still {
    top: 50%;
    left: 50%;
    width: 128%;
    height: 128%;
    object-fit: cover;
    object-position: center center;
    transform: translate3d(-50%, -50%, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cover-video__grain,
.cover-video__wash {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cover-video__grain {
    z-index: 2;
    opacity: 0.42;
    mix-blend-mode: overlay;
    background-image: url("grain-tile.png");
    background-size: 128px 128px;
}

.cover-video__wash {
    z-index: 3;
    background:
        linear-gradient(180deg, rgba(250, 249, 247, 0.28) 0%, rgba(250, 249, 247, 0.12) 40%, rgba(18, 16, 14, 0.28) 100%),
        rgba(250, 249, 247, 0.08);
}

.cover {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11vh 1.5rem 4rem;
    overflow: visible;
}

.cover-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    z-index: 2;
    margin-bottom: 6vh;
    user-select: none;
    color: #faf9f7;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.4);
}

.cover-icons {
    position: relative;
    width: min(1120px, 96vw);
    flex: 1;
    min-height: 560px;
    overflow: visible;
    pointer-events: none;
    touch-action: none;
}

.cover-icon {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 142px;
    height: auto;
    text-decoration: none;
    color: #faf9f7;
    cursor: grab;
    animation: cover-float 8s ease-in-out infinite;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    overflow: visible;
    pointer-events: auto;
}

.cover-icon--window {
    width: 111px;
}

.cover-icon--show {
    width: 114px;
}

.cover-icon--thesis,
.cover-icon--illustrations {
    width: 180px;
}

.cover-icon img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    background: transparent !important;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.42));
    transform: scale(1);
    transform-origin: center bottom;
    transition: filter 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.cover-icon__name {
    position: absolute;
    left: 50%;
    top: 100%;
    bottom: auto;
    transform: translateX(-50%);
    max-width: 12rem;
    margin: 10px 0 0;
    padding: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.68rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    line-height: 1.25;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    color: #faf9f7;
    background: none;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45), 0 0 1px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* The archive artwork ends at row 886 of its 1200px transparent canvas.
   Follow that visible edge with the existing bottom-origin 1.08 hover scale. */
.cover-icon[data-id="prints"] .cover-icon__name {
    top: 71.74%;
}

.cover-icon:hover,
.cover-icon:focus,
.cover-icon:focus-visible,
.cover-icon:active,
.cover-icon.is-hover {
    z-index: 6;
    animation-play-state: paused;
}

.cover-icon:hover img,
.cover-icon:focus img,
.cover-icon:focus-visible img,
.cover-icon:active img,
.cover-icon.is-hover img {
    transform: scale(1.08);
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.55)) brightness(1.16) contrast(1.08);
}

.cover-icon:hover .cover-icon__name,
.cover-icon:focus .cover-icon__name,
.cover-icon:focus-visible .cover-icon__name,
.cover-icon:active .cover-icon__name,
.cover-icon.is-hover .cover-icon__name {
    opacity: 1;
}

.cover-icon.is-dragging {
    cursor: grabbing;
    animation: none;
    z-index: 5;
}

.cover-icon.is-dragging .cover-icon__name,
.cover-icon.is-dragging:hover .cover-icon__name,
.cover-icon.is-dragging:active .cover-icon__name,
.cover-icon.is-dragging.is-hover .cover-icon__name {
    opacity: 0;
}

.cover-icon:nth-child(1) { animation-duration: 7.2s; animation-delay: -0.4s; }
.cover-icon:nth-child(2) { animation-duration: 8.1s; animation-delay: -1.6s; }
.cover-icon:nth-child(3) { animation-duration: 6.9s; animation-delay: -2.3s; }
.cover-icon:nth-child(4) { animation-duration: 7.8s; animation-delay: -0.9s; }
.cover-icon:nth-child(5) { animation-duration: 8.6s; animation-delay: -3.1s; }
.cover-icon:nth-child(6) { animation-duration: 7.4s; animation-delay: -1.8s; }
.cover-icon:nth-child(7) { animation-duration: 9s; animation-delay: -2.7s; }
.cover-icon:nth-child(8) { animation-duration: 6.6s; animation-delay: -0.6s; }
.cover-icon:nth-child(9) { animation-duration: 8.3s; animation-delay: -3.5s; }

@keyframes cover-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -10px, 0); }
}

@media (max-width: 768px) {
    .cover-video__panel--zoom {
        display: none;
    }

    .cover-video__panel--full {
        width: 100%;
    }

    .cover-video__panel--full video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        transform: scale(1.55);
        transform-origin: center center;
    }

    .cover-video__panel--full.is-video-fallback .cover-video__still {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        transform: scale(1.55);
        transform-origin: center center;
    }

    .cover-video__grain {
        opacity: 0.48;
    }

    .cover-video__wash {
        background:
            linear-gradient(180deg, rgba(250, 249, 247, 0.26) 0%, rgba(250, 249, 247, 0.1) 42%, rgba(18, 16, 14, 0.32) 100%),
            rgba(250, 249, 247, 0.08);
    }

    .cover {
        padding:
            max(6vh, env(safe-area-inset-top, 0px) + 2.5rem)
            max(0.9rem, env(safe-area-inset-right, 0px))
            max(2.5rem, env(safe-area-inset-bottom, 0px) + 1rem)
            max(0.9rem, env(safe-area-inset-left, 0px));
        min-height: 100dvh;
    }

    .cover-name {
        font-size: 1.3rem;
        letter-spacing: 0.12em;
        margin-bottom: 3vh;
    }

    .cover-icons {
        min-height: min(68dvh, 520px);
        width: 100%;
    }

    .cover-icon {
        width: 97px;
    }

    .cover-icon--window {
        width: 77px;
    }

    .cover-icon--show {
        width: 79px;
    }

    .cover-icon--thesis,
    .cover-icon--illustrations {
        width: 119px;
    }

    .cover-icon__name {
        top: 100%;
        bottom: auto;
        margin-top: 10px;
        max-width: 9rem;
        font-size: 0.58rem;
        letter-spacing: 0.08em;
        background: none;
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .cover-icons {
        min-height: min(72dvh, 480px);
    }

    .cover-icon {
        width: 86px;
    }

    .cover-icon--window {
        width: 70px;
    }

    .cover-icon--show {
        width: 72px;
    }

    .cover-icon--thesis,
    .cover-icon--illustrations {
        width: 106px;
    }

    .cover-icon__name {
        font-size: 0.54rem;
        letter-spacing: 0.08em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cover-icon {
        animation: none;
    }

    .cover-video {
        background: #faf9f7;
    }

    .cover-name {
        color: #1a1a1a;
        text-shadow: none;
    }

    .cover-icon__name {
        color: #1a1a1a;
        text-shadow: none;
    }
}
