/* Effet d'apparition au défilement */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================ */
/* ANIMATION ROULEAU DE PEINTURE HERO          */
/* ============================================ */

.paint-reveal-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Application du masque SVG avec suppression à la fin */
.paint-masked {
    -webkit-mask: url(#paint-mask);
    mask: url(#paint-mask);
    animation: removeMask 2.81s forwards;
}

/* SVG masque positionné par-dessus */
.paint-roller-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* État initial des 3 bandes */
.paint-stripe {
    height: 0;
}

/* Icône du rouleau de peinture */
.roller-tool {
    position: absolute;
    top: -60px;
    left: 0;
    font-size: 2.5rem;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transform: rotate(-45deg);
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.4));
}

/* --- Keyframe unique pour le rouleau --- */
@keyframes rollerFullSequence {
    /* 1er coup : Gauche (Haut -> Bas) */
    0% { top: -60px; left: 8%; opacity: 1; }
    30% { top: 90%; left: 8%; opacity: 1; }
    33% { top: 90%; left: 8%; opacity: 0; }

    /* Replacement pour 2e coup */
    34% { top: 90%; left: 42%; opacity: 0; }
    35% { opacity: 1; }

    /* 2e coup : Milieu (Bas -> Haut) */
    65% { top: -40px; left: 42%; opacity: 1; }
    68% { top: -40px; left: 42%; opacity: 0; }

    /* Replacement pour 3e coup */
    69% { top: -40px; left: 78%; opacity: 0; }
    70% { opacity: 1; }

    /* 3e coup : Droite (Haut -> Bas) */
    98% { top: 90%; left: 78%; opacity: 1; }
    100% { top: 90%; left: 78%; opacity: 0; }
}

/* --- Keyframes apparition des bandes SVG --- */
@keyframes revealStripe1 {
    0% { height: 0; }
    30%, 100% { height: 500px; }
}

@keyframes revealStripe2 {
    0%, 33% { height: 0; y: 500px; }
    65%, 100% { height: 500px; y: 0px; }
}

@keyframes revealStripe3 {
    0%, 68% { height: 0; }
    98%, 100% { height: 500px; }
}

/* --- Retrait automatique du masque à la fin --- */
@keyframes removeMask {
    0%, 99% {
        -webkit-mask: url(#paint-mask);
        mask: url(#paint-mask);
    }
    100% {
        -webkit-mask: none;
        mask: none;
    }
}

/* Déclenchement des animations */
.paint-reveal-container .stripe-1 {
    animation: revealStripe1 2.8s forwards ease-in-out;
}
.paint-reveal-container .stripe-2 {
    animation: revealStripe2 2.8s forwards ease-in-out;
}
.paint-reveal-container .stripe-3 {
    animation: revealStripe3 2.8s forwards ease-in-out;
}

.paint-reveal-container .roller-tool {
    animation: rollerFullSequence 2.8s forwards ease-in-out;
}

/* ================================================= */
/* Effet Glow & lueur dorée au survol des cartes     */
/* ================================================= */

.card-service, 
.card-review, 
.slide-item, 
.info-block,
.devis-box {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-service:hover, 
.card-review:hover, 
.slide-item:hover, 
.info-block:hover,
.devis-box:hover {
    transform: translateY(-4px);
    border-color: #d4af37;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 42px;
    height: 70px;
    background-color: #1a1a1a;
    border: 2px solid #d4af37;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    border-color: #ffffff;
}

/* Style de l'échelle d'échafaudage */
.scaffolding-ladder {
    position: relative;
    width: 24px;
    height: 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Les montants verticaux de l'échelle (tubes galvanisés) */
.scaffolding-ladder::before,
.scaffolding-ladder::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to right, #95a5a6, #ecf0f1, #7f8c8d);
    border-radius: 2px;
}
.scaffolding-ladder::before { left: 2px; }
.scaffolding-ladder::after { right: 2px; }

/* Les barres horizontales (échelons) */
.ladder-rung {
    width: 100%;
    height: 3px;
    background: linear-gradient(to bottom, #bdc3c7, #7f8c8d);
    border-radius: 1px;
    z-index: 2;
}

.back-to-top i {
    color: #d4af37;
    transition: color 0.3s ease;
}

.back-to-top:hover i {
    color: #ffffff;
}