/* ── Base & Reset ─────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background-color: rgba(74, 122, 74, 0.2);
    color: #1a2b1a;
}

img {
    display: block;
    max-width: 100%;
}

/* ── Scroll Reveal ────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        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);
    }

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* ── Hero Animations ──────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .hero-tagline {
        animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    h1 .hero-word {
        display: inline-block;
        opacity: 0;
        transform: translateY(40px);
        animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    h1 .hero-word:nth-child(1) { animation-delay: 0.15s; }
    h1 .hero-word:nth-child(2) { animation-delay: 0.25s; }
    h1 .hero-word:nth-child(3) { animation-delay: 0.35s; }
    h1 .hero-word:nth-child(4) { animation-delay: 0.45s; }
    h1 .hero-word:nth-child(5) { animation-delay: 0.55s; }
    h1 .hero-word:nth-child(6) { animation-delay: 0.65s; }
    h1 .hero-word:nth-child(7) { animation-delay: 0.75s; }

    .hero-cta {
        opacity: 0;
        animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
    }

    .hero-stats {
        opacity: 0;
        animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
    }

    .hero-image {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
        animation: imageReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    }

    .hero-floating-card {
        opacity: 0;
        animation: floatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
    }

    .scroll-line {
        width: 100%;
        height: 0%;
        background: linear-gradient(to bottom, transparent, #6a9a6a);
        animation: scrollGrow 1.5s ease-in-out infinite;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes imageReveal {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollGrow {
    0%   { height: 0%; opacity: 0; }
    50%  { opacity: 1; }
    100% { height: 100%; opacity: 0; }
}

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

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

/* ── Marquee ──────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .marquee-track {
        display: flex;
        animation: marquee 30s linear infinite;
        width: max-content;
    }

    .marquee-item {
        flex-shrink: 0;
    }
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Navbar ───────────────────────────────────────────── */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(253, 252, 250, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(48, 80, 48, 0.08);
}

/* ── Mobile Menu ──────────────────────────────────────── */
.mobile-link {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

/* ── Menu Cards ───────────────────────────────────────── */
.border-l-2 {
    border-left-width: 2px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8fb88f;
}

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

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
