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

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(13, 148, 136, 0.15);
    color: #0d9488;
}

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

::-webkit-scrollbar-track {
    background: #f8fafc;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navigation */
#navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

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

#mobileMenu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

#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; }
#mobileMenu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* Hamburger Animation */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

/* Hero Animations */
.hero-content > * {
    opacity: 0;
    transform: translateY(24px);
    animation: heroFadeUp 0.7s ease forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }
.hero-content > *:nth-child(5) { animation-delay: 0.65s; }

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

.hero-image-wrapper {
    opacity: 0;
    transform: translateX(30px);
    animation: heroImageSlide 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes heroImageSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Service Cards */
.service-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
    background: #f8fafc;
}

.service-card:hover .service-card h3 {
    color: #0d9488;
}

/* About Image */
.about-image-wrapper {
    opacity: 0;
    transform: translateX(-30px);
}

.about-image-wrapper.revealed {
    animation: aboutImageSlide 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes aboutImageSlide {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.about-content > * {
    opacity: 0;
    transform: translateY(20px);
}

.about-content.revealed > *:nth-child(1) { animation: fadeUp 0.6s ease 0.1s forwards; }
.about-content.revealed > *:nth-child(2) { animation: fadeUp 0.6s ease 0.2s forwards; }
.about-content.revealed > *:nth-child(3) { animation: fadeUp 0.6s ease 0.3s forwards; }
.about-content.revealed > *:nth-child(4) { animation: fadeUp 0.6s ease 0.4s forwards; }
.about-content.revealed > *:nth-child(5) { animation: fadeUp 0.6s ease 0.5s forwards; }

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

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Form Inputs */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%2394a3b8' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Smooth focus for links */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-content > * {
        animation-duration: 0.5s;
    }
    
    .hero-image-wrapper {
        transform: translateY(20px);
    }
    
    @keyframes heroImageSlide {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
