/* ── Base Reset & Globals ── */
*, *::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(79, 122, 51, 0.2);
    color: #1a3a10;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f3ed;
}
::-webkit-scrollbar-thumb {
    background: #9dbc82;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #719952;
}

/* ── Animations ── */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes float-delayed {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-2deg); }
}

@keyframes scroll-line {
    0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

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

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

/* ── Hero Animations ── */
.hero-eyebrow {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero-headline {
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero-subtext {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
}

.hero-cta-primary {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

.hero-cta-secondary {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards;
}

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

/* ── Utility ── */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite 1s;
}

.animate-scroll-line {
    animation: scroll-line 2s ease-in-out infinite;
}

.animate-marquee {
    animation: marquee 30s linear infinite;
}

/* ── Reveal on Scroll ── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-on-scroll.revealed:nth-child(2) { transition-delay: 0.1s; }
.reveal-on-scroll.revealed:nth-child(3) { transition-delay: 0.2s; }
.reveal-on-scroll.revealed:nth-child(4) { transition-delay: 0.3s; }
.reveal-on-scroll.revealed:nth-child(5) { transition-delay: 0.4s; }
.reveal-on-scroll.revealed:nth-child(6) { transition-delay: 0.5s; }

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

.navbar-scrolled .nav-subtext {
    color: #4f7a33;
}

.navbar-scrolled .nav-link {
    color: #3d6127;
}

.navbar-scrolled .nav-link:hover {
    color: #4f7a33;
}

.navbar-scrolled #menuLine1,
.navbar-scrolled #menuLine2,
.navbar-scrolled #menuLine3 {
    background-color: #1a3a10;
}

/* ── Mobile Menu ── */
.mobile-menu-open #menuLine1 {
    transform: rotate(45deg) translate(4px, 4px);
}
.mobile-menu-open #menuLine2 {
    opacity: 0;
}
.mobile-menu-open #menuLine3 {
    transform: rotate(-45deg) translate(4px, -4px);
}

.mobile-menu-open #mobileMenu {
    opacity: 1;
    pointer-events: all;
}

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

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

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

/* ── Service Cards ── */
.service-card {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.5s ease,
                border-color 0.5s ease,
                box-shadow 0.5s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.3);
}

/* ── Gallery Items ── */
.gallery-item {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover {
    transform: scale(1.02);
}

/* ── Focus Styles ── */
input:focus, select:focus, textarea:focus {
    outline: none;
}

/* ── Responsive Tweaks ── */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.5rem !important;
    }

    .hero-headline br {
        display: none;
    }

    .hero-headline span {
        display: inline;
    }
}
