/* ==========================================================================
   AMAN ENVIRO ENGINEERING CONSULTANT (AEEC) - MODERN DESIGN SYSTEM
   Modern, accessible, high-performance CSS Architecture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Brand Primary Palette (Deep Forest to Vibrant Mint) */
  --color-primary-950: #031a0e;
  --color-primary-900: #072e1c;
  --color-primary-800: #0a4027;
  --color-primary-700: #0f5434;
  --color-primary-600: #146c43;
  --color-primary-500: #10b981;
  --color-primary-400: #34d399;
  --color-primary-300: #6ee7b7;
  --color-primary-100: #d1fae5;
  --color-primary-50:  #ecfdf5;

  /* Accent Highlight (Golden Amber for High-Priority CTAs & Trust Badges) */
  --color-accent-600: #d97706;
  --color-accent-500: #f59e0b;
  --color-accent-400: #fbbf24;
  --color-accent-100: #fef3c7;
  --color-accent-50:  #fffbeb;

  /* Dark Slate Scale */
  --color-dark-950: #050811;
  --color-dark-900: #090e1a;
  --color-dark-800: #0f172a;
  --color-dark-700: #1e293b;
  --color-dark-600: #334155;
  --color-dark-500: #475569;

  /* Light Surface Scale */
  --color-light-50:  #f8fafc;
  --color-light-100: #f1f5f9;
  --color-light-200: #e2e8f0;
  --color-light-300: #cbd5e1;
  --color-white:     #ffffff;

  /* Text Colors */
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #64748b;
  --text-white:      #ffffff;
  --text-inverse:    #f8fafc;

  /* Glassmorphism & Elevation */
  --glass-light: rgba(255, 255, 255, 0.88);
  --glass-dark: rgba(15, 23, 42, 0.88);
  --glass-border-light: rgba(255, 255, 255, 0.4);
  --glass-border-dark: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(16px);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.25);
  --shadow-card-hover: 0 20px 35px -10px rgba(7, 46, 28, 0.15);

  /* Typography - Pairing: Jakarta (trustworthy headings) + Inter (readable body) + Space Grotesk (technical data) */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-tech: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 280ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 450ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1280px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Lenis inertia mode: let the library own wheel smoothing (desktop only) */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* Native fallback: anchored sections never hide under the sticky header */
section[id],
div[id] {
  scroll-margin-top: 104px;
}

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

/* Professional text selection + focus */
::selection {
  background: var(--color-primary-600);
  color: var(--text-white);
}

:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Slim professional scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-light-100);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary-700), var(--color-primary-500));
  border-radius: var(--radius-full);
  border: 2px solid var(--color-light-100);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-600);
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--color-light-50);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.85rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p { margin-bottom: 1rem; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }

/* Technical numerals (stats, badges, timelines) */
.stat-number,
.hero-stat-item h3,
.section-badge {
  font-family: var(--font-tech);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-fluid {
  width: 100%;
  padding-inline: var(--container-pad);
}

/* Section Wrapper */
.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  position: relative;
}

.section-sm {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.section-dark {
  background-color: var(--color-dark-900);
  color: var(--text-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--text-white);
}

.section-dark p {
  color: var(--color-light-300);
}

.section-green {
  background: linear-gradient(135deg, var(--color-primary-950) 0%, var(--color-primary-900) 60%, var(--color-primary-800) 100%);
  color: var(--text-white);
}

.section-green h2, .section-green h3, .section-green p {
  color: var(--text-white);
}

/* Section Header Utility */
.section-header {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-header.text-left {
  text-align: left;
  margin-inline: 0;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-primary-700);
  font-family: var(--font-tech);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.25);
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.section-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}

.section-badge:hover {
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.section-dark .section-badge {
  background: rgba(16, 185, 129, 0.18);
  color: var(--color-primary-400);
  border-color: rgba(16, 185, 129, 0.35);
}

.section-green .section-badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.section-subtitle {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* Grid Utilities */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Flex Utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Subtle Animations & Reveal States */
.fade-in-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger helper: <div class="fade-in-up" data-delay="120"> */
.fade-in-up[data-delay] {
  transition-delay: var(--reveal-delay, 0ms);
}

/* Image zoom on hover (gallery / cards) */
.img-zoom {
  overflow: hidden;
}
.img-zoom img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-zoom:hover img {
  transform: scale(1.05);
}

/* Elegant link underline for body copy */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left 100%;
  transition: background-size var(--transition-normal);
  padding-bottom: 2px;
}
.link-underline:hover {
  background-size: 100% 1.5px;
}

/* Scroll progress bar + back-to-top (injected by js/app.js) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 3000;
  background: transparent;
  pointer-events: none;
}
.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500));
}

.to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1500;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  color: var(--color-primary-800);
  border: 1px solid var(--color-light-200);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal), box-shadow var(--transition-fast), background var(--transition-fast);
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  background: var(--color-primary-50);
}
.to-top svg {
  width: 20px;
  height: 20px;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.8); }
}

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

.float-effect {
  animation: floatSoft 4s ease-in-out infinite;
}
