/* ========================================== WORK PAGE ========================================== */

.work-page .main-card {
    display: block;
    width: 100%;
    padding: 32px;
    min-height: 100vh;
    box-sizing: border-box;
}

.work-page .content-section {
    width: 100%;
    padding: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 64px);
}

.work-page .content-top-section {
    align-items: flex-start;
}

.work-page .about-baseline-section {
    margin-top: 16px;
    position: relative;
    min-height: 0;
    flex: 1;
}

.projects-hover-float {
    --hover-offset-x: 0px;
    --hover-offset-y: 8px;
    --hover-motion-x: 0px;
    --hover-motion-y: 0px;
    --hover-tilt-x: 0deg;
    --hover-tilt-y: 0deg;
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: flex-end;
    gap: 32px;
    width: var(--hover-width, 320px);
    opacity: 0;
    transform:
        translate3d(var(--hover-offset-x), var(--hover-offset-y), 0)
        perspective(1100px)
        rotateX(var(--hover-tilt-y))
        rotateY(var(--hover-tilt-x));
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 4;
    will-change: transform;
}

.projects-hover-float.is-active {
    --hover-offset-y: 0px;
    opacity: 1;
}

.projects-hover-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translate3d(var(--hover-motion-x), var(--hover-motion-y), 0);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.projects-hover-title {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: 0;
}

.projects-hover-desc {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: 0;
    text-align: justify;
}

.projects-hover-arrow {
    width: 80px;
    height: 80px;
    display: block;
    background: url("fichiers/arrow-left.svg") center / contain no-repeat;
    transform: translate3d(var(--hover-motion-x), var(--hover-motion-y), 0);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.dark-theme .projects-hover-arrow {
    filter: invert(1);
}

.projects-gallery-section {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    width: 100%;
}

.work-page .footer-group {
    margin-top: 0;
}

.project-item {
    --pointer-x: 0;
    --pointer-y: 0;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    border-radius: 6px !important;
    text-decoration: none;
    color: inherit;
    background: transparent;
}

.project-tilt-layer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    transform: perspective(1100px) rotateX(calc(var(--pointer-y) * -6deg)) rotateY(calc(var(--pointer-x) * 6deg));
    transform-origin: 50% 50%;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.project-media {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    transform: translate3d(calc(var(--pointer-x) * -16px), calc(var(--pointer-y) * -16px), 0) scale(1.08);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.project-item.is-hover-active .project-media {
    transform: translate3d(calc(var(--pointer-x) * -16px), calc(var(--pointer-y) * -16px), 0) scale(1.12);
}

.project-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.project-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.18s linear;
    z-index: 2;
    will-change: transform;
    border-radius: inherit;
}

.project-image-default {
    opacity: 1;
}

.project-image-hover {
    opacity: 1;
    z-index: 1;
}

.project-item.is-hover-active .project-image-default {
    opacity: 0;
}

.project-cta,
.project-meta,
.project-item::before,
.project-item::after {
    display: none;
}

@media (max-width: 900px) {
    .work-page .main-card {
        padding: 24px;
        min-height: 100vh;
    }

    .work-page .about-baseline-section {
        margin-top: 24px;
    }

    .projects-hover-float {
        display: none;
    }

    .projects-gallery-section {
        position: static;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-item {
        aspect-ratio: 3 / 2 !important;
    }
}
