/* ============================================
   D&S Fine Foods and More — 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-color: rgba(26, 77, 46, 0.2);
    color: #1a4d2e;
}

/* ============================================
   Scroll Reveal (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    /* Staggered delays */
    .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
    .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
    .scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
    .scroll-reveal:nth-child(5) { transition-delay: 0.4s; }
    .scroll-reveal:nth-child(6) { transition-delay: 0.5s; }
}

/* Ensure content is visible without JS */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Hero animations
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.hero-tag {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

h1 {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

p, .mt-14 {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-cta {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.hero-trust {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

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

/* Floating card */
.floating-card {
    animation: float 4s ease-in-out infinite;
}

/* ============================================
   Navbar
   ============================================ */
#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(26, 77, 46, 0.08);
}

.nav-link {
    position: relative;
}

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

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

/* ============================================
   Mobile menu
   ============================================ */
#mobileMenu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
}

.menu-line.active-1 {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-line.active-2 {
    opacity: 0;
}

.menu-line.active-3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 24px;
    margin-right: 0;
}

.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(26, 77, 46, 0.1);
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.mobile-link:hover {
    color: #1a4d2e;
    padding-left: 0.75rem;
}

.mobile-link:last-child {
    border-bottom: none;
}

/* ============================================
   Button focus states
   ============================================ */
a:focus-visible, button:focus-visible {
    outline: 2px solid #1a4d2e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Smooth image loading
   ============================================ */
img {
    background-color: #dce8df;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ============================================
   Decorative divider
   ============================================ */
.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1a4d2e, #3d7a3d);
    border-radius: 2px;
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #navbar, #mobileMenu {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    section {
        page-break-inside: avoid;
    }
}
