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

body {
    overflow-x: hidden;
}

/* Scroll reveal base states - content is always visible by default */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Only apply animation states when JS is active and motion is preferred */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
    }
    .reveal-right {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Navbar styles */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(10, 15, 12, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #4ade80 !important;
}

/* Mobile menu animations */
#mobileMenu {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileMenu.open {
    transform: translateX(0);
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

/* Glow effects */
.glow-emerald {
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.15);
}

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

::-webkit-scrollbar-track {
    background: #0a0f0c;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #166534, #15803d);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #15803d, #16a34a);
}

/* Selection color */
::selection {
    background: rgba(34, 197, 94, 0.3);
    color: #fefdf8;
}

/* Input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #0d1610 inset !important;
    -webkit-text-fill-color: #fefdf8 !important;
    caret-color: #fefdf8;
}

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

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #navbar, #backToTop {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}
