/* ======== 1. Variables & Configuration ======== */
:root {
    /* Palette Histoply */
    --primary-blue: #3072B6;
    --primary-dark: #0042B2;
    --accent-gold: #FFC400;
    --roman-red: #D32929;
    --imperial-purple: #7B1FA2;
    
    /* Neutres & Surfaces */
    --dark-color: #1A1A1A;
    --text-body: #4A4A4A;
    --bg-light: #F9FAFB;
    --surface-white: #FFFFFF;
    
    /* UI Elements */
    --nav-height: 80px;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --container-width: 1140px;
    
    /* Typographie */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lora', serif;
    
    /* Ombres Premium */
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
    --shadow-md: 0 12px 24px -6px rgba(0,0,0,0.05);
    --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(48, 114, 182, 0.2);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text-body);
    background-color: var(--surface-white);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, .btn, .nav-link, .feature-badge {
    font-family: var(--font-heading);
}

h1 { font-size: 3.5rem; line-height: 1.1; font-weight: 700; color: var(--dark-color); margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; font-weight: 600; color: var(--dark-color); margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--dark-color); }
p { margin-bottom: 1.5rem; font-size: 1.125rem; }

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* Optimisation CLS : Réserver l'espace pour les images */
img {
    max-width: 100%; 
    height: auto; 
    display: block;
}
/* Fallback propre si l'image ne charge pas */
img:not([src]):not([srcset]) {
    visibility: hidden;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ======== 2. Header & Navigation ======== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: all 0.4s ease;
    background: transparent; /* Transparent au début */
}

/* Classe ajoutée par JS au scroll */
.header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    height: 70px; /* Se réduit légèrement */
}

.header nav {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img { height: 42px; width: auto; transition: 0.3s; }
.header.scrolled .logo img { height: 36px; }

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-switcher a {
    font-weight: 600;
    color: var(--text-body);
    opacity: 0.6;
    margin-left: 12px;
    font-size: 0.9rem;
    padding: 4px;
}
.lang-switcher a:hover, .lang-switcher a.active {
    opacity: 1;
    color: var(--primary-blue);
}

/* ======== 3. Composants UI (Boutons & Badges) ======== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(48, 114, 182, 0.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(48, 114, 182, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-blue);
    border: 2px solid rgba(48, 114, 182, 0.1);
}
.btn-secondary:hover {
    border-color: var(--primary-blue);
    background: rgba(48, 114, 182, 0.05);
}

.feature-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    background: rgba(48, 114, 182, 0.1);
    color: var(--primary-blue);
}
.feature-badge.purple { background: rgba(123, 31, 162, 0.1); color: var(--imperial-purple); }
.feature-badge.gold { background: rgba(255, 196, 0, 0.15); color: #D4A000; }

/* ======== 4. Sections Principales ======== */

/* HERO */
.hero {
    padding: 160px 0 100px; /* Plus d'espace en haut pour la nav fixed */
    background: radial-gradient(circle at 80% 20%, rgba(48, 114, 182, 0.08) 0%, transparent 50%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.phone-mockup {
    position: relative;
    border-radius: 30px; /* Correspond aux coins des screenshots */
    border: 8px solid #1a1a1a; /* Bordure simulée de téléphone */
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: white;
    max-width: 320px;
    margin: 0 auto;
    transform: rotate(-2deg); /* Léger tilt pour le dynamisme */
    transition: transform 0.5s ease;
}
.phone-mockup:hover { transform: rotate(0deg) scale(1.02); }

/* PROBLEM SECTION */
.problem-section {
    padding: 100px 0;
    background-color: #FFF5F5;
    text-align: center;
}

/* BENTO GRID (Feature Section) */
.feature-section { padding: 120px 0; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 400px);
    gap: 24px;
    margin-top: 60px;
}

.bento-card-main {
    grid-column: span 7;
    grid-row: span 2;
    background: linear-gradient(135deg, #F0F4F8 0%, #E2E8F0 100%);
    border-radius: var(--border-radius-lg);
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    position: relative;
}
.bento-card-main img {
    margin-top: 30px;
    box-shadow: var(--shadow-md);
    border-radius: 20px;
    max-width: 280px;
    transition: 0.5s;
}
.bento-card-main:hover img { transform: scale(1.05) translateY(-10px); }

.bento-card-sub {
    grid-column: span 5;
    background: white;
    border: 1px solid #eee;
    border-radius: var(--border-radius-lg);
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: 0.3s;
    position: relative;
    overflow: hidden; 
}
.bento-card-sub:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

/* Effet de lueur au survol (Géré par JS + CSS variables) */
.bento-card-sub::before {
    content: "";
    position: absolute;
    top: var(--mouse-y, 0);
    left: var(--mouse-x, 0);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(48, 114, 182, 0.08), transparent 60%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.bento-card-sub:hover::before { opacity: 1; }

.bento-card-sub img { width: 120px; border-radius: 12px; box-shadow: var(--shadow-sm); }

.bento-text h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: var(--dark-color);
    font-weight: 600;
    font-family: var(--font-heading);
}
.bento-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ARCADE BANNER */
.gamification-banner {
    background: var(--dark-color);
    border-radius: 30px;
    padding: 80px;
    margin: 60px 0;
    position: relative;
    overflow: hidden;
    color: white;
}
/* Particules d'arrière-plan */
.gamification-banner::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.2;
}
.gamification-banner .hero-grid { position: relative; z-index: 2; }

/* Arcade floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}
.arcade-visual {
    position: relative;
    animation: float 6s ease-in-out infinite;
}
.arcade-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 196, 0, 0.2) 0%, transparent 70%);
    z-index: -1;
    filter: blur(30px);
}

/* ADAPTIVE SECTION (Feature Row Layout) */
.adaptive-section { padding: 100px 0; background: var(--bg-light); }

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    margin-bottom: 80px;
}
/* Classe pour inverser l'ordre (Image à gauche / Texte à droite) */
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }

