/* ==========================================
   MAISON D'OMBRE - ENHANCEMENTS 2025
   10 Premium Features
   ========================================== */

/* ==========================================
   1. INFINITE MARQUEE - LUXURY 2025
   ========================================== */
.marquee-container {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.marquee-content {
    display: flex;
    gap: 4rem;
    padding: 0 2rem;
}

.marquee-container .client-logo {
    min-width: 180px;
    padding: 1.5rem 2rem;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.marquee-container .client-logo:hover {
    background: rgba(255,255,255,0.95);
    transform: scale(1.05);
    box-shadow: 0 20px 40px -15px rgba(155, 77, 43, 0.2);
}

.marquee-container .client-logo .client-location {
    display: none;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-track[data-direction="right"] {
    animation-direction: reverse;
}

/* ==========================================
   2. SCROLL PROGRESS BAR
   ========================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #9B4D2B, #D4A574, #9B4D2B);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
    z-index: 10000;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #9B4D2B, 0 0 20px rgba(155, 77, 43, 0.3);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================
   3. PRELOADER CINEMATIQUE
   ========================================== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #111111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #FFFFFF;
    opacity: 0;
    transform: translateY(30px);
    animation: preloader-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.preloader-logo .accent {
    color: #9B4D2B;
    font-style: italic;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    margin-top: 2rem;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: preloader-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.preloader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #9B4D2B, #D4A574);
    border-radius: 2px;
    animation: preloader-fill 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
}

.preloader-text {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-top: 1.5rem;
    opacity: 0;
    animation: preloader-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

@keyframes preloader-reveal {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes preloader-fill {
    to { width: 100%; }
}

/* ==========================================
   4. LIQUID GLASS BUTTONS (Apple Style)
   ========================================== */
.hero-cta .btn-primary {
    background: #9B4D2B !important;
    color: #FFFFFF !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px !important;
    border: 1px solid rgba(155, 77, 43, 0.3) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(155, 77, 43, 0.3);
}

.hero-cta .btn-primary:hover {
    background: #7a3d22 !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(155, 77, 43, 0.4);
}

.hero-cta .btn-primary span,
.hero-cta .btn-primary svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.hero-cta .btn-primary::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.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta .btn-primary:hover::before {
    left: 100%;
}

.hero-cta .btn-secondary {
    background: rgba(0, 0, 0, 0.6) !important;
    color: #FFFFFF !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-2px);
}

.nav-cta {
    border-radius: 50px !important;
}

.filter-btn {
    border-radius: 50px !important;
}

/* ==========================================
   5. TEXT MASK REVEAL
   ========================================== */
.clip-reveal {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clip-reveal.revealed {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.word-reveal .word {
    display: inline-block;
    overflow: hidden;
}

.word-reveal .word-inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-reveal.revealed .word-inner {
    transform: translateY(0);
}

/* ==========================================
   6. FLOATING ELEMENTS
   ========================================== */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    filter: blur(100px);
    animation: float-physics 30s ease-in-out infinite;
    /* will-change retiré : éléments multiples + blur 100px = budget compositing énorme */
}

.floating-shape:nth-child(1) {
    width: 600px;
    height: 600px;
    background: #9B4D2B;
    top: 0%;
    left: 0%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 500px;
    height: 500px;
    background: #D4A574;
    top: 40%;
    right: 0%;
    animation-delay: -10s;
}

.floating-shape:nth-child(3) {
    width: 450px;
    height: 450px;
    background: #4A5568;
    bottom: 0%;
    left: 20%;
    animation-delay: -20s;
}

@keyframes float-physics {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(50px, -80px) rotate(90deg) scale(1.15); }
    50% { transform: translate(-40px, 60px) rotate(180deg) scale(0.9); }
    75% { transform: translate(60px, 40px) rotate(270deg) scale(1.1); }
}

/* ==========================================
   7. MICRO-INTERACTIONS FORMULAIRE
   ========================================== */
.form-group input,
.form-group textarea,
.form-group select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    box-shadow: 0 0 0 3px rgba(155, 77, 43, 0.1), 0 4px 20px rgba(155, 77, 43, 0.1);
    transform: translateY(-2px);
}

.form-group label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label {
    color: #9B4D2B;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #9B4D2B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form success state */
.form-group.success input,
.form-group.success textarea {
    border-color: #10B981 !important;
}

.form-group.success::after {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #10B981;
    font-size: 1.2rem;
    animation: check-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes check-pop {
    0% { transform: translateY(-50%) scale(0); }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(1); }
}

/* ==========================================
   8. VIDEO HERO BACKGROUND
   ========================================== */
.hero-video {
    position: absolute;
    inset: -15%;
    z-index: 1;
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: blur(0.3px) saturate(1.15) contrast(1.08) brightness(1.02);
}

/* ==========================================
   9. PAGE TRANSITIONS
   ========================================== */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 99998;
    pointer-events: none;
}

.page-transition-layer {
    position: absolute;
    inset: 0;
    background: #111111;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active .page-transition-layer {
    transform: scaleY(1);
    transform-origin: top;
}

/* ==========================================
   10. DARK MODE
   ========================================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 9997;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FDFBF7;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}

.dark-mode-toggle svg {
    width: 22px;
    height: 22px;
    color: #1A1A1A;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode-toggle .sun-icon { display: none; }
.dark-mode-toggle .moon-icon { display: block; }

/* Dark Mode Variables */
[data-theme="dark"] {
    --color-bg: #0F0F0F;
    --color-bg-alt: #1A1A1A;
    --color-text: #F5F5F5;
    --color-text-light: #A3A3A3;
}

[data-theme="dark"] body {
    background: #0F0F0F;
    color: #F5F5F5;
}

[data-theme="dark"] .dark-mode-toggle {
    background: #1A1A1A;
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .dark-mode-toggle svg {
    color: #F5F5F5;
}

[data-theme="dark"] .dark-mode-toggle .sun-icon { display: block; }
[data-theme="dark"] .dark-mode-toggle .moon-icon { display: none; }

[data-theme="dark"] .nav.scrolled {
    background: rgba(15, 15, 15, 0.98);
}

/* Nav CTA "Contact" lisible en dark mode (sinon devient blanc-sur-blanc) */
[data-theme="dark"] .nav-cta {
    background: var(--color-accent) !important;
    color: #fff !important;
}
[data-theme="dark"] .nav-cta:hover {
    background: #7D3D22 !important;
}

[data-theme="dark"] .expertise,
[data-theme="dark"] .realisations,
[data-theme="dark"] .processus,
[data-theme="dark"] .testimonials {
    background: #0F0F0F;
}

[data-theme="dark"] .expertise-card,
[data-theme="dark"] .testimonial-card {
    background: #1A1A1A;
}

[data-theme="dark"] .contact-form {
    background: #1A1A1A;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0F0F0F;
    border-color: rgba(255,255,255,0.1);
    color: #F5F5F5;
}

[data-theme="dark"] .filter-btn {
    border-color: rgba(255,255,255,0.15);
    color: #A3A3A3;
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    background: #9B4D2B;
    border-color: #9B4D2B;
    color: #FFFFFF;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .expertise-content h3,
[data-theme="dark"] .step-content h3 {
    color: #F5F5F5;
}

[data-theme="dark"] .section-subtitle,
[data-theme="dark"] .expertise-content p,
[data-theme="dark"] .step-content p {
    color: #A3A3A3;
}

[data-theme="dark"] .clients-section {
    background: linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 50%, #0F0F0F 100%);
}

[data-theme="dark"] .client-logo {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .client-logo:hover {
    background: rgba(255,255,255,0.08);
}

/* ==========================================
   RESPONSIVE FOR NEW FEATURES
   ========================================== */
@media (max-width: 768px) {
    .scroll-progress { height: 2px; }
    .preloader-logo { font-size: 1.5rem; }
    .dark-mode-toggle {
        width: 44px;
        height: 44px;
        bottom: 1.5rem;
        left: 1.5rem;
    }
    .floating-shape { display: none; }
    .marquee-container .client-logo {
        min-width: 150px;
        padding: 1rem 1.5rem;
    }
    .marquee-content { gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track,
    .floating-shape {
        animation: none;
    }
    .preloader {
        display: none;
    }
}

/* ==========================================
   11. GRAIN TEXTURE OVERLAY (Film Grain)
   ========================================== */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    mix-blend-mode: overlay;
}

[data-theme="dark"] .grain-overlay {
    opacity: 0.05;
    mix-blend-mode: soft-light;
}

/* ==========================================
   12. SPLIT TEXT ANIMATION
   ========================================== */
.split-text {
    overflow: hidden;
}

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    transform-origin: top;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-text.revealed .char {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

/* Stagger delay via CSS custom property */
.split-text .char { transition-delay: calc(var(--char-index) * 0.03s); }

/* ==========================================
   13. MORPHING BLOB BACKGROUND
   ========================================== */
.morphing-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(155, 77, 43, 0.15), rgba(212, 165, 116, 0.1));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    filter: blur(60px);
    animation: blob-morph 20s ease-in-out infinite;
    /* will-change retiré : blob blur 60px multi-instances dépassait budget */
}

.morphing-blob:nth-child(2) {
    animation-delay: -7s;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.12), rgba(74, 85, 104, 0.08));
}

.morphing-blob:nth-child(3) {
    animation-delay: -14s;
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.1), rgba(155, 77, 43, 0.08));
}

