/* Sky-inspired Design System with Cloud White and Sky Blue - Performance Optimized */
@import url("https://fonts.googleapis.com/css2?family=Metrophobic&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Metrophobic", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optimized Glass Morphism Elements */
.glass-header {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  will-change: transform;
}

.glass-card {
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.glass-card-gradient {
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.9), rgba(3, 105, 161, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px -8px rgba(135, 206, 235, 0.3);
}

.glass-element {
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.glass-input {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Optimized Navigation */
.nav-link {
  position: relative;
  color: #6b7280;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  text-decoration: none;
  display: inline-block;
}

.nav-link:hover,
.nav-link.active {
  color: #87ceeb;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #87ceeb, #0369a1);
  transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Optimized Buttons */
.glass-button {
  background: rgba(135, 206, 235, 0.15);
  border: 1px solid rgba(135, 206, 235, 0.3);
  color: #87ceeb;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.glass-button:hover {
  background: rgba(135, 206, 235, 0.25);
  transform: none;
}

.glass-button-primary {
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.9), rgba(3, 105, 161, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 16px -4px rgba(135, 206, 235, 0.4);
  font-size: 0.875rem;
}

.glass-button-primary:hover {
  transform: none;
}

.glass-button-white {
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #0369a1;
  padding: 0.875rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.glass-button-white:hover {
  background: rgba(248, 250, 252, 1);
  transform: none;
}

.glass-button-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.glass-button-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Optimized Statistics Cards */
.stats-card {
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.1), rgba(3, 105, 161, 0.05));
  border: 1px solid rgba(135, 206, 235, 0.2);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s ease;
  position: relative;
  contain: layout style paint;
}

.stats-card:hover {
  transform: none;
}

.stats-number {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #87ceeb, #0369a1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1;
}

.stats-label {
  color: #6b7280;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, rgba(135, 206, 235, 0.2), rgba(3, 105, 161, 0.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #87ceeb;
}

/* Performance Optimizations */
img {
  loading: lazy;
  decoding: async;
  height: auto;
}

video {
  loading: lazy;
}

/* Smooth scrolling */
html {
  scroll-behavior: auto;
}

/* Optimized scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(248, 250, 252, 0.5);
}

::-webkit-scrollbar-thumb {
  background: #87ceeb;
  border-radius: 2px;
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: 2px solid #87ceeb;
  outline-offset: 2px;
}

/* Mobile optimizations - Reduced effects for better performance */
@media (max-width: 768px) {
  .glass-card,
  .glass-element,
  .glass-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(248, 250, 252, 0.95);
  }

  .glass-card-gradient {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .glass-button-primary,
  .glass-button-white {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
  }

  .stats-number {
    font-size: 2.5rem;
  }

  .stats-card {
    padding: 1.5rem;
  }

  /* Disable hover effects on mobile */
  .glass-card:hover,
  .glass-element:hover,
  .portfolio-item:hover,
  .stats-card:hover {
    transform: none;
  }

  /* Reduce animations on mobile */
  * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glass-card {
    background: rgba(248, 250, 252, 0.98);
    border: 2px solid #87ceeb;
  }

  .glass-element {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid #87ceeb;
  }
}

/* Reduced motion support */
@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;
  }
}

/* Print styles */
@media print {
  .glass-card,
  .glass-element {
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: none;
  }

  .glass-button,
  .glass-button-primary {
    background: white;
    color: #0369a1;
    border: 1px solid #0369a1;
  }
}

/* GPU acceleration for critical elements only */
.nav-link::after,
.glass-button-primary {
  will-change: transform;
  transform: translateZ(0);
}

/* Container optimization */
.container {
  contain: layout;
}

/* Critical rendering path optimization */
.glass-header {
  contain: layout style paint;
}

/* Optimize for better performance */
@media (prefers-reduced-motion: no-preference) {
  .glass-card:hover {
    transform: none;
  }

  .portfolio-item:hover .glass-card {
    transform: scale(1.02);
  }
}

/* Remove expensive effects on lower-end devices */
@media (max-width: 768px) and (max-resolution: 150dpi) {
  .glass-card,
  .glass-element,
  .glass-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
