/* ===== Base & Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: #c9a84c;
    color: #0a1525;
}

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

    /* Stagger children */
    .reveal-stagger > * {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
    .reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
    .reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
    .reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
    .reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
    .reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }
}

/* Fallback: content always visible if JS is disabled */
.no-js .reveal,
.js-enabled .reveal {
    /* JS will add .revealed class */
}

/* ===== Navbar ===== */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(30, 58, 95, 0.06);
}

#navbar.scrolled .nav-link {
    color: #1e3a5f;
}

#navbar.scrolled .menu-line {
    background: #1e3a5f;
}

#navbar.scrolled .font-serif {
    color: #1e3a5f;
}

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

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

#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; }

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

/* ===== Mobile Menu Button Animation ===== */
.menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    width: 1.5rem;
}

/* ===== Smooth anchor offsets ===== */
section[id] {
    scroll-margin-top: 80px;
}

/* ===== Focus styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
    background: #b8cce9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8faed9;
}

/* ===== Image lazy-load placeholder ===== */
img {
    background: linear-gradient(135deg, #f0f4fa 0%, #dce6f5 100%);
}
