/* Paper schema from the persuasion-4-clean decks.
   Source of the values: presentations/short-presentation/design-tokens.css */

@font-face {
  font-family: "Source Sans Pro";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/source-sans-pro-regular.woff2") format("woff2"),
       url("fonts/source-sans-pro-regular.woff") format("woff");
}

@font-face {
  font-family: "Source Sans Pro";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("fonts/source-sans-pro-regular-italic.woff2") format("woff2"),
       url("fonts/source-sans-pro-regular-italic.woff") format("woff");
}

@font-face {
  font-family: "Source Sans Pro";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/source-sans-pro-semibold.woff2") format("woff2"),
       url("fonts/source-sans-pro-semibold.woff") format("woff");
}

@font-face {
  font-family: "Source Sans Pro";
  font-weight: 600;
  font-style: italic;
  font-display: swap;
  src: url("fonts/source-sans-pro-semibold-italic.woff2") format("woff2"),
       url("fonts/source-sans-pro-semibold-italic.woff") format("woff");
}

:root {
  --color-brand-primary: #002fa7;
  --color-paper: #ffffff;
  --color-ink: #111111;
  --color-ink-muted: #555555;
  --color-ink-light: #999999;
  --color-rule: #cccccc;
  --color-rule-light: #e0ddd5;
  --color-highlight: #002fa7;
  --color-icon: #888888;
  --plot-ai: #002fa7;
  --plot-ai-dark: #00185c;
  --plot-human: #4a4a4a;
  --plot-reference-line: #7f7f7f;
  --plot-rule: #404040;
  --measure: 42rem;
}

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

html {
  height: 100%;
  color-scheme: only light;
  accent-color: var(--color-brand-primary);
  -webkit-tap-highlight-color: rgba(0, 47, 167, 0.22);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: #121212;
  --color-ink: #e6e6e4;
  --color-ink-muted: #9a9a96;
  --color-ink-light: #8a8a86;
  --color-rule: #5c5c5a;
  --color-rule-light: #3a3a3c;
  --color-brand-primary: #6e91f5;
  --color-highlight: #6e91f5;
  --plot-ai: #6e91f5;
  --plot-ai-dark: #9aafef;
  --plot-human: #a3a3a3;
  --plot-reference-line: #6e6e6e;
  --plot-rule: #8a8a8a;
  accent-color: var(--color-brand-primary);
  -webkit-tap-highlight-color: rgba(110, 145, 245, 0.28);
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: "Source Sans Pro", sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body:has(.gate) {
  display: block;
  height: auto;
  min-height: 100%;
  overflow: auto;
}

::selection {
  background: var(--color-highlight);
  color: var(--color-paper);
}

:focus-visible {
  outline: 1px solid var(--color-brand-primary);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 2;
  padding: 0.35rem 0.55rem;
  background: var(--color-paper);
  color: var(--color-ink);
}

.skip:focus {
  top: 0.5rem;
}

.mast {
  position: relative;
  flex: none;
  z-index: 1;
  padding: 3.25rem 1.25rem 0.9rem;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-rule-light);
  text-align: center;
}

.name {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.name a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.identity {
  position: absolute;
  top: 1.15rem;
  right: 1.35rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.95rem;
  margin: 0;
}

.identity nav {
  display: flex;
  align-items: center;
  gap: inherit;
}

.identity a,
.identity button {
  display: flex;
  margin: -0.45rem;
  padding: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--color-icon);
  font: inherit;
  line-height: 0;
  text-decoration: none;
  cursor: pointer;
  transition: color 300ms ease;
}

.identity a:hover,
.identity a:active,
.identity button:hover,
.identity button:active,
.identity button[aria-pressed="true"] {
  color: var(--color-brand-primary);
}

.identity svg {
  width: 1.15rem;
  height: 1.15rem;
}

.night {
  position: fixed;
  z-index: 2;
  right: 0.7rem;
  bottom: 0.45rem;
  display: flex;
  padding: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--color-icon);
  line-height: 0;
  cursor: pointer;
  transition: color 300ms ease;
}

.night svg {
  width: 1.15rem;
  height: 1.15rem;
}

.night:hover,
.night:active,
.night[aria-pressed="true"] {
  color: var(--color-brand-primary);
}

.sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 2rem;
  margin-top: 1.35rem;
}

.sections a {
  flex: 0 0 auto;
  color: var(--color-ink);
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 300ms ease;
}

