:root {
  --bg: #faf9f6;
  --text: #1c1c1a;
  --muted: #6b6b64;
  --accent: #3a5a52;
  --rule: #ddd9d0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --text: #e9e7e0;
    --muted: #a3a099;
    --accent: #8fb8ac;
    --rule: #33352f;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main, header, footer {
  max-width: 640px;
  margin: 0 auto;
}

.site-header {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

h1 {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0 0 0.4rem;
}

.zh-name {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.7em;
  margin-left: 0.3em;
}

.role {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-style: italic;
}

nav {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

nav a {
  color: var(--text);
  text-decoration: none;
}

nav a:hover {
  color: var(--accent);
}

nav span {
  color: var(--rule);
  margin: 0 0.6em;
}

main {
  counter-reset: section-num;
}

section {
  counter-increment: section-num;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--rule);
}

section:last-of-type {
  border-bottom: none;
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.8rem;
}

h2::before {
  content: counter(section-num, decimal-leading-zero) "\a0\a0";
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 0.8rem;
}

h3:first-of-type {
  margin-top: 0;
}

p {
  margin: 0 0 1.2rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
}

.pub {
  color: var(--muted);
}

.pub a {
  color: var(--text);
}

ul.timeline {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

ul.timeline:last-child {
  margin-bottom: 0;
}

ul.timeline li {
  display: flex;
  gap: 1.2rem;
  padding: 0.55rem 0;
}

.years {
  flex: 0 0 5.5rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  padding-top: 0.15rem;
}

.entry {
  flex: 1;
}

.desc {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.contact-list .icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  color: var(--muted);
}

footer {
  padding: 3rem 0 4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  body {
    padding: 0 1.1rem;
  }
  .site-header {
    padding: 3rem 0 2rem;
  }
  h1 {
    font-size: 1.6rem;
  }
  nav a, nav span {
    display: inline-block;
  }
  ul.timeline li {
    flex-direction: column;
    gap: 0.15rem;
  }
  .years {
    flex: none;
  }
}
