:root{
    --h-title-color:#3948d2;
    --bs-body-font-family: "Nunito", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
}

body, h1, h2, h3, h4, h5, h6, .navbar-brand, .navbar-nav, .font-alt {
    font-family: var(--bs-body-font-family) !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

#home-md {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.about-card {
    min-width: 0;
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid var(--card-border, #dfe4f2);
    border-radius: 1.25rem;
    background: linear-gradient(125deg, var(--card-tint, #f0f4fc), #fdfdff);
    color: #303b4c;
    line-height: 1.65;
    box-shadow: 0 4px 18px rgba(40, 55, 85, 0.035);
    overflow-wrap: anywhere;
}

.about-card h4 {
    margin: 0 0 1rem;
    color: #283765;
    font-size: 1.35rem;
    font-weight: 800;
}

.about-card p:last-child {
    margin-bottom: 0;
}

.about-card-bio,
.about-card-interests,
.about-card-affiliation,
.about-card-education {
    grid-column: 1 / -1;
}

.about-card-bio { --card-tint: #edf3ff; --card-border: #dce6f7; }
.about-card-affiliation { --card-tint: #f0edfc; --card-border: #e3ddf4; }
.about-card-links { --card-tint: #eaf6f2; --card-border: #d6eae1; }
.about-card-education { --card-tint: #edf5fa; --card-border: #dbe8f0; }
.about-card-interests { --card-tint: #fceef2; --card-border: #f0dde4; }
.about-card-contact { --card-tint: #eef5e9; --card-border: #dfE9d7; }

@media screen and (max-width: 767px) {
    #home-md {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }
}

.affiliation-card p {
    margin: 0.25rem 0;
}

.affiliation-card .affiliation-lab {
    margin-bottom: 0.85rem;
    font-weight: 800;
    color: #283765;
}

.affiliation-badge {
    display: inline-block;
    padding: 0.1rem 0.65rem;
    border-radius: 999px;
    background: #e5eafb;
    font-size: 0.85em;
    white-space: nowrap;
}

.affiliation-location {
    color: #596477;
    font-size: 0.95em;
}

.affiliation-card .affiliation-adviser {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #dfe4f2;
}

.affiliation-adviser span {
    font-weight: 700;
}

.header {
    border-bottom: solid 2px var(--bs-blue);
    z-index: 10000;
}

.bg-bottom {
    background-color: var(--h-title-color);
}

.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 25rem;
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

section header h2{
    font-family: var(--bs-body-font-family) !important;
    color: var(--h-title-color);
    font-size: 2.3rem;
    line-height: 4rem;
}

section .main-body{
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 2.4rem;
}

.project-figure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    max-width: 960px;
    margin: 1.5rem auto 2.5rem;
}

.project-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.12);
}

.project-figure-wide img {
    width: 100%;
}

.project-figure-wide > a {
    display: block;
    width: 100%;
}

.project-figure-memseg {
    width: 100%;
    max-width: 960px;
}

.project-figure-pair > img,
.project-figure-pair > .project-figure-crop-top {
    width: calc(50% - 0.625rem);
}

.project-figure-pair > img {
    object-fit: contain;
}

.project-figure-pair {
    align-items: flex-start;
}

.project-figure-crop-top {
    display: block;
    overflow: hidden;
}

.project-figure-crop-top img {
    width: 100%;
    transform: translateY(-3.5%);
}

@media screen and (max-width: 575px) {
    .project-figure-pair {
        flex-direction: column;
    }

    .project-figure-pair > img,
    .project-figure-pair > .project-figure-crop-top {
        width: 100%;
    }
}


.bg-gradient-primary-to-secondary-light {
    background: linear-gradient(45deg, #fcfcfc, #ffffff) !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: linear-gradient(45deg, #f0f0f0, #f1f1f1) !important;
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}


#avatar {
    position: relative;
    height: 0;
    top:min(-65px,max(-100px,calc(-1*100vw/12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(130px,min(200px,calc(100vw/6)));
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
    }
}


