/* ============================================
   Global CSS - Solar Surge
   Reset, Variables, Typography, Utilities
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- CSS Variables --- */
:root {
  /* Colors - Solar Surge Branding */
  --color-primary: #32373c;
  --color-primary-light: #4a5568;
  --color-secondary: #1a1a1a;
  --color-secondary-dark: #000000;
  --color-accent: #2563eb;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F7F7;
  --color-text: #32373c;
  --color-text-light: #6b7280;
  --color-border: #E5E7EB;
  --color-white: #FFFFFF;
  --color-dark: #1a1a2e;
  --color-success: #10b981;
  --color-error: #ef4444;

  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.5rem;
  --fs-5xl: 3.5rem;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 80px;

  --section-padding: 80px 0;
  --container-max: 1200px;
  --container-padding: 0 24px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;

  /* Z-Index */
  --z-header: 1000;
  --z-modal: 2000;
  --z-overlay: 1500;
}

/* --- Typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: var(--fs-5xl); }
h2 { font-size: var(--fs-4xl); }
h3 { font-size: var(--fs-3xl); }
h4 { font-size: var(--fs-2xl); }
h5 { font-size: var(--fs-xl); }
h6 { font-size: var(--fs-lg); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-light);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

.section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: var(--fs-lg);
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}

.bg-alt {
  background: var(--color-bg-alt);
}

.bg-dark {
  background: var(--color-dark);
  color: var(--color-white);
}

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

.bg-dark p {
  color: rgba(255, 255, 255, 0.8);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Scroll Animation Classes --- */
.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate.fade-in {
  transform: none;
}

.animate.slide-left {
  transform: translateX(-30px);
}

.animate.slide-right {
  transform: translateX(30px);
}

.animate.is-visible {
  opacity: 1;
  transform: none;
}

.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --fs-5xl: 2.75rem;
    --fs-4xl: 2rem;
    --fs-3xl: 1.75rem;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --fs-5xl: 2.25rem;
    --fs-4xl: 1.75rem;
    --fs-3xl: 1.5rem;
    --section-padding: 60px 0;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }
}
