/* ── Base & Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: #1B4332;
    color: #FEFDF9;
}

/* ── Navbar ── */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1B4332;
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

/* ── Navbar scroll state ── */
.nav-scrolled {
    background: rgba(254, 253, 249, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 20px rgba(27, 67, 50, 0.08);
}

/* ── Floating Cards ── */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -1s;
    animation-duration: 5s;
}

.floating-card:nth-child(3) {
    animation-delay: -2.5s;
    animation-duration: 7s;
}

.floating-card:nth-child(4) {
    animation-delay: -4s;
    animation-duration: 5.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* ── Scroll Animations ── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

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

/* ── Focus styles ── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #1B4332;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
    .floating-card {
        display: none;
    }

    .floating-card:nth-child(1) {
        display: block;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        animation: none;
        margin-top: 1.5rem;
    }

    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .floating-card {
        display: none;
    }
}

/* ── 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 {
        opacity: 1;
        transform: none;
    }
}
