/* =========================================================
   siyuanguo.com — stylesheet
   Everything visual lives here. The most common things you
   might want to change are in :root below.
   ========================================================= */

:root {
  /* Colours */
  --bg:        #fbf9f6;   /* page background (warm off-white) */
  --surface:   #f4f0ea;   /* cards, news box */
  --ink:       #23201c;   /* body text */
  --ink-soft:  #5c564e;   /* secondary text, dates, venues */
  --rule:      #e2dcd2;   /* hairlines and borders */
  --accent:    #8c4a2f;   /* links and highlights (warm sienna) */
  --accent-bg: #f0e6df;   /* tint behind badges */

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;

  --measure: 46rem;       /* max text width — the key readability dial */
  --leading: 1.62;        /* line height */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #16140f;
    --surface:   #201d17;
    --ink:       #e9e3d8;
    --ink-soft:  #a8a094;
    --rule:      #332f27;
    --accent:    #d99a72;
    --accent-bg: #2a231c;
  }
}

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

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

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

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

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

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(140, 74, 47, .28); }
a:hover { border-bottom-color: currentColor; }
@media (prefers-color-scheme: dark) { a { border-bottom-color: rgba(217, 154, 114, .3); } }

p { margin: 0 0 1.1em; }

strong { font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

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

header.masthead {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

header.masthead img.avatar {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--rule);
}

h1.name {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 .3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.role {
  font-family: var(--sans);
  font-size: .93rem;
  color: var(--ink-soft);
  margin: 0 0 .7rem;
  line-height: 1.5;
}

/* small text links under the name */
nav.links {
  font-family: var(--sans);
  font-size: .86rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}
nav.links a { border-bottom: 0; color: var(--ink-soft); }
nav.links a:hover { color: var(--accent); }

@media (max-width: 560px) {
  header.masthead { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  header.masthead img.avatar { width: 96px; height: 96px; }
  h1.name { font-size: 1.7rem; }
}

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

section { margin: 3rem 0 0; }

h2 {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
}

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

/* numbered research questions */
ol.research { margin: 0; padding: 0; list-style: none; counter-reset: q; }
ol.research > li { counter-increment: q; position: relative; padding-left: 2.2rem; margin-bottom: 1.4rem; }
ol.research > li::before {
  content: counter(q);
  position: absolute; left: 0; top: .1em;
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent);
}
ol.research .q { font-weight: 600; display: block; margin-bottom: .15rem; }

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

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

ul.pubs > li {
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
}
ul.pubs > li:last-child { border-bottom: 0; }

/* Paper titles are dark, not accent-coloured: the list stays calm and the
   accent colour keeps its meaning elsewhere. Hover reveals they're links. */
a.pub-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  border-bottom: 0;
}
a.pub-title:hover { color: var(--accent); }
.pub-authors, .pub-venue {
  font-family: var(--sans);
  font-size: .84rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: block;
}
.pub-venue { margin-top: .1rem; }
.pub-venue em { font-style: italic; }

.badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 3px;
  padding: .1rem .38rem;
  margin-left: .35rem;
  vertical-align: .08em;
  white-space: nowrap;
}

.year-head {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-soft);
  padding-top: 1.4rem;
}

/* ---------- students ---------- */

ul.people {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem;
}
ul.people li { font-size: .95rem; line-height: 1.45; }
ul.people .note, ul.people .work {
  display: block;
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-soft);
}
@media (max-width: 640px) { ul.people { grid-template-columns: 1fr; } }

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

ul.news { list-style: none; margin: 0; padding: 0; }
ul.news li {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: .8rem;
  padding: .42rem 0;
  font-size: .95rem;
  line-height: 1.5;
}
ul.news .date {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-soft);
  padding-top: .22rem;
  white-space: nowrap;
}
@media (max-width: 560px) {
  ul.news li { grid-template-columns: 1fr; gap: 0; }
  ul.news .date { padding-top: 0; }
}

details.more { margin-top: .8rem; }
details.more > summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: .84rem;
  color: var(--accent);
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more > summary:hover { text-decoration: underline; }

/* ---------- callout (prospective students) ---------- */

.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.2rem;
  font-size: .95rem;
}
.callout p:last-child { margin-bottom: 0; }

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

footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ---------- talk-bio page ---------- */

.backlink {
  font-family: var(--sans);
  font-size: .84rem;
  display: inline-block;
  margin-bottom: 2rem;
  border-bottom: 0;
  color: var(--ink-soft);
}
.refs { font-size: .88rem; color: var(--ink-soft); }
.refs li { margin-bottom: .6rem; }

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  nav.links, details.more { display: none; }
}

/* People list: names read as text, underline on hover */
ul.people > li > a { color: var(--ink); border-bottom: 0; font-weight: 600; }
ul.people > li > a:hover { color: var(--accent); }
