@font-face {
    font-family: "main_font";
    src: url("fonts/nas.ttf") format("truetype");
    font-display: swap;
}

:root {
    --background: #f7f7f2;
    --text: #111;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-family: "main_font", Georgia, serif;
    color: var(--text);
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    padding-top: 12vh;
    padding-bottom: 12vh;
    background: var(--background);
}

.page {
    width: min-content;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    padding: 0;
    text-align: left;
}

h1 {
    margin: 0 0 42px;
    font-size: 66px;
    font-weight: 200;
    line-height: 1.1;
    white-space: nowrap;
}


.tagline,
.note p {
    margin: 0 auto 28px;
    max-width: 680px;
    font-size: 24px;
    line-height: 1.35;
}

.links-grid,
.profile-text {
    font-family: "main_font", Georgia, serif;
    font-size: 24px;
}

.links-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    justify-content: space-between;
    row-gap: 20px;
    width: 100%;
    text-transform: uppercase;
}

.profile-text {
    width: 100%;
    max-width: 100%;
    margin: 80px 0 0;
    font-weight: 200;
    line-height: 1.35;
    text-align: left;
    text-transform: none;
}

table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 4px 10px;
    font-size: 24px;
    line-height: 1.25;
    vertical-align: top;
}

th:first-child,
td:first-child {
    padding-left: 0;
}

th {
    font-weight: 700;
    padding-right: 46px;
    white-space: nowrap;
}

td {
    color: #666;
    font-weight: 350;
}


a {
    color: var(--text);
    font-weight: 650;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.profile-text a {
    font-weight: 200;
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

.links-grid a:nth-child(3n + 1) {
    justify-self: start;
}

.links-grid a:nth-child(3n + 2) {
    justify-self: center;
}

.links-grid a:nth-child(3n) {
    justify-self: end;
}

.note {
    margin-top: 32px;
}

.note p {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    h1 {
        font-size: 46px;
    }

    .tagline,
    .note p,
    th,
    td,
    .links-grid,
    .profile-text {
        font-size: 18px;
    }
}

@media (max-width: 420px) {
    h1 {
        font-size: 44px;
    }
}

.subnav {
    margin: 0 0 24px;
    font-size: 18px;
    text-transform: uppercase;
}

.profile-link {
    margin: -22px 0 72px;
    font-size: 22px;
}

.profile-link a {
    display: inline;
}

.publications-page,
.projects-page,
.project-detail-page {
    width: min(820px, calc(100% - 32px));
}

.publications-page h1,
.projects-page h1,
.project-detail-page h1 {
    font-size: 48px;
    white-space: normal;
}

.project-detail-text {
    color: #111;
    font-size: 20px;
    font-weight: 350;
    line-height: 1.45;
}

.project-detail-text p {
    margin: 0 0 18px;
}

.publications-table td {
    padding-top: 0;
    padding-bottom: 28px;
}

.publications-table td:first-child {
    width: 100%;
}

.publications-table td:last-child {
    padding-left: 40px;
    white-space: nowrap;
}

.publications-table td:last-child a {
    font-size: 22px;
}

.publications-table .paper-title {
    color: #111;
    font-size: 22px;
    font-weight: 200;
    line-height: 1.25;
}

.publications-table .paper-meta {
    color: #666;
    font-size: 17px;
    font-weight: 350;
    line-height: 1.3;
}

.projects-table td {
    padding-top: 0;
    padding-bottom: 28px;
}

.projects-table td:first-child {
    width: 100%;
}

.projects-table td:nth-child(2),
.projects-table td:last-child {
    white-space: nowrap;
}

.projects-table td:nth-child(2) {
    padding-left: 10px;
}

.projects-table td:last-child {
    padding-left: 8px;
}

.projects-table td:nth-child(2) a,
.projects-table td:last-child a {
    font-size: 22px;
}

.projects-table tr {
    scroll-margin-top: 12vh;
}

.projects-table .project-title {
    color: #111;
    font-size: 22px;
    font-weight: 200;
    line-height: 1.25;
}

.projects-table tr:target td {
    animation: project-row-background-highlight 2.2s ease-out forwards;
}

@keyframes project-row-background-highlight {
    0%, 14% {
        background-color: transparent;
    }

    18%, 36% {
        background-color: #e3e0d8;
    }

    100% {
        background-color: transparent;
    }
}

.projects-table .project-description {
    color: #666;
    font-size: 17px;
    font-weight: 350;
    line-height: 1.3;
    text-align: justify;
}

@media (max-width: 900px) {
    .projects-page {
        width: calc(100% - 64px);
        max-width: 820px;
    }

    .projects-table,
    .projects-table tbody {
        display: block;
        width: 100%;
    }

    .projects-table tr {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .projects-table td:first-child {
        display: block;
        width: 100%;
        padding-bottom: 6px;
    }

    .projects-table td:nth-child(2) {
        order: 3;
        width: auto;
        padding-left: 8px;
        padding-bottom: 28px;
    }

    .projects-table td:nth-child(2):empty {
        display: none;
    }

    .projects-table td:last-child {
        order: 2;
        width: auto;
        padding-left: 0;
        padding-bottom: 28px;
    }

    .projects-table .project-description {
        text-align: justify;
    }
}

