/* ============================================================
   ELANCI DIGITAL — COUCHE DE REFONTE 2025
   Parallax · Animations · Glassmorphism · Micro-interactions
   --------------------------------------------------------------
   Palette d'origine STRICTEMENT conservée :
   #00aeef · #147fd6 · #002c57 · #000 · #f4faff
   Ce fichier est chargé APRÈS style.css : il enrichit, il ne
   remplace pas. Aucune couleur de marque n'est modifiée.
   ============================================================ */

:root {
    --elx-glow:        0 0 0 1px rgba(0,174,239,.18), 0 18px 50px -12px rgba(0,80,150,.35);
    --elx-glow-strong: 0 0 0 1px rgba(0,174,239,.30), 0 26px 70px -18px rgba(0,120,210,.55);
    --elx-card-border: linear-gradient(150deg, rgba(0,174,239,.55), rgba(20,127,214,.05) 45%, rgba(255,255,255,.0));
    --elx-ease:        cubic-bezier(.22,.61,.36,1);
    --elx-ease-out:    cubic-bezier(.16,1,.3,1);
}

/* ============================================================
   0. BARRE DE PROGRESSION DE SCROLL
   ============================================================ */
.elx-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    z-index: 2000;
    background: linear-gradient(90deg, var(--primary-color), #6fd3ff 60%, var(--secondary-color));
    box-shadow: 0 0 12px rgba(0,174,239,.7);
    transition: width .12s linear;
    pointer-events: none;
}

/* ============================================================
   1. CURSEUR DE SÉLECTION + SCROLLBAR
   ============================================================ */
