/* ============================================
   JR Construction — Custom Styles
   ============================================ */

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

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

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background-color: #4e8444;
    color: #FAF9F6;
}

/* ============================================
   Geometric Hero Shapes
   ============================================ */
.geo-shape {
    position: absolute;
    pointer-events: none;
}

.shape-circle-1 {
    top: 10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(198, 223, 191, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.shape-circle-2 {
    bottom: 15%;
    right: 5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(232, 228, 220, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite reverse;
}

.shape-rect-1 {
    top: 25%;
    right: 12%;
    width: 120px;
    height: 120px;
    background: #c6dfbf;
    border-radius: 24px;
    transform: rotate(45deg);
    opacity: 0.4;
    animation: spin 20s linear infinite;
}

.shape-rect-2 {
    bottom: 25%;
    left: 8%;
    width: 80px;
    height: 80px;
    background: #e3efdf;
    border-radius: 16px;
    transform: rotate(20deg);
    opacity: 0.5;
    animation: float 7s ease-in-out infinite;
}

.shape-triangle {
    top: 60%;
    left: 3%;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(114, 166, 103, 0.15);
    animation: float 9s ease-in-out infinite;
}

.shape-dots {
    top: 40%;
    left: 45%;
    width: 200px;
    height: 200px;
    background-image: radial-gradient(circle, rgba(78, 132, 68, 0.08) 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite reverse;
}

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

@keyframes spin {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

/* ============================================
   Navbar
   ============================================ */
#navbar {
    background: rgba(250, 249, 246, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(198, 223, 191, 0.3);
}

#navbar.scrolled {
    box-shadow: 0 4px 30px rgba(26, 51, 21, 0.08);
}

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

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

/* Menu button animation */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
}
#menuBtn.active .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(26, 51, 21, 0.15);
}

/* ============================================
   Scroll Reveal Animations
   (Progressive enhancement — hidden by default, 
    revealed by JS only when prefers-reduced-motion is off)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Fallback: ensure content is visible without JS */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Form Styles
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

textarea {
    field-sizing: content;
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 768px) {
    .shape-circle-1 {
        width: 250px;
        height: 250px;
    }
    
    .shape-circle-2 {
        width: 150px;
        height: 150px;
    }
    
    .shape-rect-1 {
        width: 60px;
        height: 60px;
    }
    
    .shape-rect-2 {
        width: 40px;
        height: 40px;
    }
    
    .shape-triangle {
        display: none;
    }
    
    .shape-dots {
        display: none;
    }
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #navbar,
    #mobileMenu,
    .geo-shape {
        display: none;
    }
    
    body {
        color: #1a3315;
        background: white;
    }
}
