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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

/* ─── Custom Properties ─── */
:root {
    --forest-700: #1a3a2a;
    --forest-500: #42784e;
    --offwhite: #f5f0e8;
    --cream: #faf7f2;
}

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

    .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) {
    [data-animate] {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    [data-animate].animated {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Section Label ─── */
.section-label {
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--forest-500);
    font-weight: 300;
}

/* ─── Navbar ─── */
#navbar {
    background: transparent;
    transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
    background: rgba(245, 240, 232, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.08);
}

#navbar.scrolled .nav-link {
    color: var(--forest-700);
}

#navbar.scrolled .menu-line {
    background: var(--forest-700);
}

#navbar.scrolled .group:hover {
    color: var(--forest-700);
}

.nav-link {
    color: rgba(245, 240, 232, 0.8);
    transition: color 0.3s ease;
}

/* ─── Scroll Indicator ─── */
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.scroll-line-inner {
    animation: scrollLine 1.5s ease-in-out infinite;
}

/* ─── CTA Buttons ─── */
.cta-primary {
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cta-primary:hover::before {
    opacity: 1;
}

/* ─── Form ─── */
input::placeholder,
textarea::placeholder {
    color: rgba(26, 58, 42, 0.25);
}

input:focus,
textarea:focus {
    border-color: var(--forest-500) !important;
}

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

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.3s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.4s; }

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

/* ─── Mobile Menu Button States ─── */
.menu-open .menu-line:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-open .menu-line:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ─── Selection ─── */
::selection {
    background: rgba(26, 58, 42, 0.15);
    color: var(--forest-700);
}

/* ─── Focus Visible ─── */
:focus-visible {
    outline: 2px solid var(--forest-500);
    outline-offset: 2px;
}

/* ─── 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;
    }
}
