:root {
    --page-ink: #101828;
    --page-muted: #536174;
    --page-brand: #174675;
    --page-brand-dark: #0b2d50;
    --page-accent: #008a84;
    --page-author: #1769d2;
    --page-marker: #aa5c00;
    --page-line: #d4dde4;
    --page-soft: #f1f5f6;
    --page-white: #ffffff;
}

body {
    color: var(--page-ink);
    background: var(--page-white);
}

a {
    color: var(--page-brand);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

a:hover,
a:focus {
    color: var(--page-brand-dark);
}

.header {
    z-index: 10000;
    border-bottom: 1px solid rgba(23, 32, 51, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0.4rem 1.4rem rgba(16, 24, 40, 0.07) !important;
    backdrop-filter: blur(12px);
}

#mainNav {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

#mainNav .navbar-nav .nav-item .nav-link {
    position: relative;
    color: var(--page-ink);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
}

#mainNav .navbar-nav .nav-item .nav-link:hover,
#mainNav .navbar-nav .nav-item .nav-link:focus,
#mainNav .navbar-nav .nav-item .nav-link.active {
    color: var(--page-brand);
}

#mainNav .navbar-toggler {
    width: 2.75rem;
    height: 2.75rem;
    margin-left: auto;
    padding: 0;
    color: var(--page-ink);
    border-color: var(--page-line);
    border-radius: 6px;
}

#mainNav .navbar-toggler .bi {
    font-size: 1.5rem;
    line-height: 1;
}

#mainNav .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(49, 71, 199, 0.18);
}

.language-switcher {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(7.5rem, 1fr));
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid var(--page-line);
    border-radius: 8px;
    background: var(--page-soft);
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.language-option {
    min-width: 0;
    height: 2.75rem;
    padding: 0 1rem;
    color: var(--page-muted);
    border: 0;
    border-radius: 5px;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.language-option:hover,
.language-option:focus-visible {
    color: var(--page-brand-dark);
}

.language-option:focus-visible {
    outline: 2px solid var(--page-accent);
    outline-offset: 1px;
}

.language-option.is-active {
    color: var(--page-brand-dark);
    background: var(--page-white);
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.14);
}

.profile-language {
    margin-top: 1.35rem;
}

.top-section {
    position: relative;
    height: 26rem;
    padding: 0;
    overflow: hidden;
    background-color: #dce8ea;
    background-position: center 52%;
    background-size: cover;
}

.top-section::before {
    position: absolute;
    inset: 0;
    content: "";
    background: rgba(10, 35, 47, 0.08);
}

#avatar {
    position: relative;
    z-index: 2;
    float: right;
    width: 10.5rem;
    height: 0;
    top: -7rem;
    margin-right: 1.5rem;
}

#avatar img {
    display: block;
    width: 10.5rem;
    height: 14rem;
    object-fit: cover;
    object-position: center top;
    border: 5px solid var(--page-white);
    border-radius: 8px;
    box-shadow: 0 1.1rem 2.6rem rgba(16, 24, 40, 0.26);
}

.content-section {
    padding-top: 5.25rem;
    padding-bottom: 5.25rem;
    scroll-margin-top: 4.5rem;
}

#home {
    padding-top: 7.8rem;
}

.section-light {
    background: var(--page-white);
}

.section-muted {
    background: var(--page-soft);
}

.content-section > .container,
#mainNav > .container,
footer > .container,
body > .container {
    max-width: 74rem;
}

section header h2 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1.8rem;
    color: var(--page-brand);
    font-family: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

section header h2 .bi {
    color: var(--page-accent);
    font-size: 1.65rem;
}

#home-subtitle {
    display: block;
    max-width: 44rem;
    margin-bottom: 1.25rem;
    color: var(--page-brand);
    font-size: 2.6rem;
}

section .main-body {
    color: var(--page-ink);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.82;
}

#home-md {
    max-width: 58rem;
    font-size: 1.34rem;
    line-height: 1.78;
}

#home-md h4 {
    font-size: 1.46rem;
}

.main-body h4 {
    margin-top: 1.45rem;
    margin-bottom: 0.45rem;
    color: var(--page-ink);
    font-family: "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.24rem;
    font-weight: 700;
    letter-spacing: 0;
}

.main-body h4:first-child {
    margin-top: 0;
}

#publications-md h4,
#preprints-md h4 {
    margin-top: 3rem;
    margin-bottom: 0.75rem;
    padding: 0;
    border: 0;
}

#publications-md h4:first-child,
#preprints-md h4:first-child {
    margin-top: 0;
}

