/* === Base === */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; overflow-x: hidden; }

::selection { background: rgba(184, 101, 74, 0.3); color: #f5efe6; }

/* === Animations === */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation-name: fadeUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

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

/* === Scroll Reveal === */
.section-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* === Header === */
#header {
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
}

#header.scrolled {
    background: rgba(14, 11, 8, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #b8654a, #d4b896);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: #d4b896 !important; }

/* === Mobile Menu === */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.open .mobile-link {
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }

.menu-line { transform-origin: center; }
body.menu-open .menu-line:nth-child(1) { transform: translateY(4px) rotate(45deg); }
body.menu-open .menu-line:nth-child(2) { opacity: 0; }
body.menu-open .menu-line:nth-child(3) { transform: translateY(-4px) rotate(-45deg); width: 20px; }

/* === Hero === */
.hero-img {
    transition: transform 8s ease;
}

#hero:hover .hero-img {
    transform: scale(1.08);
}

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

.service-card:hover {
    transform: translateY(-4px);
    background: rgba(26, 20, 16, 0.8);
}

/* === Stats === */
.stat-item {
    transition: transform 0.3s ease;
}
.stat-item:hover { transform: translateY(-2px); }

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

/* === Form === */
select option {
    background: #1a1410;
    color: #f5efe6;
}

/* === Mobile === */
@media (max-width: 767px) {
    html { scroll-padding-top: 70px; }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .section-reveal { opacity: 1; transform: none; }
}
