/* Custom Styles for Phil's Handyman Service */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1209;
}
::-webkit-scrollbar-thumb {
    background: #c8956c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d4a88a;
}

/* Selection color */
::selection {
    background: #c8956c;
    color: #1a1209;
}

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

/* Scroll reveal animations - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .scroll-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);
    }
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: always visible if JS is disabled or reduced motion preferred */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* Mobile menu transitions */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
}
#mobileMenu.open {
    max-height: 500px;
    opacity: 1;
}

/* Mobile links */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
    font-size: 1.125rem;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(26, 18, 9, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(200, 149, 108, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Gold shimmer animation for hero text */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Pulse animation for the status dot */
@keyframes soft-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* 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='%23c8956c' 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;
}

/* Image aspect ratios */
img {
    display: block;
}

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

/* Ensure hero is visible immediately - no animation gate */
#hero {
    opacity: 1;
}

/* Ensure first section is visible */
#hero,
#services {
    opacity: 1;
}

/* Tablet and desktop adjustments */
@media (min-width: 768px) {
    #mobileMenu {
        max-height: none;
        opacity: 1;
    }
    #mobileMenu.closed {
        max-height: 0;
        opacity: 0;
    }
}

/* Print styles */
@media print {
    nav, #contactForm, .scroll-reveal { display: none; }
    body { background: white; color: black; }
}
