/* Custom styles for Granite State Fruit Co. */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Navbar scroll state */
#navbar.scrolled {
    background-color: rgba(250, 250, 248, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(10, 22, 40, 0.08);
}

#navbar.scrolled .font-serif,
#navbar.scrolled .text-navy-900 {
    color: #0a1628;
}

#navbar.scrolled .menu-line {
    background-color: #0a1628;
}

#navbar.scrolled .nav-link {
    color: #132238;
}

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

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

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

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

#mobileMenu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 1;
}

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

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

/* Mobile menu button active state */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Scroll reveal animations — below-the-fold only */
.about-reveal,
.product-reveal,
.craft-reveal,
.quote-reveal,
.visit-reveal,
.cta-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .about-reveal,
    .product-reveal,
    .craft-reveal,
    .quote-reveal,
    .visit-reveal,
    .cta-reveal {
        opacity: 0;
        transform: translateY(28px);
    }
}

/* Image hover smoothness */
img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Selection color */
::selection {
    background-color: rgba(201, 168, 76, 0.25);
    color: #0a1628;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fafaf8;
}

::-webkit-scrollbar-thumb {
    background: #c9a84c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8943f;
}

/* Form styles for contact */
input, textarea {
    font-family: 'Montserrat', Helvetica, sans-serif;
}

/* Focus styles */
a:focus-visible, button:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
}
