/* DÉFINITION DES VARIABLES GLOBALES */
:root{
    --max-width: 1200px;
    --gutter: 20px;
    --bg: #000000;
    --text: #ffffff;
    --muted: #9bb8d6;
    --hint-bg: rgba(255,255,255,0.06);
    --hint-strong-bg: rgba(255,255,255,0.12);
    --blue-accent: #28beff;
}

/* CONFIGURATION GÉNÉRALE DE LA PAGE */
html, body {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    overflow-x: hidden;
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700;
    color: var(--text);
    text-align: center;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GESTION DE L'ÉCRAN DE CHARGEMENT */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Adaptation de la vidéo du loader */
#loader-wrapper video {
    width: 1000px; 
    max-width: 90%; 
    height: auto;
}

#loader-wrapper.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* CURSEUR PERSONNALISÉ */
body {
    cursor: none;
}

.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10002;
    pointer-events: none;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text);
    mix-blend-mode: exclusion; 
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s; 
}

body.hovering .cursor-outline {
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

@media (max-width: 768px) {
    .cursor-dot, .cursor-outline { display: none; }
    body { cursor: auto; }
}

/* CLASSES UTILITAIRES ET CONTENEURS */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    box-sizing: border-box;
}

.container.center-vh {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 16px;
}

/* VIDÉOS D'ARRIÈRE-PLAN */
.home-image-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
}

/* Affichage par défaut : Vidéo Desktop visible, Mobile masquée */
.home-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.mobile-video {
    display: none; /* Caché sur PC */
}

/* CONTENEUR DE NAVIGATION */
#presentation {
    width: 100%;
    position: absolute;
    bottom: 60px;
    left: 0;
    z-index: 10;
    background: transparent;
}

#presentation nav {
    padding: 8px 0;
}

/* TYPOGRAPHIE DES TITRES */
h1, h2, h3 {
    color: var(--text);
    margin: 10px 0;
    line-height: 1.05;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* STRUCTURE DU CARROUSEL */
#carousel {
    padding-bottom: 0px; 
}

.carousel {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    border-radius: 12px;
    background: transparent;
    overflow: hidden;
    height: min(80vh, 760px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: none;
}

.carousel-inner {
    display: flex;
    transition: transform 0.75s cubic-bezier(.2,.8,.2,1);
    height: 100%;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 4;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    box-sizing: border-box;
    z-index: 5;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    position: relative;
    z-index: 6;
}

/* TITRE DYNAMIQUE DU CARROUSEL */
.title {
    position: relative;
    z-index: 30;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.title #carouselTitle {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: 8px 18px;
    border-radius: 999px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    
    pointer-events: auto;
    font-size: clamp(14px, 2.2vw, 20px);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: none;
    letter-spacing: -0.5px;
}

/* SCROLLBAR */
.custom-scrollbar-container {
    width: 60%;
    height: 20px;
    margin: -45px auto 0 auto; 
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1; 
    transition: opacity 0.3s ease;
    z-index: 60; 
    position: relative;
    cursor: grab;
}

.custom-scrollbar-container:active {
    cursor: grabbing;
}

.scrollbar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.25); 
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(2px);
    cursor: inherit; 
}

.scrollbar-thumb {
    height: 100%;
    background-color: white;
    border-radius: 2px;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    transition: width 0.3s ease, left 0.3s ease;
    box-shadow: 0 0 10px white;
    cursor: inherit; 
}

/* INDICATION DE NAVIGATION (HINT) */
#carouselHint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    bottom: 80px;
    background: rgba(0,0,0,0.68);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: transform .28s ease, opacity .22s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    white-space: nowrap;
}

#carouselHint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ÉLÉMENTS DE NAVIGATION ET FILTRES */
nav {
    display:flex;
    gap:12px;
    justify-content:center;
    align-items:center;
    padding: 12px 0;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    
    margin: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: clamp(16px, 2.4vw, 22px);
    transition: background .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: none;
}

nav a:hover,
nav a:focus {
    background: rgba(255,255,255,0.04);
    color: var(--muted);
}

nav::-webkit-scrollbar { display: none; }

/* BOUTON MENU HAMBURGER */
.hamburger {
    width: 36px;
    height: 26px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: none;
    z-index: 10001;
    position: fixed;
    top: 20px;
    right: 20px;
    transition: transform 0.2s ease;
}

.hamburger div {
    height: 3px;
    background-color: var(--text);
    border-radius: 2px;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.show div {
    background-color: transparent;
    opacity: 0;
}

.hamburger:hover { transform: scale(1.1); }

.hamburger::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(40, 190, 255, 0.3);
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.hamburger:hover::before {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
}

.hamburger.show div:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}
.hamburger.show div:nth-child(2) { opacity: 0; }
.hamburger.show div:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

.hamburger-menu {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.96);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    transform: scale(0.98);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    pointer-events: none;
    z-index: 9999;
}

.hamburger-menu.show {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* LIENS DU MENU MOBILE */
.hamburger-menu a {
    text-decoration: none;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 4vw, 36px);
    transition: color .18s ease;
}

.hamburger-menu a:hover,
.hamburger-menu a:focus {
    color: var(--muted);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 22px;
    font-size: 28px;
    cursor: none;
    color: var(--text);
    z-index: 10001;
}

