*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(196, 114, 74, 0.3);
    color: #E8D5C0;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0D0D0D;
}

::-webkit-scrollbar-thumb {
    background: #C4A882;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D4845A;
}

/* Header scroll state */
header.scrolled {
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(196, 168, 130, 0.08);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: linear-gradient(90deg, #D4845A, #E8C4A0);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #D4845A !important;
}

/* Mobile menu */
.mobile-nav-link {
    position: relative;
}

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

#mobile-menu.open .mobile-nav-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

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

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

.menu-line {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(8px);
}

#menu-btn.active .menu-line:nth-child(3) {
    width: 6px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Hero */
.hero {
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 70% 40%, rgba(196, 114, 74, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Service cards */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 132, 90, 0), transparent);
    transition: background 0.5s ease;
}

.service-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(212, 132, 90, 0.6), transparent);
}

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* 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;
    }
    
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .font-serif {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
}

/* Focus styles */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #D4845A;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