@keyframes blob-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(50px, -30px) rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: translate(-30px, 50px) rotate(180deg) scale(0.95);
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
        transform: translate(40px, 30px) rotate(270deg) scale(1.05);
    }
}

/* ==========================================
   14. IMAGE REVEAL MASKS (Clip-path)
   ========================================== */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal img {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.revealed img {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Diagonal reveal variant */
.image-reveal.diagonal img {
    clip-path: polygon(0 100%, 0 100%, 0 100%, 0 100%);
}

.image-reveal.diagonal.revealed img {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Circle reveal variant */
.image-reveal.circle img {
    clip-path: circle(0% at 50% 50%);
}

.image-reveal.circle.revealed img {
    clip-path: circle(75% at 50% 50%);
}

/* ==========================================
   15. STAGGERED 3D CARD REVEALS
   ========================================== */
.card-3d-reveal {
    perspective: 1000px;
}

.card-3d-reveal .card-inner {
    opacity: 0;
    transform: rotateY(-15deg) rotateX(10deg) translateZ(-50px);
    transform-style: preserve-3d;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--card-index) * 0.1s);
}

.card-3d-reveal.revealed .card-inner {
    opacity: 1;
    transform: rotateY(0) rotateX(0) translateZ(0);
}

/* Hover lift effect */
.card-3d-reveal .card-inner:hover {
    transform: translateY(-10px) translateZ(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   16. SMOOTH GRADIENT TRANSITIONS
   ========================================== */
.gradient-shift {
    background-size: 200% 200%;
    animation: gradient-flow 8s ease infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   17. GLOW EFFECTS
   ========================================== */
.glow-accent {
    box-shadow: 0 0 20px rgba(155, 77, 43, 0.3),
                0 0 40px rgba(155, 77, 43, 0.2),
                0 0 60px rgba(155, 77, 43, 0.1);
}

.glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(155, 77, 43, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(155, 77, 43, 0.5),
                    0 0 60px rgba(155, 77, 43, 0.3);
    }
}

/* ==========================================
   18. MAGNETIC HOVER ZONES
   ========================================== */
.magnetic-zone {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   19. PREMIUM SECTION DIVIDERS
   ========================================== */
.section-divider {
    position: relative;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(155, 77, 43, 0.3) 20%,
        rgba(155, 77, 43, 0.5) 50%,
        rgba(155, 77, 43, 0.3) 80%,
        transparent 100%
    );
    margin: var(--space-xl) 0;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(155, 77, 43, 0.5);
}

/* ==========================================
   20. LUXURY UNDERLINE ANIMATION
   ========================================== */
.luxury-underline {
    position: relative;
    display: inline-block;
}

.luxury-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), #D4A574);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.luxury-underline:hover::after,
.luxury-underline.active::after {
    width: 100%;
}

/* ==========================================
   21. PHONE PROTECTION (Anti-scraper)
   ========================================== */
.phone-protected {
    color: #9B4D2B;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    background: rgba(155, 77, 43, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
    user-select: none;
}

.phone-protected:hover {
    background: rgba(155, 77, 43, 0.2);
}

/* ==========================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* GPU Acceleration for smooth transforms */
.hero-cta .btn,
.nav,
.card-3d-reveal .card-inner,
.image-reveal img,
.split-text .char,
.marquee-track {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Contain layout for performance */
.section,
.expertise-card,
.testimonial-card,
.gallery-item {
    contain: layout style;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* === DISABLE HEAVY EFFECTS === */

    /* Disable grain overlay (very expensive on mobile GPU) */
    .grain-overlay {
        display: none !important;
    }

    /* Disable morphing blobs */
    .morphing-blob,
    .morphing-blobs {
        display: none !important;
    }

    /* Remove backdrop-filter (expensive) */
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary,
    .marquee-container .client-logo {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    /* Simplify scroll progress animation */
    .scroll-progress {
        animation: none;
        background: #9B4D2B;
    }

    /* === SIMPLIFY 3D ANIMATIONS === */
    .card-3d-reveal {
        perspective: none;
    }

    .card-3d-reveal .card-inner {
        transform: translateY(20px) !important;
        transition-duration: 0.5s;
    }

    .card-3d-reveal.revealed .card-inner {
        transform: translateY(0) !important;
    }

    .card-3d-reveal .card-inner:hover {
        transform: translateY(-5px) !important;
    }

    /* Simplify split text animation */
    .split-text .char {
        transform: translateY(30px) !important;
        transition-duration: 0.4s;
    }

    .split-text.revealed .char {
        transform: translateY(0) !important;
    }

    /* Faster marquee on mobile */
    .marquee-track {
        animation-duration: 25s;
    }

    /* Disable hover transforms on touch */
    .expertise-card:hover,
    .testimonial-card:hover,
    .gallery-item:hover {
        transform: none !important;
    }

    /* Simplify clip-path animations */
    .image-reveal img,
    .clip-reveal {
        transition-duration: 0.8s;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Reduce blob complexity */
    .morphing-blob {
        width: 400px;
        height: 400px;
        filter: blur(80px);
        animation-duration: 30s;
    }

    /* Simpler floating elements */
    .floating-shape {
        animation-duration: 40s;
        filter: blur(120px);
    }

    /* Lighter grain on tablet */
    .grain-overlay {
        opacity: 0.02;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .hero-cta .btn-primary:hover,
    .hero-cta .btn-secondary:hover {
        transform: none !important;
    }

    /* Disable magnetic zones */
    .magnetic-zone {
        transition: none !important;
    }

    /* Disable glow pulse (battery drain) */
    .glow-pulse {
        animation: none !important;
    }

    /* Disable parallax on touch */
    .floating-elements {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .morphing-blob,
    .marquee-track,
    .floating-shape,
    .glow-pulse {
        animation: none !important;
    }

    .split-text .char,
    .card-3d-reveal .card-inner,
    .image-reveal img,
    .clip-reveal {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) !important;
    }

    .preloader {
        display: none !important;
    }
}

/* ==========================================
   A11Y - FOCUS VISIBLE & SKIP LINK
   ========================================== */
:focus-visible {
    outline: 2px solid var(--color-accent, #9B4D2B);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--color-accent, #9B4D2B);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 999999;
    font-weight: 600;
    border-radius: 6px;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 1rem;
}

/* Custom cursor hidden on touch devices already; ensure no issues */
@media (hover: none) {
    .custom-cursor { display: none !important; }
    * { cursor: auto !important; }
}

/* ==========================================
   GALLERY - LOADING STATE
   ========================================== */
.gallery-grid:empty::before,
.gallery-grid:has(p)::before {
    content: '';
}

.gallery-item img,
.gallery-item picture img {
    transition: opacity 0.3s ease;
}

/* ==========================================
   CONTACT FORM - STATUS MESSAGES
   ========================================== */
.contact-status {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    border-left: 4px solid;
    animation: contactStatusIn 0.4s ease;
}
.contact-status.success {
    background: rgba(5, 150, 105, 0.08);
    color: #047857;
    border-left-color: #059669;
}
.contact-status.error {
    background: rgba(220, 38, 38, 0.08);
    color: #B91C1C;
    border-left-color: #DC2626;
}
@keyframes contactStatusIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .contact-status.success {
    background: rgba(5, 150, 105, 0.15);
    color: #6EE7B7;
}
[data-theme="dark"] .contact-status.error {
    background: rgba(220, 38, 38, 0.15);
    color: #FCA5A5;
}

/* ==========================================================================
   ✦ MOBILE CINEMATIC LAYER 2026 ✦
   Le desktop s'appuie sur la souris (curseur magnétique, tilt, parallax-souris).
   Sur smartphone, on recrée le "wow" avec : mouvement ambiant GPU-friendly,
   menu plein écran chorégraphié, barre d'action collante, feedback tactile.
   Tout est transform/opacity-only (compositor) → 60fps, zéro reflow.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. BARRE D'ACTION COLLANTE (Appeler · WhatsApp · Devis) — ≤768px
   --------------------------------------------------------------------------- */
.mobile-action-bar { display: none; }

@media (max-width: 768px) {
    .mobile-action-bar {
        display: grid;
        grid-template-columns: 1fr 1fr 1.45fr;
        gap: 0.4rem;
        position: fixed;
        left: 0.6rem;
        right: 0.6rem;
        bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
        z-index: 9997;
        padding: 0.45rem;
        border-radius: 22px;
        background: rgba(22, 17, 14, 0.72);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
        backdrop-filter: blur(20px) saturate(150%);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.38),
            inset 0 1px 0 rgba(255, 255, 255, 0.10);
        transform: translateY(160%);
        transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mobile-action-bar.visible { transform: translateY(0); }

    /* Le bouton WhatsApp flottant est remplacé par la barre sur mobile */
    .whatsapp-float { display: none !important; }

    /* Marge pour que la barre ne masque pas le bas du footer */
    .footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

    .mab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        min-height: 52px;
        padding: 0.45rem 0.3rem;
        border-radius: 16px;
        color: rgba(255, 255, 255, 0.92);
        font-family: var(--font-body);
        font-weight: 600;
        text-decoration: none;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.25s var(--ease), background 0.3s var(--ease);
    }
    .mab-item .mab-icon { display: flex; }
    .mab-item svg { width: 21px; height: 21px; }
    .mab-item .mab-label { font-size: 0.68rem; letter-spacing: 0.02em; }

    .mab-whatsapp { color: #2BE07A; }
    .mab-cta {
        background: linear-gradient(135deg, var(--color-accent) 0%, #C56A3E 100%);
        color: #fff;
        box-shadow: 0 4px 16px rgba(155, 77, 43, 0.45);
    }
    .mab-cta .mab-label { font-weight: 700; }
    .mab-item:active { transform: scale(0.9); }

    /* On masque la barre quand le menu plein écran est ouvert ou clavier actif */
    body.menu-open .mobile-action-bar,
    body.kb-open .mobile-action-bar { transform: translateY(160%); }
}

/* ---------------------------------------------------------------------------
   2. MENU MOBILE CHORÉGRAPHIÉ — overlay glass + reveal en cascade
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .nav-links {
        gap: 1.75rem !important;
        background: rgba(253, 251, 247, 0.94) !important;
        -webkit-backdrop-filter: blur(26px) saturate(150%);
        backdrop-filter: blur(26px) saturate(150%);
    }
    [data-theme="dark"] .nav-links {
        background: rgba(12, 12, 12, 0.88) !important;
    }

    /* Halo terracotta vivant en fond de menu */
    .nav-links.active::before {
        content: '';
        position: absolute;
        inset: 0;
        background:
            radial-gradient(circle at 25% 20%, rgba(155, 77, 43, 0.22) 0%, transparent 45%),
            radial-gradient(circle at 80% 85%, rgba(212, 165, 116, 0.20) 0%, transparent 45%);
        animation: auroraFlow 18s ease-in-out infinite;
        pointer-events: none;
        z-index: -1;
    }

    .nav-links.active { opacity: 1; animation: navOverlayIn 0.45s var(--ease-out) forwards; }

    .nav-links li {
        opacity: 0;
        transform: translateY(28px);
    }
    .nav-links.active li {
        animation: navItemIn 0.6s var(--ease-out) forwards;
    }
    .nav-links.active li:nth-child(1) { animation-delay: 0.12s; }
    .nav-links.active li:nth-child(2) { animation-delay: 0.19s; }
    .nav-links.active li:nth-child(3) { animation-delay: 0.26s; }
    .nav-links.active li:nth-child(4) { animation-delay: 0.33s; }
    .nav-links.active li:nth-child(5) { animation-delay: 0.40s; }

    /* Soulignement animé sous chaque lien au tap */
    .nav-links a:not(.nav-cta)::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: 0.15rem;
        width: 0;
        height: 2px;
        background: var(--color-accent);
        transform: translateX(-50%);
        transition: width 0.3s var(--ease-out);
    }
    .nav-links a:not(.nav-cta):active::after { width: 60%; }
}

@keyframes navOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes navItemIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------------
   3. MOUVEMENT AMBIANT DU HERO SUR MOBILE
   On réactive les .floating-shape (coupées sur tactile) en orbes lumineuses
   plus petites et plus lisibles, dérive transform-only (rasterisé une fois).
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero .floating-elements { display: block; z-index: 1; }

    .hero .floating-shape {
        opacity: 0.20;
        filter: blur(42px);
        /* pas de mix-blend-mode : le blend forçait un recompositing par frame.
           Le blur est rasterisé UNE fois, seul le transform bouge → 60fps. */
        animation: orb-drift 26s ease-in-out infinite;
    }
    .hero .floating-shape:nth-child(1) {
        width: 300px; height: 300px;
        top: -8%; left: -18%;
        animation-duration: 26s;
    }
    .hero .floating-shape:nth-child(2) {
        width: 260px; height: 260px;
        top: 32%; right: -22%; left: auto;
        animation-duration: 30s; animation-delay: -8s;
    }
    .hero .floating-shape:nth-child(3) {
        width: 220px; height: 220px;
        bottom: 6%; left: 8%; top: auto;
        animation-duration: 22s; animation-delay: -14s;
    }
}

@keyframes orb-drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(8vw, -6vh, 0) scale(1.18); }
    66%      { transform: translate3d(-6vw, 5vh, 0) scale(0.9); }
}

/* Indicateur de scroll : on garde le mouvement vivant sur mobile */
@media (max-width: 768px) {
    .scroll-indicator { opacity: 0.75; }
}

/* ---------------------------------------------------------------------------
   4. FEEDBACK TACTILE — états :active + ripple (le hover n'existe pas au doigt)
   --------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    .btn { transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease); }
    .btn:active { transform: scale(0.96); }

    .expertise-card:active,
    .feature-card:active,
    .gallery-item:active,
    .testimonial-card:active,
    .map-card:active { transform: scale(0.985); transition: transform 0.2s var(--ease); }

    .filter-btn { transition: transform 0.2s var(--ease), background 0.3s var(--ease); }
    .filter-btn:active { transform: scale(0.93); }

    .process-step:active .step-number { transform: scale(1.08); }
    .footer-social a:active,
    .contact-icon:active { transform: scale(0.9); }
}

/* Ripple injecté en JS (contenu dans des éléments en overflow:hidden) */
.tap-ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.28;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    animation: tapRipple 0.6s ease-out forwards;
}
@keyframes tapRipple {
    to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ---------------------------------------------------------------------------
   5. REVEALS AU SCROLL — utilitaire piloté par IntersectionObserver (mobile)
   --------------------------------------------------------------------------- */
.mob-reveal {
    opacity: 0;
    transform: translateY(34px);
    transition:
        opacity 0.7s var(--ease-out),
        transform 0.7s var(--ease-out);
    /* pas de will-change permanent : opacity/transform sont déjà compositées */
}
.mob-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}
.mob-reveal.delay-1 { transition-delay: 0.08s; }
.mob-reveal.delay-2 { transition-delay: 0.16s; }
.mob-reveal.delay-3 { transition-delay: 0.24s; }

/* ---------------------------------------------------------------------------
   6. GARDE-FOUS — reduced-motion neutralise tout le mouvement ambiant
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero .floating-shape { animation: none !important; }
    .mobile-action-bar { transition: none !important; transform: translateY(0) !important; }
    .nav-links.active li { animation: none !important; opacity: 1 !important; transform: none !important; }
    .nav-links.active::before { animation: none !important; }
    .tap-ripple { display: none !important; }
    .mob-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Titres de sections — reveal mot par mot piloté par .in-view (IntersectionObserver) */
.section-title .tw {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.5em);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.section-title.in-view .tw {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .section-title .tw { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ==========================================================================
   ✦ VOILE D'OMBRAGE 3D (WebGL) — effet signature, dimensionnée au viewport
   ========================================================================== */
.hero-sail {
    position: absolute;
    inset: 0;              /* couvre EXACTEMENT le .hero-bg sur-dimensionné (comme l'image) */
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    display: block;
    opacity: 0;
    transition: opacity 1.6s var(--ease-out);
    z-index: 0;            /* sous l'overlay (z-index: 2), au-dessus de l'image */
    pointer-events: none;
}
.hero-sail.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-sail { display: none !important; } }

/* ==========================================================================
   ✦ HERO VIDEO (ambiance) — image en fallback dessous, fade-in au canplay
   ========================================================================== */
.hero-video {
    position: absolute;
    inset: 0;              /* couvre EXACTEMENT le .hero-bg sur-dimensionné, comme l'image
                              → aucune bande où l'image transparaît (fix seam mobile/URL-bar) */
    width: 100%;
    height: 100%;
    transform: translateZ(0);  /* couche GPU dédiée */
    backface-visibility: hidden;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1.2s var(--ease-out);
    z-index: 0;            /* au-dessus de l'image (.hero-bg-img), sous l'overlay */
    pointer-events: none;
}
.hero-video.is-playing { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none !important; }   /* jamais de vidéo si reduced-motion */
}

/* ==========================================================================
   ✦ LIQUID GLASS RAFFINÉ — arête lumineuse dégradée (technique ::after masquée)
   UNIQUEMENT sur les surfaces SANS pseudo-élément existant, pour éviter
   d'écraser le glow des .feature-card (qui ont déjà ::before + ::after).
   Pseudo STATIQUE = coût nul au scroll.
   ========================================================================== */
/* NB : on NE repositionne PAS .mobile-action-bar (déjà fixed) ni .map-card
   (déjà absolute en desktop / relative en mobile) — sinon ils perdent leur
   ancrage. Seul .contact-form est static par défaut → il a besoin de relative
   pour ancrer son arête ::after. fixed/absolute = déjà positionnés, l'arête marche. */
.contact-form {
    position: relative;
}
.mobile-action-bar::after,
.map-card::after,
.contact-form::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.16) 22%,
        rgba(255, 255, 255, 0) 42%,
        rgba(255, 255, 255, 0) 58%,
        rgba(255, 255, 255, 0.16) 78%,
        rgba(255, 255, 255, 0.50) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}
/* Le contenu reste au-dessus de l'arête */
.mobile-action-bar > *,
.map-card > *,
.contact-form > * { position: relative; z-index: 2; }

/* ==========================================
   PRINT STYLES (basic, for users who print quote)
   ========================================== */
@media print {
    .nav, .preloader, .scroll-progress, .custom-cursor,
    .whatsapp-float, .mobile-action-bar, .dark-mode-toggle, .scroll-indicator,
    .page-transition, .floating-elements {
        display: none !important;
    }
    body { background: #fff !important; color: #000 !important; }
    .hero { min-height: auto !important; padding: 2rem !important; }
}

