/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f7f8f9;
}
::-webkit-scrollbar-thumb {
    background: #b4bec9;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8a96a5;
}

/* Selection color */
::selection {
    background: #2d6161;
    color: #f7f8f9;
}

/* Nav link styles */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #5e9e9e;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* Mobile nav link */
.mobile-nav-link {
    position: relative;
}

/* Scroll reveal base — content is VISIBLE by default. JS adds the hidden state. */
.reveal {
    /* Default: visible, no animation needed if JS fails */
}

/* Scroll reveal animation */
.reveal.revealed {
    animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* Stagger delays for grid children */
.reveal:nth-child(1) { animation-delay: 0s; }
.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.24s; }
.reveal:nth-child(5) { animation-delay: 0.32s; }
.reveal:nth-child(6) { animation-delay: 0.40s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal.revealed {
        animation: none;
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Navbar transparent state (over hero) */
#navbar {
    background: transparent;
}
#navbar.scrolled {
    background: rgba(17, 22, 28, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
#navbar.scrolled .nav-link-text {
    color: #f7f8f9;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Form select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
