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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal animations - progressive enhancement, only active with JS */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

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

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Navbar transitions */
.nav-scrolled {
    background: rgba(254, 253, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(16, 185, 129, 0.1), 0 4px 20px rgba(16, 185, 129, 0.06);
}

.nav-scrolled .nav-link {
    color: rgba(6, 78, 59, 0.8) !important;
}

.nav-scrolled .nav-link:hover {
    color: rgba(6, 78, 59, 1) !important;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #6ee7b7;
}

/* Selection color */
::selection {
    background: rgba(16, 185, 129, 0.2);
    color: #064e3b;
}

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

/* Mobile menu animation */
#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);
    }
}

/* Button ripple effect */
button, .group a {
    position: relative;
    overflow: hidden;
}

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

/* Subtle pattern overlay for sections */
.section-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(16, 185, 129, 0.05) 1px, transparent 0);
    background-size: 24px 24px;
}

/* Hero decorative elements */
.hero-deco {
    animation: float 6s ease-in-out infinite;
}

.hero-deco-delay {
    animation: float 6s ease-in-out 3s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Card hover effects */
.group:hover .group-hover\:scale-105 {
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Testimonial card hover */
.bg-gradient-to-br.from-emerald-50.to-cream-50:hover {
    background: linear-gradient(135deg, #ecfdf5 0%, #fdf9ed 100%);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.1);
}

/* Form focus transitions */
input:focus, textarea:focus {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

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

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}
