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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e9ecef;
    background-color: #0d1117;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav {
    padding: 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: #f0f6fc;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo::before {
    content: "";
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #087cfa 0%, #ff318c 100%);
    border-radius: 4px;
}

.nav-menu {
    display: flex;
    gap: 0;
}

.nav-link {
    color: #c9d1d9;
    text-decoration: none;
    font-weight: 500;
    padding: 20px 16px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle-line {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #087cfa 0%, #ff318c 50%, #7b68ee 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 24px;
    opacity: 0.9;
    color: #ffd700;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    line-height: 1.5;
    font-weight: 400;
}

.highlight {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #ffffff;
    color: #087cfa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-code-block {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 32px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
    position: relative;
}

.hero-code-block::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: #ff5f57;
    border-radius: 50%;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #28ca42;
}

.code-line {
    margin: 8px 0;
}

.code-comment {
    color: #6b7280;
}

.code-keyword {
    color: #ff318c;
}

.code-string {
    color: #ffd700;
}

.code-function {
    color: #87ceeb;
}

.hero-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.profile-image-inline {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-right: 16px;
    flex-shrink: 0;
}

.profile-image-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 64px;
    color: #f0f6fc;
    letter-spacing: -0.02em;
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #087cfa, #ff318c);
    border-radius: 2px;
}

/* About Section */
.about {
    background: #161b22;
}

.about-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text p {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: #c9d1d9;
    line-height: 1.6;
}

.about-stats {
    display: grid;
    gap: 24px;
}

.stat {
    text-align: center;
    padding: 32px 24px;
    background: #21262d;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #30363d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.stat h3 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #087cfa, #ff318c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat p {
    color: #8b949e;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Skills Section */
.skills {
    background: #0d1117;
}

.skills-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.skill-category {
    background: #21262d;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #30363d;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #087cfa, #ff318c);
}

.skill-category:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.skill-category h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #f0f6fc;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-category h3::before {
    content: "";
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #087cfa, #ff318c);
    border-radius: 50%;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-item {
    background: #161b22;
    color: #c9d1d9;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #30363d;
    transition: all 0.2s ease;
}

.skill-item:hover {
    background: linear-gradient(135deg, #58a6ff, #f85149);
    color: white;
    transform: translateY(-2px);
    border-color: transparent;
}

/* Projects Section */
.projects {
    background: #161b22;
}

.projects-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

/* Center the last item if it's alone in its row (for 2-column layout) */
.projects-grid .project-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
}

/* For very large screens with 3+ columns, center differently */
@media (min-width: 1400px) {
    .projects-grid .project-card:last-child:nth-child(odd) {
        grid-column: auto;
        margin: 0;
        max-width: none;
    }
    
    .projects-grid .project-card:last-child:nth-child(3n+1) {
        grid-column: 1 / -1;
        max-width: 400px;
        margin: 0 auto;
    }
}

.project-card {
    background: #21262d;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid #30363d;
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.project-image {
    height: 240px;
    background: linear-gradient(135deg, #58a6ff 0%, #f85149 50%, #a5a5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
}

.project-image i {
    position: relative;
    z-index: 1;
}

.project-content {
    padding: 32px;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #f0f6fc;
}

.project-content p {
    color: #c9d1d9;
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tech span {
    background: #161b22;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #30363d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Experience Section */
.experience {
    background: #0d1117;
}

.experience-timeline {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 32px;
}

.experience-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid #30363d;
    position: relative;
}

.experience-item:last-child {
    border-bottom: none;
}

.experience-item::before {
    content: "";
    position: absolute;
    left: 150px;
    top: 50px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #58a6ff, #f85149);
    border-radius: 50%;
    transform: translateX(-50%);
}

.experience-item::after {
    content: "";
    position: absolute;
    left: 150px;
    top: 56px;
    bottom: -40px;
    width: 2px;
    background: #30363d;
    transform: translateX(-50%);
}

.experience-item:last-child::after {
    display: none;
}

.experience-date {
    font-weight: 600;
    color: #58a6ff;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.experience-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f0f6fc;
}

.experience-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #58a6ff;
}

.experience-content p {
    color: #c9d1d9;
    line-height: 1.6;
    margin-bottom: 16px;
}

.experience-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.experience-tech span {
    background: #161b22;
    color: #c9d1d9;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #30363d;
}

/* Contact Section */
.contact {
    background: #161b22;
}

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

.contact-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #f0f6fc;
}

.contact-info p {
    font-size: 1.25rem;
    color: #c9d1d9;
    margin-bottom: 48px;
    line-height: 1.6;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.contact-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 32px;
    background: #21262d;
    border-radius: 16px;
    text-decoration: none;
    color: #c9d1d9;
    transition: all 0.3s ease;
    border: 1px solid #30363d;
    font-weight: 600;
}

.contact-method:hover {
    background: linear-gradient(135deg, #58a6ff, #f85149);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(88, 166, 255, 0.3);
}

.contact-method i {
    font-size: 1.5rem;
}

/* Footer */
.footer {
    background: #0d1117;
    color: #8b949e;
    padding: 48px 0;
    border-top: 1px solid #21262d;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    color: #8b949e;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}

.footer-social a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #58a6ff, #f85149);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: left 0.3s ease;
    }

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

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        flex-direction: row;
        justify-content: space-around;
    }

    .hero-buttons {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .contact-method {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}