/* Readable CV: one typeface, one accent colour (the green of
   chenfeixiong.com), no animation. Dark follows the system setting. */
:root {
  --bg: #fafaf8;
  --text: #1f1d24;
  --muted: #6b6a72;
  --faint: #8d8c93;
  --rule: rgba(28, 26, 34, 0.12);
  --accent: #00855a;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --text: #e4e4e4;
    --muted: #a0a0a6;
    --faint: #7c7c82;
    --rule: rgba(225, 225, 225, 0.12);
    --accent: #1beb9e;
  }
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; }

.cv {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

p { margin: 0 0 0.8em; }
strong, b { font-weight: 600; }
em { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color 0.15s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* ---------- header ---------- */
.head { margin-bottom: 40px; }
.name {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 6px;
}
.role { font-size: 1.1rem; color: var(--muted); margin: 0 0 14px; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.925rem;
  margin: 0;
}
.meta span { color: var(--muted); }

/* ---------- sections ---------- */
section {
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 20px;
  line-height: 1.9;
}

/* wide screens: section name on the left, content on the right */
@media (min-width: 880px) {
  .cv { max-width: 940px; }
  .head { padding-left: 200px; }
  section {
    display: grid;
    grid-template-columns: 200px 1fr;
  }
  h2 { margin: 0; position: sticky; top: 24px; align-self: start; }
}
.sec-body { min-width: 0; }

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 0;
}

/* ---------- entries ---------- */
.item { margin-bottom: 40px; }
.item:last-child { margin-bottom: 0; }

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  flex-wrap: wrap;
}

.sub { color: var(--muted); margin-bottom: 0.6em; }

.date {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.links {
  display: inline-flex;
  gap: 14px;
  font-size: 0.9rem;
}
.sub .links { margin-left: 12px; }

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

.points {
  margin: 0 0 0.8em;
  padding-left: 1.1em;
}
.points li { margin-bottom: 0.35em; padding-left: 0.2em; }
.points li::marker { color: var(--faint); }

.rows-sm { font-size: 0.95rem; }
p.label { margin: 1em 0 0.3em; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 24px;
  margin: 18px 0 18px;
}
.stats dt {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stats dd {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.stack { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5em; }

details { margin-top: 2px; }
summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent);
  width: fit-content;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: " +"; }
details[open] summary::after { content: " \2212"; }
details[open] summary { margin-bottom: 14px; }

figure { margin: 0 0 16px; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

/* ---------- key/value rows (skills, languages) ---------- */
.rows { margin: 0; }
.rows div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 2px 0;
}
.rows dt { color: var(--muted); }
.rows dd { margin: 0; }

.authors sup { font-size: 0.7em; }

.foot {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--faint);
}

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  .cv { padding-top: 44px; }
  .name { font-size: 1.75rem; }
  .rows div { grid-template-columns: 1fr; gap: 0; padding: 4px 0; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --faint: #555; }
  html { font-size: 10.5pt; }
  .cv { max-width: none; padding: 0; }
  a { color: inherit; border: 0; }
  details, figure, .links { display: none; }
  section, .item { break-inside: avoid; }
}
