/* ============================================
   NELLIE'S BAKERY — Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

::selection {
    background: #fbbf24;
    color: #4f2c39;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f5f4;
}
::-webkit-scrollbar-thumb {
    background: #d4b3c4;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a06582;
}

/* --- Hero Animations --- */
@keyframes heroSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-eyebrow {
    animation: heroSlideUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-title {
    animation: heroSlideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-subtitle {
    animation: heroSlideUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-ctas {
    animation: heroSlideUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

.hero-stats {
    animation: heroFadeIn 1s ease forwards;
    animation-delay: 1.2s;
    opacity: 0;
}

/* --- Heritage Section --- */
@keyframes heritageImgIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.heritage-img {
    animation: heritageImgIn 1s ease forwards;
}

/* --- Scroll Reveal (below fold only, progressive enhancement) --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children */
.reveal-child {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-child {
        opacity: 0;
        transform: translateY(20px);
    }
    .reveal-child.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Navbar --- */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(114, 61, 82, 0.08);
}

#navbar.scrolled .font-serif {
    color: #4f2c39 !important;
}

#navbar.scrolled .menu-line {
    background: #4f2c39 !important;
}

#navbar.scrolled a:not(.px-8) {
    color: #5e3344 !important;
}

#navbar.scrolled a:not(.px-8):hover {
    color: #d97706 !important;
}

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

#mobile-menu.open .mobile-link {
    animation: mobileLinkIn 0.4s 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; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(6) { animation-delay: 0.3s; }

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

/* Mobile menu button active state */
#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* --- Menu Cards --- */
.menu-card {
    transition: border-color 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(44, 21, 30, 0.2);
}

/* --- Gallery --- */
.gallery-item {
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(79, 44, 57, 0);
    transition: background 0.4s ease;
}

.gallery-item:hover::after {
    background: rgba(79, 44, 57, 0.15);
}

/* --- Back to Top --- */
.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 44, 57, 0.3);
}

/* --- Input Focus --- */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* --- Smooth image loading --- */
img {
    image-rendering: auto;
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem !important;
    }
    .hero-title span {
        font-size: 2.5rem !important;
    }
    .hero-title span:last-child {
        font-size: 2rem !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem !important;
    }
}
