/* RESET DE BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* FOND DÃ‰GRADÃ‰ HARMONIEUX (Fixe) */
    background: linear-gradient(135deg, #410AC2, #441D87);
    background-attachment: fixed;
    /* Le fond ne bouge pas quand on scroll */
    background-size: cover;

    /* TYPOGRAPHIE GLOBALE */
    color: white;
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    padding: 2.5vw 3vw;
    /* 50px d'écart latéral demandé -> converted to vw */
    overflow-x: hidden;
    /* Global safety against horizontal scroll */
    width: 100%;
}


/* Animations Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Text Hover Zoom Effect */
p:hover,
.paragraphe:hover {
    transform: scale(1.02);
    display: inline-block;
    width: fit-content;
    transition: transform 0.3s ease-out;
}

p,
.paragraphe {
    transition: transform 0.3s ease-out;
}

/* FONTS */
@font-face {
    font-family: 'TTCommonsExpanded';
    src: url('fonts/TT Commons Pro Trial Expanded Normal.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Agbalumo';
    src: url('fonts/Agbalumo-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Styles demandÃ©s par l'utilisateur */
.gros-mot,
.domaines-cles .domaine-item {
    font-family: 'TTCommonsExpanded', sans-serif;
    font-size: 4.5vw;
    /* taille demandée */
    letter-spacing: 0.2vw;
    /* espacement entre les lettres */
    text-align: center;
    line-height: 1;
    /* réglable si besoin */
}

.paragraphe,
.glass-card p {
    font-family: 'TTCommonsExpanded', sans-serif;
    font-size: clamp(11px, 1.1vw, 16px);
    /* Final Reduction: Min 12px, Max 16px */
    line-height: 1.5;
    /* Espacement entre les lignes demandé */
    text-align: left;
}

/* Link style for video/link items inside cards */
.glass-card .link-video {
    background: linear-gradient(90deg, #3b82f6 0%, #1e40af 100%);
    /* blue gradient */
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
}

.glass-card .link-video:hover {
    filter: brightness(1.05);
}

/* Styling for <b> used as highlighted characteristic: black background + bold */
b {
    background-color: #13051b;
    color: #ffffff;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    line-height: 1.6;
}

.titre,
.hero-section h1 {
    font-family: 'Agbalumo', serif;
    font-size: 8vw;
    /* agrandi pour Yann ALLAIN */
    letter-spacing: 0.1em;
    /* lÃ©ger espacement demandÃ© */
    text-align: center;
}

/* Rule with higher specificity so changing .titre font-size takes effect */
.hero-section h1.titre {
    font-size: 120px;
}

.sous-titre,
.glass-card h2 {
    font-family: 'Agbalumo', serif;
    font-size: clamp(40px, 4vw, 64px);
    /* Increased significantly */
    letter-spacing: 0.05em;
    /* lÃ©ger espacement demandÃ© */
    text-align: center;
    margin-bottom: 1.5vw;
    border-left: none;
    padding-left: 0;
    line-height: 1.1;
}

/* IcÃ´nes outils / langages en une rangÃ©e, mÃªme taille */
.grid-container.icons {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    /* une seule rangÃ©e */
}

.skills-row .grid-container .grid-item {
    position: relative;
}

.skills-row .grid-container .grid-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    background: rgba(19, 5, 27, 0.95);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    white-space: normal;
    text-align: center;
    font-size: 13px;
    line-height: 1.25;
    max-width: 320px;
    /* Ã©largi sur l'axe x */
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 30;
}

.skills-row .grid-container .grid-item[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(19, 5, 27, 0.95);
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: 30;
}

.skills-row .grid-container .grid-item:hover[data-tooltip]::after,
.skills-row .grid-container .grid-item:focus[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.skills-row .grid-container .grid-item:hover[data-tooltip]::before,
.skills-row .grid-container .grid-item:focus[data-tooltip]::before {
    opacity: 1;
}

/* small highlight on hover so user sees which image is targeted (no movement) */
.skills-row .grid-container .grid-item:hover,
.skills-row .grid-container .grid-item:focus {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(73, 53, 255, 0.08) inset;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    margin: 18px auto 28px;
    /* centrÃ© horizontalement */
}

/* Floating navbar â€” top overlay, rounded rectangle */
/* Floating navbar â€” top overlay, rounded rectangle */
.floating-nav {
    position: fixed;
    top: 34px;
    /* Ã©loignÃ© du bord haut */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 18px 28px;
    /* plus large et plus haut */
    background: rgba(19, 5, 27, 0.72);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.floating-nav .nav-btn {
    background: transparent;
    color: #fff;
    border: none;
    width: auto;
    height: auto;
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Agbalumo', serif;
    /* texte en Agbalumo */
    font-size: 26px;
    /* plus grand texte */
    line-height: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.floating-nav .nav-btn:hover {
    transform: scale(1.1);
}

/* nav tooltips */
.floating-nav .nav-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(19, 5, 27, 0.98);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 9999;
}

.floating-nav .nav-btn:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Active state for Contact Button */
.nav-contact.active {
    background: #ff4757;
    /* Different color (customizable) */
    transform: scale(1.1);
    /* Larger */
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
}

/* Contact Panel (Sliding Bottom Sheet) */
.contact-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(19, 5, 27, 0.95);
    /* Matches site theme */
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    padding: 30px 40px;
    /* Reduced vertical padding */
    transform: translateY(105%);
    /* Hidden by default */
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-panel.active {
    transform: translateY(0);
    /* Slide up */
}

/* Close button removed */

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    /* Reduced gap */
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1400px;
}

.contact-item-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* Reduced gap */
    color: #fff;
    font-family: 'Agbalumo', serif;
    /* "Même direction artistique" - using site font */
    font-size: 1.2rem;
    /* Reduced font size */
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    padding: 15px;
    /* Reduced padding */
    border-radius: 15px;
}

.contact-item-large:hover {
    transform: translateY(-5px);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.contact-item-large .icon {
    font-size: 2.5rem;
    /* Reduced icon size */
    display: block;
    margin-bottom: 5px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.contact-item-large .text {
    opacity: 0.9;
    letter-spacing: 1px;
}

/* small responsive adjustment */
@media (max-width: 900px) {
    .floating-nav {
        right: 10px;
    }

    .floating-nav .nav-btn {
        width: 44px;
        height: 44px;
    }

    .floating-nav .nav-btn[data-tooltip]::after {
        right: calc(100% + 8px);
    }
}

/* Section Ã  propos â€” photo sÃ©parÃ©e du bloc (restored) */
.about-section {
    display: flex;
    gap: 3.6vw;
    align-items: center;
    flex-wrap: nowrap;
    /* keep image and card on same row when space allows */
}

.about-photo {
    flex: 0 0 30%;
    /* fixed photo column width */
    max-width: 30%;
}

.about-photo img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    display: block;
}

.about-card {
    flex: 1 1 auto;
    min-width: 320px;
    /* allow shrinking on smaller screens while media query will stack */
}

/* Domaines-cles: position items left / center / right while remaining on one line */
.domaines-cles {
    position: relative;
    height: 8.3vw;
    margin-bottom: 4.2vw;
}

.domaines-cles .domaine-item {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    /* reinforce font-size in case of other overrides */
    font-size: 64px;
    display: inline-block;
    /* wrap to text width so pseudo-element follows text */
    padding: 6px 12px;
    /* small padding so the highlight follows the word */
    z-index: 2;
}

.domaines-cles .domaine-item.left {
    left: 40px;
    /* lÃ©gÃ¨rement dÃ©placÃ© vers la droite */
    /* remonter davantage Marketing */
    transform: translateY(calc(-50% - 14.6vw)) rotate(13.34deg);
    transform-origin: left center;
}

.domaines-cles .domaine-item.center {
    left: 50%;
    /* remonter lÃ©gÃ¨rement le centre */
    transform: translate(-50%, calc(-50% - 2.7vw));
}

.domaines-cles .domaine-item.right {
    right: -60px;
    /* lÃ©gÃ¨rement dÃ©placÃ© vers la gauche */
    /* remonter lÃ©gÃ¨rement Communication */
    transform: translateY(calc(-50% - 18.1vw)) rotate(-17.27deg);
    transform-origin: right center;
}

/* Highlight (surlignage) behind each domaine-item using gradient */
.domaines-cles .domaine-item::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: calc(1.05em + 12px);
    /* cover text + padding */
    border-radius: 10px;
    background: linear-gradient(90deg, #995DFF 0%, #4935FF 100%);
    z-index: -1;
    opacity: 0.75;
    transition: transform .22s ease, opacity .22s ease, box-shadow .22s ease;
}


/* Ensure text remains readable on top of the gradient */
.domaines-cles .domaine-item {
    color: #ffffff;
    position: absolute;
    display: inline-block;
    /* ensure width fits text so ::after follows */
    z-index: 3;
    /* place text above the gradient pseudo-element */
}

/* Deux colonnes pour parcours + expÃ©rience */
.two-columns {
    display: flex;
    gap: 1.5vw;
    align-items: flex-start;
    flex-wrap: nowrap;
    /* garder les 2 blocs sur la même ligne */
}

.two-columns .glass-card {
    flex: 0 0 calc((100% - 1.5vw) / 2);
    /* chaque carte prend la moitié disponible */
    min-width: 0;
}

/* Row to place tools and languages side-by-side */
.skills-row {
    display: flex;
    gap: 1.5vw;
    align-items: flex-start;
    flex-wrap: wrap;
    /* allow stacking on small screens */
    margin-bottom: 3.1vw;
}

.skills-row .glass-card {
    flex: 1 1 calc(50% - 0.75vw);
    /* two columns with gap accounted */
    min-width: 16vw;
    min-height: 18vw;
    /* ensure enough vertical space for multiple rows of icons */
}

/* Ensure icons inside the skills cards do not overflow and are laid out row-by-row */
.skills-row .grid-container.icons {
    display: grid;
    /* force grid inside cards for proper rows */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 140px;
    /* each grid row height */
    gap: 18px;
    align-items: center;
    justify-items: center;
    padding-top: 8px;
}

.skills-row .grid-container.icons .grid-item {
    height: auto;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.skills-row .grid-container.icons .grid-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Tooltip for tools icons (appears on hover, disappears on mouseout) */
.skills-row .grid-container.tools .grid-item {
    position: relative;
}

.skills-row .grid-container.tools .grid-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    background: rgba(19, 5, 27, 0.95);
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    white-space: normal;
    text-align: center;
    font-size: 13px;
    line-height: 1.25;
    max-width: 220px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 30;
}

.skills-row .grid-container.tools .grid-item[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(19, 5, 27, 0.95);
    opacity: 0;
    transition: opacity 160ms ease;
    z-index: 30;
}

.skills-row .grid-container.tools .grid-item:hover[data-tooltip]::after,
.skills-row .grid-container.tools .grid-item:focus[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.skills-row .grid-container.tools .grid-item:hover[data-tooltip]::before,
.skills-row .grid-container.tools .grid-item:focus[data-tooltip]::before {
    opacity: 1;
}

/* CONTENEUR PRINCIPAL CENTRÃ‰ */
main {
    max-width: 1600px;
    /* encore plus large pour occuper l'Ã©cran */
    width: 90vw;
    /* assure 50px d'espace de chaque cÃ´tÃ© */
    margin: 0 auto;
    /* CentrÃ© horizontalement */
}

/* --- HERO SECTION --- */
.hero-section {
    text-align: center;
    margin-bottom: 3.1vw;
    padding-top: 2.1vw;
}

.hero-section h1 {
    font-size: clamp(32px, 8vw, 120px);
    /* Lower minimum to 32px to fit mobile */
    /* TrÃ¨s gros titre */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    word-break: break-word;
    /* Ensure it breaks if still too long */
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Triple Arrow Image Responsive */
.triple-arrow {
    width: 60vw;
    /* Scales with screen */
    max-width: 900px;
    /* Cap at reasonable desktop size */
    height: auto;
    display: block;
    margin: 0 auto;
    /* Center it */
}

/* --- LES 3 PILIERS --- */
.domaines-cles {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 80px;
    flex-wrap: wrap;
}

/* --- STYLE CARTE (RECTANGLE VIOLET FONCÃ‰) --- */
.glass-card {
    /* Fond violet plus foncÃ© (#1a0536 est une version trÃ¨s sombre du violet) */
    /* OpacitÃ© rÃ©duite (0.6) pour voir un peu le dÃ©gradÃ© derriÃ¨re */
    background-color: rgba(26, 5, 54, 0.6);

    /* Contour noir */
    border: 0.1vw solid #000000;

    /* Espacement interne pour que le texte ne colle pas aux bords */
    padding: 2.6vw;

    /* Design */
    border-radius: 1vw;
    margin-bottom: 3.1vw;
    /* Espace entre les blocs */
    box-shadow: 0 0.5vw 1.5vw rgba(0, 0, 0, 0.3);
    /* Légère ombre portée */
}

/* Titres H2 dans les cartes */
.glass-card h2 {
    /* basic fallback in case .sous-titre not applied */
    font-family: 'Agbalumo', serif;
    font-size: clamp(24px, 4vw, 64px);
    text-align: center;
    margin-bottom: 2vw;
    line-height: 1.1;
}

/* Titres H3 (Dates, Postes) */
.glass-card h3 {
    color: #e0d4fc;
    /* Blanc légèrement violet */
    font-size: clamp(18px, 1.5vw, 24px);
    /* Increased H3 size */
    margin-top: 1.5vw;
    margin-bottom: 0.5vw;
}

/* Titres H4 (Lieux, Ã‰coles) */
.glass-card h4 {
    color: #a8a8a8;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 15px;
}

/* Paragraphes */
.glass-card p {
    margin-bottom: 20px;
    font-weight: 300;
    /* paragraph style moved to .paragraphe for exact specs; keep fallback */
    font-size: clamp(16px, 1.1vw, 20px);
    line-height: 149.4%;
    text-align: left;
}

/* Listes */
.glass-card ul {
    font-family: 'TTCommonsExpanded', sans-serif;
    font-size: clamp(16px, 1.1vw, 20px);
    line-height: 1.5;
    /* Espacement entre les lignes demandé */
    text-align: left;
    margin-left: 1.5vw;
    margin-bottom: 1.5vw;
}

.glass-card li {
    margin-bottom: 10px;
    padding-left: 10px;
}

/* Groupes d'items (pour sÃ©parer visuellement les Ã©coles/postes) */
.item-group {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* SÃ©parateur subtil */
    padding-bottom: 20px;
}

.item-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* --- GRILLES (OUTILS & LANGAGES) --- */
.grid-container {
    display: grid;
    /* Colonnes auto-adaptables (min 100px) */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1vw;
    margin-top: 1.5vw;
}

.grid-item {
    background: rgba(255, 255, 255, 0.05);
    border: 0.05vw solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5vw;
    height: 5.2vw;
    /* Hauteur fixe pour l'instant */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive minimal: preserve desktop absolute positions, stack/center on small screens */
/* Responsive minimal: User requested NOT to change disposition.
   We explicitly REMOVE stacking rules for mobile to keep the desktop layout (scaling down).
*/
@media (max-width: 900px) {

    /* Hero Typography adjustment: Clamp or reduce slightly on mobile to avoid "super gros" */
    .hero-section h1 {
        font-size: clamp(24px, 11vw, 60px);
        /* significantly smaller min/max for mobile */
        /* Clamp to prevent scrolling overflow */
    }

    /* PRESERVE DOMAINES CLES LAYOUT - FLUID SIZING NO SCALE
       Remove scale(), use fluid font-size instead.
    */
    .domaines-cles {
        transform: none;
        /* No scale */
        margin-bottom: 20px;
        width: 100%;
    }

    .gros-mot,
    .domaines-cles .domaine-item {
        /* Fluid font size reacting to VW */
        font-size: clamp(16px, 5.5vw, 30px);
        white-space: nowrap;
    }

    /* Reset specific positioning */
    .domaines-cles .domaine-item.left {
        left: 0px;
        transform: translateY(calc(-50% - 14.6vw)) rotate(13.34deg) translateX(20px);
    }

    .domaines-cles .domaine-item.center {
        left: 50%;
        /* remonter lÃ©gÃ¨rement le centre */
        transform: translate(-50%, calc(-50% - 2.7vw));
    }

    .domaines-cles .domaine-item.right {
        right: 0px;
        transform: translateY(calc(-50% - 18.1vw)) rotate(-17.27deg) translateX(-20px);
    }

    /* Ensure styles applied appropriately to items */
    .domaines-cles .domaine-item::after {
        width: 100%;
        left: 0;
        transform: translateY(-50%) scale(1);
        /* Ensure background fits */
    }

    /* FIX GRID ITEMS (Tools / Languages) being too small */
    .grid-item {
        height: auto;
        min-height: 80px;
        /* Force minimum height */
        padding: 10px;
    }

    .skills-row .grid-container.icons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        /* Allow smaller columns but auto-fill */
        gap: 15px;
    }

    /* RESTORE STACKING FOR CONTENT SECTIONS */
    .about-section {
        flex-direction: column;
        /* Force stacked layout explicitly */
        gap: 30px;
        /* Restore fixed gap for stacked layout */
    }

    .about-photo,
    .about-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .about-photo img {
        width: 60%;
        /* Reasonable size on mobile */
        margin: 0 auto 18px;
        display: block;
    }

    /* Two columns: Stack them */
    .two-columns {
        flex-wrap: wrap;
        gap: 30px;
    }

    .two-columns .glass-card {
        flex: 0 0 100%;
        min-width: 0;
    }

    /* Skills: Stack them */
    .skills-row {
        flex-wrap: wrap;
        gap: 30px;
    }

    .skills-row .glass-card {
        flex: 0 0 100%;
        /* Full width cards */
        min-width: 0;
        min-height: auto;
    }

    /* Just adjust floating nav to safe area and SCALE DOWN */
    .floating-nav {
        right: 50%;
        /* Re-center it or keep right? User said "reste bugé". Center is safer for "miniature" look. Or keep bottom fixed? Original was top fixed. */
        top: auto;
        bottom: 20px;
        /* Move to bottom on mobile often better? Or keep top? explicit user request was "juste diminuer la taille". Let's keep top but scale. */
        right: auto;
        left: 50%;
        transform: translateX(-50%) scale(0.8);
        /* Simple scale down or use vw */

        /* Let's be more precise with vw as requested "diminuer la taille selon l'écran" */
        width: 90vw;
        justify-content: center;
        padding: 2vw;
        gap: 2vw;
        border-radius: 10vw;
        /* rounded pill */

        top: 20px;
        /* Keep top but smaller */
        bottom: auto;
    }

    .floating-nav .nav-btn {
        width: auto;
        height: auto;
        font-size: 5vw;
        /* Scale text */
        padding: 2vw 4vw;
    }

    .floating-nav .nav-btn[data-tooltip]::after {
        display: none;
        /* Hide tooltips on mobile, they block view */
    }

    /* FIX Contact Banner Overflow */
    .contact-panel {
        padding: 20px 15px;
        /* Reduce padding on mobile */
    }

    .contact-grid {
        gap: 20px;
        /* Reduce gap on mobile */
    }

    .contact-item-large {
        width: 100%;
        /* Ensure items don't overflow */
        max-width: 300px;
    }
}

/* ---------------- INTRO OVERLAY ---------------- */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #410AC2, #441D87);
    overflow: hidden;
    transition: background 1100ms cubic-bezier(.22, .9, .3, 1), opacity 400ms ease;
}

#intro-overlay.hidden {
    display: none;
}

#intro-overlay canvas#intro-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.curtain {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.curtain .bar {
    width: 100vw;
    height: 8px;
    max-width: none;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: transform 700ms cubic-bezier(.22, .9, .3, 1), width 700ms ease, height 700ms ease, opacity 500ms ease;
    transform-origin: center center;
    z-index: 4;
}

.curtain .bar.vertical {
    transform: rotate(90deg);
    width: 10px;
    height: 100vh;
}

.curtain .panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(135deg, #410AC2, #441D87);
    transition: transform 1000ms cubic-bezier(.22, .9, .3, 1), opacity 1000ms ease;
    z-index: 2;
    transform-origin: center center;
}

/* thin vertical bars that split and slide like a theater curtain */
.split-bar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 100vh;
    background: #ffffff;
    border-radius: 6px;
    z-index: 4;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    transition: transform 1100ms cubic-bezier(.22, .9, .3, 1), left 1100ms ease, opacity 500ms ease;
    pointer-events: none;
}

.split-bar.left {
    transform-origin: center left;
}

.split-bar.right {
    transform-origin: center right;
}

/* when opening: move split bars far left/right */
#intro-overlay.open .split-bar.left {
    transform: translateX(calc(-50% - 50vw - 16px));
}

#intro-overlay.open .split-bar.right {
    transform: translateX(calc(-50% + 50vw + 16px));
}

