/* Portfolio Styles */
:root {
    /* Color Palette */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    
    /* Typography */
    --font-display: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--gray-600);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-600);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: var(--space-md) 0;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--gray-200);
}

.navbar.scrolled {
    background: rgba(248, 250, 252, 0.95);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.nav-logo .logo-text {
    color: var(--gray-900);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-2xl);
}

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    position: relative;
    padding: var(--space-sm) 0;
}

.nav-link:hover {
    color: var(--primary-600);
}

.nav-link:focus {
    outline: 2px solid var(--primary-600);
    outline-offset: 4px;
    color: var(--primary-600);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-600), var(--accent-purple));
    transition: width var(--transition-normal);
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-600);
    font-weight: 600;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: var(--space-sm);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.hamburger:focus {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}

.hamburger:hover {
    background: var(--gray-100);
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    transition: var(--transition-normal);
    border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%),
        url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=1920&h=1080&fit=crop&crop=center') center/cover;
    color: var(--gray-900);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 40% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: float 30s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(14, 165, 233, 0.03) 1px, transparent 0);
    background-size: 40px 40px;
    animation: grid-move 50s linear infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -8px) scale(1.01); }
    66% { transform: translate(-10px, 12px) scale(0.99); }
}

@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

.hero-content {
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.04em;
    animation: fadeInUp 1s ease-out;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary-400), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: var(--space-lg);
    opacity: 0.9;
    font-weight: 500;
    color: var(--gray-700);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    color: var(--gray-600);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:focus {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-300);
    color: var(--primary-700);
    transform: translateY(-2px);
}

/* Section Styles */
section {
    padding: var(--space-3xl) 0;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: var(--space-3xl);
    color: var(--gray-900);
    position: relative;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}



/* Projects Section */
.projects {
    background: var(--gray-50);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
}

.project-card {
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    min-height: 320px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

.project-info {
    flex: 1;
    padding: var(--space-2xl);
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
    font-weight: 700;
    line-height: 1.3;
}

.project-info p {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    font-size: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.tech-tag {
    background: var(--primary-100);
    color: var(--primary-800);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--primary-200);
    transition: all var(--transition-fast);
}

.tech-tag:hover {
    background: var(--primary-200);
    transform: translateY(-1px);
}

.project-links {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.project-links .btn {
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9rem;
    border-radius: var(--radius-lg);
}

.project-image {
    width: 320px;
    flex-shrink: 0;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin: var(--space-lg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.project-image:hover {
    border-color: var(--primary-300);
}

.project-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
}

.project-card:hover .project-image {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-card:hover .project-image img {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Full Size Image Hover Preview */
.image-hover-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
    border: 3px solid var(--primary-400);
    padding: var(--space-sm);
}

.image-hover-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.image-hover-preview.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1.02);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .image-hover-preview {
        display: none;
    }
}

/* Skills Section */
.skills {
    background: white;
}

.skills-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-xl);
    max-width: 900px;
    margin: 0 auto;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    background: var(--gray-50);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-600), var(--accent-purple));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.skill-item:hover img {
    transform: scale(1.1);
}

.skill-item span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: color var(--transition-normal);
}

.skill-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: white;
}

.skill-item:hover span {
    color: var(--primary-600);
}

/* Contact Section */
.contact {
    background: var(--gray-50);
    padding: var(--space-2xl) 0;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    color: var(--gray-900);
    font-weight: 700;
}

.contact-info p {
    color: var(--gray-600);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 400px;
    margin: 0 auto;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--gray-700);
    text-decoration: none;
    transition: all var(--transition-normal);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.contact-link:hover {
    color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-link:focus {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
    color: var(--primary-600);
}

.contact-link i {
    font-size: 1.2rem;
    width: 20px;
    color: var(--primary-600);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    text-align: center;
    padding: var(--space-2xl) 0;
}

.footer p {
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
}

.footer p:last-child {
    margin-bottom: 0;
    opacity: 0.8;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background: var(--primary-600);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    display: none;
    z-index: 1000;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    font-size: 1.2rem;
}

.back-to-top:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.back-to-top:focus {
    outline: 2px solid white;
    outline-offset: 2px;
    background: var(--primary-700);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(248, 250, 252, 0.95);
        backdrop-filter: blur(12px);
        width: 100%;
        text-align: center;
        transition: var(--transition-normal);
        box-shadow: var(--shadow-lg);
        padding: var(--space-xl) 0;
        gap: var(--space-lg);
        border-top: 1px solid var(--gray-200);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }



    .project-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .project-info {
        padding: var(--space-lg) var(--space-xl) var(--space-xl);
        order: 2;
        display: flex;
        flex-direction: column;
    }
    
    .project-info h3 {
        order: -1;
        margin-bottom: var(--space-md);
    }
    
    .project-image {
        width: 100%;
        margin: 0;
        border-radius: 0;
        order: 1;
        padding: var(--space-md) var(--space-xl) 0;
    }
    
    .project-image img {
        border-radius: var(--radius-lg);
    }

    .skills-showcase {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: var(--space-lg);
    }
    
    .skill-item {
        padding: var(--space-lg);
    }
    
    .skill-item img {
        width: 36px;
        height: 36px;
    }
    
    .skill-item span {
        font-size: 0.8rem;
    }

    .contact-links {
        max-width: 100%;
    }

    .project-links {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-sm);
    }

    .project-links .btn {
        text-align: center;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
        flex: 1;
        max-width: 140px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    section {
        padding: var(--space-2xl) 0;
    }





    .back-to-top {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }
}

/* Smooth Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Code Highlighting */
code {
    font-family: var(--font-mono);
    background: var(--gray-100);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--gray-800);
}

/* Selection Styles */
::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

::-moz-selection {
    background: var(--primary-200);
    color: var(--primary-900);
}