/* =========================================================================
   styles.css  —  site styling (you usually won't need to touch this)
   ========================================================================= */

:root {
  /* Palette: Warm Ivory & Charcoal */
  --maroon: #800000;          /* UChicago maroon — paper titles */
  --bg: #fbfaf7;              /* warm ivory */
  --text: #222222;            /* charcoal */
  --muted: #6b6660;           /* taupe-grey */
  --rule: #e7e3dc;            /* soft sand */
  --link: #800000;            /* maroon */
  --nav-active: #800000;
  --card: #fbfaf7;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --maxw: 720px;
}

html[data-theme="dark"] {
  /* Warm charcoal dark mode to match the ivory palette */
  --maroon: #d98a8a;          /* brightened maroon stays readable on dark */
  --bg: #1b1a18;              /* warm near-black */
  --text: #ece9e3;            /* warm off-white */
  --muted: #9b948a;
  --rule: #322f2b;
  --link: #d98a8a;
  --nav-active: #d98a8a;
  --card: #211f1c;
  --shadow: none;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

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

/* ---- Header / nav ---- */
header.site {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

nav.site a {
  color: var(--text);
  font-size: 16px;
  margin-right: 18px;
  letter-spacing: 0.02em;
}
nav.site a:last-child { margin-right: 0; }
nav.site a.active { color: var(--nav-active); }
nav.site a:hover { color: var(--maroon); text-decoration: none; }

.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--maroon); text-decoration: none; }

/* sliding light/dark switch: sun (left) — knob — moon (right) */
.theme-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  vertical-align: middle;
}
.theme-toggle:hover { border-color: var(--maroon); }
.theme-toggle .ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}
.theme-toggle .sun { left: 6px; }
.theme-toggle .moon { right: 6px; }
.theme-toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
  pointer-events: none;
}
html[data-theme="dark"] .theme-toggle .knob { transform: translateX(26px); }

hr.divider {
  border: none;
  border-top: 1px solid var(--rule);
  max-width: var(--maxw);
  margin: 20px auto 36px;
}

/* ---- About / home ---- */
.intro { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.intro img.headshot {
  width: 228px; height: auto;   /* desktop size (1.3x); height follows the image's true ratio (no crop) */
  border-radius: 8px; flex: 0 0 auto;
}
.intro .who { flex: 1 1 280px; }
.intro h1 { font-size: 30px; margin: 0 0 4px; }
.intro .affil { color: var(--muted); margin: 0 0 16px; font-size: 17px; }

h2.section { font-size: 20px; margin: 38px 0 14px; }

.quicklinks a {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 0 8px 8px 0;
  color: var(--text);
  font-size: 15px;
}
.quicklinks a:hover { border-color: var(--maroon); color: var(--maroon); text-decoration: none; }

/* ---- Papers ---- */
.paper {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
}
.paper:last-child { border-bottom: none; }

.paper .title {
  color: var(--maroon);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  display: block;
  background: none; border: none; padding: 0; margin: 0;
  text-align: left;
  font-family: inherit;
  line-height: 1.35;
}
.paper .title:hover { text-decoration: underline; }
.paper .title::before {
  content: "▸ ";
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
}
.paper.open .title::before { content: "▾ "; }

.paper .meta { color: var(--muted); font-size: 15.5px; margin-top: 4px; }
.paper .meta .venue { font-style: italic; }

.paper .body { display: none; margin-top: 10px; }
.paper.open .body { display: block; }
.paper .abstract { font-size: 16px; margin: 0 0 10px; }

.paper .links a {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 4px 11px;
  margin: 4px 8px 0 0;
  font-size: 14.5px;
  color: var(--text);
}
.paper .links a:hover { border-color: var(--maroon); color: var(--maroon); text-decoration: none; }

/* ---- CV page ---- */
.cv-embed {
  width: 100%; height: 80vh; border: 1px solid var(--rule); border-radius: 8px;
}

/* ---- Contact ---- */
.contact-line { margin: 6px 0; }
.muted { color: var(--muted); }

footer.site {
  max-width: var(--maxw);
  margin: 48px auto 0;
  padding: 24px 24px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--rule);
  text-align: left;
}
.footer-logo {
  height: 89px;
  width: auto;
  margin: 0 0 12px;
}
/* theme-swapped wordmark: maroon in light, white in dark */
img.footer-logo.dark-only { display: none; }
img.footer-logo.light-only { display: block; }
html[data-theme="dark"] img.footer-logo.light-only { display: none; }
html[data-theme="dark"] img.footer-logo.dark-only { display: block; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  /* stack + center the intro on phones; keep desktop side-by-side */
  .intro { flex-direction: column; align-items: center; gap: 18px; }
  .intro img.headshot { width: min(58vw, 230px); height: auto; }
  .intro .who { flex: 1 1 auto; width: 100%; }
  .intro .who h1,
  .intro .affil,
  .intro .quicklinks { text-align: center; }   /* name, affiliation, links centered; bio stays left */
}
