/* ─── Base & Reset ─── */
*, *::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; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* ─── Hero Animations ─── */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation-name: fade-in-up;
    animation-duration: 0.9s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-iteration-count: 1;
}

/* ─── Scroll Reveal (below-the-fold only) ─── */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal[data-reveal-state="hidden"] {
    opacity: 0;
    transform: translateY(30px);
}

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

/* ─── Navbar Scroll State ─── */
#navbar.scrolled {
    background: rgba(244, 250, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(15, 24, 48, 0.08);
}

#navbar.scrolled .font-serif {
    color: #0f1830 !important;
}

#navbar.scrolled .mobile-link {
    color: #0f1830 !important;
}

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

#mobile-menu .mobile-link {
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#mobile-menu.open .mobile-link {
    transform: translateY(0);
    opacity: 1;
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Mobile toggle animation */
#navbar.mobile-open #bar1 {
    transform: rotate(45deg) translate(5px, 5px);
}
#navbar.mobile-open #bar2 {
    opacity: 0;
}
#navbar.mobile-open #bar3 {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* ─── Selection ─── */
::selection {
    background: #93ccba;
    color: #0f1830;
}

/* ─── Focus Visible ─── */
:focus-visible {
    outline: 2px solid #3d9980;
    outline-offset: 2px;
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f4faf8;
}
::-webkit-scrollbar-thumb {
    background: #93ccba;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #62b39c;
}
