/* ============================================
   MARLEY'S CAFE — Custom Styles
   Bold Editorial · Emerald & Cream
   ============================================ */

/* --- 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;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9f0;
}
::-webkit-scrollbar-thumb {
    background: #064e3b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #047857;
}

/* --- Writing Mode (vertical text) --- */
.writing-mode-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* --- Hero Animations --- */
.hero-eyebrow {
    animation: slideUp 0.8s ease-out 0.2s both;
}

.hero-title-line {
    animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-title-line:nth-child(1) { animation-delay: 0.3s; }
.hero-title-line:nth-child(2) { animation-delay: 0.45s; }
.hero-title-line:nth-child(3) { animation-delay: 0.6s; }
.hero-title-line:nth-child(4) { animation-delay: 0.75s; }

.hero-subtitle {
    animation: slideUp 0.8s ease-out 0.9s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(400%); }
    100% { transform: translateY(400%); }
}

/* --- Scroll-triggered Animations --- */
.story-anim,
.menu-anim,
.exp-anim,
.visit-anim,
.contact-anim {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-anim.visible,
.menu-anim.visible,
.exp-anim.visible,
.visit-anim.visible,
.contact-anim.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.story-anim:nth-child(1),
.menu-anim:nth-child(1),
.exp-anim:nth-child(1),
.visit-anim:nth-child(1),
.contact-anim:nth-child(1) { transition-delay: 0.1s; }
.story-anim:nth-child(2),
.menu-anim:nth-child(2),
.exp-anim:nth-child(2),
.visit-anim:nth-child(2),
.contact-anim:nth-child(2) { transition-delay: 0.2s; }
.story-anim:nth-child(3),
.menu-anim:nth-child(3),
.exp-anim:nth-child(3),
.visit-anim:nth-child(3),
.contact-anim:nth-child(3) { transition-delay: 0.3s; }
.story-anim:nth-child(4),
.menu-anim:nth-child(4),
.exp-anim:nth-child(4),
.visit-anim:nth-child(4),
.contact-anim:nth-child(4) { transition-delay: 0.4s; }
.story-anim:nth-child(5),
.menu-anim:nth-child(5),
.exp-anim:nth-child(5),
.visit-anim:nth-child(5),
.contact-anim:nth-child(5) { transition-delay: 0.5s; }

/* --- Menu Cards --- */
.menu-card {
    padding: 2rem;
    border: 1px solid rgba(6, 78, 59, 0.08);
    border-radius: 4px;
    background: rgba(254, 253, 248, 0.6);
    backdrop-filter: blur(8px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.menu-card:hover {
    border-color: rgba(6, 78, 59, 0.2);
    box-shadow: 0 20px 60px rgba(6, 78, 59, 0.06);
}

/* --- Navbar --- */
.nav-scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

.nav-scrolled #navbar .font-serif {
    color: #064e3b;
}

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

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

/* --- Menu Toggle Animation --- */
.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.25rem;
}

/* --- Form Focus States --- */
input:focus,
textarea:focus {
    border-bottom-color: #064e3b !important;
}

input:focus,
textarea:focus {
    box-shadow: 0 1px 0 #064e3b;
}

/* --- Image Hover Container --- */
.overflow-hidden {
    position: relative;
}

.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(6, 78, 59, 0.04));
    pointer-events: none;
    border-radius: inherit;
}

/* --- Link Underline Animation --- */
a {
    text-decoration: none;
}

/* --- Selection Color --- */
::selection {
    background: #064e3b;
    color: #fefdf8;
}

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .hero-title-line {
        font-size: 3.5rem !important;
    }

    .menu-card {
        padding: 1.5rem;
    }
}

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

@media (min-width: 1024px) {
    .hero-title-line {
        font-size: clamp(3.5rem, 6vw, 6.5rem) !important;
    }
}

/* --- 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;
    }

    .story-anim,
    .menu-anim,
    .exp-anim,
    .visit-anim,
    .contact-anim {
        opacity: 1;
        transform: none;
    }
}
