/* ============================================
   Maui Wowi Hawaiian Coffees & Smoothies
   Custom Styles — Gilbert, AZ
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #fdfcf8;
    color: #0a2f1c;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #34D399;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Scroll Reveal Animations
   Progressive enhancement — content is visible
   by default, JS adds the animation class.
   ============================================ */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal:not(.revealed) {
    opacity: 0;
    transform: translateY(40px);
}

/* Staggered delays for grid items */
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 100ms; }
.reveal:nth-child(3) { transition-delay: 200ms; }
.reveal:nth-child(4) { transition-delay: 300ms; }

/* ============================================
   Navigation
   ============================================ */
#navbar {
    background: rgba(253, 252, 248, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(14, 63, 38, 0.08);
}

#navbar.scrolled {
    background: rgba(253, 252, 248, 0.95);
    box-shadow: 0 4px 20px rgba(10, 47, 28, 0.08);
}

.nav-link {
    position: relative;
}

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

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

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

#mobile-menu:not(.open) {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    position: relative;
}

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

#menu-btn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#menu-btn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    width: 0;
}

#menu-btn[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 24px;
}

/* ============================================
   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:not(.revealed) {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 639px) {
    .font-display {
        line-height: 1.1;
    }
}

@media (min-width: 768px) {
    .reveal {
        transition-delay: 0ms;
    }
}

/* ============================================
   Selection color
   ============================================ */
::selection {
    background: #34D399;
    color: #0a2f1c;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #52a976;
}
