:root {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --accent-color: #ffffff;
    --transition-speed: 0.4s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'IBM Plex Mono', monospace;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Thème Blanc pour la Home */
body.home-theme {
    background-color: #ffffff;
    color: #000000;
}

body.home-theme .header {
    background: none;
}

body.home-theme .logo svg path,
body.home-theme .logo svg rect,
body.home-theme .logo svg polygon {
    fill: #000000 !important;
}

body.home-theme .nav-link {
    color: #000000;
}

body.home-theme .nav-link:hover {
    opacity: 0.6;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Aligné en haut pour laisser de la place au nav */
    padding: 2rem 4rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.5) 0%, rgba(5, 5, 5, 0) 100%);
    pointer-events: none;
}

.header>* {
    pointer-events: auto;
}

.logo {
    display: flex;
    align-items: center;
}

.logo svg {
    height: 32px;
    width: auto;
}

.logo svg path,
.logo svg rect,
.logo svg polygon {
    fill: white;
    transition: fill 0.5s ease;
}

.logo a {
    display: block;
    width: 100%;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s, opacity 0.3s;
    letter-spacing: 0.12em;
}

.nav-link:hover {
    opacity: 0.7;
}
/* Gallery Container - Flexbox Justified Layout */
.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0; 
    min-height: 100vh;
    width: 100%;
    position: relative;
    z-index: 10;
    align-items: stretch; /* Garantit la même hauteur pour tous les items d'une ligne */
}

.gallery-item {
    flex: 1 1 30%; /* Environ 1/3 par défaut (3 images par ligne) */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #050505; /* Plus sombre pour que d'éventuels micro-trous se fondent dans le fond du site */
    transition: flex-grow 0.3s ease;
}

.gallery-item:hover {
    transform: none;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    /* État initial : invisible, simple fade-in */
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.4s ease;
}

/* Classe déclenchée par JS au chargement réel */
.gallery-item.reveal img,
.gallery-item.reveal video {
    opacity: 1;
}

/* Cas spécifiques où le ratio est FORCÉ (Point 41 du README) */
.gallery-item[class*="ratio-"] {
    aspect-ratio: auto; /* Sera écrasé par la classe spécifique */
    background-color: #000;
}

.gallery-item[class*="ratio-"] img,
.gallery-item[class*="ratio-"] video {
    height: 100%;
    object-fit: cover; /* Remplit la case uniquement si un ratio est demandé */
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.03); /* Zoom très léger */
    opacity: 1; /* Pas d'assombrissement */
}


/* Lightbox overlay */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.95);
    transition: transform var(--transition-speed) ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    font-weight: 300;
    z-index: 1001;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.05em;
    text-align: center;
    max-width: 80%;
    opacity: 0;
    transition: opacity var(--transition-speed) ease 0.2s; /* Petit délai pour l'apparition */
    font-weight: 300;
}

.lightbox.active .lightbox-caption {
    opacity: 1;
}

/* Flex Width Control */
.w-1-2 {
    flex-basis: 48%; /* Environ la moitié (2 images par ligne) */
}

.w-36 {
    flex-basis: 36%; /* Pour une image 1:1 à côté d'une image 16:9 */
}

.w-64 {
    flex-basis: 64%; /* Pour une image 16:9 à côté d'une image 1:1 */
}

.w-70 {
    flex-basis: 70%; /* Pour une image 16:9 à côté d'une image 3:4 */
}

.w-30 {
    flex-basis: 30%; /* Pour une image 3:4 à côté d'une image 16:9 */
}

.w-43 {
    flex-basis: 43%; /* Pour une image 4:3 à côté d'une image 16:9 */
}

.w-57 {
    flex-basis: 57%; /* Pour une image 16:9 à côté d'une image 4:3 */
}

.w-full {
    flex-basis: 100%; /* Pleine largeur (1 image par ligne) */
}

/* Format forcé de la case (l'image continuera de remplir parfaitement cet espace) */
.ratio-3-4 {
    aspect-ratio: 3 / 4;
}

.ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Hauteur double (ne s'applique plus de la même façon en flex, on le garde en réserve) */

/* Responsive */
/* Page Info */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 40px;
    letter-spacing: 0.2em;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #fff;
    font-weight: 300;
    white-space: pre-wrap;
    letter-spacing: 0.02em;
}

@media (max-width: 1024px) {
    .lightbox-close {
        top: 15px;
        right: 20px;
    }
}

/* Home Page Links */
.home-links {
    padding-top: 25vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 4rem;
    gap: 0.5rem;
}

.home-links a {
    font-size: 4rem;
    font-weight: 400;
    text-decoration: none;
    color: #000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    letter-spacing: -0.02em;
    font-family: 'Roboto Mono', monospace;
    text-transform: uppercase;
    position: relative;
    z-index: 20;
}

.home-links a:hover {
    transform: translateX(15px);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1.5rem;
    }
    .home-links {
        padding-left: 0;
        padding-top: 12vh;
        align-items: center;
        text-align: center;
        gap: 0.3rem;
    }
    .home-links a {
        font-size: 2.2rem;
    }
}

.contact-text-block {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    line-height: 1.4;
    text-wrap: balance;
}

.contact-baseline {
    display: flex;
    justify-content: center;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
    color: #000; /* As the contact page has the home-theme */
}

.contact-email {
    font-size: 1.2rem;
    text-decoration: none;
    margin-top: 10px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .contact-title {
        font-size: clamp(0.85rem, 4.2vw, 1.5rem);
    }
    .contact-email {
        font-size: clamp(0.8rem, 4vw, 1.2rem);
    }
    .contact-baseline {
        font-size: clamp(0.6rem, 3vw, 0.9rem);
    }
}
/* --- Nouvelles Animations Home --- */

/* Conteneur pour la grille (Desktop) */
#hover-preview-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 66vw; /* Plus grand, s'étend vers la gauche (2/3 de l'écran) */
    height: 100vh;
    padding: 0 0 0 2rem; /* Collé en haut, en bas et à droite */
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
    
    /* Grille pour limiter le rognage : on centre verticalement au lieu d'étirer */
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 15px;
    align-content: center;

    opacity: 1;
}

.floating-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4; /* Empêche le rognage massif sur grand écran en forçant une proportion portrait */
    object-fit: cover;
    pointer-events: none;
    border-radius: 0;
    /* CUT total : pas de transition */
    opacity: 1;
}

.floating-preview.active {
    opacity: 1;
}

/* Background Ambiant (Mobile) - Converti en grille sous-texte */
#ambient-background {
    position: relative;
    width: 100%;
    padding: 2rem;
    z-index: 1; 
    pointer-events: none;
    background-color: transparent;
    display: none; /* Apparaît en grille uniquement sur mobile */
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    #hover-preview-container {
        display: none;
    }
    #ambient-background {
        display: grid; /* Grille de 2 colonnes côte à côte */
        margin-top: 1.5rem;
    }
    .floating-preview {
        width: 100%;
        height: auto;
        aspect-ratio: 3/4;
        object-fit: cover;
        transition: opacity 1s ease-in-out;
    }
}

/* Style pour les vidéos flottantes */
video.floating-preview {
    background: #000;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.coming-soon-container {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    font-weight: 300;
    text-transform: uppercase;
    color: #ffffff !important;
    background-color: #050505; /* Force le fond noir pour assurer la visibilité du texte blanc */
    font-family: 'IBM Plex Mono', monospace;
    position: relative;
    z-index: 1;
}

.hover-placeholder {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 20px;
}
