/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: #fbbf24;
    color: #0d1e3f;
}

/* Scroll Reveal Animations */
.scroll-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
    }

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

    .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; }
}

/* Navbar transitions */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(13, 30, 63, 0.08);
}

#navbar.scrolled .nav-link {
    color: #1e3a72;
}

#navbar.scrolled .font-display {
    color: #0d1e3f !important;
}

#navbar.scrolled .text-navy-600 {
    color: #4164af !important;
}

/* Mobile menu animation */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Pulse animation for hero badge */
@keyframes softPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-pulse {
    animation: softPulse 2s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
    background: #f0f3f9;
}

::-webkit-scrollbar-thumb {
    background: #b3c1df;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8da2cf;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image loading placeholder */
img {
    background: linear-gradient(135deg, #f0f3f9 0%, #d9e0ef 100%);
}

/* Smooth image transitions */
img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Subtle hover on service cards */
.group:hover .group-hover\:bg-gold-50 {
    background-color: #fdf8e8;
}

/* Navbar link underline animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fbbf24;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Back to top button */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Testimonial hover lift */
.scroll-reveal:hover {
    border-color: rgba(251, 191, 36, 0.3) !important;
}

/* Print styles */
@media print {
    #navbar, #back-to-top, .scroll-reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
