/* Custom styles for Rodgers Pest Control */

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

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(250, 249, 246, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
}

.nav-scrolled .nav-text {
    color: #0f2814 !important;
}

.nav-scrolled .nav-subtext {
    color: #3d7a47 !important;
}

.nav-scrolled .nav-link {
    color: #1c4625 !important;
}

.nav-scrolled .nav-link:hover {
    color: #3d7a47 !important;
}

/* Scroll reveal animations */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-reveal="hidden"] {
    opacity: 0;
    transform: translateY(32px);
}

/* Staggered children */
.reveal-grid > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-grid.visible > * {
    opacity: 1;
    transform: none;
}

.reveal-grid.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-grid.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-grid.visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-grid.visible > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-grid.visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-grid.visible > *:nth-child(6) { transition-delay: 0.3s; }

/* Mobile menu */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Hero text animation */
#hero h1 {
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(40px);
}

#hero p {
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(40px);
}

#hero .flex-col {
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
    opacity: 0;
    transform: translateY(40px);
}

#hero .inline-flex:first-child {
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
    transform: translateY(40px);
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .reveal[data-reveal="hidden"] {
        opacity: 1;
        transform: none;
    }
    .reveal-grid > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    #hero h1,
    #hero p,
    #hero .flex-col,
    #hero .inline-flex:first-child {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .animate-bounce {
        animation: none;
    }
}

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

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

/* Print styles */
@media print {
    nav, #contact-form, .animate-bounce {
        display: none !important;
    }
    body {
        color: #000 !important;
        background: #fff !important;
    }
}
