:root {
    --bg: #0c0c0d;
    --surface: #1a1a1b;
    --accent: #3e63dd;
    --accent-light: #5472e4;
    --text: #ecedee;
    --text-dim: #9ba1a6;
    --radius: 12px;
    --padding: clamp(2rem, 5vw, 5rem);
    --font: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden; /* Controlé par GSAP */
    -webkit-font-smoothing: antialiased;
}

#bg-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;
}


/* NAVIGATION UI */
.nav-ui {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-top, .nav-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.progress-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
}

.slide-counter {
    font-weight: 800;
    font-size: 1.5rem;
}

.slide-counter .total {
    opacity: 0.3;
    font-size: 1rem;
}

.menu-trigger {
    background: none;
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.hamburger {
    width: 24px;
    height: 12px;
    position: relative;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    position: absolute;
    transition: transform 0.3s;
}

.hamburger span:last-child { bottom: 0; width: 60%; right: 0; }

.section-name {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    color: var(--accent);
}

.controls { display: flex; gap: 0.5rem; }

.ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--surface);
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.ctrl-btn:hover { background: var(--accent); border-color: var(--accent); }

/* SLIDE CORE */
#deck-container {
    height: 100vh;
    width: 100%;
}

.slide {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    padding: var(--padding);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

.content {
    width: 100%;
    max-width: 1200px;
}

/* TYPOGRAPHY */
h1 { font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; line-height: 1; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; margin-bottom: 2rem; color: var(--accent); }
.subtitle { font-size: 1.5rem; color: var(--text-dim); }

.bullets { list-style: none; margin-bottom: 2rem; }
.bullets li {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.bullets li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.6em;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

strong { color: var(--accent-light); }

/* GRIDS & CARDS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.glass-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.glass-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.glass-card .icon { font-size: 2rem; display: block; margin-bottom: 1rem; }

.kpi-grid { display: flex; gap: 2rem; margin-top: 2rem; }
.kpi-card span { display: block; font-size: 0.8rem; text-transform: uppercase; color: var(--text-dim); }
.kpi-card strong { font-size: 1.5rem; display: block; }

/* STACK BAR */
.stack-item { margin-bottom: 1.5rem; }
.stack-item span { display: block; margin-bottom: 0.5rem; font-weight: 600; }
.bar-fill { height: 6px; background: var(--accent); border-radius: 3px; position: relative; }
.bar-fill::after { content: ''; position: absolute; inset: 0; background: white; opacity: 0.1; }

/* IMAGE SLOTS */
.img-slot {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: linear-gradient(45deg, #1a1a1b, #252526);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.logo-tile {
    background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 0.8rem;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 45px rgba(0,0,0,0.38);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.logo-tile:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(62, 99, 221, 0.35);
    box-shadow: 0 24px 55px rgba(0,0,0,0.5);
}

.logo-tile img {
    max-width: 95%;
    max-height: 200px;
    width: 95%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.35));
}

.img-slot::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
}

