:root {
    --accent: #159eed;
    --bg-page: #f0f4f8;
    --text-main: #1a202c;
    --text-sub: #64748b;
    --line-color: #cbd5e1;
    --white: #ffffff;

    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(21, 158, 237, 0.15);

    --transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background: var(--bg-page);
    color: var(--text-main);
    /* Fond plus riche pour éviter le "tout blanc" */
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 60%, #e2e8f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    /* Setup variables for parallax defaults */
    --mouse-x: 0.5;
    --mouse-y: 0.5;
}

/* --- BACKGROUND LAYER --- */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* background: #f8fafc;  <-- REMOVED to let body radial gradient shine through */
}

/* Texture de bruit grainé (Noise) pour l'effet "papier premium" */
.bg-noise {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.04;
    /* Reduced back to subtle */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    /* Removed mix-blend-mode for cleaner look */
}

/* Conteneur des dégradés fluides */
.bg-gradient-mesh {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
    filter: blur(120px);
    /* Increased blur for softness */
    opacity: 0.6;
    /* Softer overall presence */
    animation: mesh-spin 180s linear infinite;
    /* Slower spin */
}

.blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    mix-blend-mode: multiply;
}

.blob-1 {
    /* Bleu marque - Immense et profond */
    top: 10%;
    left: 10%;
    width: 90vw;
    height: 90vw;
    background: radial-gradient(circle, rgba(21, 158, 237, 0.15) 0%, transparent 60%);
    animation: blob-float 40s ease-in-out infinite alternate;
}

.blob-2 {
    /* Cyan Lumière - Immense */
    top: 40%;
    left: 40%;
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(165, 243, 252, 0.2) 0%, transparent 60%);
    animation: blob-float 50s ease-in-out infinite alternate-reverse;
}

.blob-3 {
    /* Gris bleuté - Immense */
    bottom: -20%;
    left: 20%;
    width: 110vw;
    height: 110vw;
    background: radial-gradient(circle, rgba(203, 213, 225, 0.25) 0%, transparent 60%);
    animation: blob-float 45s ease-in-out infinite alternate;
    animation-delay: -10s;
}

.blob-4 {
    /* Touche Violet subtile - Immense */
    top: 20%;
    right: 10%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(199, 210, 254, 0.15) 0%, transparent 60%);
    animation: blob-float 55s ease-in-out infinite alternate-reverse;
    animation-delay: -20s;
}

/* Keyframes pour mouvoir les taches */
@keyframes mesh-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blob-float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(2%, 5%) scale(1.05);
    }

    66% {
        transform: translate(-2%, 2%) scale(0.95);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.bg-pattern {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 0.15;
    /* Much more subtle pattern */
    background-image: radial-gradient(var(--text-sub) 0.6px, transparent 0.6px);
    background-size: 40px 40px;
    /* Larger spacing */
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    /* Pattern bouge un peu en parallaxe via JS */
    transform: translate(calc((0.5 - var(--mouse-x)) * 30px),
            calc((0.5 - var(--mouse-y)) * 30px));
    transition: transform 0.1s linear;
}

/* --- BRAND CENTER --- */
.center-brand {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    /* Brought forward strongly */
    pointer-events: none;
    padding: 20px;
}

/* Glow behind center to hide line convergence */
.center-brand::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 60%);
    border-radius: 50%;
    pointer-events: none;
}

.brand-logo {
    width: auto;
    height: 120px;
    /* Adjusted size for logo */
    max-width: 240px;
    object-fit: contain;
    margin-bottom: 24px;
    /* Glow + Shadow suitable for transparent PNG */
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9)) drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 2;
}

.brand-text {
    position: relative;
    z-index: 2;
}

.brand-text h1 {
    font-weight: 200;
    /* Light weight for elegance */
    font-size: clamp(32px, 5vw, 56px);
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
    color: var(--text-main);
    /* Strong white shadow for legibility over lines */
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px white;
}