.sections a:hover,
.sections a:active,
.sections a.is-active,
.sections a.is-active:hover {
  color: var(--color-brand-primary);
  border-bottom-color: var(--color-brand-primary);
}

.mast.is-scrolled .sections a.is-active,
.mast.is-scrolled .sections a.is-active:hover {
  border-bottom-color: transparent;
}

main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

main::-webkit-scrollbar {
  display: none;
}

main section {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 2.75rem max(3rem, calc((100% - var(--measure)) / 2)) 2rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.turn {
  position: fixed;
  z-index: 2;
  top: calc(50% + 1.4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-icon);
  cursor: pointer;
  transform: translateY(-50%);
}

.turn[hidden] {
  display: none;
}

.turn-back {
  left: 0.2rem;
}

.turn-forward {
  right: 0.2rem;
}

.turn svg {
  width: 1.65rem;
  height: 1.65rem;
}

.turn:hover,
.turn:active,
.turn:focus-visible {
  color: var(--color-brand-primary);
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

p {
  margin: 0 0 1rem;
}

main strong {
  font-weight: 600;
}

main a {
  color: var(--color-brand-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

#introduction a,
#methods a {
  text-decoration: none;
}

main a:hover,
main a:active {
  color: var(--color-brand-primary);
}

.papers-lead {
  margin-top: 2rem;
}

.papers {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.paper {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--color-rule-light);
  border-radius: 12px;
}

.paper h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.paper h3 a {
  color: var(--color-brand-primary);
  text-decoration: none;
}

.paper h3 a:hover,
.paper h3 a:active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.paper-with {
  margin: 0.35rem 0 0;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.4;
}

.paper-meta {
  margin: 0.1rem 0 0.7rem;
  color: var(--color-ink-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.paper p:last-child {
  margin: 0;
}

.cv {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv li {
  display: grid;
  grid-template-columns: var(--date, 9.75rem) minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  align-items: baseline;
  padding: 0.4rem 0;
}

.cv p {
  margin: 0;
}

.cv-when {
  color: var(--color-ink-muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cv li p:last-child {
  position: relative;
  padding-left: 1.15rem;
}

.cv li p:last-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

.works {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.works li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--color-rule-light);
}

.works p {
  margin: 0;
}

.work-links {
  margin-top: 0.15rem;
  padding-left: 1.25rem;
  font-size: 0.95rem;
}

.contact {
  margin-top: 2rem;
  margin-bottom: 0;
  color: var(--color-ink-muted);
  text-align: center;
}

#introduction,
#discussion {
  display: flex;
  flex-direction: column;
}

#introduction {
  container-type: size;
  padding-left: 4.5rem;
  padding-right: 4.5rem;
}

.intro-screen {
  display: flex;
  flex-direction: column;
  width: calc(100% + 4.5rem);
  min-height: calc(100cqh + 2rem);
  margin-left: -4.5rem;
  padding-bottom: 3.75rem;
}

.intro-lead {
  display: grid;
  grid-template-columns: var(--intro-offset, 1fr) minmax(0, var(--measure));
  justify-content: start;
  align-items: start;
  flex: 1 0 auto;
  width: 100%;
  max-width: none;
  margin-right: 0;
}

.intro-lead > div:last-child {
  grid-column: 2;
  min-width: 0;
  padding-top: var(--intro-text-shift, 0px);
}

.intro-lead:not(:has(.portrait)) {
  grid-template-columns: minmax(0, var(--measure));
  justify-content: center;
}

.intro-lead:not(:has(.portrait)) > div:last-child {
  grid-column: auto;
}

.intro-screen:not(:has(.portrait)) {
  width: 100%;
  margin-left: 0;
}

.intro-screen:not(:has(.portrait)) .more-jump {
  margin-left: auto;
  margin-right: auto;
}

.portrait {
  grid-column: 1;
  align-self: start;
  width: min(18rem, calc(100% - 2.5rem));
  transform: translateY(var(--portrait-shift, 0px));
  aspect-ratio: 1;
  height: auto;
  justify-self: center;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

#introduction > * {
  flex-shrink: 0;
}

#more-info {
  --date: max(0px, calc(var(--line-offset, 12rem) - 0.7rem - 1.15rem));
  --line: calc(var(--measure) - 9.75rem - 0.7rem);
  display: grid;
  grid-template-columns: var(--date) minmax(0, var(--line));
  column-gap: 0.7rem;
  justify-content: start;
  width: 100%;
  max-width: 100%;
  margin: 1.75rem 0 0;
}

.timeline-filters {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  width: calc(100% - 1.15rem);
  margin: 0 0 0.85rem 1.15rem;
  text-align: center;
}

.timeline-filters button {
  padding: 0.25rem 0.2rem 0.2rem;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--color-ink-muted);
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.timeline-filters button:hover,
.timeline-filters button:active,
.timeline-filters button[aria-pressed="true"] {
  color: var(--color-brand-primary);
}

.timeline-filters button[aria-pressed="true"] {
  border-bottom-color: var(--color-brand-primary);
}

#more-info[data-filter="courses"] .cv li:not([data-kind="courses"]),
#more-info[data-filter="grants"] .cv li:not([data-kind="grants"]),
#more-info[data-filter="experience"] .cv li:not([data-kind="experience"]) {
  display: none;
}

.more-jump {
  margin: 0 0 0 var(--intro-offset, 0px);
  padding: 1.5rem 0 0;
  width: var(--measure);
  max-width: 100%;
  text-align: center;
}

.more-jump button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
}

.more-jump svg {
  width: 0.95rem;
  height: 0.95rem;
}

.more-jump button:hover,
.more-jump button:active {
  color: var(--color-brand-primary);
}

.edited {
  margin: auto 0 0;
  padding-top: 1.5rem;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
}

.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18vh 1.25rem 3rem;
  text-align: center;
}

.gate .name {
  margin-bottom: 1.5rem;
}

.gate-note {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: 1rem;
}

.gate-label {
  margin-top: 2rem;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
}

.gate input {
  width: min(16rem, 100%);
  margin-top: 0.35rem;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-ink-muted);
  border-radius: 0;
  background: transparent;
  color: inherit;
  caret-color: var(--color-brand-primary);
  font: inherit;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}