/* MENU SIDEBAR */
.side-summary {
    position: fixed;
    right: 0; top: 0;
    width: 40vh; height: 100vh;
   
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 4rem 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.summary-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.side-summary.open { transform: translateX(0); }
.summary-list { 
    list-style: none; 
    margin-top: 2rem; 
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.summary-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: 0.3s;
}

.summary-list li:hover { color: var(--accent); padding-left: 1rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 2rem; }
    .visual-side { display: none; }
    .nav-bottom .section-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

.img-slot img { width: 100%; height: 100%; object-fit: cover; }

.img-wrapper {
    position: relative;
    width: 100%;
    height: 400px; /* Hauteur fixe nécessaire pour la superposition */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- TYPE 1 : IMAGE UNIQUE --- */
.single-img {
    max-width: 100%;
    max-height: 100%;
    background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s, border-color 0.3s;
    cursor: zoom-in;
}

.single-img:hover {
    transform: scale(1.02);
    border-color: var(--neon-blue);
}

/* --- TYPE 2 : PILE DE CARTES (STACK) --- */
.card-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stack-img {
    position: absolute;
    width: 80%; /* Ajustable selon la taille voulue */
    height: auto;
    
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.4s ease;
    cursor: pointer;
    background: #1a1a2e; /* Évite la transparence si PNG */
    object-fit: contain;
}


.stack-img2 {
    position: absolute;
    width: 80%; /* Ajustable selon la taille voulue */
    height: auto;
    
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.4s ease;
    cursor: pointer;
    background: #1a1a2e; /* Évite la transparence si PNG */
    object-fit: contain;
}


/* Rotation automatique des cartes (Effet éventail) */
.stack-img:nth-child(1) { transform: translateX(-20px) rotate(-5deg); z-index: 1; }
.stack-img:nth-child(2) { transform: translateX(0px) rotate(0deg); z-index: 2; }
.stack-img:nth-child(3) { transform: translateX(20px) rotate(5deg); z-index: 3; }
.stack-img:nth-child(4) { transform: translateX(40px) rotate(5deg); z-index: 4; }
.stack-img:nth-child(5) { transform: translateX(60px) rotate(5deg); z-index: 5; }


/* Rotation automatique des cartes (Effet éventail) */
.stack-img2:nth-child(1) { transform: translateX(-20px) rotate(-30deg); z-index: 1; }
.stack-img2:nth-child(2) { transform: translateX(-10px) rotate(-25deg); z-index: 2; }
.stack-img2:nth-child(3) { transform: translateX(0px) rotate(-20deg); z-index: 3; }
.stack-img2:nth-child(4) { transform: translateX(10px) rotate(-15deg); z-index: 4; }
.stack-img2:nth-child(5) { transform: translateX(20px) rotate(-10deg); z-index: 5; }
.stack-img2:nth-child(6) { transform: translateX(30px) rotate(-5deg); z-index: 6; }
.stack-img2:nth-child(7) { transform: translateX(40px) rotate(0deg); z-index: 7; }
.stack-img2:nth-child(8) { transform: translateX(50px) rotate(5deg); z-index: 8; }
.stack-img2:nth-child(9) { transform: translateX(60px) rotate(10deg); z-index: 9; }
.stack-img2:nth-child(10) { transform: translateX(70px) rotate(15deg); z-index: 10; }
.stack-img2:nth-child(11) { transform: translateX(80px) rotate(20deg); z-index: 11; }
.stack-img2:nth-child(12) { transform: translateX(90px) rotate(25deg); z-index: 12; }

/* Effet au survol d'une carte dans la pile */
.stack-img:hover {
    z-index: 100; /* Passe au premier plan */
    transform: scale(1.1) rotate(0deg) translateY(-10px);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
}

.stack-img2:hover {
    z-index: 100; /* Passe au premier plan */
    transform: scale(1.1) rotate(0deg) translateY(-10px);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue);
}

/* Le petit badge "+ X Images" */
.gallery-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--neon-blue);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--neon-blue);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10;
}

/* --- STYLE DE LA MODALE (Lightbox) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Fond sombre */
    backdrop-filter: blur(10px); /* Flou d'arrière-plan */
    z-index: 9999;
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border: 2px solid var(--neon-purple);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn { from {transform: scale(0.9);} to {transform: scale(1);} }

/* Boutons Précédent / Suivant */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: 1px solid var(--neon-blue);
    border-radius: 50%;
    width: 50px; height: 50px;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem;
    transition: all 0.3s;
    user-select: none;
}
.modal-nav:hover { background: var(--neon-blue); color: black; }
.prev-btn { left: -70px; }
.next-btn { right: -70px; }

/* Bouton Fermer */
.close-modal {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}
.close-modal:hover { color: var(--neon-red); }

.modal-counter {
    position: absolute;
    bottom: 30px;
    color: white;
    font-family: sans-serif;
    letter-spacing: 2px;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .modal-nav { width: 40px; height: 40px; font-size: 1rem; }
    .prev-btn { left: -10px; background: rgba(0,0,0,0.8); }
    .next-btn { right: -10px; background: rgba(0,0,0,0.8); }
}

/* Blur du fond quand le sommaire est ouvert */
body.menu-open #deck-container,
body.menu-open #bg-canvas,
body.menu-open .nav-ui {
  filter: blur(6px) brightness(0.75);
  transition: filter 0.35s ease;
}

/* état normal (évite un jump au chargement) */
#deck-container, #bg-canvas, .nav-ui {
  transition: filter 0.35s ease;
}
