/* ===================================
   TREEB - Custom Stylesheet
   Design System: Earth-toned Corporate
   Typography: Syne + Manrope + Space Mono
   =================================== */

/* ===================================
   GLOBAL RESETS & BASE
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   ANIMATIONS & KEYFRAMES
   =================================== */

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 1.2s ease-out forwards;
}

/* ===================================
   NAVIGATION
   =================================== */

#navbar {
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background: rgba(250, 248, 245, 0.98);
    box-shadow: 0 4px 20px rgba(26, 77, 46, 0.1);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

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

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

/* ===================================
   HERO SECTION - LAYERED BACKGROUNDS
   =================================== */

#hero {
    position: relative;
}

.hero-bg-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        #FAF8F5 0%,
        #F5F2ED 25%,
        #E8E3DB 50%,
        #F0EBE3 75%,
        #FAF8F5 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    z-index: 0;
}

.hero-texture {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(107, 142, 35, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 111, 71, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(26, 77, 46, 0.02) 0%, transparent 50%);
    z-index: 1;
}

.hero-texture::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    animation: grain 8s steps(10) infinite;
    pointer-events: none;
}

/* Hero Image Enhancements */
.hero-image-wrapper {
    transition: transform 0.6s ease;
}

.hero-image-wrapper:hover {
    transform: scale(1.02);
}

/* Stats Icon Hover */
.hero-content svg {
    transition: transform 0.3s ease;
}

.hero-content .flex:hover svg {
    transform: scale(1.1);
}

/* ===================================
   SERVICES SECTION - ATMOSPHERIC BG
   =================================== */

.services-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(250, 248, 245, 0) 0%,
        rgba(245, 242, 237, 0.6) 30%,
        rgba(232, 227, 219, 0.4) 70%,
        rgba(250, 248, 245, 0) 100%
    );
    z-index: 0;
}

.services-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(107, 142, 35, 0.08) 0%, transparent 70%);
    filter: blur(60px);
}

.services-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -15%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(139, 111, 71, 0.06) 0%, transparent 70%);
    filter: blur(60px);
}

/* ===================================
   TESTIMONIALS SECTION BG
   =================================== */

.testimonials-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        #FAF8F5 0%,
        #F5F2ED 50%,
        #FAF8F5 100%
    );
    z-index: 0;
}

.testimonials-bg::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(26, 77, 46, 0.04) 0%, transparent 70%);
    filter: blur(80px);
}

/* ===================================
   HORIZONTAL SCROLL CONTAINERS
   =================================== */

.projects-scroll-container,
.testimonials-scroll-container {
    scrollbar-width: thin;
    scrollbar-color: #2D5F3F #F5F2ED;
    scroll-behavior: smooth;
}

.projects-scroll-container::-webkit-scrollbar,
.testimonials-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.projects-scroll-container::-webkit-scrollbar-track,
.testimonials-scroll-container::-webkit-scrollbar-track {
    background: #F5F2ED;
    border-radius: 4px;
}

.projects-scroll-container::-webkit-scrollbar-thumb,
.testimonials-scroll-container::-webkit-scrollbar-thumb {
    background: #2D5F3F;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.projects-scroll-container::-webkit-scrollbar-thumb:hover,
.testimonials-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #1A4D2E;
}

/* ===================================
   BUTTONS & INTERACTIVE ELEMENTS
   =================================== */

.btn-hero,
.btn-secondary,
.btn-primary {
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-hero:hover {
    box-shadow: 0 12px 40px rgba(26, 77, 46, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 8px 30px rgba(26, 77, 46, 0.2);
}

/* ===================================
   CARDS & COMPONENTS
   =================================== */

.service-card {
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.stat-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(26, 77, 46, 0.3);
}

.project-card {
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.testimonial-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #FAF8F5 100%);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(26, 77, 46, 0.2);
}

/* ===================================
   FORM ELEMENTS
   =================================== */

.form-group {
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    box-shadow: 0 4px 20px rgba(107, 142, 35, 0.15);
    transform: translateY(-1px);
}

.form-group input,
.form-group textarea,
.form-group select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: rgba(107, 142, 35, 0.3);
}

input::placeholder,
textarea::placeholder {
    color: rgba(44, 44, 44, 0.3);
}

/* Form Section Headers */
.form-group label {
    transition: color 0.2s ease;
}

.form-group:focus-within label {
    color: #6B8E23;
}

/* Enhanced Submit Button */
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Checkbox Styling */
input[type="checkbox"]:checked {
    background-color: #6B8E23;
    border-color: #6B8E23;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .animate-fade-in-up,
    .animate-fade-in-right {
        animation: fadeInUp 0.8s ease-out forwards;
    }

    .hero-bg-layer,
    .services-bg,
    .testimonials-bg {
        animation: none;
    }
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #6B8E23;
    outline-offset: 2px;
}

/* ===================================
   SMOOTH SCROLLBAR
   =================================== */

::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #2D5F3F;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1A4D2E;
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.gradient-text {
    background: linear-gradient(135deg, #1A4D2E 0%, #6B8E23 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.frosted-glass {
    background: rgba(250, 248, 245, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(26, 77, 46, 0.1);
}

.shadow-deep {
    box-shadow:
        0 10px 40px rgba(26, 77, 46, 0.1),
        0 2px 10px rgba(26, 77, 46, 0.05);
}

.shadow-soft {
    box-shadow: 0 4px 20px rgba(26, 77, 46, 0.08);
}
