/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
    background: #1a4d2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d6141;
}

/* Selection */
::selection {
    background: #1a4d2e;
    color: #fdfcfa;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #1a4d2e;
    color: #fdfcfa;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #1a4d2e;
}

.btn-primary:hover {
    background: #2d6141;
    border-color: #2d6141;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 77, 46, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: #fdfcfa;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid rgba(253, 252, 250, 0.4);
}

.btn-outline:hover {
    background: rgba(253, 252, 250, 0.1);
    border-color: rgba(253, 252, 250, 0.8);
    transform: translateY(-2px);
}

/* Navigation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1a4d2e;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(26, 77, 46, 0.08);
}

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

#navbar.scrolled .nav-link::after {
    background: #1a4d2e;
}

#navbar.scrolled .btn-primary {
    background: #1a4d2e;
    border-color: #1a4d2e;
}

#navbar.scrolled .font-serif.text-lg {
    color: #1a4d2e;
}

#navbar.scrolled .font-serif.text-xs {
    color: #3a7d52;
}

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

/* Mobile Menu */
.mobile-link {
    position: relative;
}

/* Mobile menu open state */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobileMenu.open .menu-line:nth-child(2) {
    opacity: 0;
}

#mobileMenu.open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.375rem;
}

/* Reveal Animations */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-left {
        opacity: 0;
        transform: translateX(-40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-right {
        opacity: 0;
        transform: translateX(40px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal-up.visible,
    .reveal-left.visible,
    .reveal-right.visible {
        opacity: 1;
        transform: none;
    }
}

/* Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5ca072;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}
