/* Base & Reset */
*, *::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 {
    display: block;
    max-width: 100%;
}

::selection {
    background-color: #314e2e;
    color: #faf9f6;
}

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

#navbar.scrolled {
    background: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(49, 78, 46, 0.08);
}

.nav-logo {
    transition: color 0.3s ease;
}

/* Mobile Menu */
#mobileMenu {
    z-index: 40;
}

#mobileMenu.open {
    transform: translateX(0);
}

#mobileMenu:not(.open) {
    transform: translateX(100%);
}

.mobile-link {
    transition: color 0.3s ease;
}

.mobile-link:hover {
    color: #527d4e;
}

/* Hamburger Animation */
#menuToggle.active #bar1 {
    transform: translateY(5px) rotate(45deg);
}

#menuToggle.active #bar2 {
    opacity: 0;
}

#menuToggle.active #bar3 {
    transform: translateY(-5px) rotate(-45deg);
}

/* Scroll Reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Stagger children */
.grid .reveal:nth-child(1) { transition-delay: 0ms; }
.grid .reveal:nth-child(2) { transition-delay: 100ms; }
.grid .reveal:nth-child(3) { transition-delay: 200ms; }
.grid .reveal:nth-child(4) { transition-delay: 300ms; }
.grid .reveal:nth-child(5) { transition-delay: 400ms; }
.grid .reveal:nth-child(6) { transition-delay: 500ms; }

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

/* Focus styles */
a:focus-visible, button:focus-visible {
    outline: 2px solid #314e2e;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Image hover parallax-like */
.group:hover img {
    transform: scale(1.05);
}

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

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

::-webkit-scrollbar-thumb {
    background: #9bbf96;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #527d4e;
}
