@font-face {
    font-family: "IBM Plex Serif";
    src: url("./../fonts/IBM_Plex_Serif/IBMPlexSerif-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "IBM Plex Serif";
    src: url("./../fonts/IBM_Plex_Serif/IBMPlexSerif-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

:root {
    --page-margin: 100px;
    --font-primary: "IBM Plex Serif", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --color-text: #1a1a1a;
    --article-color-text: #37383C;
    --color-text-muted: #6b7280;
    --color-background: #fafafa;
    --color-background-white: #ffffff;
    --color-border: #e5e7eb;
    --color-accent: #3b82f6;
    --color-accent-light: #eff6ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--color-background);
    font-family: var(--font-primary);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header & Navigation */
#header {
    padding: 40px var(--page-margin) 10px;
    width: 100%;
    max-width: 1200px;
}

.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 25px;
}

.nav-link {
    font-size: 15px;
    text-decoration: none;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    font-weight: 500;
}

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

hr {
    width: 100%;
    max-width: 1200px;
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0 auto 40px;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 0 var(--page-margin);
    padding-bottom: 80px;
    width: 100%;
    max-width: 1200px;
}

/* About Me Section */
.about-me {
    display: flex;
    flex-direction: row;
    gap: 50px;
    align-items: center;
    color: var(--article-color-text);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 80px;
    background: var(--color-background-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.about-me img {
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.about-me .bio h1 {
    margin: 0 0 16px 0;
    font-size: 32px;
    letter-spacing: -0.5px;
}

.about-me .bio p {
    margin: 0;
    color: var(--color-text-muted);
}

/* Lab List Section */
.lab-list {
    width: 100%;
}

.lab-list-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--color-text);
}

.lab-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    max-width: 100%;
}

.lab-card {
    width: 100%;
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background-white);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.lab-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--color-accent);
}

.lab-card .lab-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.lab-card .lab-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.lab-card .lab-title a:hover {
    color: var(--color-accent);
}

.lab-card .lab-date {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 0 12px 0;
    font-weight: 500;
}

.lab-card .lab-description {
    font-size: 14px;
    color: var(--article-color-text);
    line-height: 1.7;
    margin: 0 0 20px 0;
}

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

.tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 20px;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Project Article (Lab Pages) */
.project-article {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
}

.project-header {
    text-align: center;
    margin-bottom: 50px;
}

.project-main-title {
    margin: 0;
    line-height: 1.3;
    font-size: 36px;
    letter-spacing: -0.5px;
}

.project-section {
    margin-bottom: 48px;
    scroll-margin-top: 60px;
}

.section-title {
    margin: 0 0 20px 0;
    font-size: 22px;
    letter-spacing: -0.3px;
    color: var(--color-text);
}

.sub-section-title {
    margin-top: 24px;
    margin-bottom: 12px;
}

.section-content {
    color: var(--article-color-text);
    font-size: 15px;
    line-height: 1.8;
}

.section-content strong {
    color: var(--color-text);
    font-weight: 600;
}

.section-content a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

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

/* Images and Figures */
figure {
    margin: 0;
}

.section-content img {
    max-width: 50%;
    height: auto;
    display: block;
    margin: 32px auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.section-content figure figcaption {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 12px;
    text-align: center;
    font-style: italic;
}

/* Video embed */
.video-container {
    max-width: 560px;
    margin: 32px auto;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.video-container p {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 14px;
    margin: 12px 0 0 0;
}

.video-container iframe {
    display: block;
    width: 100%;
    height: 315px;
    border: none;
}

/* Code blocks */
.code-block {
    background-color: #1e293b;
    color: #e2e8f0;
    border: none;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: "SF Mono", "Fira Code", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Footer */
#footer {
    padding: 40px var(--page-margin);
    border-top: 1px solid var(--color-border);
    width: 100%;
    max-width: 1200px;
    background: var(--color-background-white);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-left .footer-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.footer-left a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

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

.footer-right {
    text-align: right;
}

.footer-right p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --page-margin: 24px;
    }

    .nav-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .navigation-bar {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .nav-right {
        justify-content: center;
    }

    .about-me {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .about-me img {
        width: 200px;
        height: 200px;
    }

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

    .project-article {
        padding-top: 30px;
    }

    .project-main-title {
        font-size: 26px;
    }

    .project-section {
        padding: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .sub-section-title {
        font-size: 15px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-left {
        align-items: center;
    }

    .footer-right {
        text-align: center;
    }

    .section-content img {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    :root {
        --page-margin: 16px;
    }
    
    .project-main-title {
        font-size: 22px;
    }

    .lab-card {
        padding: 20px;
    }

    .lab-card .lab-title {
        font-size: 16px;
    }

    .about-me {
        gap: 24px;
    }

    .about-me .bio h1 {
        font-size: 24px;
    }
}