/* ============================================================
   kayancheng.github.io — one stylesheet for every page
   Change the colors here and the whole site follows.
   ============================================================ */

:root {
  /* Theme B: Emory navy, with a green "available" dot */
  --ink: #1C1F24;        /* main text */
  --ink-soft: #1C1F24;   /* bio and lead-in text */
  --muted: #5B6168;      /* secondary text */
  --faint: #6B7178;      /* labels, footer */
  --rule: #E2E4E8;       /* thin dividers */
  --link: #012169;       /* Emory blue */
  --link-hover: #00133F;
  --dot: #34C759;        /* green "available" dot */
  --bg: #FFFFFF;
  --placeholder: #EEF0F4;
  --photo-bg: #E9EDF4;   /* tinted circle behind the photo */

  /* Apple's font on Apple devices (San Francisco), Segoe UI on Windows.
     Nothing is downloaded, so it loads instantly. */
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

/* Wide page: a sidebar on the left, a readable text column on the right */
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 48px;
}
.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 96px;
  padding-top: 72px;
}
main { max-width: 680px; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Header / navigation ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 40px;
}
.site-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-nav { display: flex; gap: 28px; font-size: 15px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

main > * + * { margin-top: 56px; }
main > .visually-hidden + * { margin-top: 0; }

/* ---------- Headings ---------- */
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 44px;
  line-height: 1.1;
}
.label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--faint);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 40px;
  align-self: start;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.sidebar p { margin: 0; }
/* A tinted circle with the photo standing in it. Everything below the top of the
   circle is clipped to the circle; the head above it is not, so it breaks out. */
.headshot-frame {
  position: relative;
  width: 168px;
  height: 168px;
  margin-top: 52px;              /* room for the head above the circle */
  border-radius: 50%;
  background: var(--photo-bg);
  --photo-w: 178px;              /* how wide the photo sits in the circle */
}
.headshot-clip {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}
.headshot-top {                  /* only the part above the circle */
  position: absolute;
  inset: 0;
  clip-path: inset(-260px -260px 100% -260px);
}
.headshot {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: var(--photo-w);
  max-width: none;
  height: auto;
  display: block;
}
/* Fallback: an ordinary photo cropped inside the circle. */
.headshot-frame.framed { overflow: hidden; margin-top: 0; }
.headshot-frame.framed .headshot-top { display: none; }
.headshot-frame.framed .headshot {
  width: 100%; height: 100%; object-fit: cover; transform: none; left: 0;
}
.side-block { margin-top: 24px; }
.side-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px !important;
}
.side-market { margin-top: 6px !important; color: var(--link); }
.side-market::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--dot);
  vertical-align: 1px;
}
.side-label { font-weight: 600; color: var(--faint); margin-bottom: 4px !important; }
.side-links { list-style: none; margin: 20px 0 0; padding: 0; }
.side-links a { display: inline-flex; align-items: center; min-height: 30px; }
.side-links li:first-child a { font-weight: 600; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Epigraph ---------- */
.epigraph { margin-left: 0; margin-right: 0; margin-bottom: 0; font-family: var(--serif); }
.epigraph blockquote {
  margin: 0;
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-soft);
}
.epigraph .translation {
  margin: 4px 0 0;
  font-size: 16px;
  font-style: italic;
  color: var(--muted);
}
.epigraph figcaption { margin-top: 6px; font-size: 14px; color: var(--faint); }

/* ---------- Serif prose (bio, lead-ins) ---------- */
.prose {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
}
.prose p { margin: 0; }
.prose p + p { margin-top: 22px; }

/* ---------- Hiring-committee block ---------- */
.committee {
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.committee p { margin: 0; }
.committee p + p { margin-top: 8px; }
.committee ul { margin: 0; padding-left: 20px; }
.committee li { margin-bottom: 10px; }
.committee li::marker { color: var(--faint); }
.committee li:last-child { margin-bottom: 0; }
.committee strong { color: var(--ink); font-weight: 400; }

/* ---------- Papers ---------- */
.paper + .paper { margin-top: 36px; }
section[aria-labelledby="wip"] .paper + .paper { margin-top: 20px; }
.paper-title {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
}
.paper .summary { margin: 6px 0 0; color: var(--ink); }
.wip-title { font-size: 19px; }
.paper .wip-title + details { margin-top: 0; }
.paper .meta { margin: 4px 0 0; font-size: 15px; color: var(--muted); }

details { margin-top: 4px; font-size: 15px; color: var(--muted); }
summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "Abstract"; }
details[open] summary::after { content: "Hide abstract"; }
summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details p {
  margin: 0 0 8px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  font-size: 16px;
  color: var(--muted);
}

