/* Custom styles for Rudnick Fence Co. */

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

/* Selection color */
::selection {
    background-color: #3f6330;
    color: #FAFAF6;
}

/* Hero animations */
.hero-reveal {
    opacity: 0;
    transform: translateY(24px);
    animation: heroReveal 0.7s ease forwards;
}

.hero-reveal:nth-child(1) { animation-delay: 0.1s; }
.hero-reveal:nth-child(2) { animation-delay: 0.2s; }
.hero-reveal:nth-child(3) { animation-delay: 0.3s; }
.hero-reveal:nth-child(4) { animation-delay: 0.4s; }
.hero-reveal:nth-child(5) { animation-delay: 0.5s; }
.hero-reveal:nth-child(6) { animation-delay: 0.6s; }
.hero-reveal:nth-child(7) { animation-delay: 0.7s; }

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

/* Floating cards animation */
.hero-float-card {
    animation: floatCard 6s ease-in-out infinite;
}

.hero-float-card:nth-child(2) {
    animation-delay: -2s;
}

.hero-float-card:nth-child(3) {
    animation-delay: -4s;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* Service cards */
.service-card {
    transition: background-color 0.5s ease, transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

/* Gallery items */
.gallery-item {
    cursor: pointer;
}

/* Navbar scroll state */
nav.scrolled {
    background-color: rgba(250, 250, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(63, 99, 48, 0.1);
}

nav.scrolled .menu-line {
    background-color: #3f6330;
}

/* Mobile menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.close {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Menu toggle animation */
.menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(2px, 2px);
}

.menu-toggle.active .menu-line:nth-child(2) {
    transform: rotate(-45deg) translate(2px, -2px);
}

/* Scroll-triggered animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Subtle line animations */
.fade-in-line {
    width: 0;
    height: 1px;
    background-color: #c7dabb;
    transition: width 0.8s ease;
}

.fade-in-line.visible {
    width: 100%;
}

/* Custom 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='%239fbc8f' stroke-width='1.5'%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;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Focus visible styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #3f6330;
    outline-offset: 2px;
}

/* Reduced motion */
@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;
    }
    
    .hero-reveal {
        opacity: 1;
        transform: none;
    }
    
    .hero-float-card {
        animation: none;
    }
}
