/* ==========================================================================
   01. IMPORTS & VARIABLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

:root {
    --text-massive: 280px; 
    --text-h2: 56px;
    --text-nav: 32px;
    --text-p: 18px;
    
    --grid-margin: 80px;
    
    --color-bg: #EAEAEA;
    --color-ink: #050505;
    
    --cursor-prepresse: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="8" fill="none" stroke="%23050505" stroke-width="1.5"/><line x1="16" y1="0" x2="16" y2="32" stroke="%23050505" stroke-width="1.5"/><line x1="0" y1="16" x2="32" y2="16" stroke="%23050505" stroke-width="1.5"/></svg>') 16 16, crosshair;
    --cursor-prepresse-light: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="8" fill="none" stroke="%23FFFFFF" stroke-width="1.5"/><line x1="16" y1="0" x2="16" y2="32" stroke="%23FFFFFF" stroke-width="1.5"/><line x1="0" y1="16" x2="32" y2="16" stroke="%23FFFFFF" stroke-width="1.5"/></svg>') 16 16, crosshair;
}

/* ==========================================================================
   02. RESET & STRUCTURE DE BASE
   ========================================================================== */

* {
    font-optical-sizing: auto;
    box-sizing: border-box; 
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    overscroll-behavior: none;
    background-color: var(--color-bg);
    color: var(--color-ink);
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    text-transform: uppercase;
    
    user-select: none; 
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    cursor: var(--cursor-prepresse);
}

a, .nav-link, button {
    cursor: var(--cursor-prepresse);
}

body.is-dragging { 
    cursor: move; 
}

/* ==========================================================================
   03. ANIMATIONS, LOADER & TRANSITIONS
   ========================================================================== */

.loader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--color-bg); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}

.loader-line { 
    width: 50px; height: 1px; background: var(--color-ink); animation: pulse 1.5s infinite; 
}

@keyframes pulse { 
    0%, 100% { opacity: 0.3; } 
    50% { opacity: 1; } 
}

@keyframes blink { 
    0%, 100% { opacity: 0.1; } 
    50% { opacity: 0.5; } 
}

@keyframes fadeInItem {
    to { opacity: 1; }
}

::view-transition-group(*) {
    animation-duration: 1.2s;
    animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
}

::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: 1.2s;
    animation-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* ==========================================================================
   04. TYPOGRAPHIE GLOBALE & UTILITAIRES
   ========================================================================== */

h1, h2, p, a { 
    margin: 0; text-decoration: none; color: inherit; 
}

h2 {
    font-size: var(--text-h2);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    line-height: 1;
}

p {
    font-size: var(--text-p);
    font-weight: 400;
    text-transform: none;
    width: 480px; 
    line-height: 1.3;
    letter-spacing: 0.01em;
    user-select: text;
    -webkit-user-select: text;
    color: rgba(5, 5, 5, 0.4);
}

.sub-text {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.03em;
    color: var(--color-ink);
    text-transform: uppercase;
    width: 480px;
    margin-top: 15px;
}

/* TITRE MASSIF & INTERLETTRAGES */
.text-massif {
    --text-offset: -13px;
    position: relative;
    margin-left: var(--text-offset);
    font-size: var(--text-massive);
    font-weight: 900;
    letter-spacing: -0.04em; 
    padding-bottom: 40px;
    margin-bottom: 15px; 
    line-height: 0.82;
}

.text-massif::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: calc(var(--text-offset) * -1); 
    width: calc(100% + var(--text-offset)); 
    height: 6px;
    background-color: var(--color-ink);
}

.text-massif [data-char="T"] + [data-char="Y"] { margin-left: -0.00em; }
.text-massif [data-char="Y"] + [data-char="P"] { margin-left: -0.01em; }
.text-massif [data-char="P"] + [data-char="A"] { margin-left: -0.10em; }
.text-massif [data-char="A"] + [data-char="C"] { margin-left: -0.07em; }
.text-massif [data-char="P"] + [data-char="O"] { margin-left: -0.00em; }
.text-massif [data-char="O"] + [data-char="."] { margin-left: -0.04em; }
.text-massif [data-char="C"] + [data-char="E"] { margin-left: -0.00em; }
.text-massif [data-char="T"] { margin-left: -0.01em; }

