/* =============================================
    CSS VARIABLES — DESIGN TOKENS
============================================= */
:root {
    --accent: #FF6B00;
    --accent-light: #FF8C35;
    --accent-dim: rgba(255,107,0,0.12);
    --accent-border: rgba(255,107,0,0.3);

    /* DARK MODE (default) */
    --bg-primary: #172235;
    --bg-secondary: #1c2a40;
    --bg-card: rgba(35,51,74,0.82);
    --bg-nav: rgba(23,34,53,0.9);
    --bg-mobile-menu: rgba(26,39,60,0.98);
    --text-primary: #FFFFFF;
    --text-secondary: #C4CDDA;
    --text-muted: #96A3B5;
    --border-subtle: rgba(255,255,255,0.11);
    --border-card: rgba(255,255,255,0.15);
    --input-bg: rgba(255,255,255,0.07);
    --input-border: rgba(255,255,255,0.15);
    --scrollbar-track: #172235;
    --shadow-card: 0 10px 34px rgba(5,12,24,0.22);
    --blob1: rgba(255,107,0,0.08);
    --blob2: rgba(57,79,112,0.48);
    --section-alt: rgba(39,57,84,0.72);
}

/* LIGHT MODE VARIABLES */
body.light-mode {
    --bg-primary: #F0F2F5;
    --bg-secondary: #E8EBF0;
    --bg-card: rgba(255,255,255,0.75);
    --bg-nav: rgba(240,242,245,0.94);
    --bg-mobile-menu: rgba(240,242,245,0.99);
    --text-primary: #0F172A;
    --text-secondary: #52606D;
    --text-muted: #7E8C9A;
    --border-subtle: rgba(0,0,0,0.06);
    --border-card: rgba(0,0,0,0.09);
    --input-bg: rgba(255,255,255,0.8);
    --input-border: rgba(0,0,0,0.13);
    --scrollbar-track: #E8EBF0;
    --shadow-card: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
    --blob1: rgba(255,107,0,0.08);
    --blob2: rgba(200,210,230,0.6);
    --section-alt: rgba(220,225,235,0.5);
}

