@media (min-width: 769px) {
    body, html {
        margin: 0;
        padding: 0;
        height: 100%;
        font-family: "Josefin Sans", sans-serif;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #lampe {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 4vw;
        cursor: pointer;
    }

    #lampe[src*="lampe_eteinte.png"] {
        filter: invert(1);
    }

    .container {
        display: flex;
        height: 100vh;
    }

    .sidebar {
        width: 20%;
        color: white;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        height: 100vh;
        z-index: 1;
    }

    .close-sidebar{
        display: none;
    }

    .hamburger-menu{
        display: none;
    }

    .profile-section {
        background-color: #222e3a;
        flex: 0 0 30%; /* Prend 40% de la hauteur de la sidebar */
        display: flex;
        flex-direction: column;
        align-items: center; /* Centre le contenu horizontalement */
        justify-content: center; /* Centre le contenu verticalement */
        padding: 1.5vh
    }

    .profile-section p{
        font-family: "Pacifico", cursive;
        font-size: 2vw;
        margin: 0;
        text-align: left;
        width: 100%;
    }

    .profile-photo {
        width: 60%;
        border-radius: 50%;
        margin-bottom: 5%;
    }

    .social-links a {
        display: inline-block;
        color: white;
        text-decoration: none;
        margin-top: 5%;
    }

    .social-links a:hover {
        text-decoration: underline;
    }

    .social-links img{
        width: 3vw ;
        height: auto;
        object-fit: cover;
    }

    .menu {
        background-color: #2c3e50;
        flex: 1; /* Prend le reste de la hauteur de la sidebar */
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column; /* Dispose les éléments du menu en colonne */
        text-align: center;
        justify-content: center; /* Centre les éléments verticalement */
    }

    .menu button {
        margin: 2vh 0;
        opacity: 0; /* Masque les éléments au départ */
        transform: translateX(-200px); /* Déplace les éléments en dehors de la vue */
        animation: slideIn 0.5s forwards, fadeIn 1s ease-out forwards; ; /* Applique l'animation */
        font-family: "Josefin Sans", sans-serif;
        border: none;
        background: none;
    }

    .menu button a{
        color: white;
        text-decoration: none;
        font-size: 1.8vw;
        padding: 10px;
        display: inline-block;
        position: relative;
        overflow: hidden;
    }

    .menu button a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px; /* Hauteur du trait */
        background: white;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .menu button a:hover::after {
        transform: translateX(0);
    }

    .menu button a.active::after,
    .menu button.active a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px; /* Hauteur du trait */
    background: white;
    transform: translateX(0); /* Le trait est visible en continu */
    }

    /* Définit les délais d'animation pour chaque élément */
    .menu button:nth-child(1) {
        animation-delay: 0s;
    }
    .menu button:nth-child(2) {
        animation-delay: 0.3s;
    }
    .menu button:nth-child(3) {
        animation-delay: 0.6s;
    }
    .menu button:nth-child(4) {
        animation-delay: 0.9s;
    }
    .menu button:nth-child(5) {
        animation-delay: 1.2s;
    }

    @keyframes slideIn {
        to {
            transform: translateX(0); /* Réinitialise la position de translation */
        }
    }

    @keyframes fadeIn {
        to {
            opacity: 1; /* Rend les éléments visibles */
        }
    }



    .content {
        height: 100vh;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        perspective: 1800px; 
        width: 82vw;
        color: white;
        background-color: #1a222a; 
        transform-style: preserve-3d;
    }

    .scene {
        width: 77%; /* Largeur fixe du cube */
        height:75%; /* Hauteur fixe du cube */
        position: relative;
        perspective: 1800px; /* Perspective pour l'effet 3D */
    }

    .cube {
        width: 100%;
        height: 100%;
        position: relative;
        transform-style: preserve-3d; /* Maintient l'effet 3D lors de la transformation */
        transform: rotateY(0deg); /* Initialisation */
        transition: transform 1s ease-in-out; /* Transition fluide pour la rotation */
    }

    .cube-face {
        position: absolute;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        backface-visibility: hidden; /* Cache le dos des faces */
        /*border: 1px solid #ccc;*/
    }

    .cube-face-front { transform: rotateY(0deg) translateZ(500px); }
    .cube-face-right { transform: rotateY(90deg) translateZ(500px); }
    .cube-face-back  { transform: rotateY(180deg) translateZ(500px); }
    .cube-face-left  { transform: rotateY(-90deg) translateZ(500px); }
    .cube-face-top { transform: rotateX(90deg) translateZ(500px); }

    .light-mode body, .light-mode html {
        background-color: white;
        color: black;
    }
    
    .light-mode #lampe {
        filter: invert(0);
    }
    
    .light-mode .sidebar {
        color: black;
    }
    
    .light-mode .profile-section {
        background-color: #ddd;
    }
    
    .light-mode .profile-section p {
        color: black;
    }
    
    .light-mode .social-links a {
        color: black;
    }
    
    .light-mode .social-links a:hover {
        text-decoration: underline;
    }
    
    .light-mode .menu {
        background-color: #ccc;
    }
    
    .light-mode .menu button a {
        color: black;
    }
    
    .light-mode .menu button a::after {
        background: black;
    }
    
    .light-mode .menu button a:hover::after,
    .light-mode .menu button a.active::after,
    .light-mode .menu button.active a::after {
        background: black;
    }
    
    .light-mode .content {
        background-color: #bbb;
        color: black;
    }
    
    .light-mode .cube-face {
        background-color: #bbb;
    }
    
}


