/* ============================================
   Knight's Country Market — 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: rgba(212, 168, 83, 0.3);
    color: #f1f5f9;
}

/* ============================================
   Navbar
   ============================================ */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 168, 83, 0.1), 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Mobile Menu
   ============================================ */
#mobile-menu.active {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-link {
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-link:hover {
    transform: translateY(-2px);
}

/* Menu lines animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

#menu-btn.active .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Hero Animation
   ============================================ */
.reveal-hero {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal-hero:nth-child(1) { animation-delay: 0.1s; }
.reveal-hero:nth-child(2) { animation-delay: 0.25s; }
.reveal-hero:nth-child(3) { animation-delay: 0.4s; }
.reveal-hero:nth-child(4) { animation-delay: 0.55s; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Scroll Reveal (below fold)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        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);
    }

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

    .reveal-card {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-card.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: content always visible if JS disabled or reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-card {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Gold Shimmer Accent
   ============================================ */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.gold-shimmer {
    background: linear-gradient(90deg, #d4a853, #f0d48a, #d4a853);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

/* ============================================
   Image Hover Effects
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Smooth Scroll Offset for Fixed Nav
   ============================================ */
section[id] {
    scroll-margin-top: 80px;
}

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

/* ============================================
   Focus Styles
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #d4a853;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Subtle Noise Texture Overlay (optional depth)
   ============================================ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}