.gate input:focus {
  border-bottom-color: var(--color-brand-primary);
}

.gate button {
  margin-top: 1.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.gate button:hover,
.gate button:active {
  color: var(--color-brand-primary);
}

.gate button:disabled {
  color: var(--color-ink-muted);
  cursor: default;
}

.gate-error {
  margin: 1rem 0 0;
  color: var(--color-ink-muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  body {
    font-size: 1.0625rem;
  }

  .mast {
    padding: 4.25rem 0.75rem 0.75rem;
  }

  .identity {
    top: 0.7rem;
    right: 0.75rem;
  }

  .night {
    top: 0.25rem;
    right: auto;
    bottom: auto;
    left: 0.3rem;
  }

  .turn {
    display: none;
  }

  .name {
    font-size: 1.65rem;
  }

  #more-info {
    display: block;
    max-width: var(--measure);
    margin-left: auto;
    margin-right: auto;
  }

  .timeline-filters {
    width: auto;
    margin-left: 0;
  }

  .cv li {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }

  .cv-when {
    text-align: left;
  }

  #introduction {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .intro-screen {
    width: 100%;
    margin-left: 0;
  }

  .intro-lead {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    margin-left: 0;
  }

  .intro-lead > div:last-child {
    grid-column: auto;
  }

  .portrait {
    --portrait-shift: 0px;
  }

  .more-jump {
    margin-left: 0;
    padding-left: 0;
    width: auto;
  }

  .portrait {
    width: min(16rem, 72vw);
    height: min(16rem, 72vw);
    margin: 0 0 1.25rem;
  }

  .sections {
    gap: 0.55rem 1.15rem;
    max-width: 100%;
  }

  .sections a {
    font-size: 0.95rem;
  }

  main section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  main {
    scroll-behavior: auto;
  }

  .sections a,
  .identity a,
  .identity button {
    transition: none;
  }
}

@media print {
  html,
  body {
    height: auto;
    overflow: visible;
  }

  html[data-theme="dark"] {
    --color-paper: #ffffff;
    --color-ink: #111111;
    --color-ink-muted: #555555;
    --color-ink-light: #999999;
    --color-rule: #cccccc;
    --color-rule-light: #e0ddd5;
    --color-brand-primary: #002fa7;
    --color-highlight: #002fa7;
  }

  .skip,
  .turn,
  .night,
  .more-jump,
  .timeline-filters,
  .mast .sections {
    display: none !important;
  }

  .identity {
    display: none;
  }

  main {
    display: block;
    overflow: visible;
  }

  main section,
  #introduction {
    height: auto;
    overflow: visible;
    padding-top: 1.5rem;
    break-inside: auto;
  }

  #introduction {
    container-type: normal;
  }

  .intro-screen {
    min-height: 0;
  }

  #more-info[hidden] {
    display: grid;
  }
}
