/* ==========================================
   POLICE PERSONNALISÉE
========================================== */

@font-face {
    font-family: 'Bootzy TM';

    src:
        url('fonts/BootzyTM.ttf') format('truetype'),
        url('src/font/BootzyTM.woff') format('woff'),
        url('src/font/BootzyTM.otf') format('opentype'),
        url('src/font/BootzyTM.ttf') format('truetype');

    font-weight: normal;
    font-style: normal;
    font-display: swap;
}



/* ==========================================
   VARIABLES MODE CLAIR
========================================== */

:root {
    --bg-color: #ffffff;
    --title-color: #1a1a1a;
    --text-primary: #222222;
    --nav-link-color: #2b2b2b;
    --accent-color: #ff8fab;
    --modal-bg: #ffffff;
    --card-bg: #f5f5f7;
    --dropdown-bg: #ffffff;
    --dropdown-border: rgba(0, 0, 0, 0.08);
    --gutter-mobile: max(20px, env(safe-area-inset-left));
    --gutter-mobile-right: max(20px, env(safe-area-inset-right));
}



/* ==========================================
   VARIABLES MODE SOMBRE
========================================== */

body.dark-mode {
    --bg-color: #121214;
    --title-color: #ffffff;
    --text-primary: #f0f0f0;
    --nav-link-color: #e0e0e0;
    --accent-color: #fdd38b;
    --modal-bg: #1e1e24;
    --card-bg: #2a2a32;
    --dropdown-bg: #1b1b1f;
    --dropdown-border: rgba(255, 255, 255, 0.1);
}



/* ==========================================
   RESET
========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html,
body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overflow-x: clip;
}


body {
    font-family: 'Figtree', 'Montserrat', sans-serif;

    background-color: var(--bg-color);
    color: var(--text-primary);

    display: flex;
    flex-direction: column;

    transition:
        background-color 0.4s ease,
        color 0.4s ease;

    position: relative;
}



/* ==========================================
   DÉCORATIONS SVG
========================================== */

.decorations-container {
    position: absolute;
    inset: 0;

    pointer-events: none;

    z-index: 1;

    overflow: hidden;
}


.decor-svg {
    position: absolute;

    color: var(--accent-color);

    transition: color 0.4s ease;
}


.decor-top-left {
    top: 0;
    left: 0;

    width: 42vw;
    max-width: 550px;

    height: auto;
}


.decor-bottom-right {
    bottom: 0;
    right: 0;

    width: 42vw;
    max-width: 550px;

    height: auto;
}


.draw-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;

    animation:
        drawLine 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}



/* ==========================================
   NAVBAR (BUREAU)
========================================== */

.navbar {
    width: 100%;

    padding: 30px 50px;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    z-index: 1000;
}


.home-icon {
    position: absolute;
    left: 50px;

    width: 28px;
    height: 28px;

    color: var(--nav-link-color);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 1002;

    transition:
        transform 0.2s ease,
        color 0.3s ease;
}


.home-icon:hover {
    transform: scale(1.15);

    color: var(--accent-color);
}


.home-icon svg {
    width: 100%;
    height: 100%;
}


/* Bouton burger caché sur bureau */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nav-link-color);
    padding: 6px;
    z-index: 1002;
}


.nav-panel {
    display: contents;
}


.nav-links {
    display: inline-flex;

    gap: 15px;

    align-items: center;

    font-family: 'Figtree', sans-serif;

    font-size: 1.1rem;
    font-weight: 700;
}


.nav-links a {
    text-decoration: none;

    color: var(--nav-link-color);

    transition:
        opacity 0.2s,
        color 0.3s ease;
}


.nav-links a:hover {
    opacity: 0.6;
}


.nav-links span {
    color: var(--accent-color);

    font-size: 1.2rem;
}



/* ==========================================
   CONTRÔLES DE NAVIGATION
========================================== */

.nav-controls {
    position: absolute;
    right: 50px;

    display: flex;
    align-items: center;

    gap: 18px;
}


.control-btn {
    background: none;
    border: none;

    cursor: pointer;

    font-family: 'Figtree', sans-serif;
    font-size: 0.95rem;

    color: var(--nav-link-color);

    display: flex;
    align-items: center;

    gap: 4px;
}


.lang-option {
    opacity: 0.4;
    font-weight: 700;
}


