/* Custom styles for Sparks Small Engine Repairs */

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

/* Base typography */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf8ec;
}
::-webkit-scrollbar-thumb {
    background: #d4a06a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b85635;
}

/* Selection color */
::selection {
    background: #b85635;
    color: #fefdf8;
}

/* Nav transition states */
nav.scrolled {
    background: rgba(26, 20, 16, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

nav.scrolled .nav-logo-text {
    color: #fefdf8;
}

/* Reveal animations - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .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; }
}

/* Ensure content is visible without JS */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* Hero decorative animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Button focus styles */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #b85635;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 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='%239a452c' 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;
    padding-right: 2.5rem;
}

/* Card hover shimmer effect */
.group:hover .rounded-xl {
    transition: background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Image lazy loading fade */
img {
    transition: opacity 0.3s ease;
}
img[loading="lazy"] {
    opacity: 0;
}
img.loaded {
    opacity: 1;
}

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

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

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

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:not(.visible) {
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Subtle pattern overlay for sections */
.bg-pattern-dark {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23B85635' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Print styles */
@media print {
    nav, #back-to-top, .reveal { display: none !important; }
    body { background: white !important; color: black !important; }
    section { page-break-inside: avoid; }
}
