/* ============================================
   PIEDMONT LUMBER — Custom Styles
   ============================================ */

/* Base & Reset */
*, *::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 {
    display: block;
    max-width: 100%;
}

/* Selection */
::selection {
    background: rgba(82, 128, 66, 0.2);
    color: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f5f3ef;
}
::-webkit-scrollbar-thumb {
    background: #d8d3ca;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9abf8a;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navbar {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled {
    background: rgba(250, 249, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(49, 80, 40, 0.08);
}

.nav-text {
    color: #315028;
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-text {
    color: #315028;
}

.nav-link {
    position: relative;
}

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

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

/* Mobile Menu */
#mobileMenu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-link {
    transition: opacity 0.3s ease;
}

.mobile-link:hover {
    opacity: 0.7;
}

/* ============================================
   HERO ANIMATIONS
   ============================================ */
.nav-eyebrow {
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.nav-headline {
    animation: heroFadeUp 0.9s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.nav-subheadline {
    animation: heroFadeUp 0.9s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.nav-ctas {
    animation: heroFadeUp 0.9s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

.scroll-indicator {
    animation: heroFadeUp 0.9s ease forwards;
    animation-delay: 1.2s;
    opacity: 0;
}

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

/* ============================================
   SCROLL REVEAL (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
    }

    .reveal.fade-up {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    /* Hide by default, reveal via JS */
    .reveal.fade-up {
        opacity: 0;
        transform: translateY(20px);
    }

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

    .divider-line {
        transform-origin: left center;
        animation: lineGrow 1s ease forwards;
    }

    @keyframes lineGrow {
        from {
            transform: scaleX(0);
        }
        to {
            transform: scaleX(1);
        }
    }
}

/* ============================================
   SECTION COMPONENTS
   ============================================ */
.section-eyebrow {
    letter-spacing: 0.35em;
}

.section-title {
    letter-spacing: -0.02em;
}

/* Product Cards */
.product-card {
    transition: background-color 0.5s ease;
}

.product-card img {
    transition: transform 0.7s ease;
}

/* Service Items */
.service-item {
    transition: background-color 0.3s ease;
}

/* ============================================
   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;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal.fade-up {
        opacity: 1;
        transform: translateY(0);
    }
}
