/* --- OVERLAY DE DETAIL DU PROJET --- */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 98;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
}

.detail-overlay.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* BOUTON FERMER RESTAURÉ (Style Mono Original + Blend Mode) */
#close-detail-btn {
    position: fixed;
    top: 100px;
    right: 50px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: var(--mono);
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 100;
    mix-blend-mode: difference;
    outline: none;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 1;
    visibility: visible;
    transition: transform 0.2s ease;
}

/* Hero Title Section */
.detail-hero {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px;
    box-sizing: border-box;
}

.detail-title-container {
    overflow: hidden;
}

/* Alignement du titre à gauche et du hint de scroll tout à droite */
.detail-title-wrapper {
    display: flex;
    align-items: end;
    justify-content: space-between;
    width: 100%;
}

/* Style et état initial (masqué) de la souris */
.scroll-hint {
    opacity: 0;
    transform: translateY(12px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Dimensions augmentées de la souris SVG */
.scroll-hint .mouse-icon {
    width: 32px;   /* Augmenté (au lieu de 22px) */
    height: 50px;  /* Augmenté (au lieu de 34px) */
    display: block;
}

/* Ajustement de l'amplitude de l'animation de la molette pour la nouvelle taille */
.scroll-hint .mouse-wheel {
    animation: mouseScrollAnim 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    transform-origin: center;
}

@keyframes mouseScrollAnim {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    60% {
        transform: translateY(8px); /* Course de défilement légèrement rallongée */
        opacity: 0;
    }
    61% {
        transform: translateY(-3px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

#detail-title {
    font-family: var(--hero);
    font-size: clamp(8rem, 15vw, 24rem);
    color: #ffffff;
    margin: 0;
    font-weight: 500;
    line-height: 0.85;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- DESIGN SECTION BLANCHE (Awwwards Style) --- */
.project-content {
    background-color: #ffffff;
    color: #0d0d0d;
    width: 100%;
    min-height: 100vh;
    padding: 120px 60px 180px 60px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    border-radius: 0 0 78px 78px;
}

/* Barre de métadonnées supérieure */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding-bottom: 24px;
    margin-bottom: 100px;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #666666;
    text-transform: uppercase;
}

.content-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 120px;
    align-items: start;
}

/* Colonne Gauche (Textes) */
.col-text {
    display: flex;
    flex-direction: column;
    gap: 120px;
    padding-top: 20px;
}

.text-block {
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 30px;
}

.block-index {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: #888888;
    display: block;
    margin-bottom: 16px;
}

.text-block h2 {
    font-family: var(--hero);
    font-size: clamp(3.1rem, 4.6vw, 5.7rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.4px;
    margin: 0 0 24px 0;
    color: #0d0d0d;
    text-transform: uppercase;
}

.text-block p {
    font-family: var(--corps);
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444444;
    max-width: 480px;
    font-weight: 300;
}

/* Colonne Droite (Images) */
.col-images {
    display: flex;
    flex-direction: column;
    gap: 140px;
}

.point {
    color: var(--primary);
    font-family: Arial, sans-serif;
    font-size: clamp(5.6rem, 6.8vw, 8rem);
}

/* --- GESTION DES TAILLES D'IMAGES ET ORIENTATIONS --- */
.image-slot-wrapper {
    width: 100%;
    margin-bottom: 2.5rem;
    position: relative;
    background: transparent !important;
    border-radius: 6px;
    overflow: hidden;
}

.image-slot-wrapper.is-landscape {
    aspect-ratio: var(--video-aspect, 16 / 9);
    width: 100%;
}

/* Redimensionnement dynamique ajusté au ratio réel sans bandes noires (Légèrement agrandi) */
.image-slot-wrapper.is-portrait {
    aspect-ratio: var(--video-aspect, 9 / 16);
    width: 100%;
    max-width: min(480px, calc(76vh * var(--video-aspect, 9 / 16)));
    margin-left: auto;
    margin-right: auto;
}

.image-slot,
.custom-video-player {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: transparent;
}

/* Remplissage strict à 100% sans bordures ni rognage */
.image-slot img,
.custom-video-player video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    background-color: transparent !important;
}

/* Slot fantôme (Placeholder sombre) */
.video-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: transparent !important;
    pointer-events: none;
}

/* --- ANIMATIONS DANS LA GRILLE --- */
.custom-video-player.is-sliding-out-of-grid {
    transform: translateY(70px) scale(0.93) !important;
    opacity: 0 !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.custom-video-player.is-returning-to-grid {
    transform: translateY(60px) scale(0.94) !important;
    opacity: 0 !important;
    transition: none !important;
}

.custom-video-player.is-returned-to-grid {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Positionnement du label en bas à gauche avec contraste dynamique */
.slot-label {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    color: #ffffff;
    mix-blend-mode: difference;
    font-family: monospace;
    font-size: 0.93rem;
    letter-spacing: 0.05em;
    z-index: 15;
    pointer-events: none;
    margin: 0;
    padding: 0;
    font-weight: 400;
}

/* Masquage strict du label en mode plein écran */
.custom-video-player.is-fullscreen-mode .slot-label {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* --- PLAYER VIDÉO BRUT MINIMALISTE --- */
.custom-video-player {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 0 !important;
}

.custom-video-player video {
    border-radius: 0 !important;
}

/* Masque d'assombrissement fluide au survol de la vidéo */
.custom-video-player::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 40%, transparent 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 16;
}

.custom-video-player:hover::after {
    opacity: 1;
}

/* Conteneur principal des contrôles */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.75rem;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--mono), monospace;
    color: #ffffff;
    mix-blend-mode: difference;
    border-radius: 0 !important;
    pointer-events: auto;
}

.custom-video-player:hover .video-controls {
    opacity: 1;
}

.v-timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.v-timeline-container {
    width: 100%;
    height: 24px;
    cursor: pointer;
    position: relative;
    background: transparent;
}

.v-timeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
    transition: height 0.25s ease;
}

.v-progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 1px;
    width: 0%;
    background: #ffffff;
    transform: translateY(-50%);
    z-index: 2;
    transition: height 0.25s ease;
    pointer-events: none;
}

