/* Enhanced Critical CSS for Instant Above-the-Fold Rendering */

/* Modern Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
}

/* Loading State - Critical for perceived performance */
#root {
  min-height: 100vh;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@media (min-width: 768px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Skip Link - Critical for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  font-size: 14px;
}

.skip-link:focus {
  top: 6px;
}

/* Hero Section - Above-the-fold content */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(79, 70, 229, 0.95), rgba(99, 102, 241, 0.9), rgba(234, 179, 8, 0.95));
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
  min-height: 400px;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 2rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Critical Buttons */
.btn-primary {
  background-color: #eab308;
  color: #111827;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
  min-height: 48px; /* Touch target size */
  font-family: inherit;
}

.btn-primary:hover {
  background-color: #facc15;
  transform: translateY(-1px);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.3);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-height: 48px; /* Touch target size */
  font-family: inherit;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Navigation - Critical for immediate interaction */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

/* GPU Accelerated Animations */
.gpu-accelerated {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Responsive Typography */
@media (max-width: 640px) {
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 280px;
  }
}

/* Focus Management */
.focus-visible {
  outline: 2px solid #eab308;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .loading-container,
  .hero-overlay {
    display: none !important;
  }
}