/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== SCROLL REVEAL (progressive enhancement) ===== */
.reveal-up {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-active .reveal-up {
    opacity: 0;
    transform: translateY(30px);
}

.js-active .reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.js-active .reveal-up:nth-child(1) { transition-delay: 0ms; }
.js-active .reveal-up:nth-child(2) { transition-delay: 80ms; }
.js-active .reveal-up:nth-child(3) { transition-delay: 160ms; }
.js-active .reveal-up:nth-child(4) { transition-delay: 240ms; }
.js-active .reveal-up:nth-child(5) { transition-delay: 320ms; }
.js-active .reveal-up:nth-child(6) { transition-delay: 400ms; }

/* ===== NAVBAR ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(250, 248, 244, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(26, 77, 46, 0.08);
}

/* ===== MOBILE MENU ===== */
#mobileMenu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-link {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 77, 46, 0.08);
}

.mobile-link:last-child {
    border-bottom: none;
}

/* ===== BUTTONS ===== */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231a4d2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ===== BACK TO TOP ===== */
#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== ACCESSIBILITY: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .reveal-up {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }

    #backToTop {
        transition: none;
    }
}

/* ===== FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1a4d2e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== SELECTION ===== */
::selection {
    background: #1a4d2e;
    color: #faf8f4;
}
