@font-face { font-family: "Noto Sans"; src: url("../fonts/NotoSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/NotoSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("../fonts/NotoSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Each colour is light-dark(light, dark). The visitor's system picks between them, unless
   the theme buttons in the footer have set data-theme. */
:root {
  color-scheme: light dark;
  --text: light-dark(#1c1c1c, #e8e8e8);
  --minor: light-dark(#646464, #a2a2a2);
  --background: light-dark(#fff, #131313);
  --accent: light-dark(#1d4e89, #8db8ea);
  --rule: light-dark(#e8e8e8, #2e2e2e);
  --todo: light-dark(#fff3c4, #4a3f12);
  --page-width: 57.2rem;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  position: relative;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Noto Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.62;
}

/* Wool texture: a layer above the page that scrolls with it and ignores the pointer, so
   it also covers the sticky menu and the particle band without a visible edge. */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url("../img/wool.webp") 0 0 / 512px 512px;
  opacity: 0.08;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
a:hover { text-decoration-color: currentColor; }

.explosion-header { height: 200px; color: var(--text); }

nav {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.6rem;
  padding: 0.7rem 1rem;
  background: var(--background);
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

nav a { text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }

main { max-width: var(--page-width); margin: 0 auto; padding: 2.2rem 1.5rem 4rem; }

.intro { display: flex; gap: 2rem; align-items: flex-start; }
.intro img {
  position: relative; /* above the texture */
  z-index: 3;
  flex: none;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
}

h1 { margin: 0; font-size: 2.2rem; font-weight: 650; line-height: 1.2; letter-spacing: -0.012em; }
h2 { margin: 2.8rem 0 0.7rem; font-size: 1.22rem; font-weight: 620; }
h2.bibliography { margin-top: 2.4rem; }
h3 { margin: 1.3rem 0 0.4rem; font-size: 1.02rem; }

.affiliation, .minor, .date { color: var(--minor); }
.affiliation { margin: 0.2rem 0 0.8rem; }
.minor { font-size: 0.92rem; }
.contact { margin-bottom: 0; }

ul.plain, ul.news, ul.bibliography { margin: 0.3rem 0; padding: 0; list-style: none; }
ul.plain li { margin-bottom: 0.35rem; }
ul.news li { display: flex; gap: 1.2rem; margin-bottom: 0.4rem; }
.date { flex: none; font-variant-numeric: tabular-nums; }

.talks li, .courses li, .bibliography li { margin-bottom: 1rem; }

.paper-title a { text-decoration: none; font-weight: 560; }
.paper-title a:hover { text-decoration: underline; }
.paper-authors, .paper-venue { color: var(--minor); font-size: 0.92rem; }
.paper-authors { line-height: 1.45; }

.todo { padding: 0.4rem 0.7rem; background: var(--todo); border-radius: 0.3rem; }
.date.todo { align-self: flex-start; padding: 0 0.3rem; color: inherit; }

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--minor);
  font-size: 0.85rem;
}

.theme-switch { position: relative; display: inline-flex; }
.theme-switch[hidden] { display: none; }

.theme-switch button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--minor);
  cursor: pointer;
}
.theme-switch button:hover, .theme-switch button[aria-pressed="true"] { color: var(--text); }

/* The highlight behind the chosen button. */
.theme-marker {
  position: absolute;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--rule);
  border-radius: 0.5rem;
  transition: transform 0.2s;
}
.theme-switch[data-choice="dark"] .theme-marker { transform: translateX(100%); }
.theme-switch[data-choice="system"] .theme-marker { transform: translateX(200%); }

@media (prefers-reduced-motion: reduce) {
  .theme-marker { transition: none; }
}

@media (max-width: 1024px) { .explosion-header { height: 180px; } }

@media (max-width: 600px) {
  .intro { flex-direction: column; align-items: center; gap: 1rem; }
  .explosion-header { height: 150px; }
}
