/* ==========================================================================
   VARIABLES — source unique de vérité pour tout le site.
   Ne redéfinir aucune de ces variables dans un autre fichier.
   ========================================================================== */
:root {
    /* Couleurs de marque */
    --primary-color: #ff5c00;
    --primary-hover: #ff7e33;
    --secondary-color: #4d4d4d;
    --highlight-color: #87CEFA;

    /* États */
    --error-color: #E9383F;
    --success-color: #2ea043;

    /* Texte */
    --text-color: #e6e6e6;
    --text-muted: #cccccc;
    --text-faint: #b0b0b0;

    /* Surfaces */
    --surface-color: #393939;              /* nav, aside, main */
    --surface-raised: #595959;             /* article, formulaire, bloc téléphone */
    --surface-input: #333333;              /* champs, dropzone */
    --surface-input-hover: #383838;
    --tile-overlay: rgba(77, 77, 77, 0.7); /* voile des tuiles compétences */
    --track-color: #999999;                /* fond des barres de progression */
    --border-color: #4d4d4d;

    /* Typographie */
    --font-family-main: 'Montserrat', sans-serif;
    --font-family-alt: 'Bebas Neue', sans-serif;

    /* Divers */
    --border-radius: 10px;
    --transition-duration: 0.3s;
    --gradient-bg: linear-gradient(-45deg, #FFB347, #FF6B6B, #FFF9C4);
    --box-shadow: 0px 0px 15px 5px #393939;
}

/* ==========================================================================
   STRUCTURE
   ========================================================================== */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    background: var(--gradient-bg);
    background-size: 300% 300%;
    animation: gradient 15s ease infinite;
    overflow: hidden;
}

#squaresBackground {
    height: 100vh;
    overflow: hidden;
}

#websiteContent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ---- Navigation ---- */
nav {
    margin: 6% 0 0 3%;
    padding: 5px;
    width: 7%;
    height: 60vh;
    position: absolute;
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

nav div {
    padding: 4px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color var(--transition-duration), color var(--transition-duration);
}

nav div:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

nav div .icon { font-size: 125%; }

nav div:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ---- Carte de visite ---- */
aside {
    margin: 4% 0 0 12%;
    padding: 5px;
    width: 25%;
    height: 70vh;
    position: absolute;
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    box-shadow: var(--box-shadow);
    z-index: 2;
}

aside #duration_activity {
    padding: 2%;
    width: 99%;
    background: linear-gradient(135deg, #cc4b00, #ff6600);
    display: flex;
    flex-direction: column;
    align-items: center;
}

aside #languages {
    width: 50%;
    display: flex;
    justify-content: space-around;
}

aside #languages span {
    padding: 7%;
    width: 33%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    cursor: pointer;
    border-top: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
}

aside #languages span:nth-of-type(1) {
    border-left: 1px solid #FFFFFF;
    border-radius: 10px 0 0 10px;
}

aside #languages span:nth-of-type(3) {
    border-right: 1px solid #FFFFFF;
    border-radius: 0 10px 10px 0;
}

aside .langsFlag {
    width: 80%;
    border: 1px solid #FFFFFF;
}

aside .activeLang {
    background-color: var(--secondary-color);
}

aside a {
    display: inline-block;
    padding: 7px;
    width: 70%;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: var(--border-radius);
    font-family: var(--font-family-main);
    font-weight: 300;
    background: transparent;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
    cursor: pointer;
    transition: border 0.5s ease, color 0.5s ease;
}

aside a:hover {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

aside a i {
    margin-right: 8px;
}

/* ---- Zone de contenu ---- */
main {
    margin: 4% 0 0 40%;
    padding: 5px;
    width: 50%;
    height: 70vh;
    position: absolute;
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    scroll-behavior: smooth;
    transform: scale(1);
    transition: margin-left 0.5s ease, width 0.5s ease, transform 0.5s ease;
    z-index: 1;
}

main .icon { color: var(--primary-color); }

/* CLÉ : sans `min-height: 0`, un enfant flex refuse de descendre sous la
   hauteur de son contenu et `overflow: auto` ne s'enclenche jamais.
   C'est ce qui écrasait le formulaire au lieu de le faire défiler. */
main > .scrollable {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
}

.scrollable::-webkit-scrollbar {
    width: 12px;
}

.scrollable::-webkit-scrollbar-track {
    background-color: var(--surface-color);
}

.scrollable::-webkit-scrollbar-thumb {
    border-radius: 50px;
    background-color: var(--primary-color);
}

/* ---- Bouton d'accès à la carte (mobile) ---- */
#accessCardMobile {
    display: none;
}

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    html, body {
        touch-action: none;
    }

    nav {
        margin: 0;
        width: 100%;
        height: 5vh;
        flex-direction: row;
        border-radius: 0;
    }

    nav div {
        width: 35px;
        height: 35px;
        border-radius: 50%;
    }

    nav div p {
        display: none;
    }

    main {
        padding: 1%;
        margin-left: 4%;
        margin-top: 15%;
        width: 90%;
        height: 75vh;
    }

    aside {
        padding: 1%;
        margin-left: 4%;
        margin-top: 100vh;
        width: 90%;
        height: 75vh;
    }

    #accessCardMobile {
        display: block;
        padding: 10px;
        width: 90%;
        background-color: var(--primary-color);
        border-radius: 25px;
        border: 0;
        font-size: 150%;
        cursor: pointer;
    }
}