/* ============================================
   HYPE MANAGEMENT - Performance Optimizations
   ============================================ */

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

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
  opacity: 1;
}

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

  .animate-fade-in,
  .animate-scale-in,
  .animate-stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-floating-card {
    animation: none !important;
  }

  .hero-bar {
    transform: none !important;
  }

  .dashboard-slide {
    opacity: 1 !important;
    position: relative !important;
  }

  .dashboard-slide:not(.active) {
    display: none !important;
  }
}

/* ----- Content Visibility (CLS prevention) ----- */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}

/* ----- Font Display Optimization ----- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
}

/* ----- Image Aspect Ratio (prevent layout shift) ----- */
.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1 / 1;
}

.aspect-ratio-3-4 {
  aspect-ratio: 3 / 4;
}

/* ----- Will-Change Optimizations ----- */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* ----- Contain Paint (reduce paint area) ----- */
.contain-paint {
  contain: paint;
}

/* ----- GPU Acceleration ----- */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ----- Print Styles (optimized) ----- */
@media print {
  .navbar,
  .mobile-menu,
  .mobile-menu-overlay,
  .mobile-toggle,
  .site-footer,
  .demo-modal,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  .hero {
    min-height: auto !important;
    padding: 20px 0 !important;
    background: #fff !important;
  }

  .hero-title {
    color: #000 !important;
  }

  .hero-description {
    color: #333 !important;
  }

  .hero-card-main {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .section {
    padding: 20px 0 !important;
    page-break-inside: avoid;
  }

  .product-card,
  .feature-card-large,
  .testimonial-card,
  .pricing-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  .cta-section {
    background: #f0f0f0 !important;
    color: #000 !important;
  }

  .cta-title {
    color: #000 !important;
  }
}

/* ----- Critical CSS Inlining (above-the-fold) ----- */
/* Hero section critical styles */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-description {
  font-size: 1.125rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2rem;
}

/* Navbar critical styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

/* ----- Deferred Non-Critical CSS ----- */
/* These styles can be loaded asynchronously */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.875rem;
  }
}