/* Page « Works » — liste sobre des projets, aperçu flottant au survol */

.works{
    margin-bottom: 120px;
}

/* En-tête */
.works-header{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 64px;
}
.works-header h1{
    font-size: 96px;
    font-weight: 400;
    line-height: 1;
    color: #121212;
}
.works-header h1 span{
    font-family: 'Author', sans-serif;
    font-style: italic;
    font-weight: 600;
    color: #609A7E;
}
.works-header p{
    max-width: 360px;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    color: #121212;
}

/* Liste */
.works-list{
    list-style: none;
    border-bottom: 1px solid rgba(18, 18, 18, 0.12);
}
.works-list li{
    border-top: 1px solid rgba(18, 18, 18, 0.12);
}
.works-list a{
    display: grid;
    grid-template-columns: 56px 1fr auto 40px;
    align-items: center;
    gap: 24px;
    padding: 32px 0;
    color: #121212;
    text-decoration: none;
    cursor: inherit;
    transition: opacity .4s ease;
}
.works-index{
    font-size: 14px;
    font-weight: 300;
    color: rgba(18, 18, 18, 0.68);
    font-variant-numeric: tabular-nums;
}
.works-title{
    font-size: 56px;
    font-weight: 400;
    line-height: 1.05;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1), color .3s ease;
}
.works-meta{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.4;
}
.works-meta strong{
    font-weight: 500;
}
.works-arrow{
    justify-self: end;
    font-size: 24px;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity .3s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}
/* Vignette : visible seulement sur grand écran tactile (masquée en mobile) */
.works-thumb{
    display: none;
}

/* Survol / focus : les autres projets s'estompent, le titre glisse */
@media (hover: hover){
    .works-list:hover a,
    .works-list:has(a:focus-visible) a{
        opacity: .3;
    }
}
.works-list a:hover,
.works-list a:focus-visible{
    opacity: 1 !important;
    text-decoration: none; /* annule le soulignement global de style.css */
}
/* Le glissement du titre est réservé à la souris : au doigt, un tap ne doit pas
   laisser le titre décalé en revenant sur la page */
@media (hover: hover){
    .works-list a:hover .works-title{
        transform: translateX(24px);
        color: #609A7E;
    }
}
.works-list a:focus-visible .works-title{
    transform: translateX(24px);
    color: #609A7E;
}
.works-list a:hover .works-arrow,
.works-list a:focus-visible .works-arrow{
    opacity: 1;
    transform: translateX(0);
}
.works-list a:focus-visible{
    outline: 2px solid #609A7E;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Aperçu flottant qui suit le curseur */
.works-preview{
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 380px;
    aspect-ratio: 1224 / 702;
    border-radius: 16px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(.85);
    transition: opacity .18s ease-out;
    will-change: transform, opacity;
    box-shadow: 0 24px 48px -16px rgba(18, 18, 18, 0.35);
}
.works-preview.is-visible{
    opacity: 1;
}
.works-preview img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* révélation par rideau du bas vers le haut */
    clip-path: inset(100% 0 0 0);
    transform: scale(1.15);
    transition: clip-path .7s cubic-bezier(.22, 1, .36, 1), transform .9s cubic-bezier(.22, 1, .36, 1);
}
.works-preview img.is-active{
    clip-path: inset(0 0 0 0);
    transform: scale(1);
    z-index: 1;
}
/* Première apparition : pas de rideau, l'image est là tout de suite */
.works-preview.is-instant img{
    transition: none;
}

/* Tablette / mobile, ou écrans tactiles : pas d'aperçu flottant, vignette dans la ligne */
@media (hover: none), (max-width: 900px){
    .works-preview{ display: none; }
    .works-thumb{
        display: block;
        grid-column: 1 / -1;
        width: 100%;
        aspect-ratio: 1224 / 702;
        object-fit: cover;
        border-radius: 12px;
    }
    .works-arrow{ display: none; }
}
@media (max-width: 900px){
    .works-header{ flex-direction: column; align-items: flex-start; margin-bottom: 40px; }
    .works-header h1{ font-size: clamp(44px, 12vw, 56px); }
    .works-list a{
        grid-template-columns: 40px 1fr;
        gap: 12px 16px;
        padding: 24px 0;
    }
    .works-title{ font-size: 32px; }
    /* Mobile : pas de visuel, la liste reste compacte en hauteur */
    .works-thumb{ display: none; }
    .works-meta{
        grid-column: 2;
        align-items: flex-start;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce){
    .works-list a,
    .works-title,
    .works-arrow,
    .works-preview,
    .works-preview img{
        transition: none;
    }
    .works-list a:hover .works-title,
    .works-list a:focus-visible .works-title{
        transform: none;
    }
}
