/* ========================================
   S'pol Nutrition — Custom Styles
   Premium Dark Luxury + Emerald/Cream
======================================== */

/* --- Reset & 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 {
    background: rgba(212, 160, 23, 0.3);
    color: #FDF8F0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #061210;
}
::-webkit-scrollbar-thumb {
    background: #047857;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #D4A017;
}

/* --- Navbar --- */
#navbar {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: transparent;
    transition: background 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled {
    background: rgba(6, 18, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(212, 160, 23, 0.1);
}

/* --- Mobile Menu --- */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* --- Menu Button --- */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}
#menuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Animations --- */
#heroEyebrow {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}
#heroHeadline {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}
#heroSub {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}
#heroCTAs {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.1s;
    opacity: 0;
}
#heroScroll {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1.5s;
    opacity: 0;
}

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

/* --- Scroll Reveal (progressive enhancement) --- */
.js .reveal-up,
.js .reveal-left,
.js .reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .js .reveal-up.revealed,
    .js .reveal-left.revealed,
    .js .reveal-right.revealed {
        opacity: 1;
        transform: translate(0, 0);
    }
}

/* --- Gold accent line on section dividers --- */
section::before {
    content: '';
}

/* --- Button focus states --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #D4A017;
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Image hover parallax (subtle) --- */
.group img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Card hover lift --- */
.group {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* --- Loading state for images --- */
img {
    background: linear-gradient(135deg, #0A1A14 0%, #061210 100%);
}

/* --- Smooth anchor offset for fixed nav --- */
section[id] {
    scroll-margin-top: 80px;
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    #hero h1 {
        font-size: 2.75rem;
    }
    #hero h1 span:last-of-type {
        font-size: 1.75rem;
    }
    .reveal-left,
    .reveal-right {
        transform: translateY(40px);
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    section[id] {
        scroll-margin-top: 88px;
    }
}
