/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FAF6F3;
}
::-webkit-scrollbar-thumb {
    background: #722F37;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #632930;
}

/* Selection color */
::selection {
    background: #722F37;
    color: #FDF8F6;
}

/* Navbar scroll state */
nav.scrolled {
    background: rgba(250, 246, 243, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(114, 47, 55, 0.08);
}

nav.scrolled .nav-link {
    color: #2C2420;
}

nav:not(.scrolled) .nav-link {
    color: rgba(44, 36, 32, 0.7);
}

/* Hero animations */
.hero-headline {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.2s;
}

.hero-subtitle {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.1s;
}

.hero-body {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
}

.hero-ctas {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.4s;
}

.hero-stats {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
}

.hero-image-wrapper {
    animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll reveal animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Wine card hover effects */
.wine-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Mobile menu */
.mobile-menu-open .mobile-nav-link {
    animation: mobileLinkIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

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

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

/* Mobile menu button animation */
.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-open .menu-line:nth-child(2) {
    opacity: 0;
}
.menu-open .menu-line:nth-child(3) {
    width: 20px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Select dropdown styling */
select option {
    background: #2a0e13;
    color: #FDF8F6;
}

/* 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;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.75rem !important;
    }
    
    #hero {
        padding-top: 6rem;
    }
    
    .wine-card img {
        height: 320px;
    }
}

@media (max-width: 640px) {
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-stats > div {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .hero-stats span:first-child {
        font-size: 1.5rem !important;
    }
}
