/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(13, 148, 136, 0.15);
    color: #0f172a;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0d9488;
}

/* Animations */
@keyframes scroll-line {
    0% { transform: translateY(-8px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(8px); opacity: 0; }
}

.animate-scroll-line {
    animation: scroll-line 1.5s ease-in-out infinite;
}

/* Scroll Reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Service cards */
.service-card {
    transition: background-color 0.3s ease;
}

/* Navbar transitions */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #0d9488;
    transition: width 0.3s ease;
}

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

/* Mobile menu */
#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

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

#mobile-menu .mobile-nav-link {
    opacity: 0;
}

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

/* Staggered animation delays for mobile nav */
#mobile-menu .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }

/* Hamburger animation */
#menu-icon.active #line1 {
    transform: rotate(45deg) translate(3px, 3px);
}
#menu-icon.active #line2 {
    opacity: 0;
}
#menu-icon.active #line3 {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Form select styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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 0 center;
    padding-right: 2rem;
}

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