/* Minimal academic homepage theme. Colors are tokens so dark mode is one override. */

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #5b6370;
  --faint: #8b929c;
  --rule: #e6e8eb;
  --surface: #f6f7f9;
  --link: #1d4ed8;
  --link-hover: #0b2f8a;
  --accent: #003262;          /* Berkeley blue */
  --badge-bg: #e8eef8;
  --badge-text: #003262;
  --highlight-bg: #fdf6e3;
  --highlight-rule: #fdb515;  /* California gold */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --text: #e6e8eb;
    --muted: #a3abb6;
    --faint: #7a828d;
    --rule: #262b31;
    --surface: #181c21;
    --link: #8ab4ff;
    --link-hover: #b9d1ff;
    --accent: #c9d8f0;
    --badge-bg: #1c2738;
    --badge-text: #b9cdf0;
    --highlight-bg: #221d10;
    --highlight-rule: #c99a1e;
  }
}

* { box-sizing: border-box; }

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

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

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--accent); line-height: 1.25; }

h2 {
  font-size: 1.45rem;
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }

p { margin: 0 0 1rem; }

ul { padding-left: 1.25rem; }
li { margin: 0.25rem 0; }

code, pre { font-family: var(--mono); font-size: 0.82rem; }

/* Navigation */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  flex-wrap: wrap;
}

.nav-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.site-nav nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav nav a { color: var(--muted); font-size: 0.93rem; }
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

main { padding-top: 2.5rem; padding-bottom: 2rem; }

.page-title { font-size: 2rem; margin: 0 0 1.5rem; }

/* Profile header */

.profile {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.profile img {
  width: 150px;
  height: 150px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile h1 { font-size: 2.1rem; margin: 0 0 0.25rem; }

.profile .role { color: var(--muted); margin: 0 0 0.9rem; line-height: 1.5; }

.contact { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.95rem; }
.contact a { white-space: nowrap; }

.callout {
  background: var(--highlight-bg);
  border-left: 3px solid var(--highlight-rule);
  padding: 0.7rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 1.25rem 0;
}

.interests { color: var(--muted); }
.interests strong { color: var(--text); font-weight: 500; }

/* News */

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 105px 1fr; gap: 12px; margin: 0.45rem 0; }
.news .date { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 0.93rem; padding-top: 1px; }
.news p { margin: 0; }

/* Publications */

.pub-note { color: var(--faint); font-size: 0.85rem; margin: -0.5rem 0 1rem; }
.pubs { list-style: none; padding: 0; margin: 0; }

.pub {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  margin: 0 0 1.6rem;
}

.pub-venue {
  align-self: start;
  justify-self: start;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 3px;
}

.pub-title { font-weight: 600; line-height: 1.4; }
.pub-authors { color: var(--muted); font-size: 0.95rem; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-meta { color: var(--muted); font-size: 0.95rem; }
.pub-tldr { font-size: 0.93rem; margin: 0.35rem 0 0; }

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.5rem;
  align-items: flex-start;
}

.pub-links > a,
.bibtex summary {
  font-size: 0.8rem;
  padding: 1px 9px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--link);
  cursor: pointer;
  line-height: 1.7;
}

.pub-links > a:hover,
.bibtex summary:hover { border-color: var(--link); text-decoration: none; }

.bibtex summary { list-style: none; user-select: none; }
.bibtex summary::-webkit-details-marker { display: none; }
.bibtex[open] { flex-basis: 100%; }
.bibtex[open] summary { display: inline-block; }
.bibtex pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin: 0.5rem 0 0;
}

/* Two-column entries: experience, teaching, education */

.entries { list-style: none; padding: 0; margin: 0; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0 0 1rem; }
.entry .what { font-weight: 500; }
.entry .when { color: var(--faint); font-size: 0.93rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry .detail { grid-column: 1 / -1; color: var(--muted); font-size: 0.95rem; }
.entry .detail ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.entry .detail li { margin: 0.2rem 0; }

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--faint);
  font-size: 0.85rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

/* Mobile */

@media (max-width: 640px) {
  main { padding-top: 1.75rem; }
  .profile { flex-direction: column; gap: 18px; }
  .profile img { width: 120px; height: 120px; }
  .profile h1 { font-size: 1.8rem; }
  .news li, .pub { grid-template-columns: 1fr; gap: 2px; }
  .pub-venue { margin-bottom: 4px; }
  .entry { grid-template-columns: 1fr; }
  .site-nav nav { gap: 14px; }
}
