@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/spectral-400.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/spectral-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/spectral-500.woff2") format("woff2");
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/spectral-600.woff2") format("woff2");
}

:root {
  --bg: #fcfaf4;
  --text: #2b2b2a;
  --text-dim: #6d6b66;
  --accent: #8a9a7b;
  --rule: #cfc9bc;
  --max-width: 38rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Spectral", Georgia, serif;
  font-weight: 400;
  line-height: 1.55;
  padding: 6rem 1.5rem 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

#morphogen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.intro {
  margin-bottom: 0;
}

h1 {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.18s ease;
}

.nav-link:hover { color: var(--text); }

.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1;
}

.divider {
  border: none;
  height: 2px;
  background-image: radial-gradient(circle, var(--rule) 1px, transparent 1px);
  background-size: 3px 2px;
  background-repeat: repeat-x;
  background-position: center;
  margin: 1.25rem 0;
}

.intro .divider {
  margin: 0 0 1.25rem;
}

h2, summary {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 1.25rem;
}

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: color 0.18s ease;
}

summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }

summary::after {
  content: "+";
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
  transition: color 0.18s ease;
}

details[open] > summary {
  color: var(--text);
}

details[open] > summary::after {
  content: "\2212";
}

summary:hover {
  color: var(--text);
}

details:not([open]) > summary {
  margin-bottom: 0;
}

.bio {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  text-align: justify;
  hyphens: auto;
}

.bio a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.18s ease;
}

.bio a:hover { opacity: 0.55; }

.contacts {
  text-align: right;
  color: var(--text);
  font-style: italic;
  font-size: 0.88rem;
}

.at {
  width: 1em;
  height: 0.85em;
  vertical-align: -0.15em;
  margin: 0 0.1em;
}

.footnote {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: right;
}

.footnote sup {
  font-style: normal;
}

.papers { list-style: none; }

.papers li {
  margin-bottom: 1.35rem;
}

.papers a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.18s ease;
}

.papers a:hover { opacity: 0.55; }

.papers .title {
  color: var(--text);
  font-weight: 600;
}

.papers .meta a {
  font-weight: 400;
}

.papers .meta {
  display: block;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.papers .meta em {
  font-style: italic;
}

.papers .meta strong {
  font-weight: 500;
  color: var(--text);
}

.papers sup {
  font-size: 0.65em;
  vertical-align: 0.5em;
  line-height: 0;
}

sup b {
  font-weight: 400;
  -webkit-text-stroke: 0.6px currentColor;
  text-stroke: 0.6px currentColor;
}

@media (max-width: 520px) {
  body { padding: 4rem 1.25rem 3rem; }
  h1 { font-size: 1.5rem; text-align: center; }
  .nav-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  #morphogen { display: none; }
}
