/* ===== Custom Styles for Dewie's Bake Shop ===== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Raleway', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-display {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal[data-reveal="delay-1"] { transition-delay: 0.1s; }
.reveal[data-reveal="delay-2"] { transition-delay: 0.2s; }
.reveal[data-reveal="delay-3"] { transition-delay: 0.3s; }
.reveal[data-reveal="delay-4"] { transition-delay: 0.4s; }
.reveal[data-reveal="delay-5"] { transition-delay: 0.5s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Navbar scroll state */
nav.scrolled {
    background: rgba(5, 10, 20, 0.92) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(251, 191, 36, 0.08);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

nav.scrolled .menu-line {
    background: #fff !important;
}

nav.scrolled .menu-line:last-child {
    background: #fbbf24 !important;
}

/* Mobile menu transitions */
#mobileMenu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu:not(.open) .mobile-link {
    opacity: 0;
    transform: translateY(12px);
}

/* Mobile menu links stagger */
#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Hamburger animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 1.5rem;
}

/* Gold shimmer on hover for buttons */
button:hover, a:hover {
    transition: all 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a1628;
}
::-webkit-scrollbar-thumb {
    background: #1a3562;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
}

/* Selection color */
::selection {
    background: rgba(251, 191, 36, 0.3);
    color: #fff;
}

/* Image loading placeholder */
img {
    background-color: #0f1f3a;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Smooth image transitions */
img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0a1628 inset !important;
    -webkit-text-fill-color: #fff !important;
}

/* Subtle gold glow on focus for inputs */
input:focus, textarea:focus {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
}
