body {
    --primary-color: #5871a2;
    --primary-decoration-color: #5871a210;
    --bg-color: #ffffff;
    --text-color: #2f3030;
    --text-pale-color: #767676;
    --text-decoration-color: #a9a9a9;
    --highlight-color: #c7254e;
    --selection-color: #dce2ee;
    --main-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --code-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --main-max-width: 768px;
    --font-size: 16px;
    --line-height: 1.75;

    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--main-font);
    font-size: var(--font-size);
    line-height: var(--line-height);
    overflow-y: scroll;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.dark {
    --primary-color: #6f8fd1;
    --primary-decoration-color: #6f8fd112;
    --bg-color: #1c1c1c;
    --text-color: #c1c1c1;
    --text-pale-color: #848484;
    --text-decoration-color: #5f5f5f;
    --highlight-color: #e07a9a;
    --selection-color: #8296cb30;
}

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

::selection {
    background: var(--selection-color);
    color: var(--text-color);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

#wrapper {
    width: min(var(--main-max-width), calc(100% - 30px));
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 4em 0;
}

main {
    margin: 1.5em 0 0;
    overflow: hidden;
}

.site-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1em;
    position: relative;
}

.site-name {
    width: fit-content;
    border: 0;
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.5;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: .9em;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

.nav-left a {
    color: var(--text-color);
    line-height: 1.5;
}

.nav-left a:hover,
.nav-left a:focus,
.nav-left a.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    width: 22px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
}

.menu-toggle:hover,
.menu-toggle:focus {
    color: var(--primary-color);
}

#theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    line-height: 0;
}

#theme-toggle:hover,
#theme-toggle:focus {
    color: var(--primary-color);
}

#theme-toggle .sun-icon,
body.dark #theme-toggle .moon-icon {
    display: none;
}

body.dark #theme-toggle .sun-icon {
    display: initial;
}

.intro {
    display: grid;
    grid-template-columns: 13em minmax(0, 1fr);
    align-items: center;
    gap: 2em;
}

.intro-text {
    min-width: 0;
}

.headshot {
    width: 13em;
    max-width: 100%;
    height: auto;
}

.contact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .75em .5em;
}

.contact span {
    margin-left: 1.5em;
}

.email-id {
    border-bottom-color: var(--text-decoration-color);
    color: var(--highlight-color);
    display: inline-block;
    font-size: 1em;
    line-height: 1.15;
}

.email-id:hover,
.email-id:focus {
    border-bottom-color: var(--primary-color);
    color: var(--highlight-color);
}

h1 {
    margin: 0.35em 0 .35em;
    color: var(--text-color);
    font-size: 1.4em;
    font-weight: 600;
    line-height: inherit;
}

h1 + p {
    margin-top: 0;
}

h1 + ul {
    margin-top: .35em;
}

p {
    margin: 1.35em 0;
    line-height: 1.65;
    overflow-wrap: break-word;
}

ul {
    margin: .75em 0 1.35em;
}

.research-questions {
    margin-top: 0.75em;
    margin-bottom: 0;
}

.research-links {
    margin-top: 1em;
}

.research-intro {
    margin-bottom: 0.75em;
}

strong {
    font-weight: 600;
}

a {
    border-bottom: 1.5px solid var(--text-decoration-color);
    background: transparent;
    color: var(--text-color);
    text-decoration: none;
    overflow-wrap: anywhere;
}

a:hover,
a:focus {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    opacity: .9;
}

code {
    padding: 1px 6px;
    border-radius: 2px;
    background: var(--primary-decoration-color);
    color: var(--primary-color);
    font-family: var(--code-font);
    font-size: .85em;
}

.publications {
    margin-top: 2em;
}

.publications h1 {
    margin-top: 0;
}

.publications p {
    margin: 1.18em 0;
    line-height: 1.45;
}

.selected-papers p {
    margin: 1.18em 0;
    line-height: 1.45;
}

.pub-entry {
    display: flex;
    flex-direction: column;
    gap: .28em;
}

.pub-title-line,
.pub-author-line,
.pub-detail-line {
    display: block;
}

.paper-title {
    color: var(--text-color);
    font-weight: 700;
}

.author {
    border-bottom-color: var(--text-decoration-color);
    color: var(--text-color);
}

.venue {
    color: var(--highlight-color);
}

.section-rule {
    display: block;
    overflow: hidden;
    margin: 1.45em 0 1.6em;
    text-align: center;
    white-space: nowrap;
}

.section-rule > span {
    position: relative;
    display: inline-block;
    color: var(--text-pale-color);
    font-size: 1em;
    line-height: 1.5;
}

.section-rule > span::before,
.section-rule > span::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9999px;
    height: 1px;
    background: var(--text-decoration-color);
    opacity: .45;
}

.section-rule > span::before {
    right: 100%;
    margin-right: 15px;
}

.section-rule > span::after {
    left: 100%;
    margin-left: 15px;
}

.v {
    position: relative;
    bottom: 1px;
    margin-left: 2px;
    padding: 1px 2px;
    border: 1px solid;
    background: var(--primary-decoration-color);
    color: var(--primary-color);
    font-size: .7em;
}

.note {
    color: var(--text-pale-color);
    font-size: .85em;
}

.note a {
    border-bottom-color: var(--text-decoration-color);
    color: inherit;
}

