/* Hero Section Styles */
.hero-header {
  position: relative;
  width: 100%;
  /* Fluid height: adapts naturally to viewport and content */
  min-height: clamp(480px, 70vh, 700px);
  /* Fluid padding for natural spacing */
  padding-top: clamp(var(--space-8), 8vw, var(--space-16));
  padding-bottom: clamp(var(--space-6), 4vw, var(--space-8));
  overflow: hidden;
  color: var(--color-fg-inverse);
  display: flex;
  align-items: center;
  background: linear-gradient(to right, rgba(7, 17, 41, 0.92), rgba(21, 56, 138, 0.85));
  /* Enable container queries for intrinsic responsiveness */
  container-type: inline-size;
  container-name: hero-section;
}

/* Interactive particles */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  background-color: rgba(246, 247, 252, 0.3);
  border-radius: 50%;
  pointer-events: none;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Content container */
.hero-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  width: 100%;
  /* Fluid padding for natural spacing */
  padding: 0 clamp(var(--space-4), 4vw, var(--space-6));
}

/* Content styling */
.hero-content {
  /* Fluid padding that adapts to available space */
  padding: clamp(var(--space-8), 6vw, var(--space-16)) 0;
  position: relative;
  text-align: left;
  max-width: 900px;
}

.hero-title {
  /* Fluid typography: scales naturally between breakpoints */
  font-size: clamp(2rem, 5vw + 1rem, var(--font-size-h1));
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  margin-bottom: clamp(var(--space-3), 2vw, var(--space-4));
  letter-spacing: -0.02em;
  
  /* Two-layer shadow: Creates depth and readability on gradient background */
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),    /* Dark shadow below for depth */
    0 4px 8px rgba(0, 0, 0, 0.2),    /* Ambient shadow for realism */
    0 1px 2px rgba(0, 0, 0, 0.4);    /* Sharp detail shadow */
}

.hero-subtitle {
  /* Fluid body text for optimal readability */
  font-size: clamp(0.95rem, 1.5vw + 0.5rem, var(--font-size-body));
  line-height: var(--line-height-body);
  margin-bottom: clamp(var(--space-6), 4vw, var(--space-8));
  max-width: min(600px, 90%);
  opacity: 0.95;
  /* Smooth text rendering */
  text-wrap: balance;
  
  /* Subtle shadow for readability on gradient background */
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* CTA buttons */
.hero-cta-group {
  display: flex;
  gap: clamp(var(--space-3), 2vw, var(--space-4));
  flex-wrap: wrap;
  align-items: center;
}

.cta-primary {
  color: var(--color-fg-inverse);
  /* Fluid padding for natural button sizing */
  padding: clamp(var(--space-2), 2vw, var(--space-3)) clamp(var(--space-5), 4vw, var(--space-6));
  border-radius: var(--radius-2);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  /* Fluid font size */
  font-size: clamp(0.9rem, 1.5vw + 0.3rem, var(--font-size-body));
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  display: inline-block;
  border: none;
  cursor: pointer;
  position: relative;
  
  /* Gradient enhancement: Shiny, elevated effect */
  background: linear-gradient(135deg, 
    hsl(149, 61%, 35%) 0%,    /* Lighter on top (light from above) */
    hsl(149, 61%, 28%) 100%   /* Darker on bottom */
  );
  
  /* Two-layer shadow: Medium depth for prominent CTA */
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 0.2) inset,  /* Light inner shadow on top */
    0 4px 12px rgba(22, 87, 51, 0.4),           /* Medium shadow below */
    0 2px 4px rgba(22, 87, 51, 0.3),            /* Ambient shadow */
    0 1px 2px rgba(0, 0, 0, 0.2);               /* Detail shadow */
}

.cta-primary:hover {
  /* Enhanced gradient on hover - more elevated */
  background: linear-gradient(135deg, 
    hsl(149, 61%, 40%) 0%,    /* Lighter shade on hover */
    hsl(149, 61%, 32%) 100%
  );
  
  /* Large shadow: Prominent hover state */
  box-shadow: 
    0 2px 0 0 rgba(255, 255, 255, 0.25) inset,  /* Stronger light on top */
    0 6px 20px rgba(22, 87, 51, 0.5),            /* Deeper shadow */
    0 3px 8px rgba(22, 87, 51, 0.35),            /* Enhanced ambient */
    0 1px 3px rgba(0, 0, 0, 0.25);               /* Sharp detail */
  
  transform: translateY(-3px) scale(1.02);
}

.cta-primary:active {
  /* Inset shadow: Pressed/sunken effect */
  box-shadow: 
    0 -1px 0 0 rgba(0, 0, 0, 0.2) inset,        /* Dark on top (inverted) */
    0 1px 0 0 rgba(255, 255, 255, 0.1) inset,   /* Light on bottom */
    0 2px 4px rgba(22, 87, 51, 0.2);             /* Reduced outer shadow */
  
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.cta-secondary {
  color: var(--color-fg-inverse);
  /* Fluid padding for natural button sizing */
  padding: clamp(var(--space-2), 2vw, var(--space-3)) clamp(var(--space-5), 4vw, var(--space-6));
  border-radius: var(--radius-2);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  /* Fluid font size */
  font-size: clamp(0.9rem, 1.5vw + 0.3rem, var(--font-size-body));
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  display: inline-block;
  cursor: pointer;
  position: relative;
  
  /* No border - using shadow layering instead */
  /* Subtle gradient background with glassmorphism */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.12) 0%, 
    rgba(255, 255, 255, 0.06) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  /* Two-layer shadow: Small depth for secondary button */
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 0.15) inset,  /* Light on top */
    0 2px 8px rgba(0, 0, 0, 0.15),               /* Small shadow below */
    0 1px 2px rgba(0, 0, 0, 0.1),                /* Ambient */
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;    /* Subtle border replacement */
}

