
:root {
  --bg: #ffffff;
  --text: #000000;
  --text-light: #6b6f76;
  --divider: rgba(0, 0, 0, 0.1);
    --accent: #8E59B3;
  --accent-hover: #8E59B3;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
 
:root[data-theme="dark"] {
  --bg: #1c1c1d;
  --text: #f0f0f0;
  --text-light: #a3a7ad;
  --divider: rgba(255, 255, 255, 0.14);
    --accent: #B27CD9;
  --accent-hover: #B27CD9;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
 
*,
*::before,
*::after { box-sizing: border-box; }
 
html { scroll-padding-top: 5rem; }
 
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}
 

 
/* ---------- Top bar ---------- */
 
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}
 
.bar {
  max-width: 930px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
 
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
 
.site-nav a {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 400;
}
 
.theme-toggle,
.menu-btn {
  background: none;
  border: 0;
  padding: 0.35rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 0;
}
.theme-toggle:hover,
.menu-btn:hover { color: var(--accent); }
.theme-toggle svg,
.menu-btn svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
 
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
 
.menu-btn { display: none; }
 
@media (max-width: 640px) {
  .menu-btn { display: block; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.25rem 0 1rem;
  }
  .site-nav.open { display: flex; }
}
 
/* ---------- Page ---------- */
 
main {
  flex: 1;
  width: 100%;
  max-width: 930px;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}
 
.page-title {
  margin: 0 0 1.75rem;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1.2;
}
.page-title b { font-weight: 700; }
 
.profile {
  float: right;
  width: 240px;
  margin: 0.25rem 0 1.25rem 2.5rem;
  text-align: center;
}
 
.profile img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}
 
.contact {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-light);
  line-height: 1.7;
}
 
.social {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 0.9rem;
}
.social a {
  color: var(--text-light);
  line-height: 0;
}
.social a:hover { color: var(--accent); }
.social svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
 
.about p {
  margin: 0 0 1.15rem;
  max-width: 62ch;
}
 
.about::after { content: ""; display: block; clear: both; }
 
/* ---------- Footer ---------- */
 
.site-footer {
  padding: 1.25rem 1rem 1.75rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-light);
  border-top: 1px solid var(--divider);
}
 
/* ---------- Small screens ---------- */
 
@media (max-width: 720px) {
  main { padding-top: 1.75rem; }
  .page-title { font-size: 2rem; }
  .profile {
    float: none;
    width: auto;
    margin: 0 auto 1.75rem;
  }
  .profile img { margin: 0 auto; width: 220px; }
  .about p { max-width: none; }
}
 
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
 
/* ---------- Content pages (research, teaching) ---------- */
 
.page-intro {
  max-width: 62ch;
  margin: 0 0 1.5rem;
}
 
main h2 {
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.4rem;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1.3;
  border-bottom: 1px solid var(--divider);
}
 
main h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}
 
main ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
 
main li {
  margin-bottom: 0.7rem;
  max-width: 70ch;
}
 
main li ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--text-light);
}
main li ul li { margin-bottom: 0.3rem; }
 
/* ---------- Expandable abstracts ---------- */
 
details.abstract { display: inline; margin-left: 0.5em; }
 
details.abstract summary {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before { content: "["; }
details.abstract summary::after  { content: "+]"; margin-left: 0.15em; }
details.abstract[open] summary::after { content: "\2212]"; }
details.abstract summary:hover { color: var(--accent-hover); text-decoration: underline; }
 
details.abstract p {
  margin: 0.5rem 0 0.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--divider);
  max-width: 62ch;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
}

a,
main a,
.site-nav a,
.social a {
  color: var(--accent);
  text-decoration: none;
  /* Prepares a smooth, clean transition for the underline fade */
  transition: text-decoration-color 0.15s ease-out; 
}

/* Hover State: The text color stays static, but a tiny 1px underline appears */
a:hover,
main a:hover,
.site-nav a:hover,
.social a:hover {
  color: var(--accent); /* Force color to remain exactly the same */
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px; /* Forces the line to be ultra-thin */
  text-underline-offset: 4px;      /* Keeps the tiny line cleanly below the text */
}

/* Keeps your unique summary element behavior matching the others */
details.abstract summary:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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