.brand-text .lede {
    color: var(--text-sub);
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 8px;
    text-shadow: 0 0 8px white, 0 0 16px white;
}

.brand-text .sub-lede {
    margin: 0;
    font-size: 15px;
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
    text-shadow: 0 0 8px white;
}

/* --- CONSTELLATION --- */
.constellation-shell {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.lines-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.constellation {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass through empty spaces */
}

.bubble {
    position: absolute;
    pointer-events: auto;
    /* Re-enable clicks on bubbles */
    background-color: var(--white);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-soft);
    transform: translate(-50%, -50%);
    /* Center anchor */
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    will-change: transform;
}

.bubble:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: var(--shadow-hover);
    z-index: 10;
    border-color: var(--white);
}

/* Meta info on hover */
.bubble .bubble-meta {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
}

.bubble:hover .bubble-meta {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animation Drift */
.bubble.drift {
    animation: float 6s ease-in-out infinite;
}

/* Randomize animation delay via JS or CSS nth-child if possible, 
   but for now a simple float is fine */

@keyframes float {
    0% {
        transform: translate(-50%, -50%) translateY(0px);
    }

    50% {
        transform: translate(-50%, -50%) translateY(-20px);
    }

    100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
}


/* --- MOBILE LIST --- */
.mobile-list-shell {
    display: none;
    padding: 20px 20px 80px;
    background: var(--bg-page);
    position: relative;
}

/* --- MOBILE LIST BACKGROUND FX --- */
.mobile-bg-fx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.mobile-bg-fx .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift-blob 20s infinite alternate ease-in-out;
}

.mobile-bg-fx .blob-1 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 10%;
    left: -20%;
    animation-duration: 25s;
}

.mobile-bg-fx .blob-2 {
    width: 400px;
    height: 400px;
    background: #cbd5e1; /* Gris doux */
    top: 40%;
    right: -30%;
    animation-duration: 35s;
    animation-delay: -5s;
}

.mobile-bg-fx .blob-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    bottom: 10%;
    left: 10%;
    opacity: 0.2;
    animation-duration: 28s;
}

@keyframes drift-blob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -50px) scale(1.1); }
    100% { transform: translate(-20px, 40px) scale(0.95); }
}

.mobile-bg-fx .grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--text-sub) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.08;
    z-index: 1;
}

/* --- MOBILE LIST --- */
.mobile-list-shell {
    display: none;
    padding: 60px 20px 100px; /* Padding augmenté pour l'intro */
    background: var(--bg-page);
    position: relative;
    /* overflow: hidden; -- Removed to let SVG draw potentially if needed, but safe to keep restricted */
    overflow: hidden;
}

.mobile-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Derrière les cartes (z-index 2) mais devant le fond */
    overflow: visible;
}

.mobile-list {
    display: flex;
    flex-direction: column;
    gap: 80px; /* Plus grand gap pour bien voir le fil */
    max-width: 500px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    z-index: 2;
}

.mobile-card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 140px;
    position: relative;
    transition: transform 0.4s ease;
}

/* Renforcement de la ligne de construction centrale */
.mobile-list-shell::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        var(--line-color) 0,
        var(--line-color) 4px,
        transparent 4px,
        transparent 8px
    ); /* Ligne pointillée technique */
    transform: translateX(-50%);
    opacity: 0.6;
    z-index: 0;
}



@keyframes float-mobile {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0px);
    }
}

.mobile-img-wrapper {
    /* Animation Wrapper to allow separate hover scale on img */
    margin-bottom: 12px;
    /* moved from img */
    will-change: transform;
}

.mobile-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    /* Bulle ronde */
    border: 4px solid var(--white);
    box-shadow: var(--shadow-soft);
    /* margin-bottom: 12px;  Moved to wrapper */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--white);
    z-index: 2;
    position: relative;
}

.mobile-card:hover img {
    transform: scale(1.08);
    box-shadow: var(--shadow-hover);
}

.mobile-card:active img {
    transform: scale(0.95);
}