.v-timeline-container:hover::before,
.v-timeline-container:hover .v-progress-fill {
    height: 3px;
}

.v-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v-right-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.v-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-family: var(--mono), monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 2px 0;
    position: relative;
    display: inline-block;
    border-radius: 0 !important;
}

/* --- MODE PLEIN ÉCRAN CINÉMA (ÉCRAN CATHODIQUE CRT CREATIVE DEV) --- */

/* Conteneur principal en Plein Écran */
.custom-video-player.is-fullscreen-mode {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, calc(-50% + 120px)) scale(0.88);
    opacity: 0 !important;
    width: 65vw !important;
    max-width: 980px !important;
    height: auto !important;
    aspect-ratio: var(--video-aspect, 16 / 9);
    z-index: 999999 !important;
    overflow: visible !important; /* Maintient le masque noir ::before intact */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Adaptabilité Portrait */
.custom-video-player.is-fullscreen-mode.is-portrait,
.custom-video-player.is-fullscreen-mode[data-orientation="portrait"] {
    width: auto !important;
    max-width: 90vw !important;
    height: 82vh !important;
    max-height: 85vh !important;
    aspect-ratio: var(--video-aspect, 9 / 16) !important;
}

.custom-video-player.is-fullscreen-mode.is-active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1 !important;
}

.custom-video-player.is-fullscreen-mode.is-exiting {
    transform: translate(-50%, calc(-50% + 100px)) scale(0.9);
    opacity: 0 !important;
    transition: transform 0.45s cubic-bezier(0.7, 0, 0.84, 0),
    opacity 0.4s cubic-bezier(0.7, 0, 0.84, 0);
}

/* Flux Vidéo : Galbé CRT réajusté à la hausse avec raccords d'angles ultra-fluides */
.custom-video-player.is-fullscreen-mode video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'><path d='M 70,40 Q 500,6 930,40 Q 960,40 960,70 Q 994,500 960,930 Q 960,960 930,960 Q 500,994 70,960 Q 40,960 40,930 Q 6,500 40,70 Q 40,40 70,40 Z' fill='%23000'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'><path d='M 70,40 Q 500,6 930,40 Q 960,40 960,70 Q 994,500 960,930 Q 960,960 930,960 Q 500,994 70,960 Q 40,960 40,930 Q 6,500 40,70 Q 40,40 70,40 Z' fill='%23000'/></svg>");
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    border-radius: 0 !important;
    transform: none !important;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.95));
}

/* Overlay Cathodique : Recouvrement 100% identique au masque vidéo */
.custom-video-player.is-fullscreen-mode::after {
    content: '';
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    z-index: 22;
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'><path d='M 70,40 Q 500,6 930,40 Q 960,40 960,70 Q 994,500 960,930 Q 960,960 930,960 Q 500,994 70,960 Q 40,960 40,930 Q 6,500 40,70 Q 40,40 70,40 Z' fill='%23000'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='none'><path d='M 70,40 Q 500,6 930,40 Q 960,40 960,70 Q 994,500 960,930 Q 960,960 930,960 Q 500,994 70,960 Q 40,960 40,930 Q 6,500 40,70 Q 40,40 70,40 Z' fill='%23000'/></svg>");
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    background:
            linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
            radial-gradient(circle at center, transparent 62%, rgba(0, 0, 0, 0.38) 100%),
            linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 35%);
    background-size: 100% 3px, 100% 100%, 100% 100%;
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

/* Recalage sécurisé des contrôles dans la zone d'écran CRT */
.custom-video-player.is-fullscreen-mode .video-controls {
    position: absolute !important;
    bottom: 4.5% !important;
    left: 5.5% !important;
    right: 5.5% !important;
    width: auto !important;
    padding: 0.5rem 1rem !important;
    z-index: 25 !important;
}

/* Plein Écran HTML5 Natif (fallback) */
.custom-video-player:fullscreen,
.custom-video-player:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000 !important;
}

.custom-video-player:fullscreen video,
.custom-video-player:-webkit-full-screen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Masque de fond noir d'origine conservé */
.custom-video-player.is-fullscreen-mode::before {
    content: '';
    position: fixed;
    top: -100vh;
    left: -100vw;
    width: 300vw;
    height: 300vh;
    background: #050505;
    opacity: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
    pointer-events: none !important;
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-video-player.is-fullscreen-mode.is-active::before {
    opacity: 0.94;
}

.custom-video-player.is-fullscreen-mode.is-exiting::before {
    opacity: 0;
    transition: opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- RUPTURE NOIRE & DOSSIER SEPARÉ DU PROJET --- */
.next-project-wrapper {
    width: 100%;
    background-color: #000000;
    margin-top: -65px;
    padding-top: 90px;
    padding-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-sizing: border-box;
}

.next-project-folder {
    width: 95%;
    height: 55px;
    background-color: #3e3e3e;
    border-radius: 40px 40px 0 0;
    cursor: none;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.4s ease;
    overflow: hidden;
}

.next-project-folder:hover {
    background-color: #ffffff;
    height: 61px;
    transform: translateY(-6px);
}

.detail-overlay {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE / Edge */
}

.detail-overlay::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}