/* ========================================
   EMPIRE IRRIGATION — UI POLISH LAYER
   Frontend Design Ultimate principles
   ======================================== */

/* ── Distinctive Typography ── */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap");

:root {
  /* Override font stack */
  --ei-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ei-font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  
  /* Refined lime green + charcoal palette */
  --ei-green-900: #111827;
  --ei-green-800: #1f2937;
  --ei-green-700: #4ade80;
  --ei-green-600: #86efac;
  --ei-green-500: #a7f3d0;
  --ei-green-400: #bbf7d0;
  --ei-green-300: #d1fae5;
  --ei-green-200: #e2e8f0;
  --ei-green-100: #f1f5f9;
  --ei-green-50:  #f8fafc;
  --ei-dark: #0f172a;
  --ei-accent: #4ade80;
  --ei-accent-dim: rgba(74, 222, 128, .12);
  --ei-glow: 0 0 40px rgba(74, 222, 128, .15);
}

/* ── Grain Texture Overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .4;
}

/* ── Enhanced Typography Scale ── */
h1, h2, h3, h4 {
  font-family: var(--ei-font-display);
  letter-spacing: -0.03em;
}

h1 { font-size: clamp(3rem, 6vw, 5rem); font-weight: 900; }
h2 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); font-weight: 800; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); font-weight: 700; }

/* ── Hero Enhancements ── */
.hero {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(74,222,128,.08) 0%, transparent 70%),
    linear-gradient(160deg, #0f172a 0%, #111827 40%, #1a2332 100%);
}

.hero::before {
  background: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(74,222,128,.06), transparent 60%);
  pointer-events: none;
}

.hero h1 {
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero h1 span {
  color: #4ade80;
  position: relative;
}

.hero h1 span::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 4px;
  background: #4ade80;
  opacity: .3;
  border-radius: 2px;
}

.hero-badge {
  background: rgba(74,222,128,.08);
  border: 1px solid rgba(74,222,128,.2);
  backdrop-filter: blur(12px);
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: 2px;
}

.hero-desc {
  font-size: 1.1875rem;
  color: rgba(255,255,255,.65);
  line-height: 1.85;
}

.hero-image-main {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 
    0 25px 50px -12px rgba(0,0,0,.5),
    var(--ei-glow);
}

.hero-floating-card {
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}

.hero-feature-icon {
  background: rgba(74,222,128,.1);
  border: 1px solid rgba(74,222,128,.15);
}

/* ── Section Labels ── */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: 3px;
  color: #4ade80;
}

.section-label::before {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4ade80);
}

.section-title {
  letter-spacing: -0.03em;
}

/* ── Service Cards Enhancement ── */
.service-card {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 40px 32px;
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.service-card::before {
  height: 3px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 0 0 4px 4px;
}

.service-card:hover {
  box-shadow: 
    0 20px 40px rgba(0,0,0,.08),
    0 0 0 1px rgba(74,222,128,.1);
}

.service-icon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, rgba(74,222,128,.1), rgba(74,222,128,.05));
  border: 1px solid rgba(74,222,128,.12);
}