.mobile-card .mobile-body {
    padding: 0;
    background: var(--white);
    padding: 6px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 2;
    /* Petit triangle ou connecteur optionnel, restons simple */
}

/* On cache l'eyebrow et meta sur mobile pour épurer, ou on les garde très petits */
.mobile-card .eyebrow {
    display: none;
}

.mobile-card .meta {
    display: none;
}

.mobile-card .title {
    font-size: 13px;
    margin: 0;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

/* Offsets for mobile list - CHAOTIC positioning */
/* On utilise margin-left / margin-right pour décaler visuellement du centre */
.mobile-card.offset-left {
    transform: translateX(-60px);
}

.mobile-card.offset-right {
    transform: translateX(60px);
}

.mobile-card.offset-center {
    transform: translateX(0);
}

.mobile-card.offset-mid-left {
    transform: translateX(-30px);
}

.mobile-card.offset-mid-right {
    transform: translateX(30px);
}

/* Connector dots/lines visual trick could be added via ::before on .mobile-card if desired */


/* --- MODAL --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.modal-dialog {
    position: relative;
    background: var(--white);
    width: 98%;
    max-width: 1600px;
    height: 95vh;
    border-radius: 12px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    /* Changed to Flex Column */
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.open .modal-dialog {
    transform: scale(1);
}

.modal-media {
    background: #f1f5f9;
    /* Neutral background to show boundaries */
    position: relative;
    overflow: hidden;
    flex: 1;
    /* Takes all available height */
    min-height: 0;
    /* Important for flex scrolling */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Shows FULL image without cropping */
    display: block;
}

/* Close button - Floating on top right */
.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 28px;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 20;
}

.modal-close:hover {
    background: var(--text-main);
    color: var(--white);
    transform: rotate(90deg);
}

.modal-body {
    flex: 0 0 auto;
    /* Auto height based on content */
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--line-color);
    padding: 30px 50px;
    /* More padding */
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    z-index: 10;

    display: flex;
    /* Changed to Flex row for better space management */
    flex-direction: row;
    justify-content: space-between;
    gap: 60px;
    align-items: flex-start;
}

/* Zone Titre (Gauche) */
.modal-title-group {
    display: flex;
    flex-direction: column;
    flex: 0 0 280px;
    /* Fixed width to prevent squishing the right side */
    border-right: 1px solid var(--line-color);
    /* Separation vertical line */
    padding-right: 40px;
}

.modal-eyebrow {
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.modal-body h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
    color: var(--text-main);
}

/* Zone Meta (Droite) - Horizontal Grid */
.meta-grid {
    flex: 1;
    display: flex;
    /* Flexbox instead of Grid to avoid 5-col compression */
    flex-wrap: wrap;
    gap: 40px 60px;
    /* Row gap 40, Col gap 60 */
    justify-content: flex-start;
    /* Align left */
    align-items: flex-start;
}


.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.meta-item strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

