/* ============================================
   Grover Bailey Tomato House — Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-tag {
    animation: fadeSlideUp 0.8s ease-out 0.2s both;
}

.hero-title {
    animation: fadeSlideUp 0.8s ease-out 0.4s both;
}

.hero-desc {
    animation: fadeSlideUp 0.8s ease-out 0.6s both;
}

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

/* Scroll Line Animation */
.scroll-line {
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0% {
        top: -16px;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 40px;
        opacity: 0;
    }
}

/* ============================================
   Scroll Reveal Animations
   (Below the fold only — progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }

    .reveal-up.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }

    .reveal-left.revealed {
        opacity: 1;
        transform: translateX(0);
    }

    .reveal-right {
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }

    .reveal-right.revealed {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger delays for product cards */
    .reveal-up:nth-child(1) { transition-delay: 0.05s; }
    .reveal-up:nth-child(2) { transition-delay: 0.1s; }
    .reveal-up:nth-child(3) { transition-delay: 0.15s; }
    .reveal-up:nth-child(4) { transition-delay: 0.2s; }
    .reveal-up:nth-child(5) { transition-delay: 0.25s; }
    .reveal-up:nth-child(6) { transition-delay: 0.3s; }
}

/* Fallback: ensure content is visible if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Navbar
   ============================================ */
#navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(248, 250, 252, 0.85);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.8);
}

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s 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.1s; }
.mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }

/* Menu Icon Animation */
#menu-btn.active #line1 {
    transform: rotate(45deg) translate(3px, 3px);
}

#menu-btn.active #line2 {
    opacity: 0;
}

#menu-btn.active #line3 {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* ============================================
   Image Hover Effects
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Focus States for Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* ============================================
   Selection Color
   ============================================ */
::selection {
    background-color: rgba(13, 148, 136, 0.2);
    color: #0f172a;
}

/* ============================================
   Form Input Autocomplete Styling
   ============================================ */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    box-shadow: 0 0 0 30px transparent inset !important;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #navbar,
    .scroll-indicator,
    #contact-form {
        display: none;
    }

    body {
        color: #0f172a;
        background: white;
    }

    a {
        color: #0d9488;
    }
}

/* ============================================
   Ultra-wide Screens
   ============================================ */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 80rem;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
