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

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

body {
    overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

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

/* Mobile menu line animations */
.mobile-menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body.menu-open .mobile-menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 24px;
}

body.menu-open #mobile-menu {
    transform: translateX(0);
}

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

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

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #0d9488;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover::after {
    width: 100%;
}

/* Mobile link fade-in */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
}

body.menu-open .mobile-link {
    animation: fadeInUp 0.4s ease forwards;
}

body.menu-open .mobile-link:nth-child(1) { animation-delay: 0.1s; }
body.menu-open .mobile-link:nth-child(2) { animation-delay: 0.15s; }
body.menu-open .mobile-link:nth-child(3) { animation-delay: 0.2s; }
body.menu-open .mobile-link:nth-child(4) { animation-delay: 0.25s; }
body.menu-open .mobile-link:nth-child(5) { animation-delay: 0.3s; }
body.menu-open .mobile-link:nth-child(6) { animation-delay: 0.35s; }

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

/* Scroll reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }

/* Image hover zoom */
img {
    display: block;
    max-width: 100%;
}

/* Form focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduce motion preference */
@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;
    }
}

/* Print styles */
@media print {
    nav, #mobile-menu, .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
