/* ========================================
   CC Cruz Carpentry Corp. — Custom Styles
   ======================================== */

/* --- Scroll behavior --- */
html {
    scroll-behavior: smooth;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F7EDE2;
}
::-webkit-scrollbar-thumb {
    background: #D4956A;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #B8543A;
}

/* --- Selection color --- */
::selection {
    background: #B8543A;
    color: #FDF9F5;
}

/* --- Navbar transition states --- */
#navbar.scrolled {
    background: rgba(253, 249, 245, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

#navbar.scrolled .nav-text {
    color: #36322C !important;
}

#navbar.scrolled .nav-link {
    color: #544D42 !important;
}

#navbar.scrolled .nav-link:hover {
    color: #B8543A !important;
}

/* --- Nav link underline animation --- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #B8543A;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

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

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

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

/* --- Reveal animations (progressive enhancement) --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    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);
}

/* Reduced motion: disable all custom animations */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal {
        display: block;
    }
    .reveal[style*="opacity"] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* --- Hero text shimmer on hover --- */
h1 a:hover,
.hero-highlight:hover {
    text-decoration: none;
}

/* --- Card hover lift --- */
.testimonial-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

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

/* --- Image hover zoom container --- */
.work-image {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Button ripple effect prep --- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* --- Form focus animations --- */
input:focus,
select:focus,
textarea:focus {
    border-color: #B8543A !important;
    box-shadow: 0 0 0 3px rgba(184, 84, 58, 0.15) !important;
}

/* --- Smooth image loading --- */
img {
    loading: lazy;
}

/* --- Utility: decorative line --- */
.divider-terra {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #B8543A, #D4956A);
    border: none;
    border-radius: 2px;
}

/* --- Print styles --- */
@media print {
    #navbar, #mobileMenu, .reveal {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}
