/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-card-hover: #1f2937;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --border: #2d3748;
    --gradient-start: #0a0f1a;
    --gradient-end: #1a1f35;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ===== Container ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

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

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

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-cv {
    background: var(--accent);
    color: white !important;
}

.nav-cv:hover {
    background: var(--accent-light);
}

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

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
        linear-gradient(to bottom, var(--gradient-start), var(--gradient-end));
    z-index: -1;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    text-align: center;
    padding: 24px;
    animation: fadeInUp 1s ease;
}

.hero-greeting {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
}

.hero-name {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    min-height: 1.5em;
}

.typing-text {
    color: var(--accent-light);
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.hero-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

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

.section:nth-child(even) {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== About Section ===== */
.about-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 48px;
    align-items: start;
}

.about-image-wrapper {
    position: sticky;
    top: 100px;
}

.about-image {
    width: 250px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.research-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.interest-tag {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.interest-tag:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ===== Research Section ===== */
.research-category {
    margin-bottom: 48px;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paper-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

.paper-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
    transform: translateX(4px);
}

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.paper-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.paper-year {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.paper-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.paper-badge.wip {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.paper-badge.early {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.paper-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.paper-abstract {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.paper-abstract-short {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.abstract-full {
    display: none;
    margin-top: 12px;
}

.abstract-full.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.abstract-toggle {
    background: none;
    border: none;
    color: var(--accent-light);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 8px;
    padding: 4px 0;
    font-family: inherit;
    transition: color var(--transition);
}

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

.presentations-grid {
    display: grid;
    gap: 16px;
}

.presentation-year {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    align-items: baseline;
}

.year-label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-light);
}

.presentation-year p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Teaching Section ===== */
.teaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.teaching-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all var(--transition);
}

.teaching-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.teaching-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: 10px;
    margin-bottom: 16px;
    color: var(--accent-light);
}

.teaching-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.teaching-type {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.teaching-period {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-light);
}

.teaching-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: var(--text-secondary);
}

.contact-item svg {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--accent-light);
}

.contact-item a {
    color: var(--text-secondary);
}

.contact-item a:hover {
    color: var(--accent-light);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.contact-link-card:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateX(8px);
}

.contact-link-card svg {
    color: var(--accent-light);
}

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

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        transform: translateY(-120%);
        opacity: 0;
        transition: all var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-toggle {
        display: flex;
    }

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

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

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

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

    .about-image-wrapper {
        position: static;
        display: flex;
        justify-content: center;
    }

    .about-image {
        width: 200px;
        height: 240px;
    }

    .research-interests {
        justify-content: center;
    }

    .paper-header {
        flex-direction: column;
        gap: 8px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .section {
        padding: 60px 0;
    }
}

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

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

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

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

/* ===== Selection ===== */
::selection {
    background: var(--accent);
    color: white;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
