/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
======================================== */
:root {
  /* Colors */
  --color-bg-primary: #0d0d0d;
  --color-bg-secondary: #171717;
  --color-bg-tertiary: #1a1a1a;
  --color-text-primary: white;
  --color-text-secondary: rgba(255, 255, 255, 0.45);
  --color-accent: white;
  --color-accent-hover: #f3f4f6;
  --color-text-accent: #171717;
  
  /* Typography */
  --font-primary: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Inter', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 1rem;
  --radius-md: 1.5rem;
  --radius-lg: 2rem;
  --radius-mobile: 20px;
  --radius-circle: 50%;
  
  /* Breakpoints */
  --breakpoint-tablet: 1024px;
  --breakpoint-mobile: 768px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ========================================
   LAYOUT COMPONENTS
======================================== */
.container {
    display: flex;
    min-height: 100vh;
    gap: 0;
    padding: 0;
    max-width: 1600px;
    margin: 0 auto;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: 352px;
    height: 100vh;
    min-height: 520px;
    padding: var(--spacing-md);
    gap: var(--spacing-xl);
    position: sticky;
    top: 0;
    overflow: hidden;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
    flex: 1;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    padding: 16px;
}

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
}

/* ========================================
   COMPONENTS
======================================== */

/* Profile Section */
.profile-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.avatar {
    position: relative;
    width: 32px;
    height: 32px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-circle);
    object-fit: cover;
}

.avatar-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    color: var(--color-text-accent);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    opacity: 0;
}

.name {
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0px;
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.title-description-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.title {
    font-weight: 600;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-top: -1px;
}

.description {
    font-weight: 400;
    color: var(--color-text-secondary);
    font-size: 1rem;
    letter-spacing: 0px;
    line-height: 1.3;
}

/* CTA Button */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 24px;
    background-color: var(--color-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-accent);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-family: var(--font-primary);
    width: fit-content;
}

.cta-button:hover {
    background-color: var(--color-accent-hover);
}

.cta-button:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Footer */
.footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

/* Hide mobile footer on desktop by default */
.footer-mobile {
    display: none;
}

.footer-text {
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0px;
    line-height: 1.3;
}

.copyright {
    font-weight: 500;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0px;
    line-height: 1;
}

/* Portfolio Items */
.portfolio-item {
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    will-change: opacity, transform;
}

.portfolio-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-tertiary);
    display: block;
    visibility: visible;
}

.portfolio-item.image-error {
    background-color: var(--color-bg-tertiary);
}

/* ========================================
   UTILITIES
======================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-accent);
    color: var(--color-text-accent);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

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

.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;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .sidebar {
        width: 352px;
        position: static;
        height: auto;
        min-height: auto;
        align-self: center;
    }
    
    .title {
        text-align: center;
        font-size: 2.5rem;
    }
    
    .description {
        text-align: center;
    }
    
    .cta-button {
        align-self: center;
    }
    
    .profile-section {
        justify-content: center;
    }
    
    .portfolio-item {
        border-radius: var(--radius-mobile);
    }
    
    .footer-desktop {
        display: none;
    }
    
    .footer-mobile {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 var(--spacing-md) var(--spacing-md);
        max-width: 352px;
        width: 100%;
        margin: var(--spacing-xl) auto 0;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: var(--spacing-xs);
        padding: var(--spacing-sm);
    }
    
    .sidebar {
        width: 352px;
        padding: var(--spacing-md) var(--spacing-sm);
        height: auto;
        min-height: auto;
        align-self: center;
    }
    
    .main-content {
        padding: 8px;
    }
    
    .title {
        font-size: 2.5rem !important;
        letter-spacing: -3px;
    }
    
    .description {
        font-size: 0.875rem !important;
    }
    
    .cta-button {
        font-size: 1rem !important;
    }
    
    .portfolio-grid {
        gap: var(--spacing-xs);
    }
    
    .portfolio-item {
        padding: var(--spacing-xs);
        border-radius: var(--radius-mobile);
    }
    
    .footer-desktop {
        display: none;
    }
    
    .footer-mobile {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 var(--spacing-md) var(--spacing-md);
        max-width: 352px;
        width: 100%;
        margin: var(--spacing-xl) auto 0;
        text-align: center;
    }
}

/* ========================================
   ANIMATIONS & LOADING STATES
======================================== */
/* Portfolio items start hidden and are animated via JavaScript */
.portfolio-item.loaded {
    opacity: 1;
    transform: translateY(0);
}