.lang-option.active {
    opacity: 1;

    color: var(--accent-color);
}


.lang-divider {
    opacity: 0.3;
}


.theme-icon {
    font-size: 1.3rem;

    color: var(--accent-color);
}



/* ==========================================
   SCÈNE ORBITALE 3D
========================================== */

.portfolio-hero {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    width: 100%;

    z-index: 10;
}


.orbit-scene {
    position: relative;

    width: 100%;
    max-width: 800px;
    height: 500px;

    display: flex;
    align-items: center;
    justify-content: center;

    perspective: 1000px;
}



/* ==========================================
   TITRE CENTRAL
========================================== */

.portfolio-title {
    font-family: 'Bootzy TM', 'Montserrat', sans-serif;

    font-size: 5.5rem;
    font-weight: normal;
    letter-spacing: 0.05em;

    color: var(--title-color);

    text-align: center;

    z-index: 50;

    pointer-events: none;

    animation:
        zoomIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    transition:
        opacity 0.4s ease,
        filter 0.4s ease;
}


@keyframes zoomIn {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}



/* ==========================================
   ORBITE DES MOTS-CLÉS
========================================== */

.keyword-orbit {
    position: absolute;

    width: 100%;
    height: 100%;

    top: 0;
    left: 0;

    transform-style: preserve-3d;

    pointer-events: none;
}


.keyword {
    position: absolute;

    top: 50%;
    left: 50%;

    display: inline-block;

    text-decoration: none;

    font-family: 'Montserrat', sans-serif;

    font-size: 1.15rem;
    font-weight: 700;

    color: var(--accent-color);

    white-space: nowrap;

    pointer-events: auto;

    cursor: pointer;

    transform-style: preserve-3d;

    transition:
        font-weight 0.2s ease,
        color 0.3s ease;

    will-change: transform, opacity, filter;

    -webkit-tap-highlight-color: transparent;
}


.keyword:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 6px;

    border-radius: 4px;
}



/* ==========================================
   EFFETS AU SURVOL
========================================== */

body.keyword-hovered .portfolio-title {
    opacity: 0.15;

    filter: blur(2px);
}


body.keyword-hovered .keyword:not(.active-target) {
    opacity: 0.15 !important;

    filter: blur(2px) !important;
}


.keyword.active-target {
    opacity: 1 !important;

    filter: blur(0) !important;

    font-weight: 900 !important;
}



/* ==========================================
   MODALE
========================================== */

.modal-overlay {
    position: fixed;

    top: 0;
    left: 0;

    width: 100vw;
    height: 100vh;

    background-color: rgba(0, 0, 0, 0.45);

    backdrop-filter: blur(6px);

    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1),
        visibility 0.35s ease;

    will-change: opacity, visibility;
}


.modal-overlay.active {
    opacity: 1;

    visibility: visible;
}


.modal-container {
    width: 70vw;
    height: 70vh;

    background-color: var(--modal-bg);

    border-radius: 24px;

    padding: 40px;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);

    position: relative;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    transform: scale(0.96) translateY(12px);

    transition:
        transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);

    will-change: transform;
}


.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}


.modal-close-btn {
    position: absolute;

    top: 25px;
    right: 30px;

    background: none;
    border: none;

    font-size: 2.2rem;

    color: var(--text-primary);

    cursor: pointer;

    line-height: 1;

    opacity: 0.6;

    transition:
        opacity 0.2s ease,
        color 0.2s ease;
}


.modal-close-btn:hover {
    opacity: 1;

    color: var(--accent-color);
}


.modal-title {
    font-family: 'Bootzy TM', 'Montserrat', sans-serif;

    font-size: 2.8rem;
    font-weight: normal;
    letter-spacing: 0.05em;

    color: var(--title-color);

    margin-bottom: 25px;
}



/* ==========================================
   GRILLE DE PROJETS
========================================== */

.projects-grid {
    overflow-y: auto;

    padding-right: 10px;

    flex: 1;
}


.projects-grid.standard-grid {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 25px;
}


.project-card {
    display: flex;
    flex-direction: column;

    gap: 12px;

    cursor: pointer;
}


.card-image-wrapper {
    width: 100%;

    aspect-ratio: 16 / 10;

    background-color: var(--card-bg);

    border-radius: 16px;

    overflow: hidden;
}


