/* Critical CSS - Above the fold styles */
/* This file contains only the essential styles needed for initial page render */

/* CSS Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-muted: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.5rem;
  --transition: all 0.2s ease-in-out;
}

/* Dark theme */
[data-theme="dark"] {
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --bg: #0f172a;
  --bg-muted: #1e293b;
  --border: #334155;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 70px;
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.brand:hover {
  color: var(--primary-dark);
  transform: translateY(-1px);
}

/* Navigation */
.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav a:hover,
.nav a.active {
  color: var(--primary);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0;
  min-height: 60vh;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Buttons */
.btn, .btn-outline {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.btn {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* Social links */
.socials {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.socials a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.socials a:hover {
  color: var(--primary-dark);
}

/* Loading state */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Performance optimizations */
.fonts-loaded body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.paused * {
  animation-play-state: paused !important;
}

/* Smooth scrolling optimization */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* Image loading optimization */
img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.loaded {
  opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
    padding: 2rem 0;
  }
  
  .avatar {
    width: 120px;
    height: 120px;
    justify-self: center;
    margin: 0 auto;
  }
  
  .hero-text h1 {
    font-size: 2rem;
  }
  
  .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .avatar {
    width: 100px;
    height: 100px;
  }
  
  .hero-text h1 {
    font-size: 1.75rem;
  }
  
  .hero-text p {
    font-size: 1rem;
  }
}
