/* ---------- Color tokens ---------- */
:root {
  --bg: #fcfbf9;
  --surface: #f4f3f0;
  --ink: #1c1b19;
  --muted: #68665f;
  --rule: #e4e2dd;
  --accent: #2f5d50;
  --accent-soft: #e4ece8;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212;
    --surface: #1c1c1c;
    --ink: #e8e8e8;
    --muted: #a0a0a0;
    --rule: #2e2e2e;
    --accent: #8cc2ae;
    --accent-soft: #223029;
  }
}

:root[data-theme="dark"] {
  --bg: #121212;
  --surface: #1c1c1c;
  --ink: #e8e8e8;
  --muted: #a0a0a0;
  --rule: #2e2e2e;
  --accent: #8cc2ae;
  --accent-soft: #223029;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Main ---------- */
main { padding: 3rem 0 4rem; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { font-size: 2.25rem; margin: 0 0 0.25rem; }

h2 {
  font-size: 0.8rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Profile (home) ---------- */
.page-title { margin-bottom: 2rem; }

.about {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}
.profile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 10%;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--accent-soft);
  margin-bottom: 1.5rem;
}
.profile p { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.profile .name { font-size: 1.15rem; font-weight: 600; }
.profile .role { color: var(--muted); font-style: italic; }
.profile .affil { color: var(--muted); margin-top: 0.35rem; }
.profile .contact {
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.bio p { margin: 0 0 1.1rem; }
.bio p:first-child { margin-top: -0.3rem; }

/* ---------- Research ---------- */
.paper {
  margin: 0 0 1.75rem;
}
.paper-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.paper-title a { color: var(--ink); text-decoration: none; }
.paper-title a:hover { color: var(--accent); }
.paper-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.paper-status {
  font-style: italic;
}
.paper details {
  margin-top: 0.35rem;
  font-size: 1rem;
}
.paper summary {
  cursor: pointer;
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  list-style: none;
}
.paper summary::-webkit-details-marker { display: none; }
.paper summary::before { content: "+ "; }
.paper details[open] summary::before { content: "– "; }
.paper details p {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}
.paper-links {
  display: inline;
  margin-left: 0.75rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.paper-links a { margin-right: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  body { font-size: 1.05rem; }
  main { padding: 2rem 0 3rem; }
  h1 { font-size: 1.85rem; }
  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .profile img { width: 180px; }
  .site-nav { gap: 1rem; }
  .paper-links { display: block; margin: 0.25rem 0 0; }
}
