/* ============================================
   MAXIN BAKERY — 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: #0d9488;
    color: #f5f5f4;
}

/* ============================================
   NAVBAR
   ============================================ */
#navbar {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

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

#mobile-menu.open .mobile-link {
    animation: fadeSlideIn 0.3s ease forwards;
}

#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 fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hamburger animation */
#mobile-menu-btn.active .mobile-link:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active .mobile-link:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active .mobile-link:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   SCROLL REVEAL (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        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.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* ============================================
   MENU CARD HOVER
   ============================================ */
#menu .group:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

#menu .group {
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   FOCUS STYLES
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* ============================================
   SMOOTH IMAGE LOADING
   ============================================ */
img {
    display: block;
    max-width: 100%;
}

/* ============================================
   FORM STYLES
   ============================================ */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.1;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    #menu .group {
        padding: 1.5rem !important;
    }
}
