/* ========================================
   Evans Florist — Custom Styles
======================================== */

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

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #2d4c1e;
    color: #faf9f6;
}

/* ========================================
   Scroll Reveal Animations
   These are progressive enhancement —
   content is visible by default, JS adds
   the animated state.
======================================== */

/* Default: all reveal elements are visible */
.service-reveal,
.gallery-reveal,
.about-reveal,
.testimonial-reveal,
.cta-reveal,
.contact-reveal {
    opacity: 1;
    transform: none;
}

/* When JS adds the revealed class */
.service-reveal.revealed,
.gallery-reveal.revealed,
.about-reveal.revealed,
.testimonial-reveal.revealed,
.cta-reveal.revealed,
.contact-reveal.revealed {
    animation: fadeUp 0.8s ease forwards;
}

.service-reveal:nth-child(2).revealed,
.gallery-reveal:nth-child(2).revealed,
.about-reveal:nth-child(2).revealed,
.testimonial-reveal:nth-child(2).revealed,
.cta-reveal:nth-child(2).revealed,
.contact-reveal:nth-child(2).revealed {
    animation-delay: 0.1s;
}

.service-reveal:nth-child(3).revealed,
.gallery-reveal:nth-child(3).revealed,
.about-reveal:nth-child(3).revealed,
.testimonial-reveal:nth-child(3).revealed,
.cta-reveal:nth-child(3).revealed,
.contact-reveal:nth-child(3).revealed {
    animation-delay: 0.2s;
}

.service-reveal:nth-child(4).revealed,
.gallery-reveal:nth-child(4).revealed,
.about-reveal:nth-child(4).revealed,
.testimonial-reveal:nth-child(4).revealed,
.cta-reveal:nth-child(4).revealed,
.contact-reveal:nth-child(4).revealed {
    animation-delay: 0.3s;
}

.service-reveal:nth-child(5).revealed,
.gallery-reveal:nth-child(5).revealed,
.about-reveal:nth-child(5).revealed,
.testimonial-reveal:nth-child(5).revealed,
.cta-reveal:nth-child(5).revealed,
.contact-reveal:nth-child(5).revealed {
    animation-delay: 0.4s;
}

.service-reveal:nth-child(6).revealed,
.gallery-reveal:nth-child(6).revealed,
.about-reveal:nth-child(6).revealed,
.testimonial-reveal:nth-child(6).revealed,
.cta-reveal:nth-child(6).revealed,
.contact-reveal:nth-child(6).revealed {
    animation-delay: 0.5s;
}

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

/* ========================================
   Service Cards
======================================== */
.service-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.service-card.revealed {
    animation: fadeUp 0.7s ease forwards;
}

.service-card:nth-child(1).revealed { animation-delay: 0s; }
.service-card:nth-child(2).revealed { animation-delay: 0.1s; }
.service-card:nth-child(3).revealed { animation-delay: 0.2s; }
.service-card:nth-child(4).revealed { animation-delay: 0.3s; }
.service-card:nth-child(5).revealed { animation-delay: 0.4s; }
.service-card:nth-child(6).revealed { animation-delay: 0.5s; }

/* ========================================
   Gallery Items
======================================== */
.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-item.revealed {
    animation: galleryIn 0.7s ease forwards;
}

.gallery-item:nth-child(1).revealed { animation-delay: 0s; }
.gallery-item:nth-child(2).revealed { animation-delay: 0.1s; }
.gallery-item:nth-child(3).revealed { animation-delay: 0.15s; }
.gallery-item:nth-child(4).revealed { animation-delay: 0.2s; }
.gallery-item:nth-child(5).revealed { animation-delay: 0.25s; }
.gallery-item:nth-child(6).revealed { animation-delay: 0.3s; }

@keyframes galleryIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   Floating Petals (Hero)
======================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

.petal {
    animation: float 6s ease-in-out infinite;
}

/* ========================================
   Navbar
======================================== */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(31, 51, 22, 0.08);
}

.nav-link {
    position: relative;
}

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

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

#navbar:not(.scrolled) .nav-link {
    color: rgba(250, 249, 246, 0.85);
}

#navbar:not(.scrolled) .nav-link:hover {
    color: #faf9f6;
}

#navbar:not(.scrolled) .nav-link::after {
    background-color: #faf9f6;
}

#navbar:not(.scrolled) .font-serif {
    color: #faf9f6;
}

#navbar:not(.scrolled) .w-8 {
    color: #d4e8c4;
}

/* ========================================
   Mobile Menu
======================================== */
#mobileMenu {
    z-index: 50;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* Hamburger animation */
#menuBtn.active #bar1 {
    transform: rotate(45deg) translate(4px, 4px);
}

#menuBtn.active #bar2 {
    opacity: 0;
}

#menuBtn.active #bar3 {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.5rem;
}

/* ========================================
   Smooth image loading
======================================== */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ========================================
   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;
    }
    
    .petal {
        animation: none;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #6d9d50;
}

/* ========================================
   Form focus styles
======================================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ========================================
   Select dropdown styling
======================================== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232d4c1e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ========================================
   About image reveal
======================================== */
.about-image {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-image.revealed {
    animation: slideRight 0.8s ease forwards;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.about-text {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-text.revealed {
    animation: slideLeft 0.8s ease forwards;
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Contact form wrapper
======================================== */
.contact-form-wrapper {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contact-form-wrapper.revealed {
    animation: fadeUp 0.8s ease forwards;
}