.paper-category-toggle {
    display: grid;
    grid-template-columns: 2.35rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 3.75rem;
    padding: 0.65rem 0.9rem 0.65rem 0.75rem;
    color: var(--page-brand-dark);
    text-align: left;
    border: 1px solid var(--page-line);
    border-left: 4px solid var(--page-accent);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.paper-category-toggle:hover {
    border-color: rgba(49, 71, 199, 0.45);
    background: var(--page-white);
    box-shadow: 0 0.35rem 1rem rgba(16, 24, 40, 0.08);
}

.paper-category-toggle:focus-visible {
    outline: 3px solid rgba(49, 71, 199, 0.3);
    outline-offset: 2px;
}

.paper-category-icon {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    color: var(--page-accent);
    border-radius: 5px;
    background: rgba(49, 71, 199, 0.1);
}

.paper-category-icon .bi {
    font-size: 1.24rem;
    line-height: 1;
}

.paper-category-label {
    min-width: 0;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
}

.paper-category-count {
    min-width: 1.8rem;
    padding: 0.2rem 0.45rem;
    color: var(--page-muted);
    border: 1px solid var(--page-line);
    border-radius: 5px;
    background: var(--page-soft);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.paper-category-chevron {
    font-size: 1rem;
    line-height: 1;
    transition: transform 160ms ease;
}

.paper-category-toggle[aria-expanded="false"] .paper-category-chevron {
    transform: rotate(-90deg);
}

.main-body p {
    margin-bottom: 0.8rem;
}

#publications-md ul,
#preprints-md ul,
#awards-md ul {
    padding: 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid var(--page-line);
}

#publications-md li,
#preprints-md li,
#awards-md li {
    position: relative;
    padding: 1.6rem 0 1.6rem 1.15rem;
    border-top: 1px solid var(--page-line);
    color: var(--page-muted);
    line-height: 1.65;
}

#publications-md li::before,
#preprints-md li::before,
#awards-md li::before {
    position: absolute;
    top: 1.75rem;
    bottom: 1.75rem;
    left: 0;
    width: 3px;
    content: "";
    background: var(--page-accent);
    opacity: 0.62;
}

#publications-md li p,
#preprints-md li p,
#awards-md li p {
    margin: 0;
}

#publications-md li > strong:first-child,
#publications-md li > p > strong:first-child,
#preprints-md li > strong:first-child,
#preprints-md li > p > strong:first-child,
#awards-md li > strong:first-child,
#awards-md li > p > strong:first-child {
    color: var(--page-ink);
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.5;
}

#publications-md li em,
#preprints-md li em {
    color: var(--page-accent);
    font-size: 1.06rem;
    font-style: normal;
    font-weight: 700;
}

#publications-md li a,
#preprints-md li a {
    display: inline-block;
    margin-left: 0.15rem;
    font-size: 1.06rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

#publications-md .self-author,
#preprints-md .self-author {
    color: var(--page-author);
    font-weight: 800;
}

#publications-md sup,
#preprints-md sup {
    position: relative;
    top: -0.1em;
    color: var(--page-marker);
    font-size: 0.72em;
    font-weight: 800;
}

.contribution-note {
    margin: 1rem 0 0 !important;
    color: var(--page-muted);
    font-size: 0.98rem;
    font-weight: 600;
}

.bg-bottom {
    background: #0c263f;
}

footer a {
    color: rgba(255, 255, 255, 0.72);
}

footer a:hover,
footer a:focus {
    color: var(--page-white);
}

@media (min-width: 992px) {
    #mainNav .navbar-nav .nav-item .nav-link::after {
        position: absolute;
        right: 0.5rem;
        bottom: 0.15rem;
        left: 0.5rem;
        height: 2px;
        content: "";
        background: var(--page-accent);
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 160ms ease;
    }

    #mainNav .navbar-nav .nav-item .nav-link:hover::after,
    #mainNav .navbar-nav .nav-item .nav-link:focus::after,
    #mainNav .navbar-nav .nav-item .nav-link.active::after {
        transform: scaleX(1);
    }
}

@media (max-width: 991px) {
    #mainNav .navbar-collapse {
        padding-top: 0.7rem;
        border-top: 1px solid var(--page-line);
        margin-top: 0.7rem;
    }

    #mainNav .navbar-nav .nav-item .nav-link {
        padding: 0.65rem 0;
    }

    #avatar {
        margin-right: 0;
    }
}

@media (max-width: 767px) {
    #mainNav > .container,
    body > .container,
    .content-section > .container,
    footer > .container {
        padding-right: 1.25rem !important;
        padding-left: 1.25rem !important;
    }

    .top-section {
        height: 20rem;
        background-position: center 48%;
    }

    #avatar {
        width: 8rem;
        top: -5.25rem;
    }

    #avatar img {
        width: 8rem;
        height: 10.5rem;
    }

    #home {
        padding-top: 6.35rem;
    }

    .content-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    section header h2 {
        font-size: 1.75rem;
    }

    #home-subtitle {
        font-size: 1.95rem;
    }

    section .main-body {
        font-size: 1.12rem;
        line-height: 1.76;
    }

    #home-md {
        font-size: 1.22rem;
        line-height: 1.74;
    }

    #home-md h4 {
        font-size: 1.32rem;
    }

    #publications-md h4,
    #preprints-md h4 {
        margin-top: 2.5rem;
    }

    .paper-category-toggle {
        grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
        gap: 0.6rem;
        padding: 0.6rem 0.7rem 0.6rem 0.6rem;
    }

    .paper-category-icon {
        width: 2.2rem;
        height: 2.2rem;
    }

    .paper-category-label {
        font-size: 1.3rem;
    }

    .language-switcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: min(100%, 20rem);
    }

    #publications-md li,
    #preprints-md li,
    #awards-md li {
        padding: 1.35rem 0 1.35rem 0.9rem;
    }

    #publications-md li > strong:first-child,
    #publications-md li > p > strong:first-child,
    #preprints-md li > strong:first-child,
    #preprints-md li > p > strong:first-child,
    #awards-md li > strong:first-child,
    #awards-md li > p > strong:first-child {
        font-size: 1.18rem;
    }

    #publications-md li::before,
    #preprints-md li::before,
    #awards-md li::before {
        top: 1.45rem;
        bottom: 1.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