/* --- RESPONSIVE BACKGROUND --- */
@media (max-width: 900px) {
    /* Fond qui scrolle avec la page (Absolu) */
    .bg-layer {
        position: absolute; 
        min-height: 250vh; /* Très haut pour le scroll profond */
        background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 40%, #e2e8f0 100%);
        overflow: hidden;
    }
  
    /* On fige les blobs en place verticale pour créer des zones colorées */
    .bg-gradient-mesh {
        position: absolute;
        inset: 0;
        height: 100%; /* S'adapte à la hauteur bg-layer */
        animation: none; /* Pas de spin global sur mobile */
        filter: blur(80px); /* Flou légèrement réduit pour structure */
    }
  
    .blob {
        width: 140vw; /* Très large pour déborder */
        height: 100vw;
        opacity: 0.6;
        mix-blend-mode: normal; 
    }
  
    /* Blob 1 : Haut Gauche (Bleu ciel) - Départ */
    .blob-1 {
        top: -10vw;
        left: -50vw;
        background: radial-gradient(circle, rgba(21, 158, 237, 0.25) 0%, transparent 70%);
        animation: none;
    }
  
    /* Blob 2 : Milieu Droit (Cyan) - Transition */
    .blob-2 {
        top: 25%;
        right: -60vw;
        left: auto;
        background: radial-gradient(circle, rgba(103, 232, 249, 0.3) 0%, transparent 70%);
        animation: none;
    }
  
    /* Blob 3 : Bas Gauche (Gris Bleu) - Profondeur */
    .blob-3 {
        top: 60%;
        left: -50vw;
        background: radial-gradient(circle, rgba(148, 163, 184, 0.35) 0%, transparent 70%);
        animation: none;
    }
  
    /* Blob 4 : Tout en bas Droite (Violet subtil) - Fin */
    .blob-4 {
        top: 85%;
        right: -50vw;
        left: auto;
        background: radial-gradient(circle, rgba(199, 210, 254, 0.25) 0%, transparent 70%);
        animation: none;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
    .modal-body {
        flex-direction: column;
        /* Stack vertically on mid-size screens */
        gap: 24px;
        padding: 30px;
    }

    .modal-title-group {
        width: 100%;
        flex: auto;
        border-right: none;
        border-bottom: 1px solid var(--line-color);
        padding-bottom: 24px;
        margin-bottom: 8px;
        padding-right: 0;
    }

    .modal-body h2 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    /* Let meta grid reflow naturally */
}

@media (max-width: 900px) {
    .constellation-shell {
        display: none;
    }

    /* La lignes des bulles mobile */
    .mobile-list-shell {
        display: block;
        background-color: transparent;
        /* Seamless with body gradient */
    }

    /* Le Header Mobile (ancien center-brand devenu statique) */
    .center-brand {
        position: relative;
        inset: auto;
        padding: 110px 20px 50px; /* Plus d'espace en haut pour l'effet "aérien" */
        height: auto;
        margin-bottom: 0px;
        z-index: 2;
        pointer-events: auto;
        /* Halo lumineux provenant du haut */
        background: radial-gradient(ellipse at top center, rgba(255,255,255,0.8), transparent 70%);
    }

    /* Le fil conducteur qui descend du logo vers la liste */
    .center-brand::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 1px;
        height: 50px;
        background: linear-gradient(to bottom, transparent, var(--line-color));
        transform: translateX(-50%);
    }

    /* Reset du glow desktop et transformation en point d'ancrage mobile */
    .center-brand::before {
        content: "";
        width: 7px;
        height: 7px;
        background: var(--text-main);
        border-radius: 50%;
        position: absolute;
        bottom: -3px; /* Tout en bas du fil (jointure avec la section suivante) */
        left: 50%;
        top: auto; /* Annule le top desktop */
        transform: translateX(-50%);
        z-index: 3;
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5); /* Petit halo */
    }

    /* Ajustement de la taille du logo mobile */
    .brand-logo {
        height: 90px;
        margin-bottom: 15px;
        /* Ombre portée plus marquée pour détacher le logo du fond */
        filter: drop-shadow(0 15px 30px rgba(21, 158, 237, 0.15));
        animation: float-mobile-logo 6s ease-in-out infinite;
    }

    @keyframes float-mobile-logo {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-6px); }
    }

    .brand-text h1 {
        font-size: 40px;
        margin: 0 0 8px 0;
        letter-spacing: -0.03em;
        background: linear-gradient(135deg, var(--text-main) 0%, #475569 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .brand-text .lede {
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        font-weight: 600;
        color: var(--accent);
        opacity: 0.9;
    }

    /* Mobile Modal - Stacked */
    .modal-dialog {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-close {
        top: 16px;
        right: 16px;
    }

    .modal-media {
        flex: 1;
        /* Image takes majority */
    }

    .modal-body {
        padding: 24px 20px;
        gap: 20px;
        border-radius: 20px 20px 0 0;
        /* Bottom sheet feel */
        margin-top: -20px;
        /* Overlap image slightly */
    }

    .meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .meta-item:last-child {
        grid-column: 1 / -1;
    }
}