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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll reveal base state - always visible */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Only apply hidden state when JS is active and motion is preferred */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .js-enabled .scroll-reveal:not(.revealed) {
        opacity: 0;
        transform: translateY(40px);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f7f3ee;
}
::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #2d5a8a;
}

/* Selection color */
::selection {
    background: #c9a84c;
    color: #0d1f3c;
}

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(13, 31, 60, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.nav-scrolled .nav-logo-text {
    color: #fff !important;
}

/* Image hover effects */
img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Button focus states */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Input focus states */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

/* 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;
    }
    .animate-fade-in-up {
        opacity: 1;
        transform: none;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}
