:root {
  color-scheme: light dark;
  --text: light-dark(#1a1a1a, #e6e6e3);
  --muted: light-dark(#6b6b6b, #9a9a96);
  --link: light-dark(#1a4fa0, #8db4f0);
  --bg: light-dark(#fdfdfb, #161616);
  --rule: light-dark(#e4e4e0, #2e2e2e);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 18px;
  line-height: 1.6;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 3rem 1.25rem 4rem;
  color: var(--text);
  background: var(--bg);
}

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

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.25rem; }

#theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
#theme-toggle:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); }

h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 0.5rem; }

.muted { color: var(--muted); }
.chinese-name { font-weight: 400; }
.flag { font-family: "Noto Color Emoji", sans-serif; }

.headshot {
  display: block;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.timeline {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}
.timeline dt { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline dd { margin: 0; }
.timeline .year.repeat { visibility: hidden; }

.influences { padding-left: 1.1rem; margin: 0; }
.influences li { margin: 0.2rem 0; }
cite { font-style: italic; }

@media (max-width: 30rem) {
  body { padding-top: 1rem; }
  nav { font-size: 0.75rem; column-gap: 0.45rem; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline dd { margin-bottom: 1rem; }
  .timeline dd:last-child { margin-bottom: 0; }
  .timeline .year.repeat { display: none; }
  .timeline dd:has(+ dt .year.repeat) { margin-bottom: 0.25rem; }
}
.nowrap { white-space: nowrap; }

h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.25rem; color: var(--muted); }

.headshot {
  position: relative;
  width: 160px;
  height: 160px;
  overflow: hidden;
}
.headshot img { position: absolute; inset: 0; }
.headshot-real { opacity: 0; transition: opacity 0.3s; }
.headshot { cursor: pointer; }
.headshot-toggle { position: absolute; opacity: 0; pointer-events: none; }
.headshot:has(.headshot-toggle:checked) .headshot-real { opacity: 1; }
.headshot:has(.headshot-toggle:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
@media (hover: hover) {
  .headshot:hover .headshot-real { opacity: 1; }
}

.places { list-style: none; padding: 0; margin: 0 0 1rem; }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}
blockquote p { margin: 0; font-style: italic; }

.timeline .note { display: block; color: var(--muted); }
.timeline .note.paragraph { margin-top: 0.5rem; }
