/* Base & utilities */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f5f4;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Reveal animations */
.reveal-up {
    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-left {
    opacity: 0;
    transform: translateX(-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-right {
    opacity: 0;
    transform: translateX(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-up.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Staggered delays for card grids */
.reveal-up:nth-child(2) { transition-delay: 100ms; }
.reveal-up:nth-child(3) { transition-delay: 200ms; }
.reveal-up:nth-child(4) { transition-delay: 300ms; }
.reveal-up:nth-child(5) { transition-delay: 400ms; }
.reveal-up:nth-child(6) { transition-delay: 500ms; }

/* Header scroll state */
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.04);
}

header.scrolled .font-display {
    color: #0d7a5c !important;
}

/* Nav link hover effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #0d7a5c;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-link {
    position: relative;
}

/* Mobile menu transitions */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mobile-link {
    position: relative;
}

/* Image hover zoom */
img {
    display: block;
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0d7a5c;
    outline-offset: 2px;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Form select arrow */
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 12px center;
    padding-right: 36px;
}

/* Date input styling */
input[type="date"] {
    color: #64748b;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: pointer;
}

/* Active nav link */
.nav-link.active {
    color: #0d7a5c;
    background-color: #f0fdf9;
}

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