.cta-secondary:hover {
  /* Enhanced gradient on hover */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.18) 0%, 
    rgba(255, 255, 255, 0.10) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  /* Medium shadow: Standard elevation on hover */
  box-shadow: 
    0 2px 0 0 rgba(255, 255, 255, 0.2) inset,   /* Stronger light on top */
    0 4px 16px rgba(246, 247, 252, 0.25),        /* Medium shadow */
    0 2px 4px rgba(246, 247, 252, 0.15),         /* Ambient */
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;    /* Enhanced border */
  
  transform: translateY(-3px) scale(1.02);
}

.cta-secondary:active {
  /* Inset shadow: Pressed effect */
  box-shadow: 
    0 -1px 0 0 rgba(0, 0, 0, 0.15) inset,
    0 1px 0 0 rgba(255, 255, 255, 0.1) inset,
    0 1px 4px rgba(0, 0, 0, 0.1);
  
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

/* ========================================= */
/* RESPONSIVE REARRANGEMENT WITH PURPOSE    */
/* ========================================= */

/* Tablet Landscape (769px - 1024px): Maintain layout with adjusted spacing */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-header {
    min-height: clamp(500px, 65vh, 650px);
    padding-top: clamp(var(--space-10), 6vw, var(--space-12));
  }
  
  .hero-content {
    padding: var(--space-12) 0;
  }
  
  .hero-title {
    font-size: clamp(2rem, 4.5vw, 2.5rem);
  }
  
  .hero-subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    max-width: 550px;
  }
}

/* Tablet Portrait (481px - 768px): Adjusted proportions for medium screens */
@media (min-width: 481px) and (max-width: 768px) {
  .hero-header {
    min-height: clamp(450px, 60vh, 550px);
    padding-top: var(--space-10);
    padding-bottom: var(--space-6);
  }
  
  .hero-content {
    padding: var(--space-10) 0;
    max-width: 100%;
  }
  
  .hero-title {
    font-size: clamp(1.875rem, 5vw, 2.25rem);
    margin-bottom: var(--space-3);
  }
  
  .hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1rem);
    max-width: 500px;
    margin-bottom: var(--space-6);
  }
  
  .hero-cta-group {
    gap: var(--space-3);
  }
  
  .cta-primary,
  .cta-secondary {
    padding: var(--space-2) var(--space-5);
    font-size: 0.95rem;
  }
}

/* Mobile (320px - 480px): Vertical stacking with priority-based spacing */
@media (max-width: 480px) {
  .hero-header {
    min-height: clamp(500px, 65vh, 600px);
    /* Account for fixed navbar (5rem = 80px) + balanced spacing */
    padding-top: calc(5rem + var(--space-10));
    padding-bottom: var(--space-6);
    align-items: flex-start;
  }
  
  .hero-container {
    padding: 0 var(--space-4);
  }
  
  .hero-content {
    padding: var(--space-6) 0;
    max-width: 100%;
  }
  
  .hero-title {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
    margin-bottom: var(--space-3);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.6;
    margin-bottom: var(--space-5);
    max-width: 100%;
  }
  
  .hero-cta-group {
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
  }
  
  .cta-primary,
  .cta-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: var(--space-3) var(--space-5);
    font-size: 0.95rem;
  }
  
  /* Reduce hover effects on mobile for better performance */
  .cta-primary:hover,
  .cta-secondary:hover {
    transform: translateY(-1px) scale(1.01);
  }
}

/* Extra Small Mobile (< 360px): Compact layout with essential content */
@media (max-width: 359px) {
  .hero-header {
    min-height: 480px;
    /* Account for fixed navbar (5rem = 80px) + compact spacing */
    padding-top: calc(5rem + var(--space-8));
  }
  
  .hero-container {
    padding: 0 var(--space-3);
  }
  
  .hero-content {
    padding: var(--space-5) 0;
  }
  
  .hero-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
  }
  
  .hero-subtitle {
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
  }
  
  .cta-primary,
  .cta-secondary {
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
  }
}

/* ========================================= */
/* CONTAINER QUERIES - Intrinsic Design     */
/* Modern browsers: Content adapts to       */
/* container, not just viewport             */
/* ========================================= */

@container hero-section (max-width: 480px) {
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  
  .cta-primary,
  .cta-secondary {
    width: 100%;
  }
}

@container hero-section (min-width: 481px) and (max-width: 768px) {
  .hero-content {
    max-width: 100%;
  }
}

@container hero-section (min-width: 769px) {
  .hero-content {
    max-width: 900px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-header,
  .cta-primary,
  .cta-secondary,
  .cta-primary:hover,
  .cta-secondary:hover,
  .particle {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }
}
