/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --header-h: 115px;
    --bg-color: #ffffff; 
    --text-color: #000000;
    --accent-color: #FF007F;
    --hover-overlay: rgba(255, 255, 255, 0.90);
}

/* --- INTEGRATION DES TYPOGRAPHIES (NeueHaasDisplay) --- */
@font-face {
    font-family: 'NeueHaasDisplay';
    src: url('../fonts/NeueHaasDisplayRoman.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NeueHaasDisplay';
    src: url('../fonts/NeueHaasDisplayMedium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NeueHaasDisplay';
    src: url('../fonts/NeueHaasDisplayBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NeueHaasDisplay';
    src: url('../fonts/NeueHaasDisplayBlack.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --- DÉFILEMENT & CORPS DE PAGE FLUIDES --- */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'NeueHaasDisplay', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden; 
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.loaded { opacity: 1; }
body::-webkit-scrollbar { display: none; }

/* --- CURSEUR PERSONNALISÉ --- */
#custom-cursor {
    position: fixed; top: 0; left: 0; width: 35px; height: 35px;
    border: 2px solid var(--accent-color); border-radius: 50%; pointer-events: none;
    z-index: 10001; opacity: 0; transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), height 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, border-color 0.3s ease;
}

#custom-cursor.hovered {
    width: 60px; height: 60px; background-color: rgba(255, 0, 127, 0.1); border-color: rgba(255, 0, 127, 0.5);
}

/* --- HEADER FIXE --- */
header {
    position: fixed; top: 0; left: 0; width: 100%; height: 100px; display: flex;
    background-color: rgba(255, 255, 255, 0.90); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); z-index: 1000;
}

.header-left { width: 40%; height: 100%; display: flex; align-items: center; padding-left: 40px; }
.header-right { width: 60%; height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 50px; }

.site-title {
    position: absolute; left: 50%; transform: translateX(-50%); font-weight: 900;
    font-size: 1.8rem; text-transform: uppercase; letter-spacing: 1px; margin: 0;
}

nav .menu { list-style: none; display: flex; gap: 30px; }
nav .menu a { text-decoration: none; color: var(--text-color); font-weight: normal; text-transform: uppercase; font-size: 0.9rem; transition: color 0.3s ease; }
nav .menu a.active { color: var(--accent-color); font-weight: bold; }
@media (hover: hover) { nav .menu a:hover { color: var(--accent-color); font-weight: bold; } }

.lang-switch { cursor: pointer; font-size: 0.9rem; user-select: none; padding: 10px; margin-right: -10px; }
.lang-switch span { transition: color 0.3s ease; font-weight: normal; color: var(--text-color); }
.lang-switch span.active { color: var(--accent-color); font-weight: bold; }
@media (hover: hover) { .lang-switch:hover span:not(.active) { color: rgba(0, 0, 0, 0.5); } }

/* --- LAYOUT PRINCIPAL SPLIT (ABOUT & CONTACT) --- */
.container { display: flex; width: 100%; min-height: 100vh; padding-top: 100px; }
.left-panel {
    width: 40%; position: sticky; top: 100px; height: calc(100vh - 100px);
    display: flex; justify-content: center; align-items: center; flex-shrink: 0; z-index: 10;
}
.branding { display: flex; justify-content: center; align-items: center; width: 100%; }
.branding video {
    width: 280px; height: 280px; object-fit: cover; border: none; outline: none;
    pointer-events: none; background: transparent; mix-blend-mode: multiply; transform: translateZ(0);
}
.right-panel { width: 60%; flex-grow: 1; padding: 40px 50px 50px 50px; }

/* --- NOUVEAU LAYOUT PLEIN ECRAN EDITORIAL (WORK.HTML) --- */
.work-full-layout {
    display: block; width: 100%; max-width: 1600px; margin: 0 auto; padding: 130px 4vw 0 4vw;
}

.video-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -1;
    display: flex; justify-content: center; align-items: center; pointer-events: none; opacity: 0.4;
}
.video-background video { width: 60vw; height: 60vh; max-width: 700px; object-fit: contain; mix-blend-mode: multiply; }

/* --- FOOTER --- */
.site-footer {
    width: 100%; max-width: 1600px; margin: 0 auto; padding: 40px 4vw;
    border-top: 1px solid rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; gap: 15px;
}
.footer-content { display: flex; gap: 30px; }
.footer-content a {
    text-decoration: none; color: var(--text-color); font-weight: 500; font-size: 0.9rem;
    text-transform: uppercase; transition: color 0.3s var(--ease);
}
@media (hover: hover) { .footer-content a:hover { color: var(--accent-color); } }
.footer-copy { font-size: 0.8rem; color: rgba(0, 0, 0, 0.5); }