/* ANIMATION DES LETTRES */
.text-massif .char {
    display: inline-block;
    transition: transform 4s cubic-bezier(0.76, 0, 0.24, 1), color 0.8s ease;
    will-change: transform, color;
    transform: translate(0px, 0px) rotate(0deg);
}

.text-massif.is-scattered .char {
    transform: translate(var(--rx), var(--ry)) rotate(var(--rrot));
}

/* UTILITAIRES D'ESPACEMENT */
.fine-avant { margin-left: 0.15em; display: inline-block; }
.fine-apres { margin-right: 0.15em; display: inline-block; }
.normale-avant { margin-left: 0.25em; display: inline-block; }
.normale-custom { margin-left: 0.25em; display: inline-block; }
.pb-20 { padding-bottom: 20px; }
.pb-60 { padding-bottom: 60px; }
.btn-margin-reset { margin: 0; }
.btn-dimmed { opacity: 0.4; }
.btn-right { margin-left: auto; width: fit-content; }

/* ==========================================================================
   05. LAYOUT (CANVAS & SECTIONS)
   ========================================================================== */

.canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    transform: translate(0px, 100px) scale(0.85);
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

section { position: absolute; }

.section-home {
    top: 0; left: 0; width: 1600px; height: 900px;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: var(--grid-margin); padding-top: calc(var(--grid-margin) + 80px); 
}

.section-home p { text-transform: uppercase; }

.pos-prestations { top: -700px; left: var(--grid-margin); width: 500px; }
.pos-caractere { top: 117px; left: 2000px; width: 500px; }
.pos-espace { top: 605px; left: 2600px; width: 550px; }
.pos-contraste { top: 280px; left: 3300px; width: 500px; }
.pos-esthetisme { top: 370px; left: 4000px; width: 550px; }
.pos-atelier { top: 1200px; left: var(--grid-margin); width: 500px; }

/* ==========================================================================
   06. NAVIGATION & LIENS
   ========================================================================== */

.nav-top-right {
    position: fixed !important;
    top: 5px;
    right: 0px;
    z-index: 999;
    display: flex;
    gap: 0px;
}

.lien-global {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    margin: 0;
}

.nav-grid {
    display: flex; flex-wrap: wrap; gap: 70px;
    font-size: var(--text-nav); font-weight: 900; letter-spacing: -0.01em;
}

.nav-column { display: flex; flex-direction: column; gap: 2px; }

.nav-link { cursor: pointer; transition: opacity 0.2s; }
.nav-link:hover { opacity: 0.5; }

.back-link {
    font-size: 12px; font-weight: 700; display: block;
    margin-bottom: 30px; letter-spacing: 0.05em;
}

.next-link {
    font-size: 12px; font-weight: 700; display: inline-block;
    margin-top: 40px; letter-spacing: 0.05em; padding-bottom: 4px;
}

.submit-link {
    background: transparent; border: none; color: var(--color-bg); font-size: 24px; font-weight: 700;
    font-family: inherit; letter-spacing: -0.01em; padding: 0; text-transform: uppercase; transition: opacity 0.2s;
}
.submit-link:hover { opacity: 0.5; }

/* ==========================================================================
   07. COMPOSANTS (PRESTATIONS, FORMULAIRE, RÈGLES)
   ========================================================================== */

/* RÈGLES */
.rules {
    font-size: 14px; font-weight: 400; letter-spacing: 0.05em;
    display: flex; justify-content: space-between;
    border-top: 1px solid var(--color-ink); padding-top: 20px; width: 100%;
}
.rules p { width: 100%; color: var(--color-ink); }

/* PRESTATIONS */
.typo-list div {
    font-size: 24px; font-weight: 700;
    border-top: 1px solid rgba(5, 5, 5, 0.2); padding: 16px 0;
}
.typo-list div:last-child { border-bottom: 1px solid rgba(5, 5, 5, 0.2); }

