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

body {
    overflow-x: hidden;
}

::selection {
    background-color: #2DD4BF;
    color: #042f2e;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #99f6e4;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2DD4BF;
}

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.nav-logo-text {
    transition: color 0.4s ease;
}

#navbar:not(.scrolled) .nav-logo-text {
    color: #0d1a28;
}

#navbar.scrolled .nav-logo-text {
    color: #0d1a28;
}

/* ===== Mobile Menu ===== */
.mobile-menu-link {
    position: relative;
}

.mobile-menu-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2DD4BF;
    transition: width 0.3s ease;
}

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

/* ===== Reveal Animations ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

/* ===== Hero Image ===== */
#hero img {
    will-change: transform;
}

/* ===== Card Hover Effects ===== */
.group img {
    will-change: transform;
}

/* ===== Button Focus States ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2DD4BF;
    outline-offset: 3px;
    border-radius: 9999px;
}

/* ===== Smooth Image Loading ===== */
img {
    image-rendering: auto;
}

/* ===== Selection Color ===== */
/* Already handled in base */

/* ===== Utility ===== */
.no-scroll {
    overflow: hidden;
}

/* ===== Tablet and up adjustments ===== */
@media (min-width: 768px) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
    }
}