@media (max-width: 768px) {
    body, html {
        margin: 0;
        padding: 0;
        height: 100%;
        font-family: "Josefin Sans", sans-serif;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #lampe {
        position: absolute;
        top: 5%;
        left: -1%;
        width: 10vw;
        cursor: pointer;
    }

    #lampe[src*="lampe_eteinte.png"] {
        filter: invert(1);
    }
    
    .container {
        display: flex;
        height: 100vh;
    }
    
    .sidebar {
        position: fixed;
        left: -100%; /* Hide the sidebar off-screen */
        width:50%;
        transition: left 0.3s ease-in-out;
        height: 100%;
        background-color: #222e3a;
        z-index: 1;
    }

    .sidebar.active {
        left: 0; /* Bring the sidebar into view */
    }

    .close-sidebar {
        position: absolute;
        top: 4%;
        right: 5%;
        background: none;
        border: none;
        font-size: 30px;
        color: white;
        cursor: pointer;
        display: block; /* Masqué par défaut pour les grands écrans */
    }

    /* Hamburger menu icon */
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 25px;
        position: fixed;
        top: 3%;
        left: 3%;
        cursor: pointer;
        z-index: 100;
    }

    .hamburger-menu .bar {
        height: 4px;
        width: 100%;
        background-color: white;
        border-radius: 2px;
    }

    /* Hide hamburger when sidebar is open */
    .sidebar.active + .hamburger-menu {
        display: none;
    }
    
    .profile-section {
        background-color: #222e3a;
        flex: 0 0 30%; /* Prend 40% de la hauteur de la sidebar */
        display: flex;
        flex-direction: column;
        align-items: center; /* Centre le contenu horizontalement */
        justify-content: center; /* Centre le contenu verticalement */
        padding: 1.5vh
    }
    
    .profile-section p{
        color: white;
        font-family: "Pacifico", cursive;
        font-size: 5vw;
        margin: 0;
        text-align: center;
    }
    
    .profile-photo {
        width: 80%;
        border-radius: 50%;
        margin-bottom: 5%;
        margin-top: 15%;
    }
    
    .social-links a {
        display: inline-block;
        color: white;
        text-decoration: none;
        margin-top: 5%;
    }
    
    .social-links a:hover {
        text-decoration: underline;
    }
    
    .social-links img{
        width: 8vw ;
        height: auto;
        object-fit: cover;
    }
    
    .menu {
        height: 72%;
        background-color: #2c3e50;
        flex: 1; /* Prend le reste de la hauteur de la sidebar */
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column; /* Dispose les éléments du menu en colonne */
        text-align: center;
        justify-content: center; /* Centre les éléments verticalement */
    }
    
    .menu button {
        margin: 2vh 0;
        opacity: 0; /* Masque les éléments au départ */
        transform: translateX(-200px); /* Déplace les éléments en dehors de la vue */
        animation: slideIn 0.5s forwards, fadeIn 1s ease-out forwards; ; /* Applique l'animation */
        font-family: "Josefin Sans", sans-serif;
        border: none;
        background: none;
    }
    
    .menu button a{
        color: white;
        text-decoration: none;
        font-size:4.8vw;
        padding: 10px;
        display: inline-block;
        position: relative;
        overflow: hidden;
    }
    
    .menu button a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px; /* Hauteur du trait */
        background: white;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .menu button a:hover::after {
        transform: translateX(0);
    }

    .menu button a.active::after,
    .menu button.active a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px; /* Hauteur du trait */
    background: white;
    transform: translateX(0); /* Le trait est visible en continu */
    }

    
    /* Définit les délais d'animation pour chaque élément */
    .menu button:nth-child(1) {
        animation-delay: 0s;
    }
    .menu button:nth-child(2) {
        animation-delay: 0.3s;
    }
    .menu button:nth-child(3) {
        animation-delay: 0.6s;
    }
    .menu button:nth-child(4) {
        animation-delay: 0.9s;
    }
    .menu button:nth-child(5) {
        animation-delay: 1.2s;
    }
    
    @keyframes slideIn {
        to {
            transform: translateX(0); /* Réinitialise la position de translation */
        }
    }
    
    @keyframes fadeIn {
        to {
            opacity: 1; /* Rend les éléments visibles */
        }
    }
         
    
    .content {
        height: 100vh;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        perspective: 1800px; 
        width: 100vw;
        color: white;
        background-color: #1a222a; 
        transform-style: preserve-3d;
    }
    
    .scene {
        width: 77%; /* Largeur fixe du cube */
        height:75%; /* Hauteur fixe du cube */
        position: relative;
        perspective: 1800px; /* Perspective pour l'effet 3D */
    }
    
    .cube {
        width: 100%;
        height: 100%;
        position: relative;
        transform-style: preserve-3d; /* Maintient l'effet 3D lors de la transformation */
        transform: rotateY(0deg); /* Initialisation */
        transition: transform 1s ease-in-out; /* Transition fluide pour la rotation */
    }
    
    .cube-face {
        position: absolute;
        width: 97%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        backface-visibility: hidden; /* Cache le dos des faces */
        /*border: 1px solid #ccc;*/
    }
    
    .cube-face-front { transform: rotateY(0deg) translateZ(400px); }
    .cube-face-right { transform: rotateY(90deg) translateZ(400px); }
    .cube-face-back  { transform: rotateY(180deg) translateZ(400px); }
    .cube-face-left  { transform: rotateY(-90deg) translateZ(400px); }
    .cube-face-top { transform: rotateX(90deg) translateZ(400px); }


    .light-mode body, .light-mode html {
        background-color: white;
        color: black;
    }
    
    .light-mode #lampe {
        filter: invert(0);
    }
    
    .light-mode .sidebar {
        color: black;
    }

    .light-mode .close-sidebar {      
        color: black;      
    }
    
    .light-mode .profile-section {
        background-color: #ddd;
    }
    
    .light-mode .profile-section p {
        color: black;
    }
    
    .light-mode .social-links a {
        color: black;
    }
    
    .light-mode .social-links a:hover {
        text-decoration: underline;
    }
    
    .light-mode .menu {
        background-color: #ccc;
    }
    
    .light-mode .menu button a {
        color: black;
    }
    
    .light-mode .menu button a::after {
        background: black;
    }
    
    .light-mode .menu button a:hover::after,
    .light-mode .menu button a.active::after,
    .light-mode .menu button.active a::after {
        background: black;
    }
    
    .light-mode .content {
        background-color: #bbb;
        color: black;
    }
    
    .light-mode .cube-face {
        background-color: #bbb;
    }
    
}