/* ========================================
   Local Roots Kombucha — 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: #C4724E;
    color: #FAF7F2;
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    background: rgba(250, 247, 242, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(61, 43, 31, 0.06);
}

.nav.scrolled {
    background: rgba(250, 247, 242, 0.95);
    box-shadow: 0 1px 20px rgba(61, 43, 31, 0.06);
}

.nav-link {
    position: relative;
}

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

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

/* ========================================
   Hero Blobs
   ======================================== */
.hero-blob {
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    background: radial-gradient(circle, #C4724E 0%, transparent 70%);
    animation-delay: 0s;
}

.blob-2 {
    background: radial-gradient(circle, #E8D9BE 0%, transparent 70%);
    animation-delay: -7s;
}

.blob-3 {
    background: radial-gradient(circle, #F4C9B5 0%, transparent 70%);
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ========================================
   Hero Tag Animation
   ======================================== */
.hero-tag {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

/* ========================================
   Hero Content Animations
   ======================================== */
#hero h1 {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.4s;
}

#hero p {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.6s;
}

#hero .flex.flex-col {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.8s;
}

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

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    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; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Menu icon animation */
#menuToggle.active #menuIcon {
    transform: rotate(90deg);
}

#menuToggle.active #menuIcon line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

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

#menuToggle.active #menuIcon line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* ========================================
   Scroll Reveal (progressive enhancement)
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

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

    .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
    .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
}

/* ========================================
   Flavor Cards
   ======================================== */
#flavors .group {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#flavors .group.revealed {
    opacity: 1;
    transform: translateY(0);
}

#flavors .group:nth-child(2) { transition-delay: 0.1s; }
#flavors .group:nth-child(3) { transition-delay: 0.2s; }
#flavors .group:nth-child(4) { transition-delay: 0.3s; }
#flavors .group:nth-child(5) { transition-delay: 0.4s; }
#flavors .group:nth-child(6) { transition-delay: 0.5s; }

/* ========================================
   Form Styles
   ======================================== */
#contactForm input:focus,
#contactForm textarea:focus {
    box-shadow: 0 0 0 4px rgba(196, 114, 78, 0.1);
}

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

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

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

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

/* ========================================
   Focus visible for accessibility
   ======================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #C4724E;
    outline-offset: 2px;
    border-radius: 4px;
}

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

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    #flavors .group {
        opacity: 1;
        transform: none;
    }
}
