*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --black: #0a0a0a;
    --white: #f5f5f0;
    --gray: #888;
    --light: #e8e8e3;
    --border: #d0d0cb;
    --mono: "IBM Plex Mono", monospace;
    --sans: "IBM Plex Sans", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--white);
    color: var(--black);
    font-size: 15px;
    line-height: 1.7;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-bottom: 2px solid var(--black);
    display: flex;
    align-items: stretch;
    height: 48px;
}

.nav-name {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--black);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    margin-left: auto;
}

.nav-links li a {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--gray);
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 22px;
    border-left: 1px solid var(--border);
    transition:
        color 0.1s,
        background 0.1s;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--black);
    background: var(--light);
}

/* SECTIONS */
main {
    padding-top: 48px;
}

.section {
    border-bottom: 1px solid var(--border);
}

.section-inner {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 40px;
}

.label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ABOUT */
.about-rule {
    border: none;
    border-top: 2px solid var(--black);
    margin-bottom: 28px;
}

h1 {
    font-family: var(--mono);
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 500;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 10px;
}

.position {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--gray);
    letter-spacing: 1px;
    margin-bottom: 36px;
}

.supervisor-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.1s;
}

.supervisor-link:hover {
    border-bottom-color: currentColor;
}

.bio {
    max-width: 560px;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.85;
    color: #444;
    margin-bottom: 40px;
}

.contact-row {
    display: flex;
    flex-wrap: wrap;
}

.contact-link {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--black);
    padding: 10px 18px;
    border: 1px solid var(--black);
    margin-right: -1px;
    margin-bottom: -1px;
    transition:
        background 0.1s,
        color 0.1s;
    position: relative;
}
.contact-link:hover {
    background: var(--black);
    color: var(--white);
    z-index: 1;
}

/* PUBLICATIONS */
.pub-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0 24px;
    padding: 22px 16px;
    border-top: 1px solid var(--border);
    margin: 0 -16px;
    transition: background 0.1s;
}
.pub-item:last-child {
    border-bottom: 1px solid var(--border);
}
.pub-item:hover {
    background: var(--light);
}

.pub-year {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--gray);
    padding-top: 3px;
}
.pub-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
}
.pub-venue {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.pub-authors {
    font-size: 12px;
    font-weight: 300;
    color: #666;
    margin-bottom: 10px;
}
.pub-tags {
    display: flex;
    flex-wrap: wrap;
}
.pub-tag {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--gray);
    padding: 4px 10px;
    border: 1px solid var(--border);
    margin-right: -1px;
    transition: all 0.1s;
    position: relative;
    cursor: pointer;
    background: none;
}
.pub-tag:hover {
    color: var(--black);
    border-color: var(--black);
    z-index: 1;
}
.pub-tag.hi {
    color: var(--black);
    border-color: var(--black);
}

/* MISC */
.misc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--black);
    border-left: 1px solid var(--black);
}

.misc-grid-single {
    grid-template-columns: 1fr;
}
.misc-cell {
    border-right: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
    padding: 24px;
}
.misc-cell-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 12px;
}
.misc-cell p,
.misc-cell li {
    font-size: 13px;
    font-weight: 300;
    color: #555;
    line-height: 1.7;
}
.misc-cell ul {
    list-style: none;
}
.misc-cell ul li::before {
    content: "— ";
    color: var(--gray);
    font-family: var(--mono);
}

/* FOOTER */
footer {
    border-top: 2px solid var(--black);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
footer span {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 1px;
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    z-index: 500;
    overflow-y: auto;
    padding: 60px 20px 40px;
}
.modal-overlay.open {
    display: block;
}
.modal-box {
    background: var(--white);
    max-width: 900px;
    margin: 0 auto;
    border: 2px solid var(--black);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-title {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gray);
}
.modal-close {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: none;
    border: 1px solid var(--black);
    padding: 5px 12px;
    cursor: pointer;
    color: var(--black);
    transition: all 0.1s;
}
.modal-close:hover {
    background: var(--black);
    color: var(--white);
}
.modal-body {
    padding: 28px;
}

@media (max-width: 640px) {
    .section-inner {
        padding: 60px 20px;
    }
    .misc-grid {
        grid-template-columns: 1fr;
    }
    footer {
        flex-direction: column;
        gap: 8px;
        padding: 16px 20px;
    }
    .nav-links li a {
        padding: 0 12px;
        font-size: 9px;
        letter-spacing: 1px;
    }
}

/* PUBLICATION GROUPS */
.pub-group + .pub-group {
    margin-top: 48px;
}
.pub-group-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--black);
    margin-bottom: 12px;
}

/* ASCII protein background */
.ascii-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
main,
footer {
    position: relative;
    z-index: 1;
}

.footer-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.footer-credit a:hover {
    color: var(--black);
}
