*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #050505;
    color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* REDUCTION DU VIDE : 90px correspond exactement à la hauteur de la navbar */
    padding-top: 90px;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1a1500 0%, #050505 60%);
    background-attachment: scroll;
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb {
    background: #aa8c2c;
    border-radius: 6px;
    border: 3px solid #050505;
}
::-webkit-scrollbar-thumb:hover { background: #d4af37; }

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(5, 5, 5, 0.98);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.nav-brand {
    display: flex;
    align-items: center;
    margin-right: 10px;
    z-index: 2001;
}

.nav-logo-img {
    height: 48px;
    width: auto;
    margin-right: 15px;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
    transition: transform 0.3s;
}

.navbar:hover .nav-logo-img { transform: scale(1.05); }
.nav-toggle, .nav-burger, .btn-cv-mobile { display: none; }

.nav-links {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 2vw;
    margin: 0 10px;
}

.nav-links a {
    text-decoration: none;
    color: #a0a0a0;
    font-size: clamp(0.7rem, 1vw + 0.3rem, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #d4af37;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.btn-cv-desktop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 37px;
    padding: 0 25px;
    min-width: 125px;
    gap: 8px;
    margin: 0 25px 0 auto;
    background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
    color: #000 !important;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #f9e5a0;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-cv-desktop:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #fff7cc 0%, #d4af37 100%);
}

.btn-cv-desktop svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    transition: transform 0.3s;
    margin-top: -2px;
}
.btn-cv-desktop:hover svg { transform: rotate(-10deg) scale(1.1); }
.btn-cv-desktop::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.6s;
}
.btn-cv-desktop:hover::before { left: 100%; }

.main-container {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto 60px auto; 
    flex: 1;
}

.page-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 400;
    font-style: italic;
    color: #f0f0f0;
    /* REDUCTION DU VIDE : suppression de la marge haute */
    margin: 0 0 10px 0; 
    background: linear-gradient(to right, #ffffff 20%, #d4af37 50%, #ffffff 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
}

.subtitle {
    text-align: center;
    color: #d4af37;
    margin-bottom: 50px;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- LE VRAI EFFET 3D COMMENCE ICI --- */

.timeline {
    position: relative;
    padding-left: 50px;
}

/* La ligne centrale devient un tube doré 3D */
.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 4px; /* Plus épais pour la 3D */
    background: linear-gradient(to right, #f9e5a0 0%, #aa8c2c 100%); /* Dégradé cylindrique */
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    opacity: 0;
    top: 40px; /* On utilise 'top' au lieu de 'transform' pour casser la prison du fixed ! */
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), top 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.timeline-item.visible {
    opacity: 1;
    top: 0;
}

.timeline-item:has(input:checked) {
    z-index: 9999;
}

.timeline-item input[type="checkbox"] { display: none; }

/* Les points deviennent des sphères dorées 3D */
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 30px;
    width: 20px;
    height: 20px;
    /* Effet sphère magique */
    background: radial-gradient(circle at 30% 30%, #fff7cc 0%, #d4af37 40%, #5a4505 100%);
    border-radius: 50%;
    z-index: 2;
    transition: 0.3s;
    box-shadow: 0 5px 10px rgba(0,0,0,0.8), inset -2px -2px 4px rgba(0,0,0,0.5);
}

/* La carte devient une plaque premium 3D */
.timeline-content {
    display: block;
    /* Dégradé de fond pour imiter une matière noble */
    background: linear-gradient(145deg, #151515 0%, #050505 100%);
    
    /* Bords asymétriques pour l'effet biseauté (lumière en haut à gauche, ombre en bas à droite) */
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.9);
    
    padding: 35px;
    border-radius: 12px; /* Coins plus arrondis */
    cursor: pointer;
    margin-left: 30px;
    
    /* Ombre portée massive + Ombre interne pour l'épaisseur du verre */
    box-shadow: 10px 15px 30px rgba(0, 0, 0, 0.9), inset 1px 1px 2px rgba(255, 255, 255, 0.05);
    
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
}

.timeline-content:hover {
    transform: translateX(10px) translateY(-5px) !important;
    border-top-color: #d4af37;
    border-left-color: #d4af37;
    box-shadow: 15px 25px 40px rgba(0, 0, 0, 0.95), inset 2px 2px 5px rgba(212, 175, 55, 0.2);
}

/* --- Préparation des éléments internes pour qu'ils "sortent" de la carte 3D --- */
.timeline-content .header-content,
.timeline-content .school-info,
.timeline-content p,
.timeline-content .tag-school,
.timeline-content .click-hint {
    transform: translateZ(25px);
}

.tag-school {
    font-size: 0.7rem;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-content h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #fff;
}

.date-badge {
    font-style: italic;
    color: #a0a0a0;
}

.school-info {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.school-logo-tiny {
    height: auto;
    max-height: 60px;
    max-width: 150px;
    object-fit: contain;
    display: block;
}

.logo-xl {
    max-height: 80px; 
    max-width: 200px;
}

.timeline-content p {
    color: #a0a0a0;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

.click-hint {
    display: inline-block;
    margin-top: 20px;
    font-size: 0.8rem;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed #d4af37;
}

/* Modales / Side Panel */
.side-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000;
    pointer-events: none;
    visibility: hidden;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1;
}

.panel-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 100%;
    height: 100%;
    background: #0a0a0a;
    border-left: 1px solid #d4af37;
    padding: 60px 40px;
    transform: translateX(100%);
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    box-shadow: -10px 0 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.timeline-item input:checked ~ .side-panel {
    pointer-events: auto;
    visibility: visible;
}

.timeline-item input:checked ~ .side-panel .overlay { opacity: 1; }
.timeline-item input:checked ~ .side-panel .panel-content { transform: translateX(0); }

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: #a0a0a0;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}

.close-btn:hover {
    color: #d4af37;
    transform: rotate(90deg);
}

.panel-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 8px;
}

.info-box strong {
    display: block;
    color: #d4af37;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.info-box span {
    color: #ccc;
    font-size: 0.95rem;
}

hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 30px 0;
}