/* === LIGHT MODE OVERRIDES === */
body.light-mode { background-color: var(--bg-primary) !important; color: var(--text-primary) !important; }
body.light-mode .glassmorphism {
    background: var(--bg-card);
    border-color: var(--border-card);
    box-shadow: var(--shadow-card);
}
body.light-mode .glassmorphism-nav {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 2px 20px rgba(0,0,0,0.07);
}
body.light-mode #mobile-menu {
    background: var(--bg-mobile-menu);
    border-left: 1px solid var(--border-card);
}
body.light-mode .mobile-link { color: var(--text-muted); }
body.light-mode .mobile-link:hover { color: var(--text-primary); }
body.light-mode .mobile-link.active-mobile { color: var(--accent); }
body.light-mode .text-softGray, body.light-mode .text-softGray * { color: var(--text-secondary) !important; }
body.light-mode .text-white { color: var(--text-primary) !important; }
body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4 { color: var(--text-primary); }
/* L'animation FLIP peut laisser une couleur inline issue du mode clair. */
body:not(.light-mode) [data-flip-id="label-design-svc"] { color: #fff !important; }
body.light-mode [data-flip-id="label-design-svc"] { color: var(--text-primary) !important; }
body.light-mode .nav-link { color: var(--text-secondary); }
body.light-mode .nav-link.active { color: var(--text-primary) !important; }
body.light-mode .nav-link::after { background: var(--accent); }
body.light-mode .burger-line { background: var(--text-primary); }
body.light-mode .text-gradient {
    background: linear-gradient(135deg, #0F172A 50%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-mode footer { background-color: #E2E5EC !important; border-top-color: var(--border-subtle) !important; }
body.light-mode select {
    background: rgba(255,255,255,0.9) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}
body.light-mode input, body.light-mode textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}
body.light-mode input::placeholder, body.light-mode textarea::placeholder { color: var(--text-muted) !important; }
body.light-mode ::-webkit-scrollbar-track { background: var(--scrollbar-track); }
body.light-mode .glow-hover:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(255,107,0,0.15), var(--shadow-card); }
body.light-mode .border-white\/5 { border-color: var(--border-subtle) !important; }
body.light-mode .border-white\/10 { border-color: var(--border-card) !important; }
body.light-mode .bg-darkNavy\/10, body.light-mode .bg-darkNavy\/20, body.light-mode .bg-darkNavy\/30 { background-color: var(--section-alt) !important; }
body.light-mode .portfolio-item { box-shadow: var(--shadow-card); }
body.light-mode #mobile-overlay { background: rgba(0,0,0,0.35); }
body.light-mode .mobile-menu-close { background: rgba(0,0,0,0.06); color: var(--text-primary); }
body.light-mode .mobile-menu-close:hover { background: rgba(255,107,0,0.12); }
body.light-mode .hero-badge { background: rgba(255,107,0,0.08); border-color: rgba(255,107,0,0.2); }
/* Section backgrounds in light mode */
body.light-mode header#hero-section { background: linear-gradient(160deg, #EDF0F5 0%, #F5F0EB 100%); }
body.light-mode .bg-\[radial-gradient\(\#ffffff01_1px\,transparent_1px\)\] { background-image: radial-gradient(#00000008 1px, transparent 1px) !important; }
body.light-mode .counter-card { background: white; }
/* Light mode footer text */
body.light-mode footer .text-softGray { color: var(--text-secondary) !important; }
body.light-mode footer a.hover\:text-white:hover { color: var(--text-primary) !important; }
body.light-mode footer .text-white { color: var(--text-primary) !important; }
/* Light testimonial */
body.light-mode .prose p { color: var(--text-primary) !important; }
/* Contact section */
body.light-mode #contact { background: linear-gradient(to bottom, var(--bg-primary), #E8EBF4); }
/* Theme toggle button */
body.light-mode #theme-toggle { background: rgba(255,107,0,0.08); border-color: rgba(255,107,0,0.25); color: var(--accent); }
body.light-mode #theme-toggle:hover { background: rgba(255,107,0,0.15); border-color: var(--accent); }

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body { background-color: var(--bg-primary); color: var(--text-primary); transition: background-color 0.4s ease, color 0.3s ease; }

/* Dark mode: softer anthracite surfaces and stronger link contrast */
body:not(.light-mode) .text-softGray,
body:not(.light-mode) .text-softGray * { color: var(--text-secondary) !important; }
body:not(.light-mode) #services,
body:not(.light-mode) #training,
body:not(.light-mode) .why-us-section {
    background-color: #111d2f !important;
    background-image:
        linear-gradient(rgba(10, 20, 35, 0.82), rgba(13, 27, 47, 0.88)),
        url('../images/backgrounds/dark-tech-workspace.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

/* Les navigateurs mobiles gèrent mal les fonds fixes : l'image reste cadrée sans saccades. */
@media (max-width: 767px), (prefers-reduced-motion: reduce) {
    body:not(.light-mode) #services,
    body:not(.light-mode) #training,
    body:not(.light-mode) .why-us-section {
        background-attachment: scroll;
    }
}
body:not(.light-mode) #contact {
    background: linear-gradient(180deg, var(--bg-primary), #1b2940);
}
body:not(.light-mode) footer {
    background-color: #131e30 !important;
    border-top-color: var(--border-subtle) !important;
}
body:not(.light-mode) footer a { color: #cbd4e1; }
body:not(.light-mode) footer a:hover { color: #fff; }
body:not(.light-mode) input,
body:not(.light-mode) textarea,
body:not(.light-mode) select {
    background-color: #22334d !important;
    border-color: var(--input-border) !important;
}
body:not(.light-mode) header#hero-section {
    background: radial-gradient(ellipse at 20% 45%, rgba(255,107,0,0.08), transparent 58%),
                radial-gradient(ellipse at 82% 18%, rgba(80,111,154,0.18), transparent 52%),
                linear-gradient(160deg, #172235 0%, #1c2a40 100%);
}

.glassmorphism {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    transition: background 0.4s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.glassmorphism-nav {
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.4s ease;
}
.text-gradient {
    background: linear-gradient(135deg, #FFFFFF 60%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.glow-hover:hover {
    border-color: #FF6B00;
    box-shadow: 0 0 25px rgba(255, 107, 0, 0.25);
    transition: all 0.4s ease;
}
/* Enhanced card styles for dark mode */
.glassmorphism.card-3d {
    box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.07);
}
.glassmorphism.card-3d:hover {
    box-shadow: 0 14px 38px rgba(5,12,24,0.28), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* === CUSTOM CURSOR === */
.cursor-dot {
    width: 8px; height: 8px;
    background: #FF6B00;
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
}
.cursor-ring {
    width: 32px; height: 32px;
    border: 1.5px solid rgba(255,107,0,0.5);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease;
}
body:hover .cursor-dot { opacity: 1; }

/* === PRELOADER === */
#preloader {
    position: fixed; inset: 0;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 20px;
}
.loader-logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    letter-spacing: -0.03em;
    overflow: hidden;
}
.loader-logo span { color: #FF6B00; }
.loader-bar {
    width: 200px; height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.loader-progress {
    height: 100%;
    background: linear-gradient(90deg, #FF6B00, #ff9d4d);
    border-radius: 2px;
    width: 0%;
}

/* === ACTIVE NAV LINK === */
.nav-link {
    position: relative;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: #FF6B00;
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.nav-link.active {
    color: #fff !important;
}
.nav-link.active::after {
    transform: scaleX(1);
}
.nav-link:hover::after {
    transform: scaleX(1);
}

/* === MOBILE MENU === */
#mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: min(85vw, 360px);
    height: 100dvh;
    background: var(--bg-mobile-menu);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 2.5rem;
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.77, 0, 0.175, 1);
    border-left: 1px solid rgba(255,107,0,0.1);
}
#mobile-menu.open {
    transform: translateX(0);
}
#mobile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 8999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
#mobile-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.mobile-link {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-secondary);
    letter-spacing: -0.02em;
    padding: 0.6rem 0;
    transition: color 0.3s ease, transform 0.3s ease;
    width: 100%;
}
.mobile-link:hover { color: #fff; transform: translateX(6px); }
.mobile-link.active-mobile { color: #FF6B00; }
.mobile-menu-close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.mobile-menu-close:hover { background: rgba(255,107,0,0.2); }

/* Burger Icon */
#menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
    background: none;
    border: none;
}
.burger-line {
    display: block;
    width: 24px; height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.77, 0, 0.175, 1);
    transform-origin: center;
}
#menu-btn.open .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-btn.open .burger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
#menu-btn.open .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === GSAP FLOATING PARTICLES === */
#particles-canvas {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* === MARQUEE === */
.marquee-track {
    display: flex;
    animation: marquee 25s linear infinite;
    width: max-content;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* === HERO FLOATING SHAPES === */
.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0;
}

/* === SECTION REVEAL === */
.reveal-item { opacity: 0; transform: translateY(40px); }

/* =============================================
    MORPH ANIMATIONS — BLOBS & TEXT
============================================= */

/* Morphing blob shapes */
.morph-blob {
    position: absolute;
    pointer-events: none;
    opacity: 0.55;
    filter: blur(0px);
    will-change: transform, border-radius, opacity;
}

/* Text morph container */
#morph-text-container {
    position: relative;
    display: inline-block;
    min-width: 340px;
    height: 1.2em;
    overflow: hidden;
}
.morph-word {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
    will-change: transform, filter, opacity;
    color: #FF6B00;
    font-style: italic;
}

/* Liquid canvas behind hero */
#liquid-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
}

/* Morphing SVG blobs */
.svg-morph-blob {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.18;
    will-change: transform;
}
.svg-morph-blob path {
    transform-origin: center;
}

/* =============================================
    FLIP MORPH — Ghost traveler element
============================================= */
.flip-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9990;
    will-change: transform, opacity, font-size, color;
    /* Inherit look from source */
    font-family: inherit;
    font-weight: inherit;
    white-space: nowrap;
    transform-origin: top left;
    border-radius: 4px;
}

/* === CARD 3D HOVER === */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.15s ease;
}

/* === COUNTER === */
.counter-num { font-variant-numeric: tabular-nums; }

/* === GSAP SPLIT TEXT EFFECT === */
.split-char {
    display: inline-block;
    will-change: transform, opacity;
}

/* === TABLET RESPONSIVE === */
@media (max-width: 1023px) {
    .nav-desktop { display: none !important; }
    .nav-cta-desktop { display: none !important; }
}
@media (min-width: 1024px) {
    #menu-btn { display: none !important; }
}

/* === MOBILE FOOTER CENTERING === */
@media (max-width: 640px) {
    footer {
        text-align: center;
    }

    footer .grid > div {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    footer a.flex,
    footer .flex {
        justify-content: center;
    }

    footer ul,
    footer p {
        margin-left: auto;
        margin-right: auto;
    }

    footer .border-t .flex {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: #FF6B00; border-radius: 4px; }

/* === NOISE OVERLAY — supprimé === */

/* === MAGNETIC BUTTON === */
.mag-btn { position: relative; display: inline-flex; }

/* === PORTFOLIO OVERLAY === */
.portfolio-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(7,7,7,0.95) 0%, rgba(7,7,7,0.3) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex; align-items: flex-end; padding: 1.5rem;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-item { transition: transform 0.4s ease; }
.portfolio-item:hover { transform: translateY(-6px); }

/* Spacing fix */
section { position: relative; z-index: 2; }
header { position: relative; z-index: 2; }
footer { position: relative; z-index: 2; }
nav { position: fixed; z-index: 50; }

/* === ENHANCED SECTION HEADERS === */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.section-tag::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* === ABOUT SECTION CARD IMPROVEMENTS === */
body.light-mode .about-visual-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(240,245,255,0.8));
}

/* === HERO LIGHT MODE BG === */
body.light-mode header#hero-section {
    background: radial-gradient(ellipse at 20% 50%, rgba(255,107,0,0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(15,28,46,0.05) 0%, transparent 50%),
                linear-gradient(160deg, #EDF0F6 0%, #F6F1EC 100%);
}

/* === HERO GRID LIGHT === */
body.light-mode .hero-grid-bg {
    background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
}

/* === STATS CARD IMPROVEMENTS === */
body.light-mode .stat-card {
    background: white;
    border-color: rgba(0,0,0,0.07);
}

/* === TRAINING SECTION === */
body.light-mode #training {
    background: linear-gradient(to bottom, rgba(220,225,238,0.4), rgba(230,235,245,0.6));
}

/* === TESTIMONY CARD === */
body.light-mode .testimony-card {
    background: white;
    border-color: rgba(0,0,0,0.08);
}

/* === CONTACT SECTION INPUTS === */
body.light-mode form input:focus,
body.light-mode form textarea:focus,
body.light-mode form select:focus {
    background: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}

/* === MARQUEE — LIGHT === */
body.light-mode .marquee-band {
    background-color: rgba(200,210,225,0.3) !important;
    border-color: rgba(0,0,0,0.06) !important;
}

/* === ORANGE ACCENT BADGE — LIGHT === */
body.light-mode .orange-badge {
    background: rgba(255,107,0,0.09);
    border: 1px solid rgba(255,107,0,0.2);
}

/* === PORTFOLIO FILTER BUTTONS — LIGHT === */
body.light-mode .portfolio-filter-btn {
    background: white !important;
    color: var(--text-secondary) !important;
    border-color: rgba(0,0,0,0.1) !important;
}
body.light-mode .portfolio-filter-btn:hover,
body.light-mode .portfolio-filter-btn.text-white {
    color: var(--text-primary) !important;
    border-color: rgba(255,107,0,0.4) !important;
}

/* === "POURQUOI NOUS" SECTION === */
body.light-mode .why-us-section {
    background: linear-gradient(to right, rgba(215,225,240,0.3), rgba(230,235,248,0.5));
}

/* === GENERAL BORDER TRANSITIONS === */
* { transition-property: color, background-color, border-color, box-shadow; transition-duration: 0.35s; transition-timing-function: ease; }
/* Exclude transforms & opacity from global transition to avoid GSAP conflicts */
.card-3d, .portfolio-item, .mag-btn {
    transition-property: border-color, box-shadow, background-color;
}
