/* Déclaration de la police locale Bootzy TM liée au dossier fonts en .ttf */
@font-face {
    font-family: 'Bootzy TM';
    src: url('fonts/BootzyTM.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Variables Jour (Rose #ff8fab) */
:root {
    --bg-color: #ffffff;
    --text-primary: #222222;
    --text-title: #1a1a1a;
    --text-secondary: #555555;
    --accent-color: #ff8fab;
    --btn-bg: #ff8fab;
    --btn-hover-bg: #ff7597;
    --btn-text: #ffffff;
    --btn-shadow: rgba(255, 143, 171, 0.3);
    --btn-shadow-hover: rgba(255, 143, 171, 0.45);
    --nav-link-color: #2b2b2b;
    --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 Nuit (Jaune #fdd38b) */
body.dark-mode {
    --bg-color: #121214;
    --text-primary: #f0f0f0;
    --text-title: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #fdd38b;
    --btn-bg: #fdd38b;
    --btn-hover-bg: #fcc263;
    --btn-text: #121214;
    --btn-shadow: rgba(253, 211, 139, 0.2);
    --btn-shadow-hover: rgba(253, 211, 139, 0.35);
    --nav-link-color: #e0e0e0;
    --dropdown-bg: #1b1b1f;
    --dropdown-border: rgba(255, 255, 255, 0.1);
}

/* Réinitialisation universelle */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: clip;
}

body {
    font-family: 'Figtree', 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Navbar (Bureau) */
.navbar {
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 100;
}

/* Icône Maison à gauche (toujours visible, y compris sur mobile) */
.home-icon {
    position: absolute;
    left: 50px;
    width: 28px;
    height: 28px;
    color: var(--nav-link-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.3s ease;
    z-index: 102;
}

.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: 102;
}

.nav-panel {
    display: contents;
}

.nav-links {
    display: inline-flex;
    gap: 15px;
    align-items: center;
    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,
.nav-links a.active-link {
    opacity: 0.6;
}

.nav-links span {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.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);
}

/* Hero (Accueil) */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px 48px;
    width: 100%;
    flex-grow: 1;
    gap: 30px;
}

.hero-text {
    flex: 1;
    max-width: 520px;
    min-width: 0;
}

.greeting-container {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-title);
    height: 90px;
    display: flex;
    align-items: center;
}

.cursor {
    color: var(--accent-color);
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.sub-greeting {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 20px;
}

/* --- POLICE BOOTZY TM & ESPACEMENT --- */
.highlight-name {
    font-family: 'Bootzy TM', 'Montserrat', sans-serif;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.sparkle-symbol {
    color: var(--accent-color);
    font-size: 1.8rem;
    margin-left: 6px;
    transition: color 0.4s ease;
}

.description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* --- BOUTONS STYLE PILULE --- */
.links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-portfolio {
    display: inline-block;
    padding: 14px 36px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Figtree', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    text-transform: lowercase;
    transition: transform 0.25s ease, background-color 0.3s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 15px var(--btn-shadow);
}

.btn-portfolio:hover {
    transform: scale(1.05);
    background-color: var(--btn-hover-bg);
    box-shadow: 0 6px 20px var(--btn-shadow-hover);
}

/* --- IMAGE INTERACTIVE & TOOLTIPS --- */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.interactive-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.interactive-container img {
    display: block;
    max-width: 100%;
    max-height: 460px;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Zones de survol transparentes */
.hotspot {
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

/* Bulle d'information */
.tooltip {
    position: absolute;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    font-family: 'Figtree', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 4px 15px var(--btn-shadow);
    z-index: 20;
}

.hotspot:hover .tooltip,
.hotspot:focus-within .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Positions et animations des bulles */
.tooltip-top {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    margin-bottom: 8px;
}
.hotspot:hover .tooltip-top,
.hotspot:focus-within .tooltip-top { transform: translateX(-50%) translateY(0); }

.tooltip-bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    margin-top: 8px;
}
.hotspot:hover .tooltip-bottom,
.hotspot:focus-within .tooltip-bottom { transform: translateX(-50%) translateY(0); }

.tooltip-left {
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    margin-right: 8px;
}
.hotspot:hover .tooltip-left,
.hotspot:focus-within .tooltip-left { transform: translateY(-50%) translateX(0); }

.tooltip-right {
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    margin-left: 8px;
}
.hotspot:hover .tooltip-right,
.hotspot:focus-within .tooltip-right { transform: translateY(-50%) translateX(0); }

/* Flèches des bulles */
.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip-top .tooltip-arrow {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-color: var(--btn-bg) transparent transparent transparent;
}

.tooltip-bottom .tooltip-arrow {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent var(--btn-bg) transparent;
}

.tooltip-left .tooltip-arrow {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent var(--btn-bg);
}

.tooltip-right .tooltip-arrow {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent var(--btn-bg) transparent transparent;
}

/* =========================================
   ADAPTABILITÉ MOBILE & MENU DÉROULANT
   (Maison conservée dans le header)
   ========================================= */
@media (max-width: 900px) {
    /* Tout ce qui était en police Bootzy TM passe en Montserrat Black sur téléphone */
    .highlight-name {
        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;
    }

    /* La maison reste à gauche dans le header */
    .home-icon {
        position: static;
        width: 26px;
        height: 26px;
    }

    /* Bouton burger à droite */
    .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 avec marges latérales alignées */
    .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: 99;
    }

    .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;
    }

    /* Marges extérieures et espacements verticaux généreux sur mobile */
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 20px var(--gutter-mobile-right) max(48px, calc(28px + env(safe-area-inset-bottom))) var(--gutter-mobile);
        gap: 32px;
    }

    .hero-text {
        max-width: 100%;
        padding: 0 6px;
    }

    .greeting-container {
        justify-content: center;
        font-size: 2.75rem;
        height: 64px;
        margin-bottom: 6px;
    }

    .sub-greeting {
        font-size: 1.65rem;
        margin-bottom: 18px;
    }

    .sparkle-symbol {
        font-size: 1.35rem;
    }

    .description {
        font-size: 0.96rem;
        margin-bottom: 28px;
        padding: 0 6px;
    }

    .links {
        justify-content: center;
        gap: 12px;
        padding: 0 4px;
    }

    .btn-portfolio {
        padding: 12px 26px;
        font-size: 0.98rem;
    }

    .hero-image {
        width: 100%;
        padding: 0 10px;
    }

    .interactive-container img {
        max-height: 350px;
    }

    /* Confinement des bulles à l'intérieur des marges mobile */
    .tooltip {
        max-width: min(260px, calc(100vw - 44px));
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        padding: 7px 11px;
    }

    .tooltip-left,
    .tooltip-right {
        left: 50%;
        right: auto;
        top: auto;
        bottom: 100%;
        margin: 0 0 8px 0;
        transform: translateX(-50%) translateY(-6px);
    }

    .hotspot:hover .tooltip-left,
    .hotspot:focus-within .tooltip-left,
    .hotspot:hover .tooltip-right,
    .hotspot:focus-within .tooltip-right {
        transform: translateX(-50%) translateY(0);
    }

    .tooltip-left .tooltip-arrow,
    .tooltip-right .tooltip-arrow {
        top: 100%;
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border-width: 6px 6px 0 6px;
        border-color: var(--btn-bg) transparent transparent transparent;
    }
}

@media (max-width: 480px) {
    .greeting-container {
        font-size: 2.25rem;
        height: 54px;
    }

    .sub-greeting {
        font-size: 1.45rem;
        margin-bottom: 16px;
    }

    .description {
        margin-bottom: 24px;
    }

    .btn-portfolio {
        padding: 11px 22px;
        font-size: 0.92rem;
    }
}