/* CSS Variables */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --accent-color: #60a5fa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background: #ffffff;
    --background-alt: #fafafa;
    --border-color: #e5e7eb;
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --background: #111827;
        --background-alt: #1f2937;
        --border-color: #374151;
    }
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1.25rem 0;
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background-color: rgba(17, 24, 39, 0.95);
    }
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--text-primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.2s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    padding: 140px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    animation: gradientShift 15s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(5%, 5%) rotate(120deg);
    }
    66% {
        transform: translate(-5%, 5%) rotate(240deg);
    }
}

.hero-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 4rem;
    align-items: start;
    padding-top: 2rem;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.hero-text h1 {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.highlight {
    color: var(--text-primary);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.75rem;
    line-height: 1.4;
}

.intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 650px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover {
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary:hover::before {
    width: 100%;
}

/* Sections */
.section {
    padding: 100px 0;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.3) 25%, 
        rgba(16, 185, 129, 0.3) 50%, 
        rgba(168, 85, 247, 0.3) 75%, 
        transparent 100%);
}

.section:first-of-type::before {
    display: none;
}

.section:nth-child(even) {
    background-color: var(--background-alt);
}

.section-title {
    font-size: 2.25rem;
    text-align: left;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-subtitle {
    text-align: left;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3.5rem;
    max-width: 700px;
    line-height: 1.7;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.section-header .section-subtitle {
    margin-bottom: 0;
}

/* Page Header */
.page-header {
    padding: 140px 0 80px;
    background-color: var(--background-alt);
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 800px;
}

/* Dedicated Pages */
.projects-page,
.publications-page {
    padding: 80px 0;
}

/* About Section */
.about-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 900px;
    margin: 1.5rem 0 3rem 0;
    text-align: left;
}

.characteristics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.char-card {
    background: transparent;
    padding: 0;
    transition: var(--transition);
}

.char-card:hover {
    transform: translateX(4px);
}

.char-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.char-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.char-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.975rem;
}

/* Skills Section */
.skills-categories {
    display: grid;
    gap: 2.5rem;
    max-width: 1000px;
    margin: 0;
}

.skill-category {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.skill-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: default;
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .skills-categories {
        gap: 1.5rem;
    }
    
    .skill-category {
        padding: 1.5rem;
    }
    
    .skill-category-title {
        font-size: 1rem;
    }
    
    .skill-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.85rem;
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.project-card {
    background: var(--background);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--text-light);
}

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.375rem;
    margin-bottom: 0.625rem;
    color: var(--text-primary);
    font-weight: 600;
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.7;
    font-size: 0.975rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.project-tags span {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.project-tags span:nth-child(6n+1) {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.project-tags span:nth-child(6n+2) {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.project-tags span:nth-child(6n+3) {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.project-tags span:nth-child(6n+4) {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.3);
}

.project-tags span:nth-child(6n+5) {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border-color: rgba(236, 72, 153, 0.3);
}

.project-tags span:nth-child(6n+6) {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border-color: rgba(14, 165, 233, 0.3);
}

.project-tags span:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.project-links {
    display: flex;
    gap: 1.5rem;
}

.project-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--text-primary);
}

/* GitHub Section */
.github-section {
    padding: 60px 0;
    background-color: var(--background-alt);
}

.github-link-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.github-link-card:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.github-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    color: white;
}

.github-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.github-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.github-btn {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.github-btn:hover {
    color: var(--secondary-color);
}

/* Projects List (Publication Style) */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.project-item {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.project-item:hover {
    border-left-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    transform: translateX(4px);
}

.project-item:last-child {
    margin-bottom: 0;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.project-repo {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

.project-description {
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Publications Section */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.publication-item {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.publication-item:hover {
    border-left-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

.publication-item:last-child {
    margin-bottom: 0;
}

.publication-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.publication-venue {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

.publication-description {
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.publication-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.publication-link:hover {
    color: var(--secondary-color);
    transform: translateX(2px);
}

.more-publications {
    text-align: center;
    margin-top: 3rem;
}

/* Contact Section */
.contact-content {
    max-width: 100%;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    background: transparent;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.contact-link:hover {
    transform: translateX(4px);
    color: var(--primary-color);
}

.contact-link .icon {
    font-size: 1.375rem;
}

/* Contact Page */
.contact-page {
    padding: 80px 0;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-method-item {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background);
    transition: all 0.3s ease;
}

.contact-method-item:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.contact-method-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: 12px;
    color: var(--primary-color);
}

.contact-method-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.contact-detail {
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.contact-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.contact-link-btn:hover {
    background: var(--secondary-color);
    transform: translateX(4px);
}

.contact-footer {
    margin-top: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.contact-footer h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.contact-footer p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* Footer */
.footer {
    background-color: var(--background);
    padding: 3rem 0;
    text-align: left;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 0.9rem;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

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

    .nav-toggle {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        display: flex;
        justify-content: center;
    }

    .hero-buttons {
        justify-content: center;
        flex-direction: column;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

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

    .section-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1.125rem;
    }

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

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

    .github-link-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.75rem;
    }

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

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .contact-method-item {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .contact-icon {
        margin: 0 auto;
    }
}
