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

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

body {
    margin: 0;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: #FF6B4A;
    color: white;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Scroll Reveal */
.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);
}

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

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

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

/* Navbar transition */
#navbar.scrolled {
    background: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Form focus styles */
input:focus,
textarea:focus {
    outline: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1d23;
}

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

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

/* Mobile menu */
#mobileMenu {
    animation: fadeInUp 0.3s ease forwards;
}

#mobileMenu.hidden {
    animation: fadeIn 0.2s ease forwards;
    display: none;
}

/* Service grid gap fix */
.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-px > div {
    border-radius: 0;
}

.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-px > div:first-child {
    border-radius: 16px 0 0 0;
}

.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-px > div:nth-child(3) {
    border-radius: 0 16px 0 0;
}

.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-px > div:nth-child(6) {
    border-radius: 0 0 0 16px;
}

.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-px > div:nth-child(7) {
    border-radius: 0 0 16px 0;
}