#prestations { display: flex; gap: 50px; width: auto; transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1); }
.prestations-main { width: 550px; flex-shrink: 0; }
.prestations-details {
    width: 450px; flex-shrink: 0; opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.76, 0, 0.24, 1);
    pointer-events: none; display: block; padding-top: 44px; 
}
#prestations.is-active { transform: translateY(-40px); }
#prestations.is-active .prestations-details { opacity: 1; transform: translateX(0); pointer-events: auto; }

.prestations-details p, .prestations-details .sub-text { width: 100%; font-size: 14px; }
#prestations-details #details-desc { font-size: 20px; line-height: 1.2; margin-bottom: 20px; }
#prestations-details #details-subtext { font-size: 14px; line-height: 1.4; }

/* FORMULAIRE */
.form-container { width: 100%; max-width: 800px; padding: 40px; }
.form-container h2 { color: var(--color-bg); margin-bottom: 40px; }
.form-group { margin-bottom: 40px; border: none; padding: 0; }
.row-group { display: flex; gap: 40px; }
.form-legend { color: var(--color-bg); margin-bottom: 10px; }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; font-size: 14px; letter-spacing: 0.05em; }
.checkbox-grid label { display: flex; align-items: center; gap: 10px; opacity: 0.6; transition: opacity 0.2s; cursor: inherit;}
.checkbox-grid label:hover, .checkbox-grid input:checked + label { opacity: 1; }
.checkbox-grid input[type="checkbox"] {
    appearance: none; width: 16px; height: 16px; border: 1px solid var(--color-bg); border-radius: 0;
    background: transparent; position: relative; cursor: inherit;
}
.checkbox-grid input[type="checkbox"]:checked::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; background: var(--color-bg);
}

.form-input {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(234, 234, 234, 0.3);
    color: var(--color-bg); font-family: inherit; font-size: 18px; text-transform: uppercase;
    padding: 10px 0; outline: none; transition: border-color 0.3s; border-radius: 0;
}
.form-input:focus { border-bottom-color: var(--color-bg); }
.form-input::placeholder { color: rgba(234, 234, 234, 0.3); }
textarea.form-input { resize: none; }

.form-feedback { color: var(--color-bg); margin-top: 20px; display: none; }
.form-feedback.error { color: #FF4444; }

/* BOUTONS D'ACTION */
.action-buttons-group { display: flex; gap: 20px; flex-wrap: wrap; }
.link-gallery-trigger {
    display: inline-block;
    margin-top: 40px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border: 1px solid var(--color-ink);
    padding: 12px 24px;
    transition: all 0.3s ease;
}
.link-gallery-trigger:hover {
    background-color: var(--color-ink);
    color: var(--color-bg);
}

/* ==========================================================================
   08. OVERLAYS & MODALES
   ========================================================================== */

body.overlay-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none; /* Empêche le rebond sur iOS */
}

/* OVERLAY GÉNÉRAL / DEMANDE */
.overlay-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(234, 234, 234, 0.8); z-index: 1999;
    opacity: 0; visibility: hidden; transition: opacity 0.5s;
}
.overlay-bg.is-active { opacity: 1; visibility: visible; }

.overlay-demande {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); 
    width: 90vw; max-width: 900px; height: auto; max-height: 100vh; 
    background-color: var(--color-ink); color: var(--color-bg); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; overflow-y: auto;
    border: 1px solid rgba(234, 234, 234, 0.2);
    transition: opacity 0.8s cubic-bezier(0.76, 0, 0.24, 1), transform 0.8s cubic-bezier(0.76, 0, 0.24, 1), visibility 0.8s;
}
.overlay-demande.is-active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.overlay-demande, .overlay-demande * { cursor: var(--cursor-prepresse-light) !important; }

