
:root {
    --gray: #2b2b2e;
    --light-gray: #82828a;
    --lighter-gray: #c7c7ce;
    --lightest-gray: #ececef;
    --lightestest-gray: #f8f8fa;
    --accent: #3454d1;
    --accent-soft: #eef1fc;
}

body, h1, h2, h3, ul, li, p {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'TWK Lausanne', sans-serif;
    font-weight: 200;
    line-height: 1.5;
    color: var(--gray);
    margin: 0 auto;
    max-width: 960px;
    padding: 24px;
}

strong, b {
    font-weight: 500;
}

section {
    margin: 24px 0px;
    scroll-margin-top: 32px;
}

header {
    margin: 24px 0px 40px 0px;
}

h1, h2, h3 {
    font-family: 'Computer Modern Serif', serif;
}

h1 {
    margin: 0px 0px 8px 0px;
}


a {
    color: var(--gray);
    text-decoration: underline var(--light-gray) 1px;
    text-underline-offset: 2px;
    white-space: nowrap;
}

body.ready a {
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.name {
    display: block;
    font-size: 3.3rem;
    font-weight: normal;
    color: var(--gray);
}

.title {
    display: block;
    font-size: 2.3rem;
    font-weight: normal;
    line-height: 1.2;
}

.authors {
    font-size: 1.1em;
    font-style: italic;
    color: var(--light-gray);
}

.authors a {
    text-decoration: none;
    color: var(--light-gray);
}

.authors a:hover {
    color: var(--gray);
}

.affiliations {
    color: var(--light-gray);
    font-size: 0.85em;
    margin: 0px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 32px;
}

.affiliations p {
    flex: 0 0 auto;
}

.affiliations img {
    display: inline-block;
    vertical-align: middle;
    height: 2rem;
    width: 2rem;
    transform: none !important;
}

.affiliations picture {
    display: inline-block;
    vertical-align: middle;
    height: 2rem;
    width: 2rem;
}

/* Text-only affiliation list (no logos): wraps as a dense inline paragraph
   instead of the flex grid above, so more items fit per line. */
.affiliations.list {
    display: block;
    line-height: 1.8;
}

.affiliations.list .aff {
    white-space: nowrap;
    margin-right: 14px;
}

.publication {
    color: var(--light-gray);
    margin-left: 8px;
}

sup {
    color: var(--light-gray);
    margin-right: 2px;
}

.buttons {
    margin: 16px 0px 0px 0px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--lightest-gray);
    color: var(--light-gray);
    border: none;
    text-decoration: none;
    border-radius: 100px;
}

