/* ============================================
   CSS Variables - Dark Developer Theme
   ============================================ */
:root {
    /* Color Palette - Sophisticated Dark Theme */
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-primary-light: rgba(99, 102, 241, 0.15);
    --color-primary-glow: rgba(99, 102, 241, 0.4);
    
    --color-accent: #22d3ee;
    --color-accent-light: rgba(34, 211, 238, 0.15);
    
    --color-bg: #0f0f23;
    --color-bg-alt: #1a1a2e;
    --color-bg-card: #16162a;
    --color-bg-elevated: #1e1e3f;
    
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-dim: #64748b;
    
    --color-border: rgba(99, 102, 241, 0.2);
    --color-border-subtle: rgba(255, 255, 255, 0.06);
    
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-demo: #6366f1;
    --color-demo-bg: rgba(99, 102, 241, 0.15);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-error: #ef4444;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.5rem;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 80px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Animated Grid Background */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

.hidden {
    display: none !important;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--spacing-3xl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.2) 0%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

@media (min-width: 1024px) {
    .hero .container {
        grid-template-columns: 1.2fr 1fr;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-success);
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.6s ease-out;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title .greeting {
    display: block;
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.hero-title .name {
    display: block;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .accent {
    color: var(--color-primary);
    -webkit-text-fill-color: var(--color-primary);
}

.hero-subtitle {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 500px;
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-stats {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-text);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--color-primary-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* Code Window Visual */
.hero-visual {
    display: none;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

@media (min-width: 1024px) {
    .hero-visual {
        display: block;
    }
}

.code-window {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition-base);
}

.code-window:hover {
    transform: perspective(1000px) rotateY(-2deg) rotateX(2deg);
}

.window-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border-subtle);
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-dots span:nth-child(1) { background: #ef4444; }
.window-dots span:nth-child(2) { background: #f59e0b; }
.window-dots span:nth-child(3) { background: #10b981; }

.window-title {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-dim);
}

.window-content {
    padding: var(--spacing-lg);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.8;
}

.window-content pre {
    margin: 0;
}

.window-content code {
    font-family: inherit;
}

.code-keyword { color: #c678dd; }
.code-var { color: #e06c75; }
.code-prop { color: #61afef; }
.code-string { color: #98c379; }
.code-bool { color: #d19a66; }

/* ============================================
   Tech Stack Section
   ============================================ */
.tech-stack {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-subtle);
    border-bottom: 1px solid var(--color-border-subtle);
}

.tech-stack-label {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-md);
}

.tech-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.tech-icon {
    width: 40px;
    height: 40px;
    color: var(--color-text-dim);
    transition: all var(--transition-base);
    cursor: default;
}

.tech-icon:hover {
    color: var(--color-primary);
    transform: translateY(-4px);
}

.tech-icon svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding: var(--spacing-3xl) 0;
    min-height: 60vh;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.title-decorator {
    width: 4px;
    height: 32px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
}

.subsection-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.star-icon {
    font-size: var(--text-lg);
}

/* ============================================
   Controls (Filters & Search)
   ============================================ */
.controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
}

@media (min-width: 768px) {
    .controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.filters {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--color-text-dim);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ============================================
   Error & Empty States
   ============================================ */
.error-panel, .empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
}

.error-icon, .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.error-panel h2 {
    color: var(--color-error);
    margin-bottom: var(--spacing-sm);
    font-size: var(--text-xl);
}

.error-panel p, .empty-state p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   Projects Grid
   ============================================ */
.featured-section {
    margin-bottom: var(--spacing-2xl);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 640px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Project Card - Professional Thumbnails
   ============================================ */
.project-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--color-primary);
}

/* Image Wrapper - Fixed Thumbnail Size */
.project-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg-elevated) 100%);
}

.project-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-card-image {
    transform: scale(1.05);
}

/* Image Overlay */
.project-card-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 60%,
        rgba(15, 15, 35, 0.8) 100%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.project-card:hover .project-card-image-wrapper::after {
    opacity: 1;
}

/* Placeholder for missing images */
.project-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-primary-light) 100%);
    color: var(--color-primary);
    font-size: var(--text-4xl);
    font-weight: 800;
    font-family: var(--font-display);
}

/* Card Content */
.project-card-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.project-name {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.project-year {
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    color: var(--color-text-dim);
    background: var(--color-bg-alt);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.project-description {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-md);
    flex: 1;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: var(--spacing-md);
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    font-family: var(--font-mono);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--color-primary);
    color: white;
}

/* Footer */
.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border-subtle);
    margin-top: auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.live {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.status-badge.live::before {
    background: var(--color-success);
}

.status-badge.demo {
    background: var(--color-demo-bg);
    color: var(--color-demo);
}

.status-badge.demo::before {
    background: var(--color-demo);
}

.status-badge.private {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.status-badge.private::before {
    background: var(--color-warning);
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.view-btn:hover {
    background: var(--color-primary-hover);
    transform: translateX(4px);
}

.view-btn::after {
    content: '→';
    transition: transform var(--transition-fast);
}

.view-btn:hover::after {
    transform: translateX(4px);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-brand {
    text-align: center;
}

@media (min-width: 768px) {
    .footer-brand {
        text-align: left;
    }
}

.footer-logo {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--color-text);
}

.footer-logo .accent {
    color: var(--color-primary);
}

.footer-brand p {
    color: var(--color-text-dim);
    font-size: var(--text-sm);
    margin-top: var(--spacing-xs);
}

.footer-links {
    display: flex;
    justify-content: center;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border-subtle);
}

.footer-bottom p {
    color: var(--color-text-dim);
    font-size: var(--text-sm);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    .hero {
        min-height: auto;
        padding: var(--spacing-2xl) 0;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-title .greeting {
        font-size: var(--text-base);
    }
    
    .hero-subtitle {
        font-size: var(--text-xl);
    }
    
    .hero-description {
        font-size: var(--text-base);
    }
    
    .hero-stats {
        gap: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: var(--text-2xl);
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .project-card-image-wrapper {
        height: 140px;
    }
    
    .project-card-header {
        flex-direction: column;
    }
    
    .project-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: stretch;
    }
    
    .view-btn {
        justify-content: center;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card {
    animation: slideIn 0.4s ease-out backwards;
}

.projects-grid .project-card:nth-child(1) { animation-delay: 0.1s; }
.projects-grid .project-card:nth-child(2) { animation-delay: 0.15s; }
.projects-grid .project-card:nth-child(3) { animation-delay: 0.2s; }
.projects-grid .project-card:nth-child(4) { animation-delay: 0.25s; }
.projects-grid .project-card:nth-child(5) { animation-delay: 0.3s; }
.projects-grid .project-card:nth-child(6) { animation-delay: 0.35s; }
.projects-grid .project-card:nth-child(7) { animation-delay: 0.4s; }
.projects-grid .project-card:nth-child(8) { animation-delay: 0.45s; }
.projects-grid .project-card:nth-child(9) { animation-delay: 0.5s; }

/* Smooth scroll padding for anchor links */
#projects {
    scroll-margin-top: 20px;
}