/* keep the original central bar faded when splitting */
#intro-overlay.split .curtain .bar {
    opacity: 0;
    transform: scale(0.9);
}

.curtain .panel.left {
    left: 0;
    transform: translateX(0) scaleX(1);
}

.curtain .panel.right {
    right: 0;
    transform: translateX(0) scaleX(1);
}

/* When opening, panels slide outwards to reveal content */
#intro-overlay.open .curtain .panel.left {
    transform: translateX(-110%) scaleX(1);
}

#intro-overlay.open .curtain .panel.right {
    transform: translateX(110%) scaleX(1);
}

/* Fade bar while panels move */
#intro-overlay.open .curtain .bar {
    opacity: 0;
    transform: scale(0.9);
}

/* When opening, make overlay background gradually transparent so underlying site appears */
#intro-overlay.open {
    background: transparent;
}

/* final fade */
#intro-overlay.closing {
    transition: opacity 450ms ease;
    opacity: 0;
    pointer-events: none;
}

/* Background particles canvas (under content) */
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: block;
}

/* Ensure main content sits above bg canvas */
main {
    position: relative;
    z-index: 2;
}

/* particles style fallback when reduced motion requested */
@media (prefers-reduced-motion: reduce) {
    #intro-overlay {
        display: none;
    }
}