.site-footer {
    margin-top: 1em;
    color: var(--text-pale-color);
    font-size: .85em;
}

.site-footer p {
    margin: .35em 0;
}

.video-page {
    margin-top: 2.5em;
    overflow: visible;
}

.cheesecake-video {
    display: block;
    width: 100%;
    max-height: 58vh;
    background: #000000;
    object-fit: contain;
}

.workshop-page {
    overflow: hidden;
}

.workshop-masthead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1em;
    margin-bottom: 2em;
}

.workshop-masthead h1 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.35;
}

.workshop-masthead p {
    margin: .5em 0 0;
    color: var(--text-pale-color);
    font-size: .9em;
    line-height: 1.45;
}

.workshop-masthead p a {
    color: inherit;
}

.workshop-masthead #theme-toggle {
    flex: 0 0 auto;
    margin-top: .45em;
}

.workshop-header h1 {
    margin-top: 0;
    font-size: 1.55em;
    line-height: 1.3;
}

.workshop-header .subtitle {
    display: block;
    margin-top: .35em;
    color: var(--text-pale-color);
    font-size: .72em;
    font-weight: 400;
    line-height: 1.45;
}

.workshop-page h2 {
    margin: 1.7em 0 .45em;
    padding-bottom: .15em;
    border-bottom: 1px solid var(--text-decoration-color);
    color: var(--text-color);
    font-size: 1.15em;
    font-weight: 600;
}

.workshop-page h3 {
    margin: 1.2em 0 .25em;
    color: var(--text-color);
    font-size: 1em;
    font-weight: 600;
}

.workshop-page ul {
    margin: .65em 0 1em;
    padding-left: 1.35em;
}

.workshop-page li {
    margin: .3em 0;
}

.meta,
.notice {
    background: var(--primary-decoration-color);
    border: 1px solid var(--text-decoration-color);
}

.meta {
    margin: 1.1em 0 1em;
    padding: .85em 1em;
}

.meta dl {
    display: grid;
    grid-template-columns: 6.5em 1fr;
    gap: .25em .75em;
    margin: 0;
}

.meta dt {
    color: var(--text-pale-color);
    font-weight: 600;
}

.meta dd {
    margin: 0;
}

.meta a[href^="mailto:"] {
    color: var(--highlight-color);
}

.notice {
    margin: 1em 0;
    padding: .65em .85em;
    border-left: 4px solid var(--text-decoration-color);
}

.muted {
    color: var(--text-pale-color);
}

.schedule {
    width: 100%;
    border-collapse: collapse;
    margin: .35em 0 1em;
    font-size: .98em;
}

.schedule th,
.schedule td {
    padding: .45em .55em;
    border-bottom: 1px solid var(--text-decoration-color);
    vertical-align: top;
    text-align: left;
}

.schedule tbody tr:last-child td {
    border-bottom: 0;
}

.schedule tbody tr:has(+ .schedule-day) td {
    border-bottom: 0;
}

.schedule th,
.schedule .time {
    color: var(--text-pale-color);
}

.schedule th {
    font-weight: 600;
}

.schedule .time {
    width: 8.5em;
    white-space: nowrap;
}

.schedule .schedule-day th {
    padding-top: .9em;
    color: var(--text-color);
    font-weight: 600;
}

.workshop-footer {
    padding-top: .75em;
    border-top: 1px solid var(--text-decoration-color);
}

.workshop-footer a {
    color: inherit;
}

@media (max-width: 768px) {
    #wrapper {
        padding: 2em 0;
    }

    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 1em;
        row-gap: 0;
    }

    .site-nav {
        display: contents;
    }

    .menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: space-between;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .nav-right {
        margin-left: 0;
    }

    .nav-left {
        display: flex;
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: .75em;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        padding: 0;
        margin-top: 0;
        border-top: 0 solid var(--text-decoration-color);
        border-bottom: 0 solid var(--text-decoration-color);
        background: var(--bg-color);
        transition: max-height .2s ease, margin .2s ease, padding .2s ease, border-width .2s ease, opacity .08s ease, visibility 0s linear .2s;
    }

    .site-nav.open .nav-left,
    .site-nav[data-menu-open="true"] .nav-left {
        display: flex;
        max-height: 14em;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 1em;
        padding: .75em 0;
        border-top-width: 1px;
        border-bottom-width: 1px;
        transition: max-height .2s ease, margin .2s ease, padding .2s ease, border-width .2s ease, opacity .08s ease .08s, visibility 0s;
    }

    .intro {
        display: block;
    }

    .headshot {
        display: block;
        width: min(12em, 100%);
        margin: 0 auto 1.5em;
    }

    .contact {
        gap: .5em;
    }

    .contact span {
        width: 100%;
        margin-left: 0;
    }

    .meta dl {
        display: block;
    }

    .meta dt {
        margin-top: .35em;
    }

    .schedule,
    .schedule tbody,
    .schedule tr,
    .schedule th,
    .schedule td {
        display: block;
    }

    .schedule thead {
        display: none;
    }

    .schedule td {
        padding-left: 0;
        padding-right: 0;
    }

    .schedule .time {
        width: auto;
        border-bottom: 0;
        padding-bottom: 0;
        font-weight: 600;
    }
}

.video-footer a {
    color: inherit;
}
