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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reveal Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered delays for grid children */
.reveal-up:nth-child(1) { transition-delay: 0.05s; }
.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-up:nth-child(3) { transition-delay: 0.15s; }
.reveal-up:nth-child(4) { transition-delay: 0.2s; }
.reveal-up:nth-child(5) { transition-delay: 0.25s; }
.reveal-up:nth-child(6) { transition-delay: 0.3s; }
.reveal-up:nth-child(7) { transition-delay: 0.35s; }
.reveal-up:nth-child(8) { transition-delay: 0.4s; }

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(6, 78, 59, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav-scrolled .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.nav-scrolled #nav-logo-text,
.nav-scrolled #nav-logo-sub {
    color: white !important;
}

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

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

/* Hero reveal animations */
#hero .reveal-up {
    opacity: 0;
    transform: translateY(50px);
}

#hero.revealed .reveal-up:nth-child(1) { animation: heroReveal 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#hero.revealed .reveal-up:nth-child(2) { animation: heroReveal 0.8s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#hero.revealed .reveal-up:nth-child(3) { animation: heroReveal 0.8s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#hero.revealed .reveal-up:nth-child(4) { animation: heroReveal 0.8s 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

::-webkit-scrollbar-track {
    background: #064e3b;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #065f46;
}

/* Focus styles */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

/* Selection color */
::selection {
    background: rgba(5, 150, 105, 0.3);
    color: #064e3b;
}

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

img[data-src] {
    opacity: 0;
}

/* Gallery hover overlay */
.rounded-2xl.overflow-hidden.group::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 78, 59, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
    pointer-events: none;
}

.rounded-2xl.overflow-hidden.group:hover::after {
    opacity: 1;
}

.rounded-2xl.overflow-hidden.group {
    position: relative;
}

/* 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;
    }

    .reveal-up {
        opacity: 1;
        transform: none;
    }

    #hero .reveal-up {
        opacity: 1;
        transform: none;
    }

    img {
        transition: none;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    #hero h1 {
        font-size: 2.75rem;
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    #hero h1 {
        font-size: 5.5rem;
    }
}
