/* ==========================================================================
   Academic personal site — custom theme
   Self-contained; does not depend on the Minimal Mistakes stylesheet.
   ========================================================================== */

:root {
  --bg:            #f7f9fb;
  --bg-raised:     #ffffff;
  --ink:           #101927;
  --ink-soft:      #33415a;
  --ink-muted:     #64748b;
  --rule:          #dbe3ec;
  --rule-soft:     #e8eef4;
  --accent:        #1d5a9e;
  --accent-soft:   #e9f0f8;
  --accent-ink:    #16497f;
  --chip-bg:       #eef2f7;

  --serif: "Source Serif 4", Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 70rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0e131a;
    --bg-raised:   #151c25;
    --ink:         #e3e9f0;
    --ink-soft:    #b8c4d2;
    --ink-muted:   #8496a8;
    --rule:        #263241;
    --rule-soft:   #1d2734;
    --accent:      #79b1e8;
    --accent-soft: #16263a;
    --accent-ink:  #9bc8f4;
    --chip-bg:     #1d2734;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.68;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: currentColor; }

/* --- shell ---------------------------------------------------------------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- top bar -------------------------------------------------------------- */

.topbar {
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
}
.topbar__brand {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  border: 0;
}
.topbar__brand:hover { color: var(--accent); }
.topbar nav {
  display: flex;
  gap: 1.35rem;
  font-family: var(--sans);
  font-size: .82rem;
  letter-spacing: .02em;
}
.topbar nav a { color: var(--ink-soft); border: 0; }
.topbar nav a:hover,
.topbar nav a[aria-current="page"] { color: var(--accent); }

/* --- page grid: left rail + content ---------------------------------------- */

.page {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding-top: 2.75rem;
}

.rail {
  position: sticky;
  top: 4.75rem;
}
.rail__photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.25);
  display: block;
}
.rail__name {
  font-size: 1.42rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.012em;
  margin: 1.1rem 0 0;
}
.rail__name a { color: var(--ink); border: 0; }
.rail__name a:hover { color: var(--accent); }
.rail__name .han {
  display: block;
  font-size: .68em;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: .06em;
  margin-top: .18rem;
}
.rail__role {
  font-family: var(--sans);
  font-size: .86rem;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: .4rem 0 0;
}
.rail__role span { display: block; }
.rail__role .affil { color: var(--ink-muted); font-size: .81rem; margin-top: .15rem; }

.linkbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
  margin-top: 1.05rem;
  font-family: var(--sans);
}
.linkbar a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .79rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .32rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--ink-soft);
}
.linkbar a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.linkbar svg { width: 14px; height: 14px; flex: none; }

.pdf-link {
  font-family: var(--sans);
  margin: .2rem 0 .4rem;
}
.pdf-link a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  font-weight: 550;
  letter-spacing: .01em;
  padding: .38rem .85rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}
.pdf-link a:hover {
  background: var(--accent);
  color: var(--bg-raised);
  border-color: var(--accent);
}
.pdf-link svg { width: 15px; height: 15px; flex: none; }

.page__title {
  font-size: 1.95rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 .4rem;
}

/* --- sections ------------------------------------------------------------- */

.content { padding-bottom: 3rem; min-width: 0; }

.section { padding: 2.2rem 0 .4rem; }
.content > .section:first-child { padding-top: 0; }
.section + .section { border-top: 1px solid var(--rule-soft); }

.section__title {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.15rem;
}

.prose p { margin: 0 0 1.05rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 650; }

.note {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-muted);
  margin: 0 0 1.2rem;
}

/* --- news ----------------------------------------------------------------- */

