*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal animations — progressive enhancement, only when JS runs */
.reveal-on-scroll {
    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);
}

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

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

/* Navbar transitions */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(10, 22, 40, 0.08);
}

#navbar.scrolled #nav-logo-text {
    color: #0a1628 !important;
}

#navbar.scrolled .nav-link {
    color: #1d3568 !important;
}

#navbar.scrolled .nav-link:hover {
    color: #3a9d65 !important;
}

/* Mobile menu */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #5bb882;
}

/* Selection */
::selection {
    background: rgba(58, 157, 101, 0.2);
    color: #0a1628;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #3a9d65;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image loading */
img {
    display: block;
    max-width: 100%;
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.2s ease;
}
