/* ===== Custom Properties ===== */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-text: #1a1a2e;
    --color-text-light: #555;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-border: #e2e8f0;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    --max-width: 1100px;
    --nav-height: 64px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
    --color-bg: #0f1b2d;
    --color-bg-alt: #162032;
    --color-text: #e8edf4;
    --color-text-light: #a3b1c6;
    --color-accent: #5b9cf6;
    --color-accent-hover: #7db4ff;
    --color-border: #253552;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 27, 45, 0.95);
}

[data-theme="dark"] .btn-primary {
    background: var(--color-accent);
    color: #0f1b2d;
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--color-accent-hover);
    color: #0f1b2d;
}

[data-theme="dark"] .btn-outline:hover {
    background: var(--color-accent);
    color: #0f1b2d;
}

[data-theme="dark"] .card {
    background: var(--color-bg-alt);
}

[data-theme="dark"] .tag {
    background: #1a2b42;
    border-color: var(--color-border);
    color: var(--color-text-light);
}

[data-theme="dark"] .photo-img {
    border-color: var(--color-border);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-text);
    transition: border-color 0.2s, color 0.2s;
    margin-left: 16px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-stack);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-hover);
}

ul {
    list-style-position: inside;
}

/* ===== Utilities ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.nav-logo:hover {
    color: var(--color-accent);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--color-text-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
}

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

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
    padding: 160px 0 100px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.btn-outline {
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
}

.btn-outline:hover {
    background: var(--color-accent);
    color: #fff;
}

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

.section-alt {
    background: var(--color-bg-alt);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
}

/* ===== About ===== */
.about-content {
    display: flex;
    gap: 48px;
    align-items: center;
}

.about-photo {
    flex-shrink: 0;
}

.photo-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.photo-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
}

.about-text p {
    margin-bottom: 16px;
    color: var(--color-text-light);
    font-size: 1.05rem;
}

/* ===== Projects ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px;
    transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.card-description {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.card-link {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== Experience / Timeline ===== */
.timeline {
    max-width: 700px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    gap: 32px;
    padding-bottom: 40px;
    border-left: 2px solid var(--color-border);
    margin-left: 80px;
    padding-left: 32px;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-date {
    position: absolute;
    left: -180px;
    width: 140px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 600;
    top: 2px;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.timeline-company {
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 12px;
}

.timeline-content ul {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.timeline-content li {
    margin-bottom: 4px;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.skill-group h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== Publications ===== */
.publications-list {
    max-width: 800px;
    margin: 0 auto 32px;
}

.publication {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

.publication:last-child {
    border-bottom: none;
}

.pub-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.pub-meta {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.pub-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== Contact ===== */
#contact {
    text-align: center;
}

.contact-text {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.contact-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.contact-social {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-light);
    transition: border-color 0.2s, color 0.2s;
}

.contact-social:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ===== Footer ===== */
.footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 16px 0;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s, opacity 0.3s;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        padding: 12px 24px;
        width: 100%;
        text-align: center;
    }

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

    .hero-tagline {
        font-size: 1.05rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .photo-placeholder {
        width: 160px;
        height: 160px;
    }

    .photo-img {
        width: 160px;
        height: 160px;
    }

    /* Simplified timeline for mobile */
    .timeline-item {
        margin-left: 0;
        padding-left: 24px;
        flex-direction: column;
        gap: 4px;
    }

    .timeline-date {
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: 8px;
    }

    .section {
        padding: 56px 0;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 28px;
    }
}