body.ready .button {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.button:hover {
    background-color: var(--gray);
    color: white;
    text-decoration: none;
}

h2 {
    font-size: 1.7em;
    font-weight: normal;
    letter-spacing: 0.01em;
    color: var(--gray);
    margin: 48px 0px 8px 0px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.section-rule {
    flex: 1;
    border-top: 2px solid var(--lightest-gray);
}

h3 {
    font-size: 1.25em;
    color: var(--gray);
    margin: 8px 0px 8px 0px;
}

p {
    margin: 8px 0px 8px 0px;
    line-height: 1.6;
}

figure {
    margin: 24px 0px 32px 0px;
}

figure figcaption {
    text-align: left;
    margin: 16px 2.5% 32px 2.5%;
    font-size: 0.92rem;
    color: var(--light-gray);
    line-height: 1.55;
}

figure figcaption strong {
    color: var(--gray);
}

ul {
    margin: 0px 0px 0px 32px;
 }

figure picture {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 95%;
}

figure picture img {
    width: 100%;
}

img, video {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 95%;
    height: auto;
    box-sizing: border-box;
    border-radius: 4px;
}

/* Only crop-to-fill for the hero video and grid thumbnails, where the box
   size is intentionally fixed independent of each source's aspect ratio.
   Standalone figures should just scale to their natural aspect ratio. */
header + figure video,
.grid video {
    object-fit: cover;
    object-position: 50% 20%;
}

body.ready img, body.ready video {
    transition: transform 0.2s ease-in-out;
}

img:hover, video:hover {
    transform: scale(1.02);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.grid-9 {
  grid-template-columns: repeat(9, 1fr);
}

.grid:not(.grid-9) > .grid-cell:first-child video { border-top-left-radius: 5px; }
.grid:not(.grid-9) > .grid-cell:nth-child(4) video { border-top-right-radius: 5px; }
.grid:not(.grid-9) > .grid-cell:nth-last-child(4) video { border-bottom-left-radius: 5px; }
.grid:not(.grid-9) > .grid-cell:last-child video { border-bottom-right-radius: 5px; }

.grid-9 > .grid-cell:first-child video { border-top-left-radius: 5px; }
.grid-9 > .grid-cell:nth-child(9) video { border-top-right-radius: 5px; }
.grid-9 > .grid-cell:nth-last-child(9) video { border-bottom-left-radius: 5px; }
.grid-9 > .grid-cell:last-child video { border-bottom-right-radius: 5px; }

.grid video {
    width: 100%;
    border-radius: 0;
    pointer-events: none;
}

body.ready .grid video {
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.grid-cell {
    overflow: visible;
    position: relative;
}

.grid-cell:hover {
    z-index: 1;
}

.grid-cell:hover video {
    transform: scale(1.3);
    border-radius: calc(4px / 1.3);
}

.grid-9 .grid-cell:hover video {
    transform: scale(2);
    border-radius: calc(4px / 2);
}

.grid:hover .grid-cell:not(:hover) video {
    opacity: 0.5;
}

.toc {
    position: fixed;
    top: 320px;
    left: calc((100vw - 960px) / 2 + 960px + 40px);
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 1.0em;
    text-align: left;
}

.toc a {
    color: var(--light-gray);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 0px 4px 16px;
    border-left: 2px solid var(--lightest-gray);
}

.toc a:hover {
    color: var(--gray);
}

.toc a.active {
    color: var(--gray);
    border-left-color: var(--accent);
}

@media (max-width: 1300px) {
    .toc {
        display: none;
    }
}

code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "CMU Typewriter", monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--gray);
    padding: 8px 20px;
    background-color: var(--lightestest-gray);
    border-radius: 4px;
}

.code-wrapper {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 8px;
    background-color: var(--lightest-gray);
    color: var(--light-gray);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.copy-btn:hover {
    background-color: var(--lighter-gray);
    color: white;
}

.copy-btn.copied {
    background-color: var(--gray);
    color: white;
}

.toggle-checkbox {
    display: none;
}

.abstract-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    color: var(--light-gray);
}

.toggle-checkbox:checked ~ .abstract-content {
    max-height: 600px;
    opacity: 1;
}

.toggle-label {
    cursor: pointer;
    user-select: none;
    font-size: 1.0em;
    font-style: italic;
    color: var(--light-gray);
    transition: border-color 0.2s ease;
}

body.ready .toggle-label {
    transition: color 0.2s ease-in-out;
}

.toggle-label:hover {
    color: var(--gray)
}

.toggle-label::after {
    content: "Read more";
}

.toggle-checkbox:checked + .toggle-label::after {
    content: "Read less";
}

.table-wrapper {
    width: 95%;
    margin: 0 auto 8px auto;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95em;
}

table caption {
    text-align: left;
    caption-side: top;
    color: var(--light-gray);
    font-style: italic;
    margin-bottom: 8px;
}

th, td {
    padding: 6px 12px;
    text-align: center;
    border-bottom: 1px solid var(--lightest-gray);
    white-space: nowrap;
}

th {
    font-weight: 500;
    color: var(--gray);
    border-bottom: 2px solid var(--lighter-gray);
}

td:first-child, th:first-child {
    text-align: left;
}

tr.best td {
    font-weight: 500;
    color: var(--gray);
}

tr.group-start td, tr.group-start th {
    border-top: 2px solid var(--lightest-gray);
}