.simple-list p { margin: 0; }
.simple-list p + p { margin-top: 8px; }
.simple-list .note { color: var(--muted); }

/* ---------- Teaching ---------- */
.made + .made { margin-top: 24px; }
.made-title { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.made p { margin: 4px 0 0; color: var(--ink); }
.made .meta { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.courses { font-size: 16px; }
.courses p { margin: 0; }
.courses p + p { margin-top: 10px; }
.courses .level { color: var(--muted); }

/* ---------- Job market paper line ---------- */
.brackets { color: var(--muted); }
.jmp-title { color: var(--ink); }
.committee details.jmp { margin: 0; font-size: 15px; color: var(--muted); }
.committee details + p { margin-top: 8px; }
.committee details.jmp summary {
  display: block;
  min-height: 0;
  color: var(--muted);
  cursor: pointer;
}
.committee details.jmp summary::after { content: none; }
.committee details.jmp summary:hover { text-decoration: none; }
.toggle { color: var(--link); }
.toggle::after { content: "abstract"; }
details[open] .toggle::after { content: "hide"; }
.committee details.jmp > p {
  margin: 8px 0 0;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  font-size: 15px;
}

/* ---------- Resource lists ---------- */
.intro-note { margin: 0 0 4px; font-size: 15px; color: var(--muted); }
.weeks { margin: 14px 0 18px; font-size: 16px; }
.weeks p { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.weeks p:last-child { border-bottom: 0; }
.week { display: inline-block; min-width: 92px; color: var(--muted); }
.quote {
  margin: 0 0 18px;
  padding-left: 18px;
  border-left: 2px solid var(--rule);
  font-size: 17px;
  color: var(--ink);
}

/* ---------- Collapsible sections ---------- */
.collapse { margin-top: 0; border-bottom: 1px solid var(--rule); }
main > .prose + .collapse { margin-top: 40px; }
main > .collapse:first-of-type { border-top: 1px solid var(--rule); }
.collapse > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
}
.collapse > summary::after,
.collapse[open] > summary::after { content: none; }
.collapse > summary:hover { text-decoration: none; color: var(--link); }
.collapse-title { font-weight: 600; }
.collapse-hint { margin-left: auto; font-size: 14px; color: var(--muted); }
.collapse-title::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: var(--muted);
  font-weight: 400;
}
.collapse[open] .collapse-title::before { content: "–"; }
.collapse-body { padding: 0 0 24px 18px; }
.collapse-body > *:first-child { margin-top: 0; }
.collapse-body p { padding-left: 0; border-left: 0; color: inherit; }
.collapse-body .intro-note { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { padding: 72px 0 48px; font-size: 14px; color: var(--faint); }
.site-footer a { color: var(--faint); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); }
.site-footer a:hover { color: var(--link); }

/* ---------- Things still to fill in ----------
   Anything wrapped in <span class="todo"> shows with a yellow
   highlight so you can spot it. Remove the span once it's done. */
.todo { background: #FFF3B0; color: inherit; }

/* ---------- Tablets and phones: sidebar moves on top ---------- */
@media (max-width: 880px) {
  .page { padding: 0 24px; }
  .layout { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
  }
  .headshot-frame { width: 96px; height: 96px; margin-top: 30px; grid-row: span 2; --photo-w: 102px; }
  .sidebar .side-block:first-of-type { margin-top: 0; }
  .side-block + .side-block { grid-column: 2; margin-top: 12px; }
  .side-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 12px; }
  .side-links a { min-height: 44px; }
}

@media (max-width: 560px) {
  .week { display: block; min-width: 0; }
  body { font-size: 16px; }
  .site-header { padding-top: 20px; }
  .site-nav { gap: 16px; font-size: 14px; }
  main > * + * { margin-top: 40px; }
  main > .visually-hidden + * { margin-top: 0; }
  h1 { font-size: 34px; }
  .headshot-frame { width: 76px; height: 76px; margin-top: 24px; --photo-w: 81px; }
  .sidebar { grid-template-columns: 72px minmax(0, 1fr); }
  .side-name { font-size: 22px; }
  .epigraph blockquote { font-size: 18px; }
  .prose { font-size: 18px; }
  .paper-title { font-size: 20px; }
}

@media print {
  .site-nav, .headshot-frame { display: none; }
  .layout { display: block; }
  .sidebar { position: static; margin-bottom: 32px; }
}
