/* =============================================
   Rays' Dairy Diner — Custom Styles
   Classic & Elegant · Deep Navy + Warm Gold
   ============================================= */

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

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

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Film Grain Texture ── */
.hero-grain,
.menu-grain {
    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)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
}

/* ── Navigation ── */
#site-header {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#site-header.scrolled {
    background: rgba(9, 17, 31, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #c9a84c;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: #c9a84c;
    transition: width 0.3s ease;
    margin: 4px auto 0;
}

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

/* ── Scroll Indicator ── */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 2rem; }
    50% { opacity: 1; height: 3rem; }
}

/* ── Hero Animations ── */
.hero-eyebrow {
    animation: fadeInDown 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero headline staggered animation */
#hero h1 {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

#hero p {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

#hero p:last-of-type {
    animation-delay: 0.7s;
}

#hero > div:last-child > div {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

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

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
        transform: none;
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

    .reveal-up.revealed,
    .reveal-left.revealed,
    .reveal-right.revealed {
        /* Final state — JS adds the class */
    }
}

/* Default state: always visible (no JS required) */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

/* Enhanced state with animation (JS adds these) */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up.animate-on-scroll {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    .reveal-up.animate-on-scroll.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-left.animate-on-scroll {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    .reveal-left.animate-on-scroll.revealed {
        opacity: 1;
        transform: translateX(0);
    }
    .reveal-right.animate-on-scroll {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    .reveal-right.animate-on-scroll.revealed {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Menu Card Hover ── */
.reveal-up.group:hover .aspect-\[16\/12\] img {
    filter: brightness(1.05);
}

/* ── Button Focus States ── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Selection Color ── */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #f0f3f9;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f1f3a;
}
::-webkit-scrollbar-thumb {
    background: #2d4e8a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c9a84c;
}

/* ── Responsive Adjustments ── */
@media (max-width: 767px) {
    #hero h1 {
        font-size: 2.75rem;
    }

    #hero h1 br {
        display: none;
    }

    #hero h1::after {
        content: 'served';
        display: block;
        color: #c9a84c;
        font-style: italic;
        margin-top: 0.1em;
    }
}

@media (min-width: 768px) {
    #hero h1 br {
        display: block;
    }
}

/* ── Print Styles ── */
@media print {
    #site-header,
    .scroll-line,
    .hero-grain,
    .menu-grain {
        display: none;
    }

    body {
        background: white;
        color: #1a2744;
    }

    a {
        color: #1a2744;
    }
}