::selection { background: rgba(0,174,239,.28); color: #002c57; }

@media (min-width: 992px) {
    html { scrollbar-width: thin; scrollbar-color: var(--primary-color) #e7f4fb; }
    ::-webkit-scrollbar { width: 11px; }
    ::-webkit-scrollbar-track { background: #eaf5fb; }
    ::-webkit-scrollbar-thumb {
        background: linear-gradient(var(--primary-color), var(--secondary-color));
        border-radius: 20px;
        border: 3px solid #eaf5fb;
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }
}

/* ============================================================
   2. NAVBAR — verre dépoli au défilement
   ============================================================ */
.main-navbar {
    transition: background .4s var(--elx-ease), backdrop-filter .4s, box-shadow .4s, padding .35s;
}
.main-navbar.scrolled {
    background: rgba(0,28,55,.72) !important;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.main-navbar.scrolled .logo-image { height: 72px; transition: height .35s var(--elx-ease); }
.navbar-nav .nav-link::after {
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #7ad6ff);
    box-shadow: 0 0 8px rgba(0,174,239,.6);
}

/* ============================================================
   3. HERO — fond vivant (aurore + grille + formes parallax)
   ============================================================ */
.hero-section { min-height: 92vh; isolation: isolate; }

/* On éclaircit très légèrement l'overlay pour laisser respirer l'aurore,
   tout en gardant la lisibilité maximale du texte. */
.hero-overlay {
    background: linear-gradient(140deg, rgba(0,40,80,.93) 0%, rgba(15,90,170,.78) 60%, rgba(0,44,87,.92) 100%) !important;
    z-index: 0;
}

/* Aurore : dégradés radiaux animés qui dérivent lentement */
.hero-aurora {
    position: absolute; inset: -20%;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(38% 50% at 18% 28%, rgba(0,174,239,.55), transparent 60%),
        radial-gradient(34% 46% at 82% 22%, rgba(20,127,214,.45), transparent 62%),
        radial-gradient(45% 55% at 70% 85%, rgba(0,174,239,.32), transparent 60%),
        radial-gradient(40% 50% at 25% 80%, rgba(40,150,230,.28), transparent 60%);
    filter: blur(28px) saturate(135%);
    opacity: .9;
    mix-blend-mode: screen;
    will-change: transform;
    animation: elxAurora 22s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes elxAurora {
    0%   { transform: translate3d(0,0,0) scale(1)    rotate(0deg); }
    50%  { transform: translate3d(2%,-2%,0) scale(1.08) rotate(4deg); }
    100% { transform: translate3d(-2%,1%,0) scale(1.04) rotate(-3deg); }
}

/* Grille technique en perspective, très discrète */
.hero-grid {
    position: absolute; inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0,174,239,.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,174,239,.10) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(120% 80% at 50% 30%, #000 35%, transparent 78%);
    -webkit-mask-image: radial-gradient(120% 80% at 50% 30%, #000 35%, transparent 78%);
    opacity: .5;
    animation: elxGridDrift 26s linear infinite;
}
@keyframes elxGridDrift {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 56px 56px, 56px 56px; }
}

/* Formes géométriques flottantes (profondeur parallax) */
.hero-shapes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(0,174,239,.30);
    background: radial-gradient(circle at 30% 30%, rgba(0,174,239,.16), transparent 70%);
    will-change: transform;
}
.hero-shapes .s1 { width: 120px; height: 120px; top: 16%;  left: 8%;  }
.hero-shapes .s2 { width: 64px;  height: 64px;  top: 62%;  left: 14%; border-radius: 14px; transform: rotate(20deg); }
.hero-shapes .s3 { width: 180px; height: 180px; top: 20%;  right: 9%; }
.hero-shapes .s4 { width: 40px;  height: 40px;  top: 74%;  right: 20%; background: rgba(0,174,239,.25); border: none; }
.hero-shapes .s5 { width: 90px;  height: 90px;  bottom: 12%; right: 38%; border-radius: 20px; transform: rotate(-15deg); }
.hero-shapes .dot { width: 8px; height: 8px; background: var(--primary-color); border: none; box-shadow: 0 0 14px rgba(0,174,239,.9); }
.hero-shapes .d1 { top: 30%; left: 30%; }
.hero-shapes .d2 { top: 50%; right: 28%; }
.hero-shapes .d3 { bottom: 26%; left: 42%; }

.hero-section .hero-content { z-index: 3; }

/* Léger flottement permanent des formes (en plus du parallax JS) */
.hero-shapes .shape, .hero-shapes .dot { animation: elxFloat 9s ease-in-out infinite; }
.hero-shapes .s2 { animation-delay: -2s; }
.hero-shapes .s3 { animation-delay: -4s; }
.hero-shapes .s5 { animation-delay: -1s; }
.hero-shapes .d2 { animation-delay: -3s; }
@keyframes elxFloat {
    0%,100% { translate: 0 0; }
    50%     { translate: 0 -16px; }
}

/* Titre dégradé animé (brillance qui balaye) */
.gradient-text {
    background: linear-gradient(100deg, #00aeef 0%, #8fe3ff 35%, #00aeef 60%, #5cc6ff 100%) !important;
    background-size: 250% auto !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: elxShine 6s linear infinite;
}
@keyframes elxShine { to { background-position: 250% center; } }

/* Stats du hero : carte verre + survol */
.hero-stats > div {
    background: rgba(255,255,255,.05);
    backdrop-filter: blur(6px);
    transition: transform .3s var(--elx-ease), border-color .3s, background .3s;
}
.hero-stats > div:hover {
    transform: translateY(-5px);
    border-color: rgba(0,174,239,.5);
    background: rgba(0,174,239,.10);
}
.hero-stat-val { font-variant-numeric: tabular-nums; }

/* Indicateur de scroll repensé */
.hero-scroll a { border-radius: 30px; height: 46px; }
.hero-scroll a::after {
    content: ''; position: absolute; inset: 0; border-radius: 30px;
    box-shadow: 0 0 0 0 rgba(0,174,239,.5);
    animation: elxPulse 2.4s ease-out infinite;
}
@keyframes elxPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,174,239,.45); }
    100% { box-shadow: 0 0 0 16px rgba(0,174,239,0); }
}

/* ============================================================
   4. BOUTONS — balayage lumineux + ressort
   ============================================================ */
.btn-hero-primary, .btn-cta-primary, .btn-service, .btn-portfolio, .btn-contact {
    position: relative;
    overflow: hidden;
}
.btn-hero-primary::before, .btn-cta-primary::before, .btn-service::before {
    content: '';
    position: absolute; top: 0; left: -120%;
    width: 70%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-18deg);
    transition: left .6s var(--elx-ease);
    pointer-events: none;
}
.btn-hero-primary:hover::before, .btn-cta-primary:hover::before, .btn-service:hover::before {
    left: 130%;
}
.btn-hero-primary:active, .btn-cta-primary:active { transform: translateY(-1px) scale(.98); }

/* Boutons « magnétiques » : transition douce pilotée par JS */
[data-magnetic] { transition: transform .25s var(--elx-ease-out); will-change: transform; }

/* ============================================================
   5. CARTES — bordure dégradée fine + élévation + tilt
   ============================================================ */
.service-card, .portfolio-card, .article-preview-card, .article-mini {
    position: relative;
    transition: transform .45s var(--elx-ease-out), box-shadow .45s, border-color .45s;
    will-change: transform;
}

/* Liseré dégradé qui s'illumine au survol */
.service-card::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: var(--elx-card-border);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .45s var(--elx-ease);
    pointer-events: none;
}
.service-card:hover::after { opacity: 1; }
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--elx-glow-strong);
}

/* Icône de service : halo + bascule au survol */
.service-icon {
    transition: transform .5s var(--elx-ease-out), box-shadow .4s;
}
.service-card:hover .service-icon {
    transform: translateY(-4px) rotate(-6deg) scale(1.06);
    box-shadow: 0 16px 36px -10px rgba(0,174,239,.6);
}

/* Portfolio : zoom image + voile */
.portfolio-card:hover { transform: translateY(-8px); box-shadow: var(--elx-glow-strong); }
.portfolio-image img { transition: transform .7s var(--elx-ease-out); }
.portfolio-card:hover .portfolio-image img { transform: scale(1.08); }

