/* ============================================
   Community Nutrition — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1A1A1A;
}
::-webkit-scrollbar-thumb {
    background: #3D3D3D;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4A4A4A;
}

/* Selection */
::selection {
    background: #C25E3A;
    color: #fff;
}

/* ============================================
   Navigation
   ============================================ */
.nav-fixed {
    will-change: transform;
}

.nav-link {
    position: relative;
}

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

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

/* Mobile Menu */
.mobile-menu {
    animation: slideDown 0.3s ease forwards;
}

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

.mobile-link {
    position: relative;
}

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

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

/* Hamburger Animation */
.hamburger-line {
    transition: all 0.3s ease;
}

#mobile-toggle.active .hamburger-line:nth-child(1) {
    top: 15px;
    transform: rotate(45deg);
}

#mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

#mobile-toggle.active .hamburger-line:nth-child(3) {
    top: 15px;
    width: 6px;
    left: 3px;
    transform: rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.scroll-indicator {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.2);
    }
}

/* ============================================
   Marquee
   ============================================ */
.marquee-track {
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ============================================
   Card Elevation
   ============================================ */
.card-elevated {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.card-elevated:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px -20px rgba(194, 94, 58, 0.15);
}

/* ============================================
   Reveal Animations (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }

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

/* When JS is disabled, all content is visible by default */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

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

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .marquee-track {
        animation-duration: 20s;
    }
}

@media (max-width: 640px) {
    .font-serif {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
}
