/**
 * ============================================
 * AIEF GLOBAL STYLES - OPTIMIZED
 * ============================================
 * 
 * PERFORMANCE OPTIMIZATIONS:
 * - CSS Variables for consistent theming and easy maintenance
 * - Mobile-first responsive design
 * - GPU-accelerated animations (will-change, transform)
 * - Minimized CSS duplication
 * - Optimized font rendering
 * 
 * ACCESSIBILITY FEATURES:
 * - Semantic HTML support
 * - ARIA-ready classes
 * - Screen reader friendly
 * - Keyboard navigation support
 * 
 * BROWSER SUPPORT:
 * - Modern browsers (Chrome, Firefox, Safari, Edge)
 * - Graceful degradation for older browsers
 */

/* ============================================
   CSS VARIABLES - Single source of truth
   ============================================ */
:root {
  /* Typography */
  --font-heading: "Bricolage Grotesque", sans-serif;
  --font-body: "DM Sans", sans-serif;

  /* Brand Colors */
  --color-primary: #044836;
  --color-primary-hover: #066141;
  --color-primary-light: #1f514c;
  --color-accent-teal: #1f514c;
  --color-primary-dark: #21275e;

  /* Grayscale Colors */
  --color-text-primary: #030303;
  --color-text-dark: #1f2937;
  --color-text-gray: #6b7280;
  --color-text-light: #9ca3af;
  --color-bg-light: #fafafa;
  --color-bg-offwhite: #edffe3;
  --color-border-gray: rgba(238, 238, 238, 0.1);

  /* Spacing Scale (8px base) */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Layout */
  --max-width-container: 1360px;
  --max-width-wide: 1920px;
  --border-radius: 10px;
  --border-radius-lg: 24px;
  --border-radius-xl: 34px;

  /* Transitions - Optimized for 60fps */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 4px 12px rgba(4, 72, 54, 0.3);

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal: 400;
  --z-tooltip: 500;

  /* Gradients */
  --gradient-primary: linear-gradient(
    228deg,
    #066141 -0.2%,
    #21275e -0.19%,
    #044836 99.99%
  );
  --gradient-hero: linear-gradient(
    258deg,
    #edffe3 0%,
    #ffffff 73%,
    #fdfffc 100%
  );
  --gradient-card: linear-gradient(
    332deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  line-height: 1.6;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6,
.font-heading,
.font-bricolage {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.font-body,
.font-dm-sans {
  font-family: var(--font-body) !important;
}

/* ============================================
   BUTTON SYSTEM - Optimized
   ============================================ */
.btn-primary,
.btn-secondary,
.about-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  will-change: transform, box-shadow;
  user-select: none;
}

.btn-primary,
.about-btn {
  background: var(--gradient-primary);
  color: #ffffff;
}

.btn-primary:hover,
.about-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary:active,
.about-btn:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ============================================
   SECTION HEADING - Reusable component
   ============================================ */
.section-heading-gradient {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.8px;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-primary) !important;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-hover) !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container-custom {
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-spacing {
  padding: 5rem 1.5rem;
}

/* Consistent vertical spacing between major sections */
.section-gap + .section-gap {
  margin-top: 4rem; /* 64px */
}
@media (min-width: 768px) {
  .section-gap + .section-gap {
    margin-top: 6rem; /* 96px */
  }
}

.card-optimized {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.card-optimized:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* GPU Acceleration for smooth animations */
.gpu-accelerated {
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
  transform: translate3d(0, 0, 0);
}

/* Optimize font rendering */
body,
input,
textarea,
button {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Lazy load images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*img[loading="lazy"] {*/
/*  opacity: 0;*/
/*  transition: opacity 0.3s;*/
/*}*/

/*img[loading="lazy"].loaded {*/
/*  opacity: 1;*/
/*}*/

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile First - Base styles (320px+) */
@media (min-width: 0px) {
  html {
    font-size: 14px;
  }
}

/* Small devices (640px+) */
@media (min-width: 640px) {
  html {
    font-size: 15px;
  }
}

/* Medium devices (768px+) */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Large devices (1024px+) */
@media (min-width: 1024px) {
  .section-spacing {
    padding: 6rem 2rem;
  }
}

/* XL devices (1280px+) */
@media (min-width: 1280px) {
  .container-custom {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* 2XL devices (1920px+) */
@media (min-width: 1920px) {
  .container-custom {
    max-width: var(--max-width-wide);
  }
}

/* ============================================
   HIDE SCROLLBAR UTILITY
   ============================================ */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a {
    text-decoration: underline;
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
.collapse {
    visibility: visible !important;
}