/* Cartes inclinables (effet 3D piloté par JS) */
[data-tilt] { transform-style: preserve-3d; }
[data-tilt] > * { transform: translateZ(0); }

/* Items « pourquoi nous » / features : glissement de l'icône */
.feature-item .feature-icon { transition: transform .4s var(--elx-ease-out), background .4s, color .4s; }
.feature-item:hover .feature-icon { transform: rotate(8deg) scale(1.08); }

/* ============================================================
   6. TITRES DE SECTION — accent animé
   ============================================================ */
.section-title { position: relative; }
.section-badge {
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 22px -8px rgba(0,174,239,.6);
}
.section-badge::after {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
    animation: elxBadge 4.5s ease-in-out infinite;
}
@keyframes elxBadge { 0%,60% { left: -100%; } 100% { left: 160%; } }

/* ============================================================
   7. RÉVÉLATION AU SCROLL (enrichit .reveal de style.css)
   ============================================================ */
.reveal {
    transition: opacity .7s var(--elx-ease-out), transform .7s var(--elx-ease-out), filter .7s;
    transform: translateY(34px);
    filter: blur(2px);
}
.reveal.visible { transform: none; filter: blur(0); }

/* Nouvelles variantes utilisables sur n'importe quel élément */
.elx-up,   .elx-left, .elx-right, .elx-zoom {
    opacity: 0; transition: opacity .8s var(--elx-ease-out), transform .8s var(--elx-ease-out);
    will-change: transform, opacity;
}
.elx-up    { transform: translateY(40px); }
.elx-left  { transform: translateX(-46px); }
.elx-right { transform: translateX(46px); }
.elx-zoom  { transform: scale(.9); }
.elx-up.visible, .elx-left.visible, .elx-right.visible, .elx-zoom.visible {
    opacity: 1; transform: none;
}

/* ============================================================
   8. BANDEAU CLIENTS — défilement infini (marquee)
   ============================================================ */
.trust-clients { overflow: hidden; }
.tc-marquee {
    position: relative;
    width: 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.tc-track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 3rem;
    animation: elxMarquee 32s linear infinite;
}
.tc-marquee:hover .tc-track { animation-play-state: paused; }
@keyframes elxMarquee { to { transform: translateX(-50%); } }
/* Quand le marquee est actif, on neutralise l'ancienne grille */
.tc-marquee .tc-grid { display: contents; }

/* ============================================================
   9. SECTIONS SOMBRES — atmosphère parallax douce
   ============================================================ */
.cta-section, .quick-contact, .blog-preview-section {
    position: relative;
    overflow: hidden;
}
.cta-section::after {
    content: '';
    position: absolute; width: 480px; height: 480px;
    right: -120px; top: -160px;
    background: radial-gradient(circle, rgba(0,174,239,.18), transparent 68%);
    pointer-events: none;
    will-change: transform;
}

/* ============================================================
   10. BOUTON RETOUR EN HAUT — anneau de progression
   ============================================================ */
.back-to-top {
    transition: transform .35s var(--elx-ease), opacity .35s, box-shadow .35s;
}
.back-to-top:hover { transform: translateY(-4px) scale(1.08); box-shadow: 0 14px 34px rgba(0,174,239,.5); }

/* ============================================================
   11. ENTRÉE DE PAGE — fondu général léger
   ============================================================ */
body { animation: elxPageIn .7s var(--elx-ease-out) both; }
@keyframes elxPageIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   12. RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .hero-section { min-height: 84vh; }
    .hero-grid { background-size: 42px 42px; }
    .hero-shapes .s1, .hero-shapes .s3 { display: none; }
}
@media (max-width: 575px) {
    .hero-shapes .shape { opacity: .6; }
    .tc-track { gap: 2rem; animation-duration: 24s; }
}

/* ============================================================
   13. ACCESSIBILITÉ — mouvement réduit
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .hero-aurora, .hero-grid, .tc-track, .gradient-text { animation: none !important; }
    .hero-shapes { display: none; }
    .reveal, .elx-up, .elx-left, .elx-right, .elx-zoom { opacity: 1 !important; transform: none !important; filter: none !important; }
    body { animation: none !important; }
}

/* Pause des animations du hero quand il sort de l'écran (perf refonte) */
.hero-section.elx-paused .hero-aurora,
.hero-section.elx-paused .hero-grid,
.hero-section.elx-paused .hero-shapes .shape,
.hero-section.elx-paused .hero-shapes .dot { animation-play-state: paused; }

/* ===== Logo agrandi (header desktop ~x2, plafonné à la résolution native 300x120) ===== */
.main-navbar .logo-image { height: 100px; }

/* Tablette / mobile : barre compacte -> logo raisonnable, footer & page-hero ajustés */
@media (max-width: 991.98px) {
    .main-navbar .logo-image,
    .main-navbar.scrolled .logo-image { height: 48px; }
    .logo-footer { height: 56px; }
    .page-hero { padding-top: 70px; }
}
