:root {
  color-scheme: light dark;
}

:root {
  --border-radius: 4px;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-main-background:#e6e6e6;
    --color-background: #f0f6f0;
    --color-background-darker: #E8ECE8;
    --color-foreground-darker: #2c283f;
    --color-foreground: #0f0f1b;
    --color-primary: #d92e70;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-main-background:#161616;
    --color-background: #222323;
    --color-background-darker: #191A1A;
    --color-foreground-darker: #fffcf3;
    --color-foreground: #fffcf3;
    --color-primary: #d92e70;
  }
}

html,
body {
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: 'Fira Code', monospace;
  font-optical-sizing: auto;
  font-style: normal;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header,
main,
footer {
  max-width: 800px;
  padding: 25px;
  background-color: var(--color-main-background);
}

header {
  padding-bottom: 0px;
}

main {
  flex-grow: 1;
}

footer {
  padding-top: 10px;
  padding-bottom: 10px;
}

footer p {
  padding-top: 5px;
  border-top: 1.5px dashed var(--color-foreground);
}

table,
tr,
td,
th {
  border: 0;
}

td,
th {
  padding: 5px;
  text-align: left;
  vertical-align: top;
}

/* Always scale images in single-post views */
img.responsive, .single-content img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

h2 {
  font-weight: 500;
}

h3,
h4 {
  font-weight: 500;
}

h1 {
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0;
  line-height: 1;
}

h2 {
  margin-top: 0.25em;
  font-weight: 300;
  font-size: 1.2em;
  line-height: 1;
}

h3 {
  padding: 10px 0px;
  font-size: 1.5em;
  line-height: 1;
}

h3 a {
  text-decoration: none;
}

h3.single-post {
  margin-bottom: 0px;
}

h4 {
  margin-bottom: 5px;
  padding-top: 5px;
  padding-bottom: 5px;
}

ul {
  position: relative;
  list-style: none;
  margin-left: 1.0em;
  padding-left: 1.2em;
}

ul li:before {
  content: "-";
  position: absolute;
  left: 0;
}

nav ul li a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
}

nav ul li a:hover {
  text-decoration: underline;
}

section {
  margin-top: 2.6em;
}

section ul li {
  padding-bottom: 1.0em;
}

.social a {
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.social a:hover {
  text-decoration: underline;
}

div.csl-bib-body {
  margin-bottom: 2em;
}

div.post-time {
  color: var(--color-foreground-darker);
  font-size: 0.75em;
}

div.news-item {
  background: var(--color-background-darker);
  padding: 10px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
}

div.news-item h4 {
  margin: 0;
  padding: 0;
  border: 0px;
  font-size: 1.2em;
}

div.news-item h4 a {
  color: var(--color-primary);
  text-decoration: none;
}

div.news-item a.read-more {
  font-weight: 500;
  color: var(--color-primary);
}

div.publication {
  position: relative;
  background: var(--color-background-darker);
  padding: 10px;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
}

div.publication span.journal {
  font-style: italic;
}

div.publication span.volume {
  font-weight: 700;
}

div.publication a.title,
div.publication a.title:visited,
div.publication span.authors a,
div.publication span.authors a:visited {
  color: var(--color-primary);
  text-decoration: none
}

div.publication a.title {
  font-weight: 500;
}

div.publication a.title:hover,
div.publication span.authors a:hover {
  text-decoration: underline;
}

div.publication span.authors a {
  font-size: 0.75em;
}

div.publication span.copy-bib {
  position: absolute;
  display: inline-block;
  right: 5px;
  bottom: 5px;
}

div.publication span.copy-bib button {
  cursor: pointer;
  font-size: 1em;
  padding: 5px 10px;
  border-radius: var(--border-radius);
  background-color: var(--color-background);
  border: 1px solid transparent;
  outline: none;
}

div.publication span.copy-bib button:hover {
  border: 1px solid var(--color-primary);
}

div.publication span.copy-bib button:active {
  background-color: var(--color-primary);
}

div.team-member {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  /* background: var(--color-background-darker); */
  /* padding: 10px; */
  margin-bottom: 39px;
  border-radius: var(--border-radius);
}

div.team-member div {
  flex-grow: 2;
}

div.team-member div.portrait {
  width: 256px;
  min-width: 256px;
  margin-right: 5px;
}

div.team-member div.portrait img {
  box-sizing: content-box;
  width: 256px;
  height: 256px;
  object-fit: cover;
  border: 10px solid var(--color-background-darker);
  border-radius: var(--border-radius);
}

div.team-member div.profile {
  padding: 0;
  margin-top: 10px;
}

div.team-member div.profile a {
  color: var(--color-primary);
  text-decoration: none;
}

div.team-member div.profile a:hover {
  text-decoration: underline;
}

@keyframes type {
  to {
    width: calc(var(--length, 35) * 1ch);
  }
}

@keyframes caret {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes print {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

h1 {
  opacity: 0;
  animation: print 200ms ease-out both;
}

h2 .caret {
  display: inline-block;
  width: 0.5ch;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--color-primary);
  animation: caret 1s 490ms infinite;
}

@media (min-width: 500px) {
  h2 .typed {
    display: inline-block;
    vertical-align: bottom;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: content-box;
    width: 0;
    padding-right: 0.15ch;
    animation: type 450ms steps(var(--length, 35)) 40ms both;
  }
}

nav ul li {
  opacity: 0;
  animation: print 200ms ease-out both;
  animation-delay: calc(var(--i, 1) * 40ms);
}

.social {
  opacity: 0;
  animation: print 200ms ease-out 240ms both;
}

main>* {
  opacity: 0;
  animation: print 200ms ease-out both;
}

main>*:nth-child(2) {
  animation-delay: 40ms;
}

main>*:nth-child(3) {
  animation-delay: 80ms;
}

main>*:nth-child(4) {
  animation-delay: 120ms;
}

main>*:nth-child(5) {
  animation-delay: 160ms;
}

main>*:nth-child(6) {
  animation-delay: 200ms;
}

main>*:nth-child(7) {
  animation-delay: 240ms;
}

main>*:nth-child(n+8) {
  animation-delay: 280ms;
}

div.news-item,
div.publication {
  transition: box-shadow 90ms linear;
}

div.news-item:hover,
div.publication:hover {
  box-shadow: inset 2px 0 0 var(--color-primary);
}

div.publication span.copy-bib button {
  transition: border-color 90ms linear, background-color 90ms linear, color 90ms linear;
}

div.publication span.copy-bib button.copied {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

@media (prefers-reduced-motion: reduce) {

  h1,
  h2 .caret,
  nav ul li,
  .social,
  main>* {
    opacity: 1;
    animation: none;
  }

  h2 .typed {
    display: inline;
    width: auto;
    animation: none;
  }

  * {
    transition-duration: 1ms !important;
  }
}
