@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;
    /*outline: red 2px solid;*/
}

*,
*::before,
*::after {
    box-sizing: inherit;
    /*outline: 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: #000000;
    --article-color-text: #37383C;
    --color-text-muted: #919191;
    --color-background: #fafafa;
    --color-border: #e0e0e0;
    --grid-gap: 24px;
}

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 {
    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: normal;
}

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

.nav-avatar {
    width: 173px;
    height: auto;
}

.site-title {
    font-size: 36px;
    color: var(--color-text);
}

.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;
}

.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 20px;
}

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

.about-me {
    display: flex;
    flex-direction: row;
    gap: 50px;
    align-items: center;
    color: var(--article-color-text);
    font-size: 15px;
    line-height: 1.7;
}

.contact {
    color: var(--article-color-text);
    font-size: 15px;
    line-height: 1.7;
}

.filter-section {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.filter-dropdown {
    position: relative;
}

.dropdown-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--color-text);
    cursor: pointer;
    background: white;
    transition: border-color 0.2s ease;
}

.dropdown-button:hover {
    border-color: var(--color-text-muted);
}

.filter-dropdown.wide .dropdown-button {
    min-width: 160px;
}

.dropdown-button svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.filter-dropdown.open .dropdown-button svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin: 4px 0 0 0;
    padding: 8px 0;
    list-style: none;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    min-width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.filter-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: var(--color-background);
}

.project-article {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
}

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

.project-main-title {
    margin: 0;
    line-height: 1.3;
}

.project-page-date {
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.project-page-authors {
    color: var(--color-text);
    margin: 0;
}

.project-hero {
    margin: 0 0 60px 0;
    text-align: center;
}

.project-hero-media {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 12px;
}

.project-hero-media iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.project-hero-caption {
    font-size: 13px;
    color: var(--color-text);
    margin: 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 315px);
    gap: var(--grid-gap);
    margin-bottom: 50px;
    justify-content: center;
}

.grid-item {
    display: flex;
    flex-direction: column;
    width: 315px;
}

.grid-item figure {
    margin: 0;
}

.project-img {
    width: 315px;
    height: 276px;
    object-fit: cover;
    display: block;
}

.project-info {
    padding: 12px 0;
}

.project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.project-title {
    font-size: 15px;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
}

.project-title a {
    color: var(--color-text);
    text-decoration: none;
}

.project-icons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-link {
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.icon-link:hover {
    opacity: 0.6;
}

.project-date {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

figure {
    margin: 0px;
}

.section-content img {
    max-width: 75%;
    height: auto;
    display: block;
    margin: 24px auto;
}

.content-figure {
    margin: 24px 0;
    text-align: center;
}

.content-figure img {
    max-width: 75%;
    height: auto;
    margin: 0 auto;
}

.section-content figure figcaption,
.content-figure figcaption {
    font-size: 13px;
    color: var(--color-text);
    margin-top: 8px;
    text-align: center;
}

.section-content figure > table + figcaption {
    text-align: left;
}

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

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

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

.section-content a {
    color: var(--color-text);
    text-decoration: underline;
}

.section-content a:hover {
    opacity: 0.6;
}

.list {
    margin: 16px 0;
    padding-left: 24px;
}

.list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.project-table {
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

.project-table th,
.project-table td {
    border: 1px solid var(--color-text);
    text-align: left;
    padding: 8px;
}

.project-table th {
    font-weight: bold;
}

.math {
    margin: auto 30px;
}

.citation-text {
    margin: auto 30px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    font-size: 12px;
    text-decoration: none;
    color: var(--color-text);
    padding: 8px 12px;
    transition: opacity 0.2s ease;
}

.page-link:hover {
    opacity: 0.6;
}

.page-link.active {
    position: relative;
}

.page-link.active::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: var(--color-text);
}

.page-link.next {
    margin-left: 8px;
}

.page-ellipsis {
    font-size: 14px;
    color: var(--color-text);
    padding: 8px 4px;
}

#footer {
    padding: 20px var(--page-margin);
    border-top: 1px solid var(--color-border);
    width: 100%;
    max-width: 1200px;
}

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

.copyright {
    font-size: 13px;
    color: var(--color-text);
    margin: 0;
}

.footer-icons {
    display: flex;
    gap: 16px;
}

.footer-icons .icon-link {
    color: var(--color-text);
}

@media (max-width: 1024px) {
    :root {
        --page-margin: 100px;
    }
}

@media (max-width: 768px) {
    :root {
        --page-margin: 40px;
    }

    .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;
    }

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

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

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

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

    .filter-section {
        flex-wrap: wrap;
    }

    .grid-container {
        justify-content: center;
    }

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

    .footer-icons {
        justify-content: center;
    }
}

@media (max-width: 500px) {
    :root {
        --page-margin: 24px;
    }

    .filter-section {
        justify-content: center;
    }
    
    .project-main-title {
        font-size: 22px;
    }

    .project-hero-media iframe {
        aspect-ratio: 4 / 3;
    }

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

    .grid-item {
        width: 100%;
    }

    .project-img {
        width: 100%;
        height: auto;
        aspect-ratio: 315 / 276;
    }

    .project-title-row {
        width: 100%;
    }

    .project-table {
        font-size: 12px;
    }

    .project-table th,
    .project-table td {
        padding: 8px;
    }
}