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

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(74, 125, 72, 0.2);
    color: #1d322b;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

    /* Hero animations — only if JS is available */
    .hero-sub {
        opacity: 0;
        animation: fadeUp 0.8s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    .hero-title {
        opacity: 0;
        animation: fadeUp 0.8s 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    .hero-desc {
        opacity: 0;
        animation: fadeUp 0.8s 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    .hero-cta {
        opacity: 0;
        animation: fadeUp 0.8s 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
}

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

/* ── Navbar transitions ── */
#navbar.scrolled .nav-text-color {
    color: #1d322b;
}

.nav-link {
    position: relative;
}

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

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

.nav-btn-border {
    position: relative;
    overflow: hidden;
}

.nav-btn-border::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.nav-btn-border:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-btn-border:hover {
    color: #faf9f6 !important;
}

/* ── Mobile menu ── */
#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-link {
    position: relative;
}

/* ── Form focus styles ── */
input:focus,
textarea:focus {
    outline: none;
}

/* ── Utility ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
