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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(77, 176, 120, 0.3);
    color: #e0f5e8;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a1f3f;
}
::-webkit-scrollbar-thumb {
    background: rgba(77, 176, 120, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 176, 120, 0.5);
}

/* ─── Hero Animations ─── */
.hero-anim {
    opacity: 0;
    transform: translateY(24px);
    animation: heroReveal 0.8s ease forwards;
}

.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.25s; }
.hero-anim:nth-child(3) { animation-delay: 0.4s; }
.hero-anim:nth-child(4) { animation-delay: 0.55s; }

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

.hero-image {
    opacity: 0;
    transform: translateX(40px);
    animation: heroImageReveal 1s ease 0.3s forwards;
}

@keyframes heroImageReveal {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Reveal on Scroll (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

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

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* ─── Fallback: always visible if JS is disabled or reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

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

#navbar.scrolled {
    background: rgba(6, 19, 38, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ─── Mobile Menu ─── */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

/* ─── Button Focus ─── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(77, 176, 120, 0.6);
    outline-offset: 2px;
}

/* ─── Image aspect ratios ─── */
img {
    display: block;
}

/* ─── Subtle hover lift for cards ─── */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}
