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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-light: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --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);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

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

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

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 120px 24px 60px;
}

.hero-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
}

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

.profile-photo img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.profile-photo img:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15);
}

.hero-text {
    flex: 1;
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

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

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

.hero-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.hero-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.hero-links svg {
    flex-shrink: 0;
}

/* Introduction Section */
.introduction {
    background-color: var(--bg-primary);
}

.intro-content {
    max-width: 1000px;
    margin: 0 auto;
}

.intro-block {
    margin-bottom: 36px;
}

.intro-block:last-child {
    margin-bottom: 0;
}

.intro-block h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.intro-block p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.intro-block p:last-child {
    margin-bottom: 0;
}

.intro-block a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.intro-block a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

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

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    text-align: center;
    color: var(--text-primary);
}

/* Education Section */
.education {
    background-color: var(--bg-secondary);
}

.edu-list {
    max-width: 1000px;
    margin: 0 auto;
}

.edu-item {
    display: flex;
    align-items: baseline;
    gap: 32px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

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

.edu-item:hover {
    box-shadow: var(--shadow-md);
}

.edu-time {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    min-width: 180px;
}

.edu-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.edu-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Publications Section */
.publications {
    background-color: var(--bg-secondary);
}

.pub-list {
    max-width: 1000px;
    margin: 0 auto;
}

.pub-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

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

.pub-item:hover {
    box-shadow: var(--shadow-md);
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pub-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.pub-title a:hover {
    text-decoration: underline;
}

.pub-link {
    font-size: 0.85rem;
    font-weight: 500;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pub-venue {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Projects Section */
.projects {
    background-color: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.project-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.project-content {
    padding: 24px;
}

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

.project-content h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.project-content h3 a:hover {
    text-decoration: underline;
}

.project-repo {
    font-size: 0.8rem;
    font-weight: 500;
}

.project-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Events Section */
.events {
    background-color: var(--bg-primary);
}

.events-list {
    max-width: 1000px;
    margin: 0 auto;
}

.event-item {
    display: flex;
    align-items: baseline;
    gap: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

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

.event-item:hover {
    box-shadow: var(--shadow-md);
}

.event-year {
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
}

.event-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.event-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.event-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Contact Section */
.contact {
    background-color: var(--bg-primary);
}

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

.contact-content > p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.contact-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.contact-link svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--bg-tertiary);
    padding: 32px 0;
    text-align: center;
}

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

/* Social Page */
.nav-active {
    color: var(--primary-color) !important;
}

.nav-game {
    color: #7c3aed !important;
    font-weight: 700 !important;
}

.nav-social {
    color: #e63946 !important;
    font-weight: 700 !important;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.video-item {
    display: flex;
    flex-direction: column;
}

.video-caption {
    text-align: center;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.video-wrapper {
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px 24px;
    text-decoration: none;
    transition: var(--transition);
}

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

.social-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background-color: #00a1d6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.social-icon-img img {
    object-fit: contain;
}

.social-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

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

/* Game Page */
.game-page {
    padding: 100px 24px 60px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    max-width: 1100px;
    width: 100%;
}

.game-area {
    position: relative;
    flex-shrink: 0;
}

.game-area {
    touch-action: none;
}

.game-area canvas {
    display: block;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    color: white;
    text-align: center;
    padding: 24px;
}

.game-overlay h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.game-overlay p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.submit-score {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.submit-score input {
    padding: 10px 14px;
    border: 2px solid white;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    width: 150px;
}

.submit-score input::placeholder {
    color: rgba(255,255,255,0.6);
}

.submit-score input:focus {
    border-color: var(--primary-color);
    background: rgba(255,255,255,0.25);
}

.leaderboard {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 1000px;
    box-shadow: var(--shadow-md);
}

.leaderboard h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 6px 8px;
    border-bottom: 2px solid var(--border-color);
    text-align: left;
}

.leaderboard-table td {
    padding: 8px 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table tr.gold td {
    color: #b8860b;
    font-weight: 700;
}

.leaderboard-table tr.silver td {
    color: #808080;
    font-weight: 600;
}

.leaderboard-table tr.bronze td {
    color: #cd7f32;
    font-weight: 600;
}

.leaderboard-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .nav-links {
        gap: 12px;
        font-size: 0.85rem;
        justify-content: center;
    }

    .hero {
        padding: 100px 16px 32px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

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

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

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

    .hero-links {
        justify-content: center;
        gap: 12px;
    }

    .hero-links a {
        font-size: 0.85rem;
    }

    .section {
        padding: 48px 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 32px;
    }

    .intro-content,
    .pub-list,
    .edu-list,
    .events-list {
        max-width: 100%;
    }

    .intro-block h3 {
        font-size: 1.1rem;
    }

    .intro-block p {
        font-size: 0.95rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .edu-item,
    .event-item {
        flex-direction: column;
        gap: 4px;
    }

    .social-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

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

    .game-page {
        padding: 90px 12px 40px;
    }

    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .game-overlay h2 {
        font-size: 1.4rem;
    }

    .game-overlay p {
        font-size: 0.95rem;
    }

    .submit-score {
        flex-direction: column;
        align-items: center;
    }

    .submit-score input {
        width: 100%;
        max-width: 200px;
    }

    .leaderboard {
        width: 100%;
        min-width: auto;
        padding: 16px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .container {
        padding: 0 16px;
    }

    .footer {
        padding: 24px 0;
    }
}
