/* Base & Typography */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(13, 148, 136, 0.4);
    color: #f1f5f9;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0d9488;
}

/* Reveal animations — progressive enhancement, respects reduced motion */
@media (prefers-reduced-motion: no-preference) {
    .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.visible {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal-gallery {
        opacity: 0;
        transform: scale(0.95);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .reveal-gallery.visible {
        opacity: 1;
        transform: scale(1);
    }
}

/* Navbar glass effect */
.nav-scrolled {
    background: rgba(2, 6, 23, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(13, 148, 136, 0.15);
}

/* Mobile menu animation */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* Image hover container */
.reveal-gallery img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* Service card hover */
.group:hover .group-hover\:bg-teal-800\/40 {
    background-color: rgba(13, 110, 110, 0.4);
}

/* Form select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' 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 1rem center;
    padding-right: 2.5rem;
}

/* Smooth anchor offset for fixed nav */
section[id] {
    scroll-margin-top: 80px;
}

/* Gallery grid adjustments */
@media (min-width: 768px) {
    .reveal-gallery:nth-child(1) { transition-delay: 0ms; }
    .reveal-gallery:nth-child(2) { transition-delay: 80ms; }
    .reveal-gallery:nth-child(3) { transition-delay: 160ms; }
    .reveal-gallery:nth-child(4) { transition-delay: 240ms; }
    .reveal-gallery:nth-child(5) { transition-delay: 320ms; }
    .reveal-gallery:nth-child(6) { transition-delay: 400ms; }
    .reveal-gallery:nth-child(7) { transition-delay: 480ms; }
    .reveal-gallery:nth-child(8) { transition-delay: 560ms; }
}