/* --- GRILLE DE PROJETS ÉDITORIALE STRICTE (SWISS DESIGN) --- */
.work-full-layout .project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 60px 25px; /* Espacement vertical large (60px) pour séparer les rangées */
    align-items: start; /* Aligne le haut des textes sur une ligne parfaite */
    padding: 40px 0 80px 0;
}

.project-item { 
    display: flex; 
    flex-direction: column; 
    text-decoration: none; 
    color: var(--text-color); 
    background: transparent; 
    width: 100%; 
}

.meta-ed { 
    margin-bottom: 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 3px; 
}
.meta-ed h3 { font-size: 1.05rem; font-weight: bold; line-height: 1.1; }
.meta-ed p { font-size: 0.85rem; line-height: 1.3; color: #333; }
.meta-ed span { font-size: 0.85rem; color: var(--accent-color); margin-top: 2px; font-weight: 500; }

.img-ed { 
    width: 100%; 
    aspect-ratio: 4 / 5; 
    overflow: hidden; 
    background-color: #f7f7f7; 
    border-radius: 4px; 
}
.img-ed img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
@media (hover: hover) { .project-item:hover .img-ed img { transform: scale(1.05); } }

/* --- ANIMATIONS AU SCROLL --- */
.animate-up, .project-item, .section-title, .detail-img, .btn-info {
    opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.animate-up.in-view, .project-item.in-view, .section-title.in-view, .detail-img.in-view, .btn-info.in-view { opacity: 1; transform: none; }
.fast-pop { animation: popIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; transform: translateY(15px); }
@keyframes popIn { to { opacity: 1; transform: translateY(0); } }

/* --- SECTIONS DÉTAILS PROJET --- */
.section-title { color: var(--accent-color); text-align: center; font-weight: 500; margin-bottom: 20px; font-size: 1.1rem; }
.slider-wrapper { position: relative; width: 100%; margin-bottom: 50px; display: flex; align-items: center; justify-content: center; }
.inline-slider { display: flex; overflow-x: auto; gap: 15px; width: calc(100% - 80px); scrollbar-width: none; scroll-behavior: auto; overscroll-behavior-x: contain; }
.inline-slider::-webkit-scrollbar { display: none; }
.slide-img { flex: 0 0 calc((100% - 30px) / 3); max-width: calc((100% - 30px) / 3); aspect-ratio: 4 / 5; object-fit: contain; border-radius: 8px; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
@media (hover: hover) { .slide-img:hover { transform: scale(1.02); } }
.slider-btn { background: transparent; border: none; outline: none; color: var(--accent-color); font-size: 2.5rem; position: absolute; z-index: 10; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); font-family: sans-serif; }
@media (hover: hover) { .slider-btn:hover { transform: scale(1.2); } }
.inline-prev { left: 0; }
.inline-next { right: 0; }

/* --- GRILLE DE WORKFLOW DYNAMIQUE --- */
.project-gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-bottom: 50px; max-width: 1000px; margin: 0 auto; align-items: start; }
.project-gallery-grid.grid-60-40 { grid-template-columns: 60% calc(40% - 20px); grid-template-rows: auto auto; gap: 20px; align-items: center; }
.project-gallery-grid .detail-img { width: 100%; height: auto; display: block; border-radius: 8px; grid-column: span 1; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); }
.project-gallery-grid .span-2-rows { grid-column: 1; grid-row: 1 / 3; width: 100%; height: auto; max-height: 85vh; object-fit: contain !important; align-self: center; }
.project-gallery-grid .col-right-1 { grid-column: 2; grid-row: 1; width: 100%; height: auto; object-fit: contain !important; }
.project-gallery-grid .col-right-2 { grid-column: 2; grid-row: 2; width: 100%; height: auto; object-fit: contain !important; }
.project-gallery-grid img.detail-img { border: 1px solid rgba(0, 0, 0, 0.05); }
.project-gallery-grid video.detail-img { border: none !important; outline: none !important; background-color: transparent; border-radius: 8px; transform: translateZ(0); }
.project-gallery-grid .detail-img.full-width { grid-column: 1 / -1; }
.project-gallery-grid .center-vertical { grid-column: 1 / -1; max-height: 80vh; width: auto; margin: 0 auto; display: block; }
@media (hover: hover) { .project-gallery-grid .detail-img:hover { transform: scale(1.02); opacity: 0.95; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); } }

