/* Custom styles for Casper & Sons Contracting */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #080b0a;
}
::-webkit-scrollbar-thumb {
    background: #1a6b1a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2d8a2d;
}

/* Hero animations - only below the fold for progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .hero-badge {
        animation: fadeInDown 0.8s ease-out forwards;
    }
    .hero-title {
        animation: fadeInUp 0.8s ease-out 0.2s forwards;
        opacity: 0;
    }
    .hero-subtitle {
        animation: fadeInUp 0.8s ease-out 0.4s forwards;
        opacity: 0;
    }
    .hero-ctas {
        animation: fadeInUp 0.8s ease-out 0.6s forwards;
        opacity: 0;
    }
    .hero-trust {
        animation: fadeInUp 0.8s ease-out 0.8s forwards;
        opacity: 0;
    }
    .hero-scroll {
        animation: fadeInUp 0.8s ease-out 1s forwards;
        opacity: 0;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll reveal - progressive enhancement only */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Service card stagger */
.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* Mobile menu */
.menu-line {
    display: block;
}

#mobileMenu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
#mobileMenu.open .menu-line:nth-child(2) {
    opacity: 0;
}
#mobileMenu.open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 24px;
}

/* Mobile link hover */
.mobile-link {
    position: relative;
}
.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #c9984a;
    transition: width 0.3s ease;
}
.mobile-link:hover::after {
    width: 100%;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(4, 5, 4, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 152, 74, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Gallery image hover */
.group img {
    will-change: transform;
}

/* Form select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9984a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* Selection color */
::selection {
    background: rgba(45, 138, 45, 0.3);
    color: #faf8f5;
}
