/* ============================================
   Snack Shack — Custom Styles
   ============================================ */

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #3f604a;
    color: #fdfcfa;
}

/* ============================================
   Navbar
   ============================================ */
.nav-logo-text {
    transition: color 0.4s ease;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Scrolled navbar state */
nav.scrolled {
    background: rgba(253, 252, 250, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(15, 26, 20, 0.08);
}

nav.scrolled .nav-logo-text {
    color: #223429;
}

nav.scrolled .nav-link {
    color: #324d3c;
}

nav.scrolled .menu-line {
    background: #223429;
}

nav.scrolled .mobile-link {
    color: #223429;
}

/* ============================================
   Mobile Menu
   ============================================ */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

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

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

/* Hamburger Animation */
.menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   Hero Floating Cards
   ============================================ */
.floating-card {
    animation: float1 6s ease-in-out infinite;
}

.floating-card-2 {
    animation: float2 7s ease-in-out infinite;
}

.floating-card-3 {
    animation: float3 5.5s ease-in-out infinite;
}

.floating-card-4 {
    animation: float4 6.5s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(-1deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(0.5deg); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(-0.5deg); }
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ============================================
   Back to Top
   ============================================ */
#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

#back-to-top {
    transform: translateY(20px);
}

/* ============================================
   Focus Styles
   ============================================ */
*:focus-visible {
    outline: 2px solid #547d60;
    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;
    }
    
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
    }
    
    .floating-card,
    .floating-card-2,
    .floating-card-3,
    .floating-card-4 {
        animation: none;
    }
}

/* ============================================
   Responsive Tweaks
   ============================================ */
@media (max-width: 767px) {
    .floating-card,
    .floating-card-2,
    .floating-card-3,
    .floating-card-4 {
        display: none;
    }
}