/* --- LIGHTBOX --- */
#lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: rgba(0, 0, 0, 0.95); display: flex; align-items: center; justify-content: center; z-index: 99999; opacity: 0; pointer-events: none; transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
#lightbox.active { opacity: 1; pointer-events: all; }
#lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
#lightbox-close { position: absolute; top: 30px; right: 50px; color: white; font-size: 40px; font-family: sans-serif; }
#lightbox-prev, #lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 60px; font-weight: bold; user-select: none; padding: 20px; transition: color 0.3s ease, transform 0.2s; }
@media (hover: hover) { #lightbox-prev:hover, #lightbox-next:hover { color: var(--accent-color); transform: translateY(-50%) scale(1.1); } }
#lightbox-prev { left: 30px; }
#lightbox-next { right: 30px; }

/* --- PAGES ABOUT & CONTACT --- */
.project-info { text-align: left; max-width: 80%; }
.project-info h2 { font-weight: bold; font-size: 2.5rem; margin-bottom: 10px; }
.project-info .year { color: var(--accent-color); font-weight: 500; margin-bottom: 20px; }
.content-page { max-width: 800px; padding-bottom: 50px; }
.content-page h2 { font-weight: bold; font-size: 2rem; margin-bottom: 20px; }
.content-page p { font-weight: normal; font-size: 1.1rem; line-height: 1.6; margin-bottom: 20px; }

/* --- JAUGE LOGICIELS --- */
.software-logos { display: flex; flex-wrap: wrap; gap: 35px; margin-bottom: 40px; }
.logo-gauge { position: relative; width: 45px; height: 45px; }
.logo-gauge img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.logo-gauge .faded { opacity: 0.15; filter: grayscale(100%); }
.logo-gauge::after { content: attr(data-name); position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; font-weight: bold; color: var(--text-color); opacity: 0; transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1); white-space: nowrap; }
@media (hover: hover) { .logo-gauge:hover::after { opacity: 1; } }

/* --- GRILLE SPOTIFY --- */
.spotify-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 20px; width: 100%; }

/* =========================================
   PAGE D'ACCUEIL (HOME) - HERO
   ========================================= */
.home-body { background-color: var(--bg-color); }
.home-hero { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; width: 100%; padding-top: 100px; }
.hero-content { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 1000px; padding: 0 20px; }
.hero-name { font-weight: bold; font-size: 1.2rem; letter-spacing: 5px; color: var(--accent-color); text-transform: uppercase; margin-bottom: 30px; }
.hero-video-wrapper { margin-bottom: 40px; }
.hero-video { width: 350px; height: 350px; object-fit: cover; pointer-events: none; border: none; outline: none; background: transparent; mix-blend-mode: multiply; transform: translateZ(0); }
.hero-desc { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 50px; color: rgba(0, 0, 0, 0.6); }

.hero-buttons { display: flex; gap: 20px; justify-content: center; }
.btn-liquid {
    position: relative; padding: 14px 40px; border-radius: 100px; font-family: inherit; font-weight: 500; font-size: 1.1rem; color: #000000; text-decoration: none; background: rgba(245, 245, 247, 0.6); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), inset 0 2px 2px rgba(255, 255, 255, 1), inset 0 -1px 2px rgba(0, 0, 0, 0.03); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease, background 0.3s ease; display: inline-flex; align-items: center; justify-content: center;
}
@media (hover: hover) { .btn-liquid:hover { transform: scale(1.03); background: rgba(255, 255, 255, 0.8); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), inset 0 2px 2px rgba(255, 255, 255, 1), inset 0 0 0 1px rgba(255, 255, 255, 0.8); } }
.btn-info { display: inline-block; margin-top: 20px; padding: 10px 20px; border: 1px solid var(--text-color); text-decoration: none; color: var(--text-color); font-weight: 500; transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
@media (hover: hover) { .btn-info:hover { background-color: var(--text-color); color: var(--bg-color); } }

/* =========================================
   RESPONSIVE : MOBILES & TABLETTES
   ========================================= */
@media screen and (max-width: 900px) {
    body { overflow-x: hidden; }
    .container { flex-direction: column; height: auto; min-height: 100vh; padding-top: 0; }
    
    header {
        height: auto; padding: 15px 20px; flex-direction: column;
        background-color: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: none; backdrop-filter: none;
        border-bottom: 1px solid #f0f0f0; position: fixed;
    }
    .header-right { width: 100%; justify-content: space-between; padding: 0; margin-bottom: 15px; }
    .site-title { position: relative; left: 0; transform: none; }
    .header-left { width: 100%; padding: 0; justify-content: center; }
    nav .menu { gap: 15px; flex-wrap: wrap; justify-content: center; }
    nav .menu a { font-size: 0.85rem; }

    .left-panel {
        position: relative; width: 100%; height: auto; top: 0;
        padding: calc(var(--header-h) + 20px) 20px 20px 20px; min-height: auto;
    }
    .branding video { width: 180px; height: 180px; }
    .right-panel { width: 100%; height: auto; padding: 0 20px 40px 20px; }

    /* Responsive Work Grid (2 colonnes) */
    .work-full-layout { padding: calc(var(--header-h) + 20px) 15px 40px 15px; }
    .work-full-layout .project-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 40px 15px; 
    }
    
    .video-background video { width: 90vw; height: 90vw; }

    .project-gallery-grid.grid-60-40 { grid-template-columns: 1fr; grid-template-rows: auto; }
    .project-gallery-grid .span-2-rows { grid-column: 1; grid-row: auto; max-height: 50vh; width: 100%; }
    .project-gallery-grid .col-right-1, .project-gallery-grid .col-right-2 { grid-column: 1; grid-row: auto; }

    .project-info { max-width: 100%; text-align: center; margin-bottom: 30px; }
    .content-page h2 { text-align: center; }
    .slider-wrapper { padding: 0; }
    .inline-slider { width: 100%; gap: 10px; }
    .slide-img { flex: 0 0 85%; max-width: 85%; }
    .slider-btn { display: none; }
    .spotify-grid { grid-template-columns: 1fr; }
    .software-logos { justify-content: center; }

    #lightbox-prev { left: 10px; font-size: 40px; }
    #lightbox-next { right: 10px; font-size: 40px; }
    #lightbox-close { top: 15px; right: 20px; font-size: 35px; }
    #lightbox img { max-width: 95vw; max-height: 80vh; }
    
    .home-hero { padding-top: calc(var(--header-h) + 35px); }
    .hero-buttons { flex-direction: column; width: 100%; gap: 15px; padding: 0 20px; }
    .btn-liquid { width: 100%; text-align: center; }
    .hero-video { width: 220px; height: 220px; }
    .hero-desc { font-size: 1.2rem; }
    
    .site-footer { padding: 30px 20px; }
    .footer-content { gap: 15px; flex-wrap: wrap; justify-content: center; }
}

