/* ============================================
   White River Seed Library — Custom Styles
   ============================================ */

/* Base reset & typography */
*, *::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;
}

/* Smooth scroll offset for fixed nav */
section[id] {
    scroll-margin-top: 80px;
}

/* Selection color */
::selection {
    background-color: rgba(26, 58, 42, 0.15);
    color: #1a3a2a;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f5f3ed;
}
::-webkit-scrollbar-thumb {
    background: #9fbd83;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #558a3a;
}

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

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Navbar scroll state
   ============================================ */
#navbar.scrolled {
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.08);
}

#navbar.scrolled .logo-text {
    color: #1a3a2a;
}

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

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

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

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

/* Hamburger animation */
#menu-icon.active #bar1 {
    transform: translateY(5px) rotate(45deg);
}
#menu-icon.active #bar2 {
    opacity: 0;
}
#menu-icon.active #bar3 {
    transform: translateY(-5px) rotate(-45deg);
}

/* ============================================
   Service card hover effect
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #558a3a;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover::after {
    width: 100%;
}

/* ============================================
   Form animations
   ============================================ */
#contact-form input,
#contact-form select,
#contact-form textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(85, 138, 58, 0.1);
}

/* ============================================
   Utility: thin decorative lines
   ============================================ */
.deco-line {
    position: absolute;
    background-color: rgba(159, 189, 131, 0.4);
}

.deco-line--horizontal {
    width: 80px;
    height: 1px;
}

.deco-line--vertical {
    width: 1px;
    height: 60px;
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .service-card::after {
        transition: none !important;
    }
    #navbar,
    #mobile-menu,
    #menu-icon span {
        transition: none !important;
    }
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 767px) {
    section[id] {
        scroll-margin-top: 70px;
    }

    .font-serif.text-5xl,
    .font-serif.text-6xl {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .font-serif.text-5xl {
        font-size: 3.5rem;
    }
}
