@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
}

.skip-link:focus {
    left: 0.75rem;
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

/* Base theme variables */
:root {
    --accent-color: #30b1ff;
    --background-color: #ffffff;
    --text-color: #000000;
    --link-color: var(--accent-color);
    --footer-text-color: #666666;
    --border-color: #cccccc;
}

html.dark-mode {
    --background-color: #121212;
    --text-color: #ffffff;
    --link-color: var(--accent-color);
    --footer-text-color: #aaaaaa;
    --border-color: #444444;
}

@media (prefers-reduced-motion: reduce) {
    body,
    .button,
    .slider,
    .slider:before,
    .filter-button,
    a:not(.button)::before,
    .papers-list a::before,
    .footer a::before {
        transition: none;
    }
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 900px;
    margin: 1% auto 0;
    padding: 15px;
}

.button {
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    text-decoration: none;
    border: 2px solid var(--text-color);
    border-radius: 8px;
    color: var(--text-color);
    background-color: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    width: fit-content;
}

.button:hover {
    color: var(--background-color);
    background-color: var(--text-color);
    border-color: var(--text-color);
}

.button:hover::before,
.button:hover::after {
    content: none;
}

.button-arrow {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 0.5rem;
}

/* Public engagement page */
.engagement-intro {
    margin-bottom: 1.5rem;
}

.engagement-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.engagement-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.engagement-item--article .engagement-caption {
    padding-top: 1.25rem;
}

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #111;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-embed img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.error-card {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.engagement-caption {
    padding: 1rem 1.25rem 1.25rem;
}

.engagement-caption h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.engagement-caption p {
    margin: 0 0 0.75rem;
}

.engagement-caption p:last-child {
    margin-bottom: 0;
}

.engagement-photo {
    margin: 0;
    line-height: 0;
}

.engagement-photo img {
    width: 100%;
    height: auto;
    vertical-align: middle;
    display: block;
}

a:not(.button) {
    position: relative;
    color: var(--link-color);
    text-decoration: none;
}

a:not(.button):hover {
    text-decoration: none;
}

a:not(.button)::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--link-color);
    transition: width 0.3s ease-in-out;
}

a:not(.button):hover::before {
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.header h1 a {
    color: inherit;
    text-decoration: none;
}

.header h1 a:hover {
    text-decoration: none;
    color: inherit;
}

.header h1 a::before {
    display: none;
}

.toggle-container {
    position: relative;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(25px);
}

section {
    margin: 20px 0;
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.footer-line {
    width: 100%;
    border: none;
    height: 2px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--footer-text-color);
    padding-top: 20px;
    gap: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-nav-wrap {
    display: block;
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
}

.footer-nav li {
    display: inline-flex;
    align-items: center;
}

.footer-nav li:not(:last-child)::after {
    content: "•";
    margin-left: 10px;
    color: var(--footer-text-color);
    opacity: 0.6;
    pointer-events: none;
}

.footer a {
    position: relative;
    text-decoration: none;
    color: inherit;
    padding: 6px 4px;
    transition: color 0.2s ease;
}

.footer a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.2s ease-in-out;
}

.footer a:hover {
    color: var(--link-color);
}

.footer a:hover::before {
    width: 100%;
}

.footer-meta {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Work page: publication filters and list */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.filter-button {
    font-family: 'Inter', sans-serif;
    padding: 5px 10px;
    text-decoration: none;
    border: 1.5px solid var(--text-color);
    border-radius: 6px;
    color: var(--text-color);
    background-color: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.filter-button:hover {
    color: var(--background-color);
    background-color: var(--text-color);
    border-color: var(--text-color);
}

.filter-button.active {
    color: var(--background-color);
    background-color: var(--text-color);
    border-color: var(--text-color);
}

.papers-list {
    list-style-type: none;
    padding: 0;
}

.papers-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.papers-list li:last-child,
.papers-list li.last-visible {
    border-bottom: none;
}

.papers-list a {
    position: relative;
    color: var(--accent-color);
    text-decoration: none;
}

.papers-list a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s ease-in-out;
}

.papers-list a:hover::before {
    width: 100%;
}

.paper-item.hidden {
    display: none;
}

.muted {
    opacity: 0.75;
    font-weight: 400;
}
