:root {
  --bg: #ffffff;
  --text: #1d1b18;
  --muted: #6e675e;
  --accent: #96461d;
  --accent-hover: #632c10;
  --accent-bg: rgba(150, 70, 29, 0.07);
  --border: #e6e1d8;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --text: #ece6dc;
    --muted: #a39a8c;
    --accent: #dfa071;
    --accent-hover: #f3c296;
    --accent-bg: rgba(223, 160, 113, 0.1);
    --border: #383128;
  }

  .photo img {
    filter: brightness(0.9);
  }
}

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

body {
  max-width: 680px;
  margin: 56px auto;
  padding: 0 22px;
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px solid var(--border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

a:hover, a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
  background: var(--accent-bg);
}

::selection {
  background: var(--accent-bg);
}

header {
  margin-bottom: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

nav a {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: none;
}

h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.3rem;
  font-size: 1.05rem;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.intro::after {
  content: "";
  display: block;
  clear: both;
}

.photo {
  float: right;
  width: 170px;
  margin: 0.35rem 0 1rem 1.75rem;
}

.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 6px;
}

.photo figcaption {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news {
  position: relative;
  overflow-y: auto;
  padding-right: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scroll-behavior: smooth;
}

.news:not(.end) {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 2.5em), transparent);
}

.news li {
  display: grid;
  grid-template-columns: 5.25em 1fr;
  gap: 0.75em;
  margin-bottom: 0.6em;
}

.date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pubs li {
  margin-bottom: 1.4em;
  line-height: 1.5;
}

.pubs .title {
  font-weight: 600;
}

.pubs .authors, .pubs .venue {
  color: var(--muted);
}

.pubs .authors b {
  color: var(--text);
  font-weight: 600;
}

.pubs .venue {
  font-style: italic;
}

.links {
  display: flex;
  gap: 1em;
  margin-top: 0.15em;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.email {
  margin-left: auto;
  color: var(--muted);
}

.credit {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  body {
    margin: 36px auto;
    font-size: 17px;
  }

  .photo {
    width: 120px;
    margin-left: 1rem;
  }

  .news li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
