/* ---------- Colors & fonts: edit these to restyle the whole site ----------
   Forest-green accent; warm brown text taken from the portrait. */
:root {
  --bg: #ffffff;
  --text: #2a1f19;         /* dark brown */
  --muted: #7a6a5f;        /* warm grey-brown */
  --accent: #38761d;       /* forest green, same as the old Google Site */
  --rule: #ebe4de;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --text-font: "Newsreader", Georgia, "Times New Roman", serif;
}
/* Dark mode: only when the visitor clicks the toggle (light is the default) */
:root[data-theme="dark"] {
  --bg: #17120f;
  --text: #eee6de;
  --muted: #a8998d;
  --accent: #93c47d;
  --rule: #33291f;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  font-size: 19px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.1; text-wrap: balance; }

/* ---------- Top navigation ---------- */
.topbar { border-bottom: 1px solid var(--rule); }
.nav { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.1rem; padding-bottom: 1rem; }
.nav .brand { font-family: var(--display); font-size: 1.3rem; color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.nav ul a { color: var(--muted); font-size: 1.02rem; text-decoration: none; }
.nav ul a:hover { color: var(--accent); }
.nav ul a[aria-current="page"] { color: var(--text); font-style: italic; }
.theme-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 1.4rem; height: 1.4rem; color: var(--muted); display: grid; place-items: center;
  align-self: center;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Home ---------- */
.hero {
  display: grid;
  grid-template-columns: 215px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-top: 3.5rem; padding-bottom: 1rem;
}
.portrait { width: 100%; height: auto; display: block; }
.hero h1 { font-size: 3.4rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
.role { color: var(--muted); margin: 0 0 1.5rem; font-style: italic; font-size: 1.05rem; line-height: 1.45; }
.role a { font-style: italic; }
/* Justified text: bio and abstracts (hyphenation avoids wide gaps between words) */
.hero p:not(.role), details p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.links { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 0; font-size: 1rem; }
.links li + li::before { content: "·"; color: var(--muted); margin: 0 .6rem; }

.news h2 { font-size: 1.9rem; margin: 2rem 0 .8rem; }
.news ul { padding-left: 1.1rem; margin: 0; }
.news li { margin-bottom: .35rem; }
.news li::marker { color: var(--accent); }

/* ---------- Inner pages ---------- */
section { padding-bottom: 1rem; }
.page { padding-top: 3rem; }
.page h1 { font-size: 2.9rem; margin: 0 0 1.25rem; }
section h3 {
  font-family: var(--text-font); font-weight: 400; font-style: italic;
  font-size: 1.25rem; color: var(--muted);
  margin: 2.5rem 0 .5rem;
  display: flex; align-items: center; gap: .9rem;
}
.page h1 + h3 { margin-top: 1.25rem; }
section h3::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.button { font-size: 1.05rem; }
.pdf { width: 100%; height: 85vh; border: 1px solid var(--rule); margin-top: 1rem; }

/* ---------- Papers ---------- */
.paper { padding: .8rem 0 .9rem; }
.paper h4 { font-family: var(--text-font); font-size: 1.22rem; font-weight: 600; line-height: 1.3; margin: 0 0 .15rem; text-wrap: balance; }
.paper h4 a { color: var(--text); text-decoration: none; }
.paper h4 a:hover { color: var(--accent); }
.authors { margin: 0; color: var(--muted); font-size: 1rem; }
.talks { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.talks span { font-style: italic; }
.talks small { font-size: .85rem; }
details { margin-top: .25rem; }
summary {
  cursor: pointer; display: inline-block; list-style: none;
  color: var(--accent); font-size: .98rem;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: " ↓"; }
details[open] summary::after { content: " ↑"; }
summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details p { font-size: 1rem; margin: .5rem 0 0; }
figure { max-width: 480px; margin: 1.2rem auto .4rem; background: #fff; padding: .75rem; border: 1px solid var(--rule); }
figure img { width: 100%; height: auto; display: block; }
figcaption { color: #7a6a5f; font-size: .9rem; font-style: italic; margin-top: .4rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule); margin-top: 3.5rem; padding-top: 1rem; padding-bottom: 2.5rem; color: var(--muted); font-size: .92rem; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  body { font-size: 17.5px; }
  .wrap { padding: 0 18px; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; }
  .portrait { max-width: 200px; }
  .hero h1 { font-size: 2.6rem; }
  .nav .brand { display: none; }
  .nav { justify-content: center; }
  .wrap.nav { padding: .9rem 12px .8rem; }
  .nav-right { gap: .9rem; }
  .nav ul { gap: .4rem 1rem; flex-wrap: wrap; justify-content: center; }
  .nav ul a { font-size: .95rem; }
  .page { padding-top: 2rem; }
  .page h1 { font-size: 2.3rem; }
  .pdf { height: 70vh; }
}
