/* ============================================
   The Original Handyman Extraordinaire
   Custom Styles
   ============================================ */

/* Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(200, 150, 60, 0.3);
    color: #3a1b2d;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fafaf5;
}
::-webkit-scrollbar-thumb {
    background: #c4a44a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b8943c;
}

/* Header scroll state */
#site-header.scrolled {
    background-color: rgba(35, 16, 25, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#site-header.scrolled .header-text {
    color: #ffffff;
}

#site-header:not(.scrolled) .header-text {
    color: #ffffff;
}

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

#mobile-menu.active .mobile-nav-link {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

#mobile-menu.active .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.active .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.active .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.active .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.active .mobile-nav-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu line animation */
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
}
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 28px;
}

/* Service card hover */
.service-card {
    transform: translateY(0);
}

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

/* Testimonial card hover */
.testimonial-card {
    transform: translateY(0);
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* Gallery items */
.gallery-item {
    height: 200px;
}

@media (min-width: 768px) {
    .gallery-item {
        height: 240px;
    }
}

.gallery-item .row-span-2 {
    grid-row: span 2;
    height: 100%;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #C8963C;
    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;
    }
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement — hidden by default,
   revealed by JS only
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }

    .reveal[data-reveal] {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal[data-reveal="left"] {
        transform: translateX(-30px);
    }

    .reveal[data-reveal="right"] {
        transform: translateX(30px);
    }

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