/* ==========================================================================
   Homepage stylesheet
   To change the look, edit the colors and fonts in :root below.
   ========================================================================== */

:root {
  --bg:      #fbfaf7;   /* page background (warm paper white) */
  --text:    #1c1b19;   /* main text */
  --muted:   #6d6a64;   /* dates, authors, secondary text */
  --rule:    #e3dfd6;   /* thin lines */
  --accent:  #b4441c;   /* links on hover, highlights */

  --serif: "Source Serif 4", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --width: 45rem;       /* max width of the page (720px) */
  --gutter: 9.5rem;     /* width of the date column */
}

/* dark mode colors (used when the Dark/Light button or the device setting picks dark) */
:root[data-theme="dark"] {
  --bg:     #151513;
  --text:   #e9e6df;
  --muted:  #9b978e;
  --rule:   #2e2d2a;
  --accent: #e8875c;
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

p { margin: 0 0 1em; }
strong { font-weight: 600; }
img, video { max-width: 100%; display: block; }

/* ---------- header ---------- */

.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.intro h1 {
  margin: 0 0 .35rem;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.intro .role  { margin: 0; font-size: 1.05rem; }
.intro .email { margin: .2rem 0 0; color: var(--muted); font: 400 .82rem/1.6 var(--mono); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.2rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  font: 500 .78rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.links a { text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.links a:hover { border-color: currentColor; }

/* sun / moon button in the top-right corner */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--accent); border-color: currentColor; }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }

/* show the moon in light mode (click = go dark), the sun in dark mode */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.photo {
  width: 108px;
  aspect-ratio: 4 / 5;         /* slightly tall oval */
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;    /* keep the face centered in the oval */
  box-shadow: 0 0 0 1px var(--rule);  /* thin outline so the oval edge shows */
  flex-shrink: 0;
  filter: grayscale(15%);
}

/* ---------- section headings ---------- */

h2 {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 3rem 0 1.2rem;
  font: 500 .78rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
h2::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

h3 { margin: 1.5rem 0 .5rem; font-size: 1.05rem; font-weight: 600; }

/* plain markdown lists (e.g. Research Interests) */
.page > ul:not([class]) { margin: 0; padding-left: 1.1rem; }
.page > ul:not([class]) li { margin-bottom: .25rem; }
.page > ul:not([class]) ul { margin-top: .25rem; padding-left: 1.1rem; color: var(--muted); }
.page > ul:not([class]) li::marker { color: var(--muted); }

/* ---------- date | content rows (news, education) ---------- */

.rows { margin: 0; padding: 0; list-style: none; }

.row {
  display: grid;
  grid-template-columns: var(--gutter) 1fr;
  gap: 1rem;
  padding: .45rem 0;
}

.row .when {
  color: var(--muted);
  font: 400 .8rem/1.6 var(--mono);
  padding-top: .15rem;
  white-space: nowrap;
}

.row .what p:last-child { margin-bottom: 0; }
.row .detail { color: var(--muted); font-size: .95rem; }

/* ---------- publications ---------- */

.pubs { margin: 0; padding: 0; list-style: none; }

.pub {
  display: grid;
  grid-template-columns: 12.5rem 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.pub.no-teaser { grid-template-columns: 1fr; }
.pub:first-child { padding-top: .25rem; }
.pub:last-child  { border-bottom: 0; }

.pub .teaser {
  width: 100%;
  height: auto;
  border-radius: .3rem;
  background: var(--rule);
}

.pub .venue {
  margin: 0 0 .3rem;
  font: 500 .74rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.pub .note { color: var(--accent); }

.pub .title   { margin: 0 0 .3rem; font-weight: 600; line-height: 1.35; }
.pub .title a { text-decoration: none; }
.pub .authors { margin: 0 0 .5rem; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.pub .authors strong { color: var(--text); font-weight: 600; }

.pub .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
  font: 400 .75rem/1.4 var(--mono);
}

.pub .actions a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: .3rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, border-color .15s, background-color .15s;
}
.pub .actions a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}
.pub .actions a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pub .actions svg {
  width: .9rem;
  height: .9rem;
  flex-shrink: 0;
}

/* ---------- footer ---------- */

.colophon {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 400 .74rem/1.6 var(--mono);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { padding: 2.5rem 1rem 2rem; }

  .intro { flex-direction: column-reverse; gap: 1.25rem; margin-bottom: 2.5rem; }
  .intro h1 { font-size: 2rem; }
  .photo { width: 84px; }

  .row { grid-template-columns: 1fr; gap: 0; }
  .pub { grid-template-columns: 1fr; gap: .9rem; }
}
