/* Base & Typography */
html {
    scroll-behavior: smooth;
}

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

/* Navbar scroll state */
.nav-scrolled {
    background: rgba(253, 251, 247, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-scrolled .nav-text {
    color: #2a1d14 !important;
}

.nav-scrolled .nav-link {
    color: #3d2b1f !important;
}

/* Hero entrance animations */
#hero-eyebrow {
    animation: fadeUp 0.8s ease forwards 0.2s;
}

#hero-headline {
    animation: fadeUp 0.8s ease forwards 0.4s;
}

#hero-sub {
    animation: fadeUp 0.8s ease forwards 0.6s;
}

#hero-cta {
    animation: fadeUp 0.8s ease forwards 0.8s;
}

#hero-scroll {
    animation: fadeUp 0.8s ease forwards 1s;
}

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

/* Scroll reveal animations */
.section-eyebrow,
.service-card,
.work-card,
.form-group,
.contact-detail {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Staggered delays for service cards */
.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; }

/* Staggered delays for work cards */
.work-card:nth-child(1) { transition-delay: 0.05s; }
.work-card:nth-child(2) { transition-delay: 0.1s; }
.work-card:nth-child(3) { transition-delay: 0.15s; }
.work-card:nth-child(4) { transition-delay: 0.2s; }
.work-card:nth-child(5) { transition-delay: 0.25s; }
.work-card:nth-child(6) { transition-delay: 0.3s; }

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

.menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-open .menu-line:nth-child(2) {
    opacity: 0;
}

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

/* Custom 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='%23916540' 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;
    background-size: 16px;
    padding-right: 40px;
}

/* Selection color */
::selection {
    background: #c43516;
    color: #fdfbf7;
}

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

    .service-card,
    .work-card,
    .section-eyebrow {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Focus visible */
:focus-visible {
    outline: 2px solid #c43516;
    outline-offset: 2px;
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
