/* ===== Base & Utilities ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal-section {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

    /* Staggered delays */
    .reveal-section:nth-child(1) { transition-delay: 0.05s; }
    .reveal-section:nth-child(2) { transition-delay: 0.12s; }
    .reveal-section:nth-child(3) { transition-delay: 0.19s; }
    .reveal-section:nth-child(4) { transition-delay: 0.26s; }
}

/* Default visible state for reduced-motion / no-JS */
@media (prefers-reduced-motion: reduce) {
    .reveal-section {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* No-JS fallback: everything visible */
.no-js .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
}

/* ===== Floating Cards Animation ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

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

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

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

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

@media (prefers-reduced-motion: reduce) {
    .floating-card {
        animation: none;
    }
}

/* ===== Navbar scroll state ===== */
#site-header.scrolled {
    background: rgba(254, 253, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08), 0 4px 24px rgba(6, 78, 59, 0.06);
}

#site-header.scrolled .nav-link {
    color: #064e3b;
}

#site-header.scrolled .nav-link:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* ===== Mobile Menu Transitions ===== */
#mobile-menu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-menu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-link {
    transition: background 0.2s ease;
}

/* ===== Smooth anchor offset ===== */
section[id] {
    scroll-margin-top: 80px;
}

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