.card-image-wrapper img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.4s ease,
        filter 0.4s ease;
}


.project-card:hover .card-image-wrapper img {
    transform: scale(1.06);

    filter: brightness(1.05);
}


.project-name {
    font-family: 'Montserrat', sans-serif;

    font-size: 1rem;
    font-weight: 700;

    color: var(--text-primary);

    transition: color 0.2s ease;
}


.project-card:hover .project-name {
    color: var(--accent-color);
}



/* ==========================================
   LOGOS
========================================== */

.logos-wrapper-staggered {
    display: flex;
    flex-direction: column;

    gap: 20px;

    align-items: center;
    justify-content: flex-start;

    padding-top: 10px;
}


.logo-row {
    display: flex;

    justify-content: center;

    gap: 20px;

    width: 100%;
}


.logo-card-small {
    cursor: pointer;

    transition: transform 0.3s ease;
}


.logo-card-small:hover {
    transform: scale(1.1);
}


.logo-image-box {
    width: 90px;
    height: 90px;

    background-color: var(--card-bg);

    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}


.logo-image-box img {
    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
}



/* ==========================================
   BARRE DE DÉFILEMENT
========================================== */

.projects-grid::-webkit-scrollbar {
    width: 6px;
}


.projects-grid::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);

    border-radius: 10px;
}



/* ==========================================
   RESPONSIVE : TABLETTES
========================================== */

@media (max-width: 1024px) {

    .modal-container {
        width: 85vw;
        height: 80vh;
    }


    .projects-grid.standard-grid {
        grid-template-columns: repeat(2, 1fr);
    }


    .logo-image-box {
        width: 70px;
        height: 70px;
    }

}



/* ==========================================
   ADAPTABILITÉ MOBILE, MENU DÉROULANT & POLICE
   ========================================== */

@media (max-width: 900px) {

    /* Tout ce qui était en police Bootzy TM passe en Montserrat Black sur téléphone */
    .portfolio-title,
    .modal-title {
        font-family: 'Montserrat', sans-serif;
        font-weight: 900;
        letter-spacing: 0.01em;
    }

    .navbar {
        padding: max(18px, env(safe-area-inset-top)) var(--gutter-mobile-right) 18px var(--gutter-mobile);
        justify-content: space-between;
    }

    .home-icon {
        position: static;
        width: 26px;
        height: 26px;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .mobile-menu-btn:hover {
        color: var(--accent-color);
    }

    .burger-lines,
    .burger-lines::before,
    .burger-lines::after {
        display: block;
        width: 22px;
        height: 2.5px;
        background-color: currentColor;
        border-radius: 2px;
        position: relative;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }

    .burger-lines::before,
    .burger-lines::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .burger-lines::before { top: -7px; }
    .burger-lines::after { top: 7px; }

    .mobile-menu-btn[aria-expanded="true"] .burger-lines {
        background-color: transparent;
    }
    .mobile-menu-btn[aria-expanded="true"] .burger-lines::before {
        top: 0;
        transform: rotate(45deg);
    }
    .mobile-menu-btn[aria-expanded="true"] .burger-lines::after {
        top: 0;
        transform: rotate(-45deg);
    }

    /* Menu déroulant sous le header */
    .nav-panel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        position: absolute;
        top: 100%;
        left: var(--gutter-mobile);
        right: var(--gutter-mobile-right);
        background-color: var(--dropdown-bg);
        border: 1px solid var(--dropdown-border);
        border-radius: 18px;
        padding: 18px 20px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
        z-index: 999;
    }

    .nav-panel.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        font-size: 1.05rem;
    }

    .nav-dot {
        display: none;
    }

    .nav-controls {
        position: static;
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid var(--dropdown-border);
        gap: 12px;
    }

    .portfolio-title {
        font-size: 3.4rem;
    }

    .keyword {
        font-size: 1rem;
    }

}


@media (max-width: 600px) {

    .portfolio-title {
        font-size: 2.5rem;
    }

    .keyword {
        font-size: 0.9rem;
    }

    .projects-grid.standard-grid {
        grid-template-columns: 1fr;
    }

    .modal-container {
        width: 94vw;
        height: 85vh;
        padding: 25px;
    }

    .logo-image-box {
        width: 60px;
        height: 60px;
    }

}