/* Critical CSS for above-the-fold content */

/* System font fallback */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Roboto"), local("Roboto-Regular"),
    url("../fonts/roboto-v30-latin-regular.woff2") format("woff2");
}

/* Critical variables */
:root {
  --primary: #bb86fc;
  --primary-variant: #3700b3;
  --secondary: #03dac6;
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Critical layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header styles */
.header-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(18, 18, 18, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.logo-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.5rem;
  font-family: "Poppins", sans-serif;
  margin-right: 30px;
}

/* Hero section */
.hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
  padding: 80px 0;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  contain: layout style paint;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
  contain: layout style paint;
}

/* Critical image styles */
.optimized-img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  content-visibility: auto;
  contain: layout paint style;
  will-change: transform;
}

/* Reduce layout shifts */
img {
  aspect-ratio: attr(width) / attr(height);
}

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

/* Critical button styles */
.btn-primary {
  background-color: var(--primary);
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
  will-change: background-color;
}

.btn-primary:hover {
  background-color: var(--secondary);
}

/* Critical navigation */
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  will-change: background-color;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(187, 134, 252, 0.15);
  color: var(--primary);
}

/* Mobile navigation */
@media (max-width: 767.98px) {
  .hero-section {
    padding: 60px 0;
    text-align: center;
  }

  .hero-subtitle {
    margin: 0 auto 2rem;
  }

  .header-toolbar {
    padding: 0 1rem;
  }
}

/* Loading state */
.loading-placeholder {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-primary);
  contain: strict;
}
