/* ============================================================
   MATHS-MDE 2026 — THEME FUTURISTE APPLE (BLEU / BLANC)
   Glassmorphism + Minimalisme + Néon subtil
   ============================================================ */

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

body {
    font-family: "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f9ff, #e8f0ff);
    color: #1a1a1a;
    overflow-x: hidden;
}

/* ----- HEADER ----- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);

    z-index: 1000;
}

/* ----- LOGO ----- */
.logo {
    display: flex;
    align-items: center;
    font-size: 26px;
    font-weight: 700;
    color: #0a0a0a;
}

.logo span {
    color: #007aff;
}

.logo img {
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

/* ----- NAVIGATION ----- */
.nav {
    display: block;
}

.menu-root {
    list-style: none;
    display: flex;
    gap: 28px;
}

.menu-root > li > a {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    padding: 8px 0;
    display: block;
}

/* ----- MENU MULTI-NIVEAUX ----- */
.has-sub {
    position: relative;
}

.submenu {
    list-style: none;
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin-top: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-radius: 10px;
    border-left: 2px solid rgba(0,122,255,0.2);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    z-index: 1001;
}

/* Sous-sous-menu (niveau 3+) : ouvert vers la droite pour ne pas empiler à la verticale */
/* Tous les 3e niveaux (et au-delà) s'empilent verticalement plutôt que de
   se déployer sur le côté (plus cohérent, et évite tout débordement d'écran
   quelle que soit la position du menu). */
.submenu .submenu {
    position: static;
    top: auto;
    left: auto;
    min-width: 0;
    margin: 6px 0 6px 16px;
    box-shadow: none;
    border-left: 2px solid rgba(0,122,255,0.2);
    background: transparent;
    backdrop-filter: none;
}

.has-sub.open > .submenu {
    display: block !important;
}

.submenu li a {
    display: block;
    padding: 4px 0;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.submenu li a:hover {
    color: #007aff;
}

/* ----- MENU MOBILE ----- */
.menu-btn {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .nav {
        display: none;
        position: absolute;
        top: 80px;
        right: 20px;
        left: 20px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(14px);
        padding: 20px;
        border-radius: 14px;
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    }

    .menu-root {
        flex-direction: column;
        gap: 10px;
    }

    .menu-btn {
        display: block;
    }

    .logo img {
        width: 42px;
        height: 42px;
    }

    /* Tous les sous-menus (2e, 3e niveau...) s'empilent verticalement au lieu
       de se déployer sur le côté (le "left: 100%" du 3e niveau sortirait de
       l'écran sur mobile) */
    .submenu,
    .submenu .submenu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        min-width: 0 !important;
        margin: 6px 0 6px 16px !important;
        box-shadow: none !important;
        border-left: 2px solid rgba(0,122,255,0.2) !important;
        background: transparent !important;
        backdrop-filter: none !important;
    }
}

/* ----- HERO SECTION ----- */
.hero {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    padding: 0 20px;

    background: linear-gradient(135deg, #eaf2ff, #ffffff);
    position: relative;
    overflow: hidden;
}

#hero-webgl {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    width: 130px;
    height: 130px;
    filter: drop-shadow(0 0 18px rgba(127, 179, 255, 0.8));
    animation: heroLogoPulse 4s ease-in-out infinite;
}

@keyframes heroLogoPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.hero-formulas {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.formula-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    padding: 8px 16px;
    border: 1px solid rgba(0, 122, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    color: #0a0a0a;
    animation: formulaFloat 6s ease-in-out infinite;
}

.f1 { top: 12%; left: 10%; animation-delay: 0s; }
.f2 { top: 20%; right: 10%; animation-delay: 0.8s; }
.f3 { bottom: 24%; left: 8%; animation-delay: 1.6s; }
.f4 { bottom: 16%; right: 12%; animation-delay: 2.4s; }
.f5 { top: 50%; left: 4%; animation-delay: 3.2s; }
.f6 { top: 48%; right: 4%; animation-delay: 4s; }

@keyframes formulaFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}

@media (max-width: 900px) {
    .formula-card { display: none; } /* trop de place prise sur mobile, on garde juste le logo */
}

.hero p {
    font-size: 20px;
    margin-top: 12px;
    color: #3a3a3a;
}

.btn {
    margin-top: 28px;
    padding: 14px 28px;
    font-size: 18px;
    border-radius: 12px;

    background: linear-gradient(135deg, #007aff, #4da3ff);
    color: white;
    text-decoration: none;
    font-weight: 600;

    box-shadow: 0 4px 18px rgba(0, 122, 255, 0.35);
    transition: 0.2s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.55);
}

/* ----- SLIDER ----- */
.slider {
    margin-top: 40px;
    height: 380px;
    position: relative;
    overflow: hidden;
}

.slides {
    height: 100%;
    display: flex;
    transition: transform 0.8s ease;
}

.slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;

    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.caption {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    padding: 12px 22px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-size: 22px;
    color: #0a0a0a;
    font-weight: 600;
}

/* ----- GLASS SECTIONS ----- */
.glass-section {
    padding: 60px 40px;
    text-align: center;
}

.glass-section h2 {
    font-size: 36px;
    margin-bottom: 30px;
    color: #0a0a0a;
}

.glass-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    transition: 0.2s;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.glass-card iframe {
    width: 100%;
    height: 260px;
    border-radius: 14px;
    border: none;
}

/* ----- FOOTER ----- */
.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;

    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);

    color: #3a3a3a;
    font-size: 16px;
}
