/* ==========================================================================
    Header
    Barre du haut, navigation et menu burger
   ========================================================================== */

/* ---------- Barre du header ---------- */
header {
    display: flex;
    width: 100%;
    max-width: var(--container-width);
    justify-content: space-between;
    align-items: center;

    position: sticky;
    top: 10px;
    z-index: 1000;

    padding: 10px 15px;
    border-radius: 15px;
    transition: background 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out;
}

header.header-active {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
}


/* ---------- Nom ---------- */
.name {
    position: relative;
    z-index: 1100;
}

.name p {
    font-size: var(--fs-logo);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-title);
}


/* ---------- Navigation ---------- */
nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.nav-link {
    position: relative;
    font-size: var(--fs-body);
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--nav-underline);
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}


/* ---------- Burger ---------- */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 14.5px;
    position: relative;
    z-index: 1100;
    border: none;
    background: none;
    cursor: pointer;
}

.burger-menu span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--text-title);
    border-radius: 3px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}


/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
    header {
        padding: 8px 15px;
    }

    .burger-menu {
        display: flex;
    }

    /* Menu caché au-dessus de l'écran, il descend avec la classe .active */
    nav {
        position: fixed;
        top: -100vh;
        left: 0;
        width: 100%;
        min-height: 300px;
        flex-direction: column;
        justify-content: center;
        padding: 70px 0 20px;
        gap: 25px;

        background: var(--nav-mobile-bg);
        backdrop-filter: blur(12px);
        border-radius: 20px;
        transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    nav.active {
        top: 0;
    }

    /* Les trois barres se transforment en croix */
    .burger-menu.open span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .burger-menu.open span:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.open span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}
