/* ── Custom Styles ── */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: rgba(22, 101, 52, 0.2);
    color: #166534;
}

/* ── Floating Card Animations ── */
.floating-card {
    animation: float1 4s ease-in-out infinite;
}

.floating-card-2 {
    animation: float2 5s ease-in-out infinite;
}

.floating-card-3 {
    animation: float3 4.5s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(-1deg); }
}

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

/* ── Scroll Reveal (progressive enhancement) ── */
.reveal-section {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

    /* Stagger children */
    .reveal-section:nth-child(2) { transition-delay: 0.1s; }
    .reveal-section:nth-child(3) { transition-delay: 0.2s; }
    .reveal-section:nth-child(4) { transition-delay: 0.3s; }
    .reveal-section:nth-child(5) { transition-delay: 0.4s; }
    .reveal-section:nth-child(6) { transition-delay: 0.5s; }
}

/* ── Navbar scroll state ── */
#navbar.scrolled {
    background-color: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(5, 46, 22, 0.08);
}

/* ── Mobile menu transitions ── */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobileMenu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* ── Back to top button ── */
#backToTop.visible {
    opacity: 1;
    pointer-events: all;
}

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

/* ── Image loading placeholder ── */
img {
    background-color: #e8ebe2;
}

/* ── Subtle pattern backgrounds ── */
.bg-pattern-dots {
    background-image: radial-gradient(circle, rgba(22, 101, 52, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}
