/* Custom styles for The Bainbridge Farm and Artisan Market */

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

/* Reduced motion preference */
@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;
    }
}

/* Hero geometric animations */
@keyframes float-slow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(15px, -20px) rotate(3deg); }
    66% { transform: translate(-10px, 10px) rotate(-2deg); }
}

@keyframes float-medium {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 15px) rotate(5deg); }
}

@keyframes float-fast {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -15px) scale(1.05); }
}

.hero-geo {
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.hero-geo-1 {
    animation: float-slow 12s infinite;
}

.hero-geo-2 {
    animation: float-medium 16s infinite;
}

.hero-geo-3 {
    animation: float-fast 10s infinite;
}

.hero-geo-4 {
    animation: float-medium 8s infinite;
}

.hero-geo-5 {
    animation: float-fast 6s infinite;
}

.hero-geo-6 {
    animation: float-slow 14s infinite;
}

.hero-geo-7 {
    animation: float-medium 11s infinite;
}

/* Marquee animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-track {
    animation: marquee 30s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

/* Scroll reveal animations */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Progressive enhancement: only animate when JS is available and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 0;
    }
    
    .reveal-up {
        transform: translateY(40px);
    }
    
    .reveal-left {
        transform: translateX(-40px);
    }
    
    .reveal-right {
        transform: translateX(40px);
    }
    
    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        opacity: 1;
        transform: none;
    }
}

/* Navbar styles */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(253, 246, 240, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(120, 31, 46, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #781F2E, #F4A0AD);
    transition: width 0.3s ease;
}

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

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

/* Mobile menu */
#mobile-menu {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.mobile-menu-link {
    position: relative;
}

.mobile-menu-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #F4A0AD;
    transition: width 0.3s ease;
}

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

/* Vendor card hover effect */
.vendor-card {
    transform: translateY(0);
}

.vendor-card:hover {
    transform: translateY(-4px);
}

/* Button hover effects */
a[href="#visit"],
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

a[href="#visit"]::before,
button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

a[href="#visit"]:hover::before,
button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9A2A3A;
}

/* Selection color */
::selection {
    background: #F4C2C2;
    color: #781F2E;
}

/* Image loading placeholder */
img {
    background: linear-gradient(135deg, #fce4e8 0%, #f9c5ce 100%);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #781F2E;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #navbar,
    #back-to-top,
    .marquee-strip {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
