* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    font-size: 105%;
    margin:0;
    padding-top: 60px;
}

body > *:not(footer) {
    flex: 1;
}

html {
    scroll-padding-top: 60px;
    scroll-behavior: smooth;
}

html,body{
    width: 100%;
    height: 100%;
}

#topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;           
    height: 60px;
    padding: 0 20px;     
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3000;
    overflow: hidden;   
}

#topbar-text {
    font-weight: bold;
    font-size: 1rem;
}

#symbole {
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;      
}

#menu {
    display: none;
    position: fixed;
    padding: 10px 25px;
    top: 60px;
    right: 0;       
    left: auto;    
    width: 250px;   
    text-align: center;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
    z-index: 2000;
}

#menu a{
    text-decoration: none;
}

#menu a:hover{
    font-weight: bold;
    border-radius: 5px;
}

#menu ul{
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#menu ul li{
    margin:10px;
}

#mode {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

#btnmode {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    cursor: pointer;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 30px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.slider::after {
    content: "🌙";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

#btnmode:checked + .switch .slider {
    background-color: #4a9eff;
}

#btnmode:checked + .switch .slider::before {
    transform: translateX(30px);
}

#btnmode:checked + .switch .slider::after {
    content: "☀️";
    left: 8px;
    right: auto;
}

.switch:hover .slider {
    box-shadow: 0 0 5px rgba(74, 158, 255, 0.5);
}

section {
    padding: 15px;
    max-width: 900px;
    margin: 20px auto;
    border-radius: 10px;
}

section#accueil {
    max-width: 900px;
    margin: 70px auto;
}

#prenom{
    cursor: pointer;
    position: relative;
    display: inline-block;
}

#div-moi{
    display: flex;
    align-items: center;
    justify-content: center;
}

#photoPres{
    height: 30%;
    width: 30%;
    border-radius: 50%;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

h2{
    margin-left: 10px;
}

#sommaire {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.flip-card {
    background-color: transparent;
    width: 280px;
    height: 180px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 10px;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.flip-card-front h3 {
    margin: 0;
    font-size: 1.15rem;
    text-align: center;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flip-card-back ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
    text-align: left;
    width: 100%;
}

.flip-card-back ul li {
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.3;
}
.flip-card-back ul li:last-child {
    margin-bottom: 0;
}

.comp-subgroup {
    margin-top: 25px;
    text-align: center;
}

.comp-subgroup h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.learning-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.learning-list li {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.compétence-cont {
    margin-top: 25px;
    text-align: center;
}

.compétence-cont h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.apprentissage {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#dev , #certification{
    list-style-type: none;
    display:flex;
    flex-wrap: wrap;
    gap:10px;
    align-items: center;
    justify-content: center;
}

.img-langage, .img-certification {
    width: 180px;
    height: 180px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    border-radius: 7px;
    overflow: hidden;
}

.img-langage::before, .img-certification::before {
    display: none; 
}

.img-langage span, .img-certification span {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 10px;
    box-sizing: border-box;
    z-index: 1;
}

#projets{
    width:90%;
    margin:0 auto;
    text-align:center;
}

#conteneur-projet {
    display: flex;
    transition: transform 0.3s ease-in-out;
    flex-wrap: nowrap;
}

#carroussel-projet {
    position: relative;
    width: 520px;     
    margin: 0 auto;
    overflow: hidden;
    padding-bottom: 10px;
}

.proj {
    flex: 0 0 96%;   
    margin: 0 10px;
    border-radius: 10px;
    padding: 20px;
}

.p-proj{
    margin-left:10px;
    margin-right: 10px;
}

.proj img {
    width: 100%;
    height: auto;    
    border-radius: 10px;
    display: block;
}

.fleche {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  z-index: 2;
}

.prec { left: 10px; }
.suiv { right: 10px; }

#bac{
    cursor: pointer;
}

.lien-maps{
    text-decoration: none;
}

#diplome-bac{
    display: none;
}

#div-lycee, #div-fac{
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.source-img {
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.7;
    text-align: center;
    margin-top: 5px;
}

#btncontact{
    display: flex;
    justify-content: center;
}

footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

#div-liens{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.img-liens{
    height: 40px;
    width: 40px;
}

@media (max-width: 600px) {

    body, section, #projets {
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }

    section {
        max-width: 100%;
        margin: 10px auto;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #mode{
        left: 65%;
        transform: translateX(-20%);
    }

    .switch {
        width: 50px;
        height: 25px;
    }
    
    .slider::before {
        height: 18px;
        width: 18px;
    }
    
    #btnmode:checked + .switch .slider::before {
        transform: translateX(25px);
    }

    #sommaire {
        flex-direction: column;
        gap: 10px;
    }

    #photoPres {
        width: 180px;
        height: auto;
    }

    #dev , #certification {
        padding: 0;
        margin: 0 auto;
    }

    .flip-card {
        width: 100%; 
        max-width: 320px;
    }

    .img-langage, .img-certification {
        width: 120px;
        height: 120px;
        display: block;    
    }

    #carroussel-projet {
        width: calc(100% - 30px);
        margin: 0 15px;
        overflow: hidden;
        padding-bottom: 10px;
        position: relative;
    }

    #conteneur-projet {
        display: flex;
        flex-wrap: nowrap;
        transition: transform 0.3s ease-in-out;
    }

    .proj {
        flex: 0 0 calc(100% - 30px);
        margin: 0 15px;
        box-sizing: border-box;
        padding: 20px;
    }

    .proj img {
        width: 100%;
        height: auto;
        display: block;
    }

    .fleche {
        font-size: 1.5rem;
        padding: 5px;
        top: 40%;
    }

    .prec { 
        left: 5px; 
    }
    
    .suiv { 
        right: 5px; 
    }

    #menu {
        width: 100%;
        left: 0;
        right: 0;
    }

    #topbar {
        z-index: 3000;
    }

}