/* ---------- Colors (light + dark) ---------- */
:root {
  --bg: #ffffff;
  --ink: #1a1f2b;
  --muted: #5f6675;
  --faint: #8a909c;
  --line: #e6e7ea;
  --accent: #0c2340;      /* UTSA navy */
  --link: #1f4e8c;
  --tag-bg: #f3f4f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181e; --ink: #e5e7eb; --muted: #a3a9b5; --faint: #7d8492;
    --line: #2a2f38; --accent: #e5e7eb; --link: #93b9ec; --tag-bg: #1f232b;
  }
}
:root[data-theme="dark"] {
  --bg: #15181e; --ink: #e5e7eb; --muted: #a3a9b5; --faint: #7d8492;
  --line: #2a2f38; --accent: #e5e7eb; --link: #93b9ec; --tag-bg: #1f232b;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 .9rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header / nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; min-height: 64px; flex-wrap: wrap;
}
.brand {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem; font-weight: 600; color: var(--accent);
}
.brand:hover { text-decoration: none; }
nav.links { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: .9rem; }
nav.links a { color: var(--muted); padding: 4px 0; border-bottom: 1px solid transparent; }
nav.links a:hover, nav.links a.active {
  color: var(--ink); text-decoration: none; border-bottom-color: var(--ink);
}

/* ---------- Profile (top of home page) ---------- */
.profile {
  display: grid; grid-template-columns: 180px 1fr; gap: 48px;
  padding: 64px 0 56px; border-bottom: 1px solid var(--line);
}
.photo {
  width: 180px; height: 220px; object-fit: cover; object-position: center 20%; border-radius: 4px;
  background: var(--tag-bg); display: grid; place-items: center;
  font: 600 2.6rem "Source Serif 4", Georgia, serif; color: var(--faint);
}
.profile h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.3rem; color: var(--accent); margin-bottom: .5rem;
}
.titles { list-style: none; padding: 0; margin: 0 0 1.4rem; color: var(--muted); }
.titles li { line-height: 1.55; }
.contact {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  font-size: .92rem;
}

/* ---------- Sections: label on the left, content on the right ---------- */
section.row {
  display: grid; grid-template-columns: 180px 1fr; gap: 48px;
  padding: 48px 0; border-bottom: 1px solid var(--line);
}
section.row:last-of-type { border-bottom: 0; }
section.row > h2 {
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); padding-top: 4px;
}
h3 {
  font-size: .95rem; color: var(--ink);
  margin: 2rem 0 .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line);
}
section.row > div > h3:first-child { margin-top: 0; }

.interests { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.interests li { background: var(--tag-bg); padding: 4px 12px; border-radius: 4px; font-size: .88rem; }

/* Publications and other entries */
.entries { list-style: none; padding: 0; margin: 0; }
.entries > li { padding: 0 0 1.15rem; }
.entries > li:last-child { padding-bottom: 0; }
.entries .t { font-weight: 600; color: var(--ink); }
a.t { color: var(--ink); }
a.t:hover { color: var(--link); }
.entries .a { color: var(--muted); font-size: .93rem; }
.entries .v { font-size: .93rem; }
.entries .v i { color: var(--ink); }
.entries .n { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.status {
  display: inline-block; font-size: .78rem; font-weight: 600;
  color: var(--accent); border: 1px solid var(--line);
  padding: 0 8px; border-radius: 3px; margin-left: 4px; white-space: nowrap;
}
.me { font-weight: 600; color: var(--ink); }
.small { font-size: .88rem; color: var(--muted); }

/* Dated rows (teaching, talks, awards, service) */
.dated { list-style: none; padding: 0; margin: 0; }
.dated li {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px;
  padding: .55rem 0; border-top: 1px solid var(--line);
}
.dated li:first-child { border-top: 0; padding-top: 0; }
.dated .d { color: var(--faint); font-size: .88rem; padding-top: 2px; font-variant-numeric: tabular-nums; }
.dated .b { font-size: .95rem; }
.dated .b .sub { display: block; color: var(--muted); font-size: .88rem; }

.cols { columns: 2; column-gap: 32px; list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.cols li { break-inside: avoid; padding: 2px 0; }

/* ---------- Literature page ---------- */
.page-head { padding: 56px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 {
  font-family: "Source Serif 4", Georgia, serif; font-size: 2rem;
  color: var(--accent); margin-bottom: .8rem;
}
.page-head p { color: var(--muted); max-width: 680px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 1.2rem 0; font-size: .9rem; }
.filter {
  width: 100%; max-width: 480px; padding: 9px 12px; font: inherit; font-size: .92rem;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink);
}
.filter:focus { outline: 2px solid var(--link); outline-offset: -1px; }
section.lit { padding: 8px 0 48px; max-width: 820px; }
section.lit h3 { margin-top: 2.4rem; }
.refs { list-style: none; padding: 0; margin: 0; }
.refs li {
  padding: .5rem 0 .5rem 1.5em; text-indent: -1.5em;
  border-top: 1px solid var(--line); font-size: .93rem;
}
.refs li:first-child { border-top: 0; }
.refs li[hidden] { display: none; }
.note dt { font-weight: 600; margin-top: 1.2rem; font-size: .95rem; }
.note dt:first-child { margin-top: 0; }
.note dd { margin: .35rem 0 0; color: var(--muted); font-size: .92rem; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--faint); font-size: .85rem; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  header.site { position: static; }
  html { scroll-padding-top: 0; }
  .profile, section.row { grid-template-columns: 1fr; gap: 20px; }
  .profile { padding: 36px 0; }
  .photo { width: 120px; height: 146px; font-size: 1.8rem; }
  .profile h1 { font-size: 1.8rem; }
  section.row { padding: 36px 0; }
  .dated li { grid-template-columns: 1fr; gap: 0; }
  .cols { columns: 1; }
}
