/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Reveal animations (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .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; }
}

/* ── Navbar ── */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}
#navbar.scrolled {
    background: rgba(253, 249, 243, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(15, 28, 63, 0.08);
}

/* ── Mobile menu ── */
#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}
#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* ── Hamburger animation ── */
.menu-line:last-child {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
body.menu-open .menu-line:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}
body.menu-open .menu-line:nth-child(2) {
    opacity: 0;
}
body.menu-open .menu-line:last-child {
    width: 20px;
    transform: rotate(-45deg) translate(3px, -3px);
    margin-left: 0;
}

/* ── Floating cards subtle animation ── */
@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes float-medium {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes float-fast {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes float-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: no-preference) {
    .float-slow { animation: float-slow 6s ease-in-out infinite; }
    .float-medium { animation: float-medium 5s ease-in-out infinite; }
    .float-fast { animation: float-fast 4.5s ease-in-out infinite; }
    .float-subtle { animation: float-subtle 7s ease-in-out infinite; }
}

/* ── Selection ── */
::selection {
    background: rgba(200, 164, 92, 0.25);
    color: #0F1C3F;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FDF9F3; }
::-webkit-scrollbar-thumb { background: #0F1C3F; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #162A54; }
