/* Reset & Base Variables */
:root {
    /* Brand Colors - Modern Blue Palette */
    --primary: #2563eb;
    /* Blue 600 */
    --primary-dark: #1d4ed8;
    /* Blue 700 */
    --primary-light: #60a5fa;
    /* Blue 400 */
    --accent: #06b6d4;
    /* Cyan 500 */

    /* Neutral / UI Colors */
    --bg-body: #ffffff;
    --bg-surface: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #475569;
    /* Slate 600 */
    --text-lihgt: #94a3b8;
    /* Slate 400 */
    --text-white: #ffffff;

    /* Effects */
    --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);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Utilities */
h1,
h2,
h3,
h4 {
    line-height: 1.2;
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--bg-surface);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -0.05rem;
    color: var(--text-main);
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.navbar {
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-menu a:hover {
    color: var(--primary);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 0.5rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 1.5rem;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    padding: 2px;
    border-radius: 4px;
}

.lang-btn img {
    display: block;
    width: 24px;
    height: auto;
    border-radius: 2px;
}

.lang-btn:hover,
.lang-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Mobile Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    max-width: 600px;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dbeafe;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

.btn-outline:hover {
    border-color: var(--text-main);
    background: var(--bg-surface);
}


.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

/* Hero Image & Blob */
.hero-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blob-shape {
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(45deg, #dbeafe, #e0f2fe);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    z-index: 1;
    animation: blobMorph 8s ease-in-out infinite;
}

.profile-img {
    position: relative;
    z-index: 2;
    width: 380px;
    /* height: 380px; */
    /* Let aspect ratio handle it, assume somewhat square */
    border-radius: 20px;
    /* Clean modern look: slightly rotated or just clean shadow */
    box-shadow: var(--shadow-xl);
    transform: rotate(-3deg);
    transition: var(--transition);
    object-fit: cover;
}

.profile-img:hover {
    transform: rotate(0) scale(1.02);
}

@keyframes blobMorph {

    0%,
    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Changed to match Hero grid for better alignment */
    gap: 4rem;
    align-items: start;
}

.about-text {
    max-width: 650px;
    /* Constrain text width for readability */
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: justify;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid #f1f5f9;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Timeline / Experience --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    transform: translateX(-50%);
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid #f1f5f9;
}

.timeline-date {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
    margin-top: 1rem;
}

.timeline-content li {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.25rem;
}

.timeline-content li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* --- Research --- */
.research-card {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #f1f5f9;
    border-top: 5px solid var(--primary);
}

.research-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.research-type {
    padding: 0.4rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.research-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.research-institution {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.research-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- Skills --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
    transition: var(--transition);
}

.skill-category:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    border-bottom: 2px solid #eff6ff;
    padding-bottom: 0.5rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: var(--bg-surface);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background: var(--primary);
    color: white;
}

/* --- Contact --- */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.contact-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* --- Footer --- */
footer {
    padding: 4rem 0;
    text-align: center;
    background: var(--bg-surface);
    color: var(--text-muted);
    margin-top: 4rem;
}

/* --- Responsive Design --- */
@media (max-width: 968px) {
    .section-title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-grid {
        grid-template-columns: 100%;
        text-align: center;
        gap: 3rem;
    }

    .hero-image-container {
        order: -1;
    }

    .blob-shape {
        width: 350px;
        height: 350px;
    }

    .profile-img {
        width: 280px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    /* Fixed alignment for hero description */
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .about-content {
        grid-template-columns: 100%;
    }

    /* Constrain about-text to match hero alignment */
    .about-text {
        max-width: 90%;
        margin: 0 auto;
    }

    .about-stats {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .hamburger {
        display: flex;
    }

    .language-selector {
        margin-right: 1rem;
    }

    .contact-cta {
        flex-direction: column;
    }
}

/* --- Animations --- */
/* Only hide elements if JS is active and page is loading */
.js-loading .timeline-item,
.js-loading .stat-card,
.js-loading .skill-category,
.js-loading .research-card,
.js-loading .contact-content {
    opacity: 0;
    transform: translateY(30px);
}

/* Base transition state - always applied */
.timeline-item,
.stat-card,
.skill-category,
.research-card,
.contact-content {
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: opacity, transform;
}

/* Visible state overrides everything */
.visible,
/* Also show if js-loading is NOT present (fallback) - implicitly handled by default styles */
html:not(.js-loading) .timeline-item,
html:not(.js-loading) .stat-card,
html:not(.js-loading) .skill-category,
html:not(.js-loading) .research-card,
html:not(.js-loading) .contact-content {
    opacity: 1;
    transform: translateY(0);
}

.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}