.adaptive-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 60px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======== 5. Témoignages (Nouveau Design) ======== */
.testimonial-section { padding: 100px 0; text-align: center; }
.testimonial-card {
    background: white;
    padding: 60px 40px 40px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 40px auto;
    position: relative;
    border-top: 4px solid var(--primary-blue);
}
.testimonial-card::before {
    content: "“";
    font-family: serif;
    font-size: 120px;
    color: var(--primary-blue);
    opacity: 0.15;
    position: absolute;
    top: -20px;
    left: 20px;
    line-height: 1;
}
.testimonial-text { font-size: 1.4rem; font-style: italic; color: var(--dark-color); }
.testimonial-author { margin-top: 20px; font-weight: 700; color: var(--primary-blue); font-family: var(--font-heading); text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }

/* ======== 6. Footer ======== */
.footer {
    background: #111;
    color: #eee;
    padding: 80px 0 40px;
    font-family: var(--font-heading);
}
.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}
.footer h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer a { color: #999; display: block; margin-bottom: 10px; font-size: 0.95rem; }
.footer a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

/* ======== 7. Animations JS (Classes utilitaires) ======== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======== 8. Responsive & Desktop Optimisations ======== */

/* Desktop (Grands écrans) */
@media (min-width: 993px) {
    .phone-mockup {
        max-height: 80vh; /* Garde l'image visible sans scroller */
        width: auto;      
    }
    .bento-grid {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablette & Mobile */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    .hero-grid, .adaptive-container, .feature-row { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .feature-row.reverse .feature-text { order: 0; } /* Reset ordre mobile */
    .feature-row.reverse .feature-visual { order: 1; }
    
    .bento-grid { display: flex; flex-direction: column; gap: 24px; margin-top: 40px; }
    .bento-card-sub { flex-direction: column; text-align: center; }
    .bento-mockup-sub { width: 140px; }
    
    .footer-content { grid-template-columns: 1fr 1fr; gap: 30px; }
    .footer-col:first-child { grid-column: span 2; text-align: center; margin-bottom: 20px; }
    
    .gamification-banner { padding: 60px 30px; }
    .gamification-banner .hero-grid { display: flex; flex-direction: column-reverse; }
}

@media (max-width: 576px) {
    h1 { font-size: 2rem; }
    .container { width: 92%; padding: 0 15px; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-col:first-child { grid-column: span 1; }
}