/* Follows the system theme; site.js sets data-theme when the visitor picks one. */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root {
  --bg: light-dark(#fcfcfa, #141414);
  --fg: light-dark(#1c1c1c, #e8e8e6);
  --muted: light-dark(#5f6368, #a0a0a0);
  --line: light-dark(#e3e3de, #2c2c2c);
  --accent: light-dark(#8c1515, #e0736f); /* Stanford cardinal */
  --card: light-dark(#ffffff, #1b1b1b);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
nav { display: flex; gap: 20px; margin: 0 0 40px; font-size: 0.92rem; font-weight: 500; }
nav a { color: var(--muted); }
nav a[aria-current="page"] { color: var(--fg); }
#theme-toggle {
  margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted); width: 32px; height: 32px; padding: 0; cursor: pointer;
  display: grid; place-items: center;
}
#theme-toggle:hover { color: var(--fg); }
h1 { font-size: 2.2rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 48px 0 16px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 1rem; margin: 0; }
p { margin: 0 0 12px; }
.intro { display: flex; gap: 28px; align-items: flex-start; }
.headshot { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
@media (max-width: 560px) {
  .intro { flex-direction: column-reverse; gap: 16px; }
  .headshot { width: 110px; height: 110px; }
}
.role { color: var(--muted); margin: 0 0 16px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 0; list-style: none; font-weight: 500; }
.item { margin: 0 0 26px; }
.meta { color: var(--muted); font-size: 0.92rem; }
.row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub { margin: 0 0 26px; }
.pub .title { font-weight: 600; }
.pub .venue { font-style: italic; }
figure { margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
figure img, figure video { width: 100%; height: auto; display: block; border-radius: 3px; }
figure.narrow img, figure.narrow video { max-width: 420px; margin: 0 auto; }
figure .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
/* Gallery: native horizontal scroll with snap points, so swipe and trackpad work; buttons for mouse users. */
.gallery { position: relative; margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.gallery .track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery figure { flex: 0 0 100%; scroll-snap-align: start; margin: 0; padding: 0; border: 0; background: none; }
.gallery figure img, .gallery figure video { height: 380px; object-fit: contain; }
@media (max-width: 560px) { .gallery figure img, .gallery figure video { height: 240px; } }
.gallery button {
  position: absolute; top: 190px; transform: translateY(-50%); width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0.85;
}
@media (max-width: 560px) { .gallery button { top: 130px; } }
.gallery button:hover { opacity: 1; }
.gallery button:disabled { visibility: hidden; }
.gallery .prev { left: 4px; }
.gallery .next { right: 4px; }
.gallery .count { position: absolute; top: 14px; right: 16px; font-size: 0.75rem; color: var(--muted); background: var(--bg); padding: 0 6px; border-radius: 3px; }
ul { margin: 6px 0 0; padding-left: 20px; }
li { margin: 2px 0; }
footer { color: var(--muted); font-size: 0.85rem; margin-top: 56px; }
.seeking { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; font-style: italic; }
