:root { 
    --bg: #ffffff; 
    --text: #1b1b1b; 
    --muted: #6b7280; 
    --primary: #013461;
    --accent: #155685;
    --accent-600: #0f4570;
    --accent-700: #0c3659; 
    --surface: #f6f7fb; 
    --footer: #0f1115; 
    --footerText: #ffffff; 
    --space-1: 10px; 
    --space-2: 20px; 
    --space-3: 30px; 
    --space-4: 60px; 
    --radius: 14px; 
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

* { 
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth; 
}

body { 
    font-family: 'Inter', sans-serif; 
    margin: 0; 
    padding: 0; 
    color: var(--text); 
    background: var(--bg); 
    line-height: 1.55;
    overflow-x: hidden;
}

img { 
    max-width: 100%; 
    display: block; 
}

/* Animations globales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 50% { border-color: rgba(255,255,255,0.8); }
    51%, 100% { border-color: transparent; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Header avec effet glassmorphism amélioré */
header { 
    position: fixed; 
    top: 0; 
    left: 0;
    right: 0;
    z-index: 1000; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 14px var(--space-2);
    background: rgba(255,255,255,0.66);
    -webkit-backdrop-filter: saturate(100%) blur(14px);
    backdrop-filter: saturate(100%) blur(14px);
    border-bottom: 1px solid rgba(0,0,0,0.06); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled { 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
    background: rgba(255,255,255,0.72);
    -webkit-backdrop-filter: saturate(100%) blur(16px);
    backdrop-filter: saturate(100%) blur(16px);
    padding: 10px var(--space-2);
}

header img { 
    height: 50px; 
    transition: height 0.3s ease;
}

header.scrolled img {
    height: 45px;
}

/* Navigation avec indicateur dynamique */
nav {
    position: relative;
}

nav a { 
    position: relative; 
    margin: 0 18px; 
    text-decoration: none; 
    color: var(--primary); 
    font-weight: 600; 
    padding: 8px 0;
    transition: all 0.3s ease;
}

nav a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0;
}

nav a:hover::before {
    width: 100px;
    height: 100px;
    opacity: 0.1;
}

nav a::after { 
    content: ""; 
    position: absolute; 
    left: 0; 
    bottom: 0; 
    height: 2px; 
    width: 0; 
    background: var(--gradient-primary); 
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

nav a:hover::after, 
nav a.active::after { 
    width: 100%; 
}

nav a:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

/* Hero section avec parallax et particules */
.hero { 
    position: relative; 
    padding: 160px 20px 120px; 
    text-align: center; 
    color: #fff; 
    background: linear-gradient(135deg, rgba(1,52,97,0.8) 0%, rgba(21,86,133,0.6) 100%), 
                url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2073&q=80') center/cover no-repeat;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(21,86,133,0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(1,52,97,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content { 
    max-width: 820px; 
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h1 { 
    margin: 0 0 20px 0; 
    font-size: 3.2em; 
    font-weight: 800; 
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p { 
    margin: 0 0 30px 0; 
    font-size: 1.2em; 
    color: rgba(255,255,255,0.9);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero .btn {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Sections avec espacement amélioré */
section {
    padding: 80px var(--space-2);
    scroll-margin-top: 100px;
}

/* Toutes les sections sont centrées sauf la hero */
section:not(.hero) {
    max-width: 1200px;
    margin: auto;
}

/* Hero pleine largeur */
.hero {
    width: 100%;
    max-width: none;
    margin: 0;
    background-size: cover;
    background-position: center;
}

h2 { 
    font-size: 2.4em; 
    margin: 0 0 40px 0; 
    font-weight: 800; 
    letter-spacing: -0.01em;
    text-align: center;
    position: relative;
}

h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

h3 { 
    margin: 15px 0; 
    font-weight: 700;
    color: var(--primary);
}

/* Grilles responsives avec gap amélioré */
.agencies, .values, .projects, .services { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3); 
    margin-top: 50px;
}

/* Cartes avec effets avancés */
.card { 
    background: var(--surface); 
    padding: var(--space-3); 
    border-radius: var(--radius); 
    text-align: center; 
    box-shadow: var(--shadow); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.card:hover::before {
    left: 100%;
}

.card:hover { 
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.services .card:hover {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(21,86,133,0.05) 100%);
}

.agencies .card img, 
.projects .card img { 
    transition: transform 0.3s ease;
}

.card:hover img {
    transform: scale(1.1);
}

.agencies .card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain; /* affiche 100% sans coupe sur desktop */
    background: rgba(0,0,0,0.02);
    border-radius: 10px;
    margin: 0 0 15px 0;
}

/* Desktop: proportions cohérentes via aspect-ratio, pas de coupe */
@media (min-width: 769px) {
    .agencies .card img { object-fit: contain !important; }
    /* Desktop: arrondir les cartes et clipper le contenu pour un effet visible */
    .agencies .card,
    .projects .card { border-radius: 12px !important; overflow: hidden !important; }
    /* Les images n'ont plus besoin d'un radius propre, elles héritent du clipping de la carte */
    .agencies .card img,
    .projects .card img { border-radius: 0 !important; }
}

/* Conserve la grille par défaut, centrée */

/* Mobile: image plein cadre pour un rendu fort */
@media (max-width: 768px) {
    .agencies .card img { object-fit: cover; }
}

.projects .card img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    border-radius: 10px; 
    margin-bottom: 15px; 
}

/* Compteurs animés */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin: 60px 0;
    text-align: center;
}

.stat-item {
    padding: var(--space-2);
}

.stat-number {
    font-size: 3em;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* Bandeau CTA amélioré avec coordonnées */
.cta-band { 
    padding: 35px 40px; 
    margin: 60px 0; 
    background: var(--gradient-primary); 
    color: #fff; 
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.cta-band::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='m0 40l40-40h-40v40zm40 0v-40h-40l40 40z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.cta-band > * {
    position: relative;
    z-index: 1;
}

.cta-content h3 {
    font-size: 2em;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #fff;
}

.cta-content p {
    font-size: 1.1em;
    font-weight: 500;
    margin: 0 0 20px 0;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.contact-link:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}



/* Boutons avec effets avancés */
.btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 700; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary { 
    background: var(--gradient-primary); 
    color: #fff; 
    box-shadow: 0 8px 25px rgba(21,86,133,0.3); 
}

.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 35px rgba(21,86,133,0.4); 
}

/* Footer amélioré */
footer { 
    background: var(--gradient-primary); 
    color: var(--footerText); 
    text-align: center; 
    padding: 50px 20px; 
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

footer > * {
    position: relative;
    z-index: 1;
}

footer p { 
    margin: 10px 0; 
    font-size: 1.1em;
}

footer a { 
    color: var(--footerText); 
    text-decoration: none; 
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

footer a:hover { 
    border-bottom-color: currentColor;
    transform: translateY(-1px);
}

.social-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.social-links svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Menu mobile amélioré */
.menu-toggle { 
    display: none; 
    border: 0; 
    background: transparent; 
    padding: 10px; 
    margin-left: auto; 
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(21,86,133,0.1);
}

.menu-toggle .bar { 
    display: block; 
    width: 28px; 
    height: 3px; 
    background: var(--primary); 
    margin: 6px 0; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 2px;
}

header.is-open .menu-toggle .bar:nth-child(1) { 
    transform: translateY(9px) rotate(45deg); 
}

header.is-open .menu-toggle .bar:nth-child(2) { 
    opacity: 0; 
    transform: rotate(180deg);
}

header.is-open .menu-toggle .bar:nth-child(3) { 
    transform: translateY(-9px) rotate(-45deg); 
}

/* Animations de révélation */
.reveal { 
    opacity: 0; 
    transform: translateY(30px); 
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
}

.reveal.in { 
    opacity: 1; 
    transform: none; 
}

.reveal.slide-right {
    transform: translateX(-30px);
}

.reveal.slide-right.in {
    transform: translateX(0);
}

/* Responsive design amélioré */
@media (max-width: 768px) {
    header { 
        flex-wrap: wrap; 
        padding: 12px var(--space-2);
    }

    .menu-toggle { 
        display: inline-block; 
        position: relative;
        z-index: 1201; /* au-dessus du drawer */
    }

    /* Drawer verre à droite */
    nav { 
        display: none; 
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 78%;
        max-width: 360px;
        z-index: 1100;
        padding: 90px 22px 24px; /* espace header */
        background: linear-gradient(180deg, rgba(255,255,255,0.56), rgba(255,255,255,0.44));
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        box-shadow: -16px 0 40px rgba(0,0,0,0.18);
        border-left: 1px solid rgba(21,86,133,0.12);
        transform: translateX(100%);
        transition: transform .3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    header.is-open nav { 
        display: block; 
        transform: translateX(0);
    }

    nav a { 
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 0; 
        margin: 0;
    }
    nav a::before {
        content: "";
        width: 20px;
        height: 20px;
        border-radius: 6px;
        background: var(--accent);
        opacity: .2;
        transition: opacity .2s ease, transform .2s ease;
    }
    nav a::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        height: 2px;
        width: 0;
        background: var(--accent);
        transition: width .25s ease;
    }
    nav a:hover::after { width: 100%; }
    nav a:hover::before { opacity: .35; transform: scale(1.05); }

    nav a:last-child {
        border-bottom: none;
    }

    .hero { 
        padding: 140px 16px 100px; 
    }

    .hero h1 { 
        font-size: 2.2em; 
    }

    .hero p {
        font-size: 1.1em;
    }

    section { 
        padding: 60px var(--space-2); 
    }

    h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .cta-band {
        padding: 30px 20px;
    }

    .cta-content h3 {
        font-size: 1.6em;
    }

    .cta-content p {
        font-size: 1em;
        margin-bottom: 15px;
    }

    .contact-info {
        gap: 8px;
    }

    .contact-link {
        padding: 8px 14px;
        font-size: 0.95em;
    }

    .agencies, .values, .projects, .services {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Overlay plein écran */
    .menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 900; /* derrière le header/nav pour ne pas bloquer les clics */
        background: rgba(0,0,0,0.35);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity .25s ease;
    }
    header.is-open ~ .menu-overlay { display: block; opacity: 1; }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8em;
    }

    .stat-number {
        font-size: 2.2em;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

/* Hover effects for better interactivity */
.projects .card {
    cursor: pointer;
}

.projects .card:hover h3 {
    color: var(--accent);
}

/* Loading animation */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-shimmer {
    position: relative;
    overflow: hidden;
}

.loading-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}