.service-card:hover .service-icon {
  background: linear-gradient(135deg, #111827, #1f2937);
  border-color: transparent;
  box-shadow: var(--ei-glow);
}

.service-link {
  color: #111827;
  font-family: 'DM Mono', monospace;
  font-size: .8125rem;
  letter-spacing: .5px;
}

/* ── About Section ── */
.about {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.about-img-main {
  border-radius: 24px;
  border: 1px solid rgba(0,0,0,.06);
}

.about-experience {
  background: linear-gradient(135deg, #111827, #1f2937);
  border-radius: 16px;
  box-shadow: var(--ei-glow), 0 20px 40px rgba(0,0,0,.3);
}

.about-experience .number {
  font-family: var(--ei-font-display);
  font-size: 3rem;
  background: linear-gradient(135deg, #4ade80, #86efac);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-list li svg {
  color: #4ade80;
}

/* ── Steps Enhancement ── */
.step-number {
  background: linear-gradient(135deg, #111827, #1f2937);
  font-family: var(--ei-font-display);
  box-shadow: 
    0 0 0 8px rgba(74,222,128,.06),
    0 0 0 16px rgba(74,222,128,.03);
}

.steps-grid::before {
  background: linear-gradient(90deg, transparent, rgba(74,222,128,.3), rgba(74,222,128,.3), transparent);
  height: 1px;
}

.step-icon {
  background: linear-gradient(135deg, rgba(74,222,128,.08), rgba(74,222,128,.04));
  border: 1px solid rgba(74,222,128,.1);
  border-radius: 16px;
}

/* ── Projects Section ── */
.projects {
  background: linear-gradient(160deg, #0f172a 0%, #111827 50%, #0f172a 100%);
}

.project-card {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}

.project-overlay {
  background: linear-gradient(to top, rgba(15,23,42,.95) 0%, rgba(15,23,42,.4) 50%, transparent 100%);
  padding: 32px;
}

.project-tag {
  color: #4ade80;
  font-family: 'DM Mono', monospace;
  font-size: .6875rem;
  letter-spacing: 2px;
}

/* ── Stats Section ── */
.stats {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  border-top: 1px solid rgba(74,222,128,.08);
  border-bottom: 1px solid rgba(74,222,128,.08);
}

.stats::before { display: none; }

.stat-number {
  font-family: var(--ei-font-display);
  font-size: 3rem;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-icon {
  background: rgba(74,222,128,.08);
  border: 1px solid rgba(74,222,128,.12);
}

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

/* ── Features Enhancement ── */
.feature-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 20px;
  padding: 48px 36px;
}

.feature-card:hover {
  box-shadow: 
    0 25px 50px rgba(0,0,0,.06),
    0 0 0 1px rgba(74,222,128,.08);
  border-color: transparent;
}

.feature-icon {
  width: 84px;
  height: 84px;
  background: linear-gradient(135deg, rgba(74,222,128,.1), rgba(74,222,128,.04));
  border: 1px solid rgba(74,222,128,.1);
}

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, #111827, #1f2937);
  box-shadow: var(--ei-glow);
  border-color: transparent;
}

/* ── Testimonials Enhancement ── */
.testimonials {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.testimonial-card {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 20px;
  padding: 40px;
}

.testimonial-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.06);
  border-color: rgba(74,222,128,.1);
}

.testimonial-quote-icon {
  color: rgba(74,222,128,.15);
}

.testimonial-text {
  font-size: 1.0625rem;
  color: #374151;
  line-height: 1.85;
}

.testimonial-avatar {
  background: linear-gradient(135deg, rgba(74,222,128,.15), rgba(74,222,128,.08));
  color: #111827;
  font-family: var(--ei-font-display);
}

.testimonial-stars svg {
  color: #facc15;
  fill: #facc15;
}

/* ── CTA Banner Enhancement ── */
.cta-banner {
  background: 
    radial-gradient(ellipse 60% 80% at 50% 120%, rgba(74,222,128,.1) 0%, transparent 60%),
    linear-gradient(160deg, #0f172a 0%, #111827 100%);
}

.cta-banner::before {
  background: radial-gradient(circle at 80% 20%, rgba(74,222,128,.06), transparent 50%);
  width: auto;
  height: auto;
  inset: 0;
  border-radius: 0;
}

.cta-banner h2 {
  font-weight: 900;
  letter-spacing: -0.04em;
}

/* ── Blog Cards Enhancement ── */
.blog-card {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
}

.blog-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.06);
  border-color: transparent;
}

.blog-meta {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  letter-spacing: .5px;
}

.blog-read-more {
  color: #111827;
  font-family: 'DM Mono', monospace;
  font-size: .8125rem;
}

/* ── Footer Enhancement ── */
.site-footer {
  background: linear-gradient(180deg, #0f172a 0%, #0a0f1a 100%);
}

.footer-logo {
  font-family: var(--ei-font-display);
}

.footer-col h4::after {
  background: linear-gradient(90deg, #4ade80, transparent);
  width: 40px;
}

.footer-social a {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

.footer-social a:hover {
  background: rgba(74,222,128,.12);
  border-color: rgba(74,222,128,.2);
  box-shadow: var(--ei-glow);
}

.footer-bottom {
  border-color: rgba(255,255,255,.04);
}

/* ── Buttons Polish ── */
.btn-primary {
  background: linear-gradient(135deg, #111827, #1f2937);
  border-color: #1f2937;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(74,222,128,.1), transparent);
  opacity: 0;
  transition: opacity .3s ease;
}

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

.btn-primary:hover {
  box-shadow: var(--ei-glow), 0 10px 30px rgba(0,0,0,.2);
}

.btn-outline {
  border-color: rgba(74,222,128,.3);
  color: #111827;
}

.btn-outline:hover {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.btn-white {
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.btn-white:hover {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ── Enhanced Scroll Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.services-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.services-grid .fade-up:nth-child(2) { transition-delay: .1s; }
.services-grid .fade-up:nth-child(3) { transition-delay: .2s; }
.services-grid .fade-up:nth-child(4) { transition-delay: .3s; }

.steps-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.steps-grid .fade-up:nth-child(2) { transition-delay: .12s; }
.steps-grid .fade-up:nth-child(3) { transition-delay: .24s; }
.steps-grid .fade-up:nth-child(4) { transition-delay: .36s; }

.features-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.features-grid .fade-up:nth-child(2) { transition-delay: .1s; }
.features-grid .fade-up:nth-child(3) { transition-delay: .2s; }

.testimonials-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.testimonials-grid .fade-up:nth-child(2) { transition-delay: .1s; }
.testimonials-grid .fade-up:nth-child(3) { transition-delay: .2s; }

.projects-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.projects-grid .fade-up:nth-child(2) { transition-delay: .12s; }
.projects-grid .fade-up:nth-child(3) { transition-delay: .24s; }

.stats-grid .fade-up:nth-child(1) { transition-delay: 0s; }
.stats-grid .fade-up:nth-child(2) { transition-delay: .08s; }
.stats-grid .fade-up:nth-child(3) { transition-delay: .16s; }
.stats-grid .fade-up:nth-child(4) { transition-delay: .24s; }

/* ── Header Polish ── */
.site-header.scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(0,0,0,.04);
}

.site-header.scrolled .nav-link:hover,
.site-header.scrolled .nav-link.active {
  color: #111827;
  background: rgba(74,222,128,.08);
}

.site-header.scrolled .btn-primary {
  background: linear-gradient(135deg, #111827, #1f2937);
}

/* ── Smooth Scrollbar ── */
html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(74,222,128,.3) transparent;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
  background: rgba(74,222,128,.3); 
  border-radius: 3px; 
}
::-webkit-scrollbar-thumb:hover { 
  background: rgba(74,222,128,.5); 
}

/* ── Selection Color ── */
::selection {
  background: rgba(74,222,128,.2);
  color: #0f172a;
}

/* ── Image Hover Effects ── */
.project-card img {
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}

.blog-card-image img {
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}

/* ── Mobile Polish ── */
@media (max-width: 768px) {
  h1 { font-size: clamp(2.25rem, 8vw, 3.5rem) !important; }
  h2 { font-size: clamp(1.75rem, 6vw, 2.5rem) !important; }
  
  .hero { min-height: auto; padding-bottom: 60px; }
  
  .main-nav.active {
    background: linear-gradient(160deg, #0f172a, #111827);
    backdrop-filter: blur(20px);
  }
  
  .cta-banner { padding: 60px 0; }
  .services, .about, .how-it-works, .features, .testimonials, .blog-section {
    padding: 60px 0;
  }
}
