/* Custom styles for Hype Nutrition / Fit Republic */

:root {
    --navy-dark: #0a1628;
    --navy-mid: #1a2d4a;
    --gold-light: #d4a853;
    --gold-mid: #b8923f;
    --gold-dark: #8a6d2b;
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
}

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

body {
    font-family: 'Lato', sans-serif;
    color: var(--navy-dark);
    background-color: var(--stone-50);
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

/* Tailwind config override */
@tailwind base;
@tailwind components;
@tailwind utilities;

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

/* Navbar scroll effect */
.navbar-scrolled {
    background-color: rgba(10, 22, 40, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--stone-50);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-mid);
}

/* Selection color */
::selection {
    background-color: var(--gold-light);
    color: var(--navy-dark);
}

/* Input focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--gold-light) !important;
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

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

/* Hover underline animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--gold-light);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* Mobile menu animation */
#mobile-menu {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#mobile-menu.open {
    transform: translateY(0) !important;
    opacity: 1;
}

#mobile-menu.closed {
    transform: translateY(-100%);
    opacity: 0;
}

/* Intersection Observer animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Print styles */
@media print {
    nav,
    #contact-form,
    button {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