/* PROMPTEUR PHILOSOPHIE */
#overlay-philosophie { height: 90vh !important; overflow: hidden !important; }
.philo-container { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 40px !important; overflow: hidden; }
.philo-controls { display: flex; gap: 30px; margin-bottom: 40px; flex-shrink: 0; }
.philo-scroll-area { flex-grow: 1; overflow-y: hidden; padding-right: 0; }
.philo-content { color: var(--color-bg); text-transform: none; max-width: 720px; }
.philo-content::after {
    content: "↓"; display: block; text-align: center; color: var(--color-bg); opacity: 0.3; margin-top: 20px; animation: blink 2s infinite;
}
.philo-lead { color: var(--color-bg); width: 100%; margin-bottom: 30px; font-size: 20px; line-height: 1.4; font-weight: 700; }
.philo-divider { border: none; border-top: 1px solid rgba(234, 234, 234, 0.2); margin: 40px 0; }
.philo-h3 { font-size: 24px; font-weight: 900; margin-bottom: 20px; letter-spacing: -0.02em; text-transform: uppercase; }
.philo-p { color: rgba(234, 234, 234, 0.7); width: 100%; margin-bottom: 20px; }

/* PROMPTEUR MENTIONS (LÉGAL) */
#overlay-legal {
    position: fixed; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important;
    width: 90vw !important; max-width: 900px !important; height: 80vh !important; 
    background-color: var(--color-ink) !important; border: 1px solid rgba(234, 234, 234, 0.2);
    display: flex !important; flex-direction: column !important; opacity: 0; visibility: hidden; transition: opacity 0.3s;
}
#overlay-legal.is-active { opacity: 1; visibility: visible; }
#legal-scroll-zone {
    flex-grow: 1; overflow-y: auto !important; padding-right: 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#legal-scroll-zone::-webkit-scrollbar { width: 4px; }
#legal-scroll-zone::-webkit-scrollbar-track { background: transparent;  }
#legal-scroll-zone::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 20px; }

/* COOKIES */
.cookie-banner {
    position: fixed; bottom: 40px; right: 40px; width: 360px; height: 360px;
    background: #050505 !important; color: #EAEAEA !important; padding: 40px; z-index: 5000;
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    border: 1px solid rgba(234, 234, 234, 0.2);
}
.cookie-banner p { color: #EAEAEA !important; font-size: 14px; line-height: 1.5; margin: 0 0 40px 0; width: 100%; text-transform: uppercase; }
.cookie-actions { display: flex; gap: 40px; justify-content: center; width: 100%; }
.cookie-banner .nav-link { color: #EAEAEA !important; font-size: 14px; font-weight: 700; cursor: pointer; background: none; border: none; padding: 0; text-transform: uppercase; transition: opacity 0.2s; }
.cookie-banner .nav-link:hover { opacity: 0.5; }
.cookie-banner.is-hidden { display: none !important; }

/* ==========================================================================
   09. GALERIE & CLIENTS
   ========================================================================== */

/* OVERLAY GALERIE */
.overlay-gallery {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: var(--color-ink); 
    z-index: 3000; opacity: 0; visibility: hidden; 
    overflow: hidden; overflow-x: hidden; 
    transition: opacity 0.8s cubic-bezier(0.76, 0, 0.24, 1), visibility 0.8s;
    cursor: var(--cursor-prepresse-light); 
}
.overlay-gallery.is-active { opacity: 1; visibility: visible; }

.btn-close-cross {
    position: fixed; top: 20px; right: 40px; font-size: 80px; font-weight: 300;
    color: var(--color-bg); background: none; border: none; z-index: 3010; line-height: 0.5; padding: 10px; transition: opacity 0.2s;
    cursor: var(--cursor-prepresse-light); mix-blend-mode: difference; 
}
.btn-close-cross:hover { opacity: 0.4; }
#btn-close-clients { color: var(--color-ink) !important; mix-blend-mode: normal !important; }

/* GRILLE GALERIE */
.gallery-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 20vh);
    width: 100vw; height: 100vh; gap: 0; padding: 0; overflow: hidden;
}

.gallery-item {
    width: 100%; height: 100%; object-fit: cover; background-color: var(--color-ink); opacity: 0;
    animation: fadeInItem 0.8s cubic-bezier(0.76, 0, 0.24, 1) forwards;
    filter: grayscale(100%) contrast(0.7) brightness(1.2);
    transition: filter 0.8s ease; contain: paint;
}
.gallery-item:hover { filter: grayscale(0%) contrast(1.1) brightness(1); }
/* (Note : Tu avais doublé la déclaration .gallery-item:hover dans l'original, je l'ai conservé tel quel pour ne rien modifier) */
.gallery-item:hover { filter: grayscale(0%) contrast(1.1) brightness(1); }

