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

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: #2d5a3f;
    color: #faf8f4;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scrollIndicator {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float-in {
    animation: floatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scroll-indicator {
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

/* ===== Reveal on Scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal.revealed:nth-child(2) { transition-delay: 0.1s; }
.reveal.revealed:nth-child(3) { transition-delay: 0.2s; }
.reveal.revealed:nth-child(4) { transition-delay: 0.3s; }

/* ===== Navbar ===== */
#navbar {
    background: transparent;
    transition: background-color 0.5s ease, box-shadow 0.5s ease, padding 0.5s ease;
}

#navbar.scrolled {
    background: rgba(250, 248, 244, 0.95);
    backdrop-blur-md;
    box-shadow: 0 1px 20px rgba(26, 60, 42, 0.08);
}

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

#navbar.scrolled .nav-link:hover {
    color: #4a9163;
}

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

/* ===== Mobile Menu ===== */
.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

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

/* Mobile menu toggle animation */
.menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

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

.menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* ===== Stat Cards ===== */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(26, 60, 42, 0.15);
}

/* ===== Buttons ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

/* ===== Gallery Images ===== */
.gallery-item {
    overflow: hidden;
    position: relative;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 60, 42, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ===== Form Styles ===== */
input:focus,
textarea:focus {
    border-color: #4a9163;
    box-shadow: 0 0 0 3px rgba(74, 145, 99, 0.1);
}

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

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

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

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stat-card {
        display: none;
    }
}

/* ===== Print ===== */
@media print {
    #navbar,
    #contact,
    .btn-primary {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
