:root {
    --primary-green: #6B7F0C;
    --secondary-green: #65760C;
    --off-white: #FCFCF9;
}

/* Base styles */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

.bg-primary { background-color: var(--primary-green); }
.bg-secondary { background-color: var(--secondary-green); }
.bg-off-white { background-color: var(--off-white); }
.text-primary { color: var(--primary-green); }
.text-secondary { color: var(--secondary-green); }
.border-primary { border-color: var(--primary-green); }

/* Hero pattern */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(107, 127, 12, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(107, 127, 12, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(107, 127, 12, 0.05) 0%, transparent 50%);
}

/* SCROLL ANIMATIONS */
.scroll-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0s;
}

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

/* Animation variants */
.fade-up {
    transform: translateY(40px);
}

.fade-up.revealed {
    transform: translateY(0);
}

.fade-down {
    transform: translateY(-40px);
}

.fade-down.revealed {
    transform: translateY(0);
}

.fade-left {
    transform: translateX(-60px);
}

.fade-left.revealed {
    transform: translateX(0);
}

.fade-right {
    transform: translateX(60px);
}

.fade-right.revealed {
    transform: translateX(0);
}

.zoom-in {
    transform: scale(0.8);
}

.zoom-in.revealed {
    transform: scale(1);
}

.zoom-out {
    transform: scale(1.2);
}

.zoom-out.revealed {
    transform: scale(1);
}

/* Staggered animations */
.stagger-item {
    transition-delay: calc(var(--stagger-index, 0) * 0.1s);
}

/* Section title animation */
.section-title {
    position: relative;
    overflow: hidden;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60px;
    height: 3px;
    background: var(--primary-green);
    transition: transform 0.6s ease;
}

.scroll-reveal.revealed .section-title::after {
    transform: translateX(-50%) scaleX(1);
}

/* Card animations */
.card-hover {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(107, 127, 12, 0.15);
}

/* Button animations */
.btn-primary {
    background-color: var(--primary-green);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background-color: var(--secondary-green);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(107, 127, 12, 0.3);
}

/* Counter animation */
.count-up {
    font-weight: bold;
    color: var(--primary-green);
}

/* Pulse animation */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Floating animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Slide down animation */
@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.animate-slide-down {
    animation: slideDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Backdrop (fade in/out) */
.modal {
    transition: opacity 0.3s ease;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Modal content animation (scale + fade) */
.modal-content {
    transition: all 0.3s ease;
    transform: scale(0.95);
    opacity: 0;
}
.modal:not(.hidden) .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Loader Styles */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6B7F0C 0%, #65760C 50%, #ea580c 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-container.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 30px;
    animation: logoFloat 2s ease-in-out infinite;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

@keyframes logoFloat {
    0% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-20px) scale(1.08); 
    }
    100% { 
        transform: translateY(0px) scale(1); 
    }
}

.loader-text {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 40px;
    text-align: center;
    opacity: 0;
    animation: textFadeIn 1.2s ease-in-out 0.5s forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes textFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-tagline {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-style: italic;
    margin-top: 25px;
    opacity: 0;
    animation: textFadeIn 1.2s ease-in-out 1.8s forwards;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hide main content while loading */
body.loading {
    overflow: hidden;
}

.main-content {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.main-content.show {
    opacity: 1;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Reduce animation distances for mobile */
    .scroll-reveal {
        transform: translateY(30px);
    }
    
    .fade-left {
        transform: translateX(-30px);
    }
    
    .fade-right {
        transform: translateX(30px);
    }
    
    /* Faster animations on mobile */
    .scroll-reveal {
        transition-duration: 0.6s;
    }
    
    .card-hover:hover {
        transform: translateY(-4px);
    }
    
    /* Mobile loader adjustments */
    .loader-logo {
        width: 100px;
        height: 100px;
    }
    
    .loader-text {
        font-size: 22px;
        margin-bottom: 30px;
    }
    
    .loader-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loader-tagline {
        font-size: 16px;
        padding: 0 20px;
        text-align: center;
    }
    
    /* Mobile modal adjustments */
    .modal > div {
        margin: 10px;
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* ACCESSIBILITY */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        transition: opacity 0.3s ease;
        transform: none;
    }
    
    .scroll-reveal.revealed {
        transform: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
    
    .floating,
    .pulse-animation,
    .loader-logo {
        animation: none;
    }
}

/* PERFORMANCE OPTIMIZATIONS */
.scroll-reveal {
    will-change: opacity, transform;
}

.card-hover {
    will-change: transform, box-shadow;
}

.btn-primary {
    will-change: transform, box-shadow, background-color;
}

/* Remove will-change after animation completes */
.scroll-reveal.revealed {
    will-change: auto;
}

/* ENHANCED INTERACTIONS */
@media (hover: hover) {
    .card-hover:hover {
        cursor: pointer;
    }
    
    .btn-primary:hover {
        cursor: pointer;
    }
}

/* Focus styles for accessibility */
.btn-primary:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(107, 127, 12, 0.5);
    outline-offset: 2px;
}

/* Smooth transitions for focus */
button, a {
    transition: outline 0.2s ease;
}