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

body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Selection color */
::selection {
    background-color: #166534;
    color: #fefdf8;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #15803d;
}

/* Scroll reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    opacity: 0;
    transform: translateY(30px);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger children */
    .reveal-grid > *:nth-child(1) { transition-delay: 0.1s; }
    .reveal-grid > *:nth-child(2) { transition-delay: 0.2s; }
    .reveal-grid > *:nth-child(3) { transition-delay: 0.3s; }
    .reveal-grid > *:nth-child(4) { transition-delay: 0.4s; }
}

/* Navbar scroll state */
.navbar-scrolled {
    background-color: rgba(254, 253, 248, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(20, 83, 45, 0.08);
}

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

.navbar-scrolled .nav-link:hover {
    color: #15803d !important;
}

/* Hero floating cards animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(var(--rotate, 2deg)); }
    50% { transform: translateY(-12px) rotate(var(--rotate, 2deg)); }
}

.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -2s;
    animation-duration: 7s;
}

.floating-card:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 5.5s;
}

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

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

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

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                padding 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#mobile-menu.open {
    max-height: 400px;
    padding: 1.5rem 0;
}

/* Menu item hover */
.menu-item {
    position: relative;
}

.menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #86efac;
    transition: width 0.3s ease;
}

.menu-item:hover::after {
    width: 100%;
}

/* Gallery hover overlay */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20, 83, 45, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Button ripple effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Decorative elements */
.ornament {
    display: inline-block;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, transparent, #166534, transparent);
}

/* Print styles */
@media print {
    nav, #mobile-menu-btn, .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
