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

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

body {
    margin: 0;
    min-height: 100vh;
}

::selection {
    background: #22A26E;
    color: #FFF8F0;
}

/* ── Navbar ── */
#navbar {
    background: rgba(255, 248, 240, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(13, 74, 58, 0.06);
}

#navbar.scrolled {
    background: rgba(255, 248, 240, 0.95);
    box-shadow: 0 4px 30px rgba(13, 74, 58, 0.08);
}

/* ── Hero Shapes ── */
.hero-shape {
    animation: float 8s ease-in-out infinite;
}

.hero-shape:nth-child(2) { animation-delay: -2s; animation-duration: 10s; }
.hero-shape:nth-child(3) { animation-delay: -4s; animation-duration: 7s; }
.hero-shape:nth-child(4) { animation-delay: -1s; animation-duration: 9s; }
.hero-shape:nth-child(5) { animation-delay: -3s; animation-duration: 11s; }
.hero-shape:nth-child(6) { animation-delay: -5s; animation-duration: 8s; }
.hero-shape:nth-child(7) { animation-delay: -2.5s; animation-duration: 12s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(var(--rotation, 0deg)); }
    50% { transform: translateY(-20px) rotate(var(--rotation, 0deg)); }
}

/* ── Hero Cards ── */
.hero-card {
    animation: cardEntrance 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(40px);
    opacity: 0;
}

@keyframes cardEntrance {
    to { transform: translateY(0); opacity: 1; }
}

.hero-float {
    animation: floatCard 6s ease-in-out infinite;
}

.hero-float:nth-child(2) { animation-delay: -1s; }
.hero-float:nth-child(3) { animation-delay: -2.5s; }
.hero-float:nth-child(4) { animation-delay: -4s; }

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

/* ── Service Cards ── */
.service-card {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ── Gallery ── */
.gallery-item {
    height: 280px;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .gallery-item {
        height: 320px;
    }
}

/* ── Testimonials ── */
.testimonial-card {
    opacity: 1;
}

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

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

/* Default visible state for progressive enhancement */
.scroll-reveal {
    transform: translateY(0);
}

/* Reduced motion - no animations */
@media (prefers-reduced-motion: reduce) {
    .hero-shape,
    .hero-float,
    .hero-card,
    .scroll-reveal,
    .service-card,
    .gallery-item img,
    .back-to-top {
        animation: none !important;
        transition: none !important;
    }

    .hero-card {
        transform: none;
        opacity: 1;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ── Back to Top ── */
.back-to-top {
    transition: opacity 0.3s, transform 0.3s;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

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

#mobile-menu .mobile-link {
    opacity: 0;
    transform: translateY(20px);
    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.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }

/* ── Mobile Menu Button ── */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

#mobile-menu-btn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#mobile-menu-btn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn[aria-expanded="true"] .menu-line:nth-child(3) {
    width: 6px;
    transform: translateY(-4px) rotate(-45deg);
}

/* ── Form Select Arrow ── */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230D4A3A' 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 12px center;
    padding-right: 40px;
}

/* ── Utility ── */
.js-loaded body {
    opacity: 1;
}
