/* Réinitialisation de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0a192f;      /* Bleu nuit technique très profond */
    --accent: #025912;       /* Rouge/Corail vif "A3D" pour l'impact visuel */
    --bg-light: #f4f6f9;
    --text-dark: #1e293b;
    --text-light: #fff;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --shadow: rgba(10, 88, 0, 0.2);
    --shadow2: #025912ab;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: var(--text-light);
}

.container {
    width: 85%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    padding: 25px 0;
    transition: var(--transition);
}

.main-header.scrolled {
    background: var(--primary);
    padding: 15px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-light);
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent);
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 35px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-nav {
    border: 2px solid var(--accent);
    padding: 8px 24px;
    transform: skewX(-12deg); /* Forme inclinée pour le bouton menu */
    display: inline-block;
}

.btn-nav:hover {
    background: var(--accent);
    color: var(--text-light) !important;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95), rgba(10, 25, 47, 0.85)), 
                url('https://images.unsplash.com/photo-1539220482118-9fc88a486453?auto=format&fit=crop&w=1950&q=80') no-repeat center center/cover;
    display: flex;
    align-items: center;
    color: var(--text-light);
    padding: 120px 0 60px 0;
}

.hero-container {
    display: table;
    width: 100%;
}

.hero-content, .hero-image-wrapper {
    display: table-cell;
    vertical-align: middle;
    width: 50%;
}

.hero-content h1 {
    font-size: 3.8rem;
    font-weight: 900;
    margin-bottom: 25px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.85;
    max-width: 500px;
}

/* Bouton Principal Parallélogramme */
.btn-primary {
    display: inline-block;
    padding: 16px 36px;
    background: var(--accent);
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    transform: skewX(-12deg); /* Crée le parallélogramme */
    transition: var(--transition);
    box-shadow: -5px 5px 0px var(--shadow);
}

.btn-primary:hover {
    transform: skewX(-12deg) translateY(-3px);
    box-shadow: -8px 8px 0px var(--shadow);
}

/* L'élément flottant stylisé (Design demandé) */
.hero-image-wrapper {
    padding-left: 50px;
    text-align: right;
}

.parallelogram-box {
    display: inline-block;
    width: 100%;
    max-width: 450px;
    height: 350px;
    overflow: hidden;
    transform: skewX(-12deg); /* Incline la boîte globale */
    border-top-left-radius: 40px;  /* Arrondi Haut-Gauche */
    border-bottom-right-radius: 40px; /* Arrondi Bas-Droit */
    box-shadow: -20px 20px 0px var(--shadow); /* Ombre technique */
    animation: floatAnimation 4s ease-in-out infinite; /* Animation de flottement */
}

/* On remet l'image droite à l'intérieur pour éviter la distorsion */
.parallelogram-box img {
    width: 130%; /* Plus large pour compenser le masque de l'inclinaison */
    height: 100%;
    object-fit: cover;
    transform: skewX(12deg) scale(1.1); /* Contre-inclinaison */
    transition: var(--transition);
}

.parallelogram-box:hover img {
    transform: skewX(12deg) scale(1.2);
}

/* Animation de flottement fluide */
@keyframes floatAnimation {
    0% { transform: skewX(-12deg) translateY(0px); }
    50% { transform: skewX(-12deg) translateY(-15px); }
    100% { transform: skewX(-12deg) translateY(0px); }
}

/* Services / Savoir-faire */
.services-section {
    padding: 120px 0;
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.6rem;
    font-weight: 900;
    margin-bottom: 70px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 5px;
    background: var(--accent);
    margin: 15px auto 0 auto;
    transform: skewX(-20deg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--text-light);
    padding: 50px 35px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.03);
    transition: var(--transition);
    border-top-left-radius: 20px;   /* Rappel du design arrondi */
    border-bottom-right-radius: 20px;
    border-left: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    border-left: 4px solid var(--accent);
    box-shadow: 0 20px 50px rgba(10, 25, 47, 0.08);
}

.service-card .icon {
    font-size: 2.8rem;
    margin-bottom: 25px;
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.3rem;
}

/* Stats Section */
.stats-section {
    background: var(--primary);
    color: var(--text-light);
    padding: 100px 0;
    text-align: center;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 50px;
}

.stat-item {
    transform: skewX(-8deg); /* Incline légèrement les blocs de statistiques */
}

.stat-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent);
    display: block;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-item p {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Footer */
footer {
    background: #050c16;
    color: rgba(255,255,255,0.4);
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* --- ANIMATIONS DE REVEAL POUR JS --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Cas particulier pour ne pas casser la structure de l'image flottante déjà inclinée */
.hero-image-wrapper.reveal {
    transform: translateY(50px);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0) !important;
}

/* Section Galerie */
.gallery-section {
    padding: 100px 0;
    background: var(--text-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px; /* Plus d'espace pour laisser respirer les parallélogrammes */
    padding: 20px 0;
}

.gallery-item {
    display: flex;
    justify-content: center;
}

.gallery-parallelogram {
    position: relative;
    width: 100%;
    max-width: 350px;
    height: 250px;
    overflow: hidden;
    transform: skewX(-12deg); /* Même angle que le reste du site */
    border-top-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.gallery-parallelogram img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%; /* Garde la marge pour le biseau */
    height: 100%;
    object-fit: cover;
    
    /* Le translate(-50%, -50%) force le centre parfait de l'image au centre du cadre.
       Ensuite, on applique la contre-inclinaison de 12deg et le zoom de 1.1.
    */
    transform: translate(-50%, -50%) skewX(12deg) scale(1.1);
    
    transform-origin: center;
    transition: var(--transition);
}

/* Effet au survol des photos */
.gallery-parallelogram:hover {
    transform: skewX(-12deg) translateY(-5px);
    box-shadow: -10px 15px 30px var(--shadow);
}

.gallery-parallelogram:hover img {
    /* On garde impérativement le translate(-50%, -50%) ici aussi au survol */
    transform: translate(-50%, -50%) skewX(12deg) scale(1.2);
}

/* Overlay sombre avec texte qui apparaît au survol */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: -20%; /* Légèrement décalé pour couvrir le parallélogramme */
    width: 140%;
    height: 100%;
    background: linear-gradient(to top, var(--shadow2), var(--shadow));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: var(--transition);
    transform: skewX(12deg); /* Garde le texte droit */
}

.gallery-parallelogram:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
}

/* Version mobile de secours basique */
@media (max-width: 768px) {
    .hero-container { display: block; }
    .hero-content, .hero-image-wrapper { display: block; width: 100%; text-align: center; padding: 0; }
    .hero-image-wrapper { margin-top: 50px; }
    .nav-links { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
}