/* ============================================
   Heavenly Coffee Shop — Custom Styles
   ============================================ */

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

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: #4cc38e;
    color: #0d1b2a;
}

/* ============================================
   Navigation
   ============================================ */
#site-header {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(13, 27, 42, 0.08);
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-anim {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.25s; }
.hero-anim:nth-child(3) { animation-delay: 0.4s; }
.hero-anim:nth-child(4) { animation-delay: 0.55s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Features Strip
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: featureReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes featureReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Scroll Reveal (Progressive Enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        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);
    }

    /* Staggered children */
    .reveal .menu-card {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

/* ============================================
   Menu Cards
   ============================================ */
.menu-card {
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2da872, #4cc38e);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.menu-card:hover::before {
    opacity: 1;
}

/* ============================================
   Community Cards
   ============================================ */
.community-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease,
                border-color 0.4s ease;
}

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

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-link {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateX(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; }

/* Hamburger Animation */
#menu-toggle[aria-expanded="true"] .line:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#menu-toggle[aria-expanded="true"] .line:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 100%;
}

/* ============================================
   Form Styles
   ============================================ */
#contact-form input:focus,
#contact-form select:focus,
#contact-form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 195, 142, 0.15);
}

/* ============================================
   Image Hover Effects
   ============================================ */
.rounded-2xl.overflow-hidden {
    overflow: hidden;
}

.rounded-2xl.overflow-hidden img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Accessibility
   ============================================ */
@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 {
        opacity: 1;
        transform: none;
    }

    .hero-anim {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Focus Visible
   ============================================ */
:focus-visible {
    outline: 2px solid #4cc38e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #site-header,
    #mobile-menu,
    #menu-toggle {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    .hero-anim,
    .reveal {
        opacity: 1;
        transform: none;
    }
}