.format-horizontal { grid-column: span 2; }
.format-vertical { grid-row: span 2; }
.format-large { grid-column: span 2; grid-row: span 2; }

/* CURSEUR GALERIE */
.gallery-cursor {
    position: fixed; top: 0; left: 0; background-color: var(--color-ink); color: var(--color-bg); 
    padding: 6px 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
    pointer-events: none; z-index: 4000; opacity: 0; transform: translate(15px, 15px); transition: opacity 0.2s ease; white-space: nowrap;
}
.gallery-cursor.is-visible { opacity: 1; }

/* GRILLE CLIENTS */
.clients-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(20vw, 1fr)); grid-auto-rows: 20vh;
    width: 100vw; height: 100vh; background-color: var(--color-bg);
}
.client-cell {
    display: flex; align-items: center; justify-content: center;
    border-right: 1px solid rgba(5, 5, 5, 0.1); border-bottom: 1px solid rgba(5, 5, 5, 0.1); padding: 40px; 
}
.client-img {
    max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(100%); opacity: 1; transition: opacity 0.8s ease; 
}
.client-img.is-fading { opacity: 0; }

/* ==========================================================================
   10. MEDIA QUERIES (MOBILE)
   ========================================================================== */

.mobile-warning { display: none; }

@media (max-width: 768px) {
    /* TYPOGRAPHIE & BASES */
    html, body {
        position: fixed !important; width: 100% !important; height: 100% !important;
        overflow: hidden !important; touch-action: none !important; -webkit-overflow-scrolling: auto; 
    }
    .lien-global { display: none !important; }
    
    .text-massif {
        font-size: 20vw !important; font-weight: 900; line-height: 0.85 !important;
        letter-spacing: -0.05em !important; text-align: center !important;
        border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; white-space: nowrap;
    }
    .text-massif::after { display: none !important; }
    .text-massif.is-scattered .char { transform: translate(calc(var(--rx) * 0.15), calc(var(--ry) * 0.15)) rotate(var(--rrot)) !important; }

    /* LAYOUT */
    .canvas {
        position: absolute !important; top: 0 !important; left: 0 !important;
        width: 100vw !important; height: 100vh !important;
        transform: translate(0, 0) scale(1) !important;
        pointer-events: none !important; display: flex !important;
        align-items: flex-start !important; justify-content: center !important;
    }
    
    .section-home {
        position: relative !important; top: auto !important; left: auto !important;
        width: auto !important; height: auto !important; display: flex !important;
        align-items: center !important; justify-content: center !important; padding-top: 5vh !important;
    }

    .section-home header > a, .section-home .nav-grid, .section-home .rules,
    section:not(.section-home), .archive-overlay { display: none !important; }

    /* AVERTISSEMENT MOBILE */
    .mobile-warning {
        display: flex !important; position: fixed !important; bottom: 10px; left: 0;
        width: 100%; justify-content: center; z-index: 1000; padding: 0 30px;
    }
    .warning-message {
        font-size: 12px; font-weight: 700; line-height: 1.5; text-align: center;
        text-transform: uppercase; letter-spacing: 0.05em; color: #000000; max-width: 1000px; width: 1000px; bottom: 10px;
    }

    /* FORMULAIRE & COOKIES */
    .row-group { flex-direction: column; gap: 40px; }
    .checkbox-grid { grid-template-columns: 1fr; }
    
    .cookie-banner {
        width: calc(100vw - 40px); height: auto; min-height: 250px;
        bottom: 20px; right: 20px; left: 20px; padding: 30px 20px;
    }

    /* GRILLES (GALERIE & CLIENTS) */
    .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(5, 20vh); }
    .clients-grid { grid-template-columns: repeat(auto-fill, minmax(50vw, 1fr)); }
    .client-cell { padding: 20px; }
    
    /* CORRECTIONS BOUTONS ET FORMATS SUR MOBILE */
    .btn-close-cross { top: 10px; right: 20px; font-size: 60px; }
    .format-horizontal { grid-column: span 2; } 
    .format-large { grid-column: span 2; grid-row: span 2; }
}