@media screen and (max-width: 500px) {
    /* Full mobile (1 colonne) */
    .work-full-layout .project-grid { grid-template-columns: 1fr; gap: 40px 0; }
    .footer-content { flex-direction: column; align-items: center; gap: 10px; }
}

/* =========================================
   OPTIMISATIONS & MICRO-ANIMATIONS
   ========================================= */
@supports (height: 100dvh) { .container, .home-hero { min-height: 100dvh; } #lightbox { height: 100dvh; } }
@media (min-width: 901px) { @supports (height: 100dvh) { .left-panel { height: calc(100dvh - 100px); } } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }
.slider-btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 0; }
.detail-img:focus-visible { outline-offset: 3px; }

header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(0, 0, 0, 0.07); opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
header.scrolled::after { opacity: 1; }

nav .menu a { position: relative; display: inline-flex; flex-direction: column; align-items: center; padding: 10px 4px; margin: -10px -4px; }
nav .menu a::before { content: attr(data-label); font-weight: bold; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; user-select: none; }
nav .menu a::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 7px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left center; transition: transform 0.45s var(--ease); }
nav .menu a.active::after { display: none; }
@media (hover: hover) { nav .menu a:hover::after { transform: scaleX(1); } }

#custom-cursor { transition: width 0.3s var(--ease), height 0.3s var(--ease), background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.loaded .hero-content > * { animation: rise 0.9s var(--ease) both; }
.loaded .hero-content > :nth-child(2) { animation-delay: 0.08s; }
.loaded .hero-content > :nth-child(3) { animation-delay: 0.16s; }
.loaded .hero-content > :nth-child(4) { animation-delay: 0.24s; }

.btn-liquid:active { transform: scale(0.97); }
.btn-info:active { transform: scale(0.97); }
.project-item.in-view:active { transform: scale(0.985); }
.slider-btn:active { transform: scale(0.9); }
.logo-gauge .solid { transition: clip-path 1.1s var(--ease); }

#lightbox { visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s; }
#lightbox.active { visibility: visible; transition-delay: 0s; }
#lightbox img, #lightbox video { transition: opacity 0.25s ease, transform 0.5s var(--ease); }
#lightbox img.swap { opacity: 0; }
#lightbox:not(.active) img, #lightbox:not(.active) video { transform: scale(0.97); }
#lightbox-close, #lightbox-prev, #lightbox-next { cursor: pointer; -webkit-user-select: none; user-select: none; }
#lightbox-close { transition: transform 0.4s var(--ease), color 0.3s ease; }
@media (hover: hover) { #lightbox-close:hover { transform: rotate(90deg); color: var(--accent-color); } }
#lightbox-video { max-width: 90vw; max-height: 90vh; object-fit: contain; }

@media (pointer: coarse) { .lang-switch { padding: 14px; margin-right: -14px; } #lightbox-close { padding: 12px; } }
@media screen and (max-width: 900px) { header::after { display: none; } #lightbox-video { max-width: 95vw; max-height: 80vh; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; } }