/* ===== Base & Typography ===== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(74, 124, 89, 0.2);
    color: #1a3626;
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 1;
    transform: none;
    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);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Stagger children */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* Gallery items */
.gallery-item {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item.revealed {
    opacity: 1;
    transform: scale(1);
}

.gallery-item:nth-child(1) { transition-delay: 0.02s; }
.gallery-item:nth-child(2) { transition-delay: 0.06s; }
.gallery-item:nth-child(3) { transition-delay: 0.1s; }
.gallery-item:nth-child(4) { transition-delay: 0.14s; }
.gallery-item:nth-child(5) { transition-delay: 0.18s; }
.gallery-item:nth-child(6) { transition-delay: 0.22s; }
.gallery-item:nth-child(7) { transition-delay: 0.26s; }
.gallery-item:nth-child(8) { transition-delay: 0.3s; }

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(251, 250, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(45, 90, 61, 0.08);
}

.nav-text {
    color: #1a3626;
}

.nav-subtext {
    color: #4A7C59;
}

#navbar:not(.scrolled) .nav-text {
    color: #FBFAF7;
}

#navbar:not(.scrolled) .nav-subtext {
    color: rgba(251, 250, 247, 0.6);
}

.nav-link {
    color: #1a3626;
}

#navbar:not(.scrolled) .nav-link {
    color: rgba(251, 250, 247, 0.8);
}

#navbar:not(.scrolled) .nav-link:hover {
    color: #C9A96E;
}

.nav-btn span {
    background: #1a3626;
}

#navbar:not(.scrolled) .nav-btn span {
    background: #FBFAF7;
}

/* ===== Mobile Menu ===== */
.mobile-link {
    font-size: 1.5rem;
}

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

/* Mobile menu button animation */
#menuBtn.active span:nth-child(1) {
    transform: rotate(45deg) translate(0.25rem, 0.25rem);
}

#menuBtn.active span:nth-child(2) {
    opacity: 0;
}

#menuBtn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(0.25rem, -0.25rem);
    width: 1.5rem;
}

/* ===== Custom Select ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A7C59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ===== Smooth focus ===== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ===== Button hover effects ===== */
button[type="submit"],
a[href="#contact"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::after,
a[href="#contact"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

button[type="submit"]:hover::after,
a[href="#contact"]:hover::after {
    left: 100%;
}

/* ===== Accessibility ===== */
@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,
    .service-card,
    .gallery-item {
        opacity: 1;
        transform: none;
    }
}

/* ===== Responsive adjustments ===== */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
}
