/* Custom styles for Forestal Roofing & Siding */

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

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Scroll reveal animations — progressive enhancement via JS */
.js .reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

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

    .reveal.delay-1 { transition-delay: 0.1s; }
    .reveal.delay-2 { transition-delay: 0.2s; }
    .reveal.delay-3 { transition-delay: 0.3s; }
    .reveal.delay-4 { transition-delay: 0.4s; }
}

/* Navbar scroll state */
#navbar.scrolled {
    background-color: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mobile menu transitions */
#mobile-menu {
    animation: slideDown 0.2s ease-out;
}

#mobile-menu.hidden {
    display: none;
}

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

/* Active nav link */
.nav-link-active {
    color: #1a5c33;
    position: relative;
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #1a5c33;
    border-radius: 1px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #faf6ed;
}

::-webkit-scrollbar-thumb {
    background: #95d5aa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5fbc7e;
}

/* Selection color */
::selection {
    background-color: #c3eacf;
    color: #1a5c33;
}

/* Input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid #1a5c33;
    outline-offset: 2px;
}
