/* =============================================
   Lakefront Roofing & Siding Supply
   Custom Styles
   ============================================= */

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

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

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f0e8;
}
::-webkit-scrollbar-thumb {
    background: #8aad96;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #427454;
}

/* --- Navbar --- */
.navbar-text {
    transition: color 0.4s ease;
}
.navbar-text-muted {
    transition: color 0.4s ease;
}

#navbar.scrolled .navbar-text {
    color: #faf8f4;
}
#navbar.scrolled .navbar-text-muted {
    color: #b3c7bb;
}

#navbar.scrolled {
    background: rgba(10, 26, 23, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(170, 173, 150, 0.1);
}

/* --- Hero Animations --- */
.hero-subtitle {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-headline {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
    opacity: 0;
    transform: translateY(40px);
}

.hero-desc {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-buttons {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-stats {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* --- Marquee --- */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* --- Section Labels --- */
.section-label {
    animation: fadeIn 0.6s ease forwards;
}

.section-label-light {
    animation: fadeIn 0.6s ease forwards;
}

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

/* --- Product Cards --- */
.product-card {
    transform: translateZ(0);
}

.product-card img {
    will-change: transform;
}

/* --- Service Cards --- */
.service-card {
    transform: translateZ(0);
    transition: background-color 0.4s ease;
}

.service-card:hover {
    background-color: #1a3c34;
}

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

/* --- Mobile Menu --- */
#mobile-menu {
    box-shadow: none;
}

#mobile-menu.open {
    box-shadow: 0 20px 60px rgba(10, 26, 23, 0.2);
}

.mobile-nav-link {
    position: relative;
}

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

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

/* --- Mobile Menu Animations --- */
#menu-toggle.active #bar1 {
    transform: translateY(5px) rotate(45deg);
}

#menu-toggle.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}

#menu-toggle.active #bar3 {
    transform: translateY(-5px) rotate(-45deg);
    width: 1.5rem;
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #427454;
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Print --- */
@media print {
    #navbar, .animate-marquee, #menu-toggle {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-forest-700, .bg-forest-900, .bg-forest-950 {
        background: #1a3c34 !important;
        color: #fff !important;
    }
}
