/* ==========================================================================
   Academic website — shared stylesheet
   Edit the color variables below to restyle the whole site at once.
   ========================================================================== */

:root {
  --max-width: 820px;
  --text: #1a1a1a;
  --text-muted: #565650;
  --bg: #f5f4f0;              /* warm cream */
  --accent: #2c5f8a;          /* muted steel-blue links, highlights */
  --accent-soft: #e7ebf1;     /* keyword-tag / bibtex background */
  --border: #e2dfd6;
  --nav-bg: #f5f4f0;
  --font-body: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6e6e6;
    --text-muted: #a5a5a5;
    --bg: #17181a;
    --accent: #82abd4;
    --accent-soft: #232a33;
    --border: #2c2f36;
    --nav-bg: #1c1e21;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* ---- Navigation -------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.site-nav .nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.2rem;
}
.site-nav .brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}
.site-nav a:not(.brand) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active {
  color: var(--text);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-weight: 600;
}

/* ---- Layout ------------------------------------------------------------ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.3; }
h1 { font-size: 1.4rem; font-weight: 500; margin: 0 0 0.3rem; }
h2 {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 1rem; margin: 1.2rem 0 0.35rem; }

a { color: var(--accent); }
p { margin: 0.6rem 0; }

/* ---- Homepage header (photo + intro) ----------------------------------- */
.intro {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.intro .photo {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  flex: 0 0 auto;
}
.intro .headline { flex: 1 1 320px; min-width: 260px; }
.intro .affiliation { color: var(--text-muted); margin-top: 0.2rem; }

/* ---- Keyword tags ------------------------------------------------------ */
.tags { list-style: none; padding: 0; margin: 0.8rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

/* ---- Lists (projects, news, publications) ------------------------------ */
.stack { list-style: none; padding: 0; margin: 0; }
.stack > li { margin: 0.9rem 0; }
.stack .date { color: var(--text-muted); font-size: 0.85rem; }

.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list > li { margin: 1rem 0; padding-left: 1.6rem; position: relative; }
.pub-list > li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.pub-list .venue { color: var(--text-muted); font-style: italic; }
.pub-list .affiliation { color: var(--text-muted); font-size: 0.9rem; }

/* ---- BibTeX toggle (publications) -------------------------------------- */
.bib-row { margin-top: 0.25rem; }
.bib-link {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
  cursor: pointer;
  user-select: none;
}
.bib-link:hover { background: var(--accent-soft); }
.bib-wrap { position: relative; margin: 0.5rem 0 0.2rem; }
.bib-code {
  margin: 0;
  padding: 0.8rem 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Contact / profile links ------------------------------------------ */
.profiles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; padding: 0; list-style: none; }

/* ---- CV timeline ------------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { display: flex; gap: 1rem; margin: 0.7rem 0; }
.timeline .years { flex: 0 0 6.5rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- Footer ------------------------------------------------------------ */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .intro .photo { width: 110px; height: 110px; }
  .timeline > li { flex-direction: column; gap: 0.1rem; }
  .timeline .years { flex-basis: auto; }
}