/* small responsiveness */
@media (max-width: 700px) {
    .curtain .bar {
        width: 80vw;
    }
}

/* helper to ensure underlying content not scroll-locked when overlay removed */
body.intro-locked {
    overflow: hidden;
}

/* Navigation Arrows on Project Pages */
.project-nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) scaleY(2.5);
    /* Stretched on Y axis */
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 6rem;
    /* Much larger */
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    z-index: 1000;
    font-family: 'Courier New', Courier, monospace;
    /* Monospace for clean < > shape */
    font-weight: 100;
    /* Thin look */
    line-height: 1;
    padding: 20px;
    user-select: none;
}

.project-nav-arrow:hover {
    color: #ffffff;
    transform: translateY(-50%) scaleY(2.5) scale(1.1);
    /* Keep stretch and zoom */
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.project-nav-arrow.left {
    left: 40px;
    /* Moved slightly more inwards due to size */
}

.project-nav-arrow.right {
    right: 40px;
}

/* Responsive adjustment to avoid overlap on small screens */
@media (max-width: 768px) {
    .project-nav-arrow {
        font-size: 4rem;
        top: auto;
        bottom: 20px;
        transform: scaleY(1.5);
        /* Less extreme stretch on mobile */
    }

    .project-nav-arrow:hover {
        transform: scaleY(1.5) scale(1.1);
    }

    .project-nav-arrow.left {
        left: 20px;
    }

    .project-nav-arrow.right {
        right: 20px;
    }
}
/* --- EMERGENCY MOBILE OVERRIDES (max-width: 480px) --- */
/* Forcing styles to strictly apply on phone screens */
@media (max-width: 480px) {
    /* 1. FORCE SMALLER H1 */
    .hero-section h1, 
    .hero-section h1.titre {
        font-size: 28px !important; /* Force small size */
        line-height: 1.2 !important;
        width: 100% !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    /* 2. FORCE DOMAINES TO SHRINK (Keep Absolute but shrink text hard) */
    .domaines-cles {
        transform: none !important; 
        width: 100% !important;
    }
    .domaines-cles .domaine-item, 
    .gros-mot {
         font-size: 14px !important; /* Tiny font size to guarantee fit */
         white-space: nowrap !important; /* Keep on one line as requested layout */
         letter-spacing: 0 !important;
    }

    /* 3. FORCE PARAGRAPHS SMALLER */
    .paragraphe, 
    .glass-card p {
        font-size: 13px !important;
    }
    
    /* 4. Contact Panel Safety */
    .contact-panel {
        padding: 10px !important;
        width: 100% !important;
    }
    .contact-item-large {
        width: 100% !important;
    }
}




/* Navbar Lateral Disposition for screens < 500px */
@media (max-width: 500px) {
    .floating-nav {
        top: 50%;
        right: 0;
        left: auto;
        transform: translateY(-50%);
        flex-direction: column;
        padding: 15px 5px; /* Reduced padding further */
        border-radius: 15px 0 0 15px;
        gap: 15px;
        width: auto;
        max-width: 50px; /* Even narrower as requested 'petite partie' */
    }

    .floating-nav .nav-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 12px; /* Drastically reduced as requested */
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        word-break: break-all; /* Break long words if needed */
        white-space: normal;
        line-height: 1;
    }
    /* Specific sizing for text buttons to fit */
    .floating-nav .nav-contact, .floating-nav .nav-page {
        font-size: 9px; /* Very small for text buttons */
        width: 100%;
        height: auto;
        padding: 4px 0;
    }

    /* Tooltips to the LEFT (since nav is right) */
    .floating-nav .nav-btn[data-tooltip]::after {
        left: auto;
        right: calc(100% + 10px);
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }

    .floating-nav .nav-btn:hover[data-tooltip]::after {
        transform: translateY(-50%);
    }

    /* REDUCED CONTACT PANEL HEIGHT */
    .contact-panel {
        padding: 12px 10px !important;
    }
    .contact-item-large {
        padding: 6px !important;
        font-size: 0.9rem !important;
        gap: 4px;
    }
    .contact-item-large .icon {
        font-size: 1.6rem !important;
        margin-bottom: 0;
    }
    .contact-grid {
        gap: 15px !important;
    }

    /* REDUCE DOMAINES CLES SIZE */
    .gros-mot, .domaines-cles .domaine-item {
        font-size: 16px !important; /* Force smaller size */
        padding: 4px 8px !important;
    }
    .domaines-cles {
        height: auto !important;
        margin-bottom: 20px !important;
    }
}


/* MOBILE UPDATE: Fix Domaines Cles Overlap and Size (<500px) */
@media (max-width: 500px) {
    .domaines-cles {
        margin-top: 50px !important; /* Adjusted up slightly */
        transform: scale(0.85) !important; /* Global shrink */
        transform-origin: center top !important;
    }

    .domaines-cles .domaine-item {
        font-size: 11px !important; /* Smaller font */
        padding: 3px 8px !important; /* Smaller size */
    }
}

/* HARMONIZATION: Standard Mobile Rules */
@media (max-width: 900px) {
    /* Ensure body doesn't crush content with huge padding */
    body {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Standardize all project containers to use full width */
    .project-container, 
    .carambar-container,
    .container {
        width: 95% !important;
        max-width: 95vw !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
