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

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

body {
    overflow-x: hidden;
}

/* ===== Navigation ===== */
.nav-scrolled {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-scrolled.scrolled {
    background-color: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(26, 77, 46, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
    opacity: 0.4;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-nav-link {
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 77, 46, 0.08);
}

/* ===== Hero Floating Cards ===== */
.floating-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-card:hover {
    transform: translateY(-6px);
}

.card-1 { animation: float1 4s ease-in-out infinite; }
.card-2 { animation: float2 4.5s ease-in-out infinite; }
.card-3 { animation: float3 5s ease-in-out infinite; }
.card-4 { animation: float4 4.2s ease-in-out infinite; }

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

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

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

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

/* ===== Scroll Reveal (progressive enhancement) ===== */
.js .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-on-scroll {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

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

    /* Stagger children */
    .reveal-on-scroll:nth-child(2) { transition-delay: 0.1s; }
    .reveal-on-scroll:nth-child(3) { transition-delay: 0.2s; }
    .reveal-on-scroll:nth-child(4) { transition-delay: 0.3s; }
}

/* ===== Image hover transitions ===== */
.group img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ===== Selection color ===== */
::selection {
    background-color: rgba(45, 114, 64, 0.2);
    color: #1a4d2e;
}

/* ===== Mobile menu transitions ===== */
#mobile-menu {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #72b37e;
}

/* ===== Mobile responsiveness adjustments ===== */
@media (max-width: 767px) {
    html {
        scroll-padding-top: 70px;
    }

    #hero h1 {
        font-size: 2.75rem;
    }

    .floating-card {
        padding: 1.25rem;
    }

    .floating-card .font-serif {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #hero h1 {
        font-size: 4rem;
    }
}