.news { margin: 0; padding: 0; list-style: none; }
.news li {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 1rem;
  padding: .42rem 0;
  border-bottom: 1px dashed var(--rule-soft);
}
.news li:last-child { border-bottom: 0; }
.news__date {
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-muted);
  padding-top: .3rem;
  white-space: nowrap;
}
.news__text { font-size: .96rem; }
.news__text strong { font-weight: 650; color: var(--ink); }
.news__text a {
  color: var(--accent);
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.news__text a:hover { text-decoration-thickness: 2px; }
.news__text a strong { color: inherit; }

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

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

.pub {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 1.15rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.pub:last-child { border-bottom: 0; }

.pub__badge {
  font-family: var(--sans);
  text-align: center;
  padding: .34rem .3rem .3rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--chip-bg);
  align-self: start;
  margin-top: .18rem;
}
.pub__venue {
  display: block;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .03em;
  color: var(--accent-ink);
  line-height: 1.2;
}
.pub__year {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: .04em;
}

.pub__title {
  font-size: 1.04rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.005em;
  margin: 0 0 .18rem;
  color: var(--ink);
}
.pub__title a { color: inherit; }
.pub__title a:hover { color: var(--accent); }

.pub__authors {
  font-size: .92rem;
  color: var(--ink-soft);
  margin: 0 0 .1rem;
}
.pub__authors strong { font-weight: 650; color: var(--ink); }

.pub__meta {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-muted);
  margin: 0;
}
.pub__note {
  font-weight: 600;
  color: var(--accent);
}

.pub__link {
  font-weight: 600;
  color: var(--accent);
}
.pub__link:hover { border-bottom-color: currentColor; }

.more-link {
  font-family: var(--sans);
  font-size: .84rem;
  margin: 1.3rem 0 0;
}

/* --- timeline (experience / education) ------------------------------------ */

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.15rem;
  padding: .75rem 0;
  border-bottom: 1px dashed var(--rule-soft);
}
.timeline li:last-child { border-bottom: 0; }
.timeline__when {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: .02em;
  padding-top: .22rem;
}
.timeline__what { font-size: .97rem; }
.timeline__what strong { font-weight: 650; }
.timeline__what .where { display: block; font-size: .87rem; color: var(--ink-muted); font-family: var(--sans); }

.timeline__points {
  list-style: none;
  margin: .5rem 0 .1rem;
  padding: 0;
}
.timeline__points li {
  display: block;
  position: relative;
  grid-template-columns: none;
  gap: 0;
  padding: .12rem 0 .12rem 1rem;
  border: 0;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.timeline__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

/* --- awards --------------------------------------------------------------- */

.awards { margin: 0; padding: 0; list-style: none; }
.awards li {
  position: relative;
  padding: .3rem 0 .3rem 1.15rem;
  font-size: .97rem;
}
.awards li::before {
  content: "";
  position: absolute;
  left: 0; top: .95em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .6;
}
.awards .year { color: var(--ink-muted); font-family: var(--sans); font-size: .85rem; }

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

.site-footer {
  border-top: 1px solid var(--rule-soft);
  margin-top: 2rem;
  padding: 1.6rem 0 2.6rem;
  font-family: var(--sans);
  font-size: .76rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  justify-content: space-between;
}
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--accent); }

/* --- responsive ----------------------------------------------------------- */

/* Tablet: rail stops being a column and becomes a horizontal header. */
@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    gap: 1.9rem;
    padding-top: 2.25rem;
  }
  .rail {
    position: static;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    grid-template-areas:
      "photo name"
      "photo role"
      "links links";
    column-gap: 1.5rem;
    align-items: center;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--rule-soft);
  }
  .rail__photo { grid-area: photo; width: 124px; height: 124px; align-self: center; }
  .rail__name  { grid-area: name; margin: 0; align-self: end; font-size: 1.6rem; }
  .rail__role  { grid-area: role; align-self: start; margin-top: .3rem; }
  .linkbar {
    grid-area: links;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 1.1rem;
  }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }

  .rail {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "name" "role" "links";
    justify-items: center;
    text-align: center;
    row-gap: 0;
  }
  .rail__photo { width: 116px; height: 116px; margin-bottom: 1rem; }
  .rail__name { font-size: 1.6rem; }
  .linkbar { justify-content: center; }

  .page__title { font-size: 1.7rem; }

  .pub { grid-template-columns: 1fr; gap: .5rem; }
  .pub__badge {
    justify-self: start;
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    padding: .18rem .5rem;
    margin-top: 0;
  }
  .pub__venue, .pub__year { display: inline; }

  .news li, .timeline li { grid-template-columns: 1fr; gap: .1rem; }
  .news__date, .timeline__when { padding-top: 0; }

  .topbar nav { gap: 1rem; }
}

@media print {
  .topbar, .site-footer, .linkbar { display: none; }
  .page { display: block; }
  .rail { position: static; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .pub { break-inside: avoid; }
}