/* PIED DE PAGE */
.footer-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px var(--gutter);
    padding-right: 80px;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.footer-custom .footer-center {
    display:flex;
    gap:12px;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
}

.footer-center .footer-icon {
    width: 29px;
    height: 29px;
    object-fit: cover;
    filter: none;
}

.footer-custom a {
    color: var(--text);
    text-decoration: none;
    transition: color .16s ease, background .12s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: none;
}

.footer-custom a:hover,
.footer-custom a:focus {
    color: var(--muted);
    text-decoration: none;
}

/* FLÈCHE DE RETOUR EN HAUT */
.scroll-top-arrow {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 100;
    cursor: none;
    width: 40px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.scroll-top-arrow span {
    display: block;
    width: 18px;
    height: 18px;
    border-top: 5px solid #4058a4;
    border-left: 5px solid #4058a4;
    transform: rotate(-45deg);
    margin: -8px 0;
    animation: swipeUp 1.8s infinite;
    box-sizing: border-box;
}

.scroll-top-arrow span:nth-child(2) { animation-delay: -0.18s; }
.scroll-top-arrow span:nth-child(3) { animation-delay: -0.36s; }

@keyframes swipeUp {
    0% { opacity: 0; transform: translateY(12px) scale(0.95); }
    50% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* ADAPTATION RESPONSIVE GÉNÉRALE */
@media (min-width: 1400px) {
    .carousel { height: 100vh; border-radius: 16px; }
    .carousel-inner { gap: 0; }
}

@media (min-width: 1025px) and (max-width: 1399px) {
    .carousel { height: 95vh; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .carousel { height: 80vh; border-radius: 12px; }
}

/* ADAPTATION SPÉCIFIQUE MOBILE (LAYOUT ET VIDÉO) */
@media (max-width: 767px) {
    #customCursor { display: none; }

    .container.center-vh { min-height: auto; padding-top: 28px; padding-bottom: 28px; }

    .carousel { height: 56vh; border-radius: 10px; cursor: grab; }

    .title #carouselTitle { font-size: clamp(13px, 3.2vw, 18px); }

    .home-image-container { 
        height: 100vh;
        display: block; 
    }
    
    /* Gestion de l'affichage vidéo selon le device */
    .desktop-video {
        display: none !important;
    }
    
    .mobile-video {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Positionnement du menu mobile */
    #presentation {
        position: absolute;
        bottom: 40px;
        background: transparent;
        backdrop-filter: none;
        margin-top: 0;
        transform: none;
    }

    nav a { font-size: 18px; }

    .carousel-infos {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 12px;
    }

    #carouselHint {
        position: static !important;
        margin-top: 12px;
        margin-bottom: 0;
        width: 100%;
        transform: none !important;
        left: auto !important;
        bottom: auto !important;
        text-align: center;
        opacity: 1 !important;
        background: var(--hint-strong-bg);
        border: none;
        box-shadow: none;
        max-width: 90%;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .custom-scrollbar-container {
        width: 80%;
        margin-top: 5px; 
    }
}

@media (max-width: 420px) {
    .carousel { height: 48vh; border-radius: 8px; }
    .home-image-container video { height: 100vh; max-height: none; }
    .footer-custom { flex-direction: column; gap: 8px; padding: 12px; text-align: center; }
    .hamburger { transform: translateZ(0); }
    .title #carouselTitle { padding: 6px 12px; font-size: 13px; }
}

@media (max-width: 340px) {
    .carousel { height: 44vh; }
    .title #carouselTitle { font-size: 12px; padding: 5px 10px; }
}

/* ACCESSIBILITÉ */
a:focus, button:focus {
    outline: 3px solid rgba(255,255,255,0.12);
    outline-offset: 3px;
    border-radius: 6px;
}

/* EFFET DE HALO DU CARROUSEL */
.carousel::before {
    content: "";
    position: absolute;
    inset: -56px;
    border-radius: 18px;
    pointer-events: none;
    background:
        radial-gradient(30% 18% at 30% 22%,
        rgba(0, 67, 202, 0.65),
        rgba(0,50,150,0.30) 22%,
        rgba(0,50,150,0.10) 44%,
        rgba(0,50,150,0) 68%),
        radial-gradient(30% 18% at 72% 78%,
        rgba(0, 53, 158, 0.48),
        rgba(0,40,120,0.22) 20%,
        rgba(0,40,120,0) 48%),
        radial-gradient(closest-side at 50% 42%,
        rgba(0, 58, 175, 0.28),
        rgba(0,30,90,0) 60%);

    filter: blur(60px) saturate(150%);
    z-index: 1;
    box-shadow:
        0 10px 36px rgba(0,30,90,0.14),
        inset 0 22px 62px rgba(0,30,90,0.08);
}

@media (max-width: 600px) {
    .carousel::before {
        inset: -22px;
        filter: blur(12px) saturate(120%);
        border-radius: 10px;
        background:
            radial-gradient(30% 18% at 50% 30%,
            rgba(0,50,150,0.48),
            rgba(0,50,150,0.20) 24%,
            rgba(0,50,150,0) 60%),
            radial-gradient(closest-side at 50% 50%,
            rgba(0,30,90,0.18),
            rgba(0,30,90,0) 60%);
        box-shadow: 0 6px 20px rgba(0,30,90,0.08);
    }
}