.panel-content h3 {
    color: #d4af37;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin: 30px 0 15px 0;
}

.panel-content p {
    color: #b0b0b0;
    line-height: 1.8;
    margin-bottom: 20px;
}

.highlight-text {
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid #d4af37;
    padding: 20px;
    margin: 20px 0;
}

.highlight-text strong {
    display: block;
    color: #f0f0f0;
    margin-bottom: 10px;
}

.discrete-link {
    color: #d4af37;
    text-decoration: underline;
}

.site-footer {
    text-align: center;
    padding: 20px;
    background-color: #050505;
    color: #d4af37;
    font-size: 0.9rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    margin-top: auto;
}

/* Magie JS */
#gold-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    pointer-events: none; 
}
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    mix-blend-mode: screen;
    transition: opacity 0.3s ease;
}
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    background-color: rgba(255, 255, 255, 0.5);
}
@keyframes ripple-effect {
    to { transform: scale(4); opacity: 0; }
}

@media (max-width: 900px) {
    body { padding-top: 70px; }
    .navbar {
        height: 70px;
        padding: 0 20px;
        justify-content: space-between;
        flex-direction: row;
        background: #050505;
    }
    .nav-logo-img { height: 35px; margin: 0; }
    .btn-cv-desktop { display: none; }
    .nav-burger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 2002;
    }
    .nav-burger span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: #d4af37;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        height: 100vh;
        background-color: #050505;
        border-left: 1px solid #d4af37;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        margin: 0;
        z-index: 2000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.8);
        padding: 20px;
    }
    .nav-toggle:checked ~ .nav-links { transform: translateX(0); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
    .nav-links a { font-size: 1.2rem; color: #f0f0f0; }
    .btn-cv-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-top: 20px;
        padding: 12px 30px;
        border: 1px solid #d4af37;
        color: #d4af37;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        text-decoration: none;
        font-size: 0.9rem;
    }

    .main-container { width: 95%; margin-top: 10px; overflow-x: hidden; }
    .page-title { font-size: 2.2rem; margin-bottom: 10px; }
    .subtitle { margin-bottom: 40px; font-size: 0.8rem; }
    .timeline { padding-left: 20px; }
    .timeline::before { left: 9px; }
    .timeline-dot { left: 2px; top: 20px; }
    .timeline-content {
        margin-left: 25px;
        padding: 20px;
        width: calc(100% - 25px);
        transform-style: flat; /* Désactive la 3D sur mobile pour éviter les bugs tactiles */
    }
    .timeline-content .header-content,
    .timeline-content .school-info,
    .timeline-content p,
    .timeline-content .tag-school,
    .timeline-content .click-hint {
        transform: none;
    }
    .school-logo-tiny, .logo-xl { max-width: 100%; height: auto; max-height: 60px; }
    .panel-content { width: 100%; max-width: 100%; padding: 40px 20px; }
    .info-grid { grid-template-columns: 1fr; }
}
