/* Performance Optimization CSS */

/* Critical CSS - Above the fold styles */
:root {
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-900: #0f172a;
    --bg-primary: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --transition-normal: all 0.3s ease;
    /* Fluid typography helpers */
    --fluid-h1: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
    --fluid-h2: clamp(1.25rem, 1rem + 1.2vw, 2rem);
    --fluid-h3: clamp(1.125rem, 0.95rem + 0.8vw, 1.5rem);
    --fluid-pad: clamp(1rem, 0.8rem + 1vw, 2rem);
}

/* Critical layout styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--neutral-900);
    background: var(--neutral-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.sidebar {
    width: 350px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--neutral-50) 100%);
    padding: var(--fluid-pad);
    border-right: 1px solid var(--neutral-100);
}

.main-content {
    flex: 1;
    padding: var(--fluid-pad);
    overflow-y: auto;
}

/* Critical typography */
h1, h2, h3 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--fluid-h1);
    color: var(--neutral-900);
}

h2 {
    font-size: var(--fluid-h2);
    color: var(--primary-600);
}

h3 {
    font-size: var(--fluid-h3);
}

/* Critical components */
.profile-section {
    text-align: center;
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.profile-img {
    width: 160px;
    height: 200px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    border: 3px solid var(--primary-500);
}

.content-section {
    margin-bottom: var(--space-8);
    background: var(--bg-primary);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.competency-item {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    margin-bottom: var(--space-2);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--neutral-900);
    transition: var(--transition-normal);
    border: 1px solid var(--neutral-100);
}

.competency-item:hover {
    background: var(--primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.competency-item i {
    margin-right: var(--space-4);
    font-size: var(--font-size-lg);
    width: 20px;
    text-align: center;
}

/* Critical animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Critical accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-500);
    color: white;
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    border-radius: var(--radius-lg);
    z-index: 1000;
    transition: top 0.3s ease;
}

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

/* Critical responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--neutral-100);
    }
    
    .main-content {
        padding: var(--space-6);
    }
    
    .profile-img {
        width: 120px;
        height: 150px;
    }
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Font loading optimization */
.font-loaded body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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