/* ===================================
   Lucky Zhang 888 — Custom Styles
   Classic & Elegant Restaurant Site
   =================================== */

/* Custom Tailwind plugin for animations */
@layer base {
    html {
        scroll-behavior: smooth;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Selection color */
    ::selection {
        background-color: #d45538;
        color: #fefdfb;
    }
}

/* Clip path for hero diagonal */
.clip-diagonal {
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
}

/* Scroll line animation */
@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        transform-origin: top;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
        transform-origin: top;
        opacity: 0;
    }
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* Navbar transitions */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(254, 253, 251, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

/* Mobile menu button animation */
#mobile-menu-btn.active #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active #bar2 {
    opacity: 0;
}

#mobile-menu-btn.active #bar3 {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* Mobile menu */
#mobile-menu.open {
    transform: translateX(0);
}

/* Mobile link hover */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #d45538;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mobile-link:hover::after {
    width: 80%;
}

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

#back-to-top:hover {
    transform: translateY(-2px);
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #d45538;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Reduced motion preference */
@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;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .clip-diagonal {
        clip-path: polygon(0% 0, 100% 0, 100% 85%, 0% 100%);
    }
}

/* Small mobile adjustments */
@media (max-width: 360px) {
    .font-serif {
        font-size: clamp(1.5rem, 8vw, 2rem);
    }
}

/* Print styles */
@media print {
    nav,
    #back-to-top,
    .animate-scroll-line {
        display: none !important;
    }
    
    body {
        color: #1a1a1a;
        background: white;
    }
    
    a {
        color: #d45538;
    }
}
