:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --rule: #e6e3df;
  --accent: #8a1e3c;
  --serif: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --ink: #eceae7;
    --muted: #9c9a97;
    --faint: #7a7875;
    --rule: #262626;
    --accent: #d9a2b7;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.68;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; }

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  transition: color 0.15s, text-decoration-color 0.15s;
}

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

/* ---------- masthead ---------- */
.masthead { padding: clamp(48px, 8vw, 88px) 0 0; }

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--rule);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h1 .cn {
  margin-left: 10px;
  font-size: 0.36em;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--muted);
  vertical-align: middle;
}

.role-line {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-bottom: 4px;
}

.masthead nav a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover { color: var(--ink); }

/* ---------- sections ---------- */
main { padding-bottom: 40px; }

section {
  padding: clamp(46px, 7vw, 72px) 0;
  border-bottom: 1px solid var(--rule);
}

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

h2 {
  margin: 0 0 30px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- about ---------- */
.lede {
  margin: 0 0 22px;
  font-size: clamp(21px, 2.6vw, 24px);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

#about p { margin: 0 0 18px; }

#about p:not(.lede) { color: #2c2c2c; }

@media (prefers-color-scheme: dark) {
  #about p:not(.lede) { color: #cfcdca; }
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

.contact-line a { text-decoration-color: var(--rule); }

/* ---------- news ---------- */
.lined { margin: 0; padding: 0; list-style: none; }

.lined li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  font-size: 16.5px;
}

.lined li:first-child { border-top: 0; padding-top: 0; }

.lined p { margin: 0; }

.when {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--faint);
  padding-top: 3px;
}

/* ---------- experience ---------- */
.entry {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}

.entry:first-of-type { border-top: 0; padding-top: 0; }

.entry h3, .pub h3, .project h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.entry h3 a { text-decoration: none; }

.cn-inline {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.sub {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.entry p:last-child { margin: 0; font-size: 16.5px; }

/* ---------- publications ---------- */
.pub { padding: 26px 0; border-top: 1px solid var(--rule); }

.pub:first-of-type { border-top: 0; padding-top: 0; }

.meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.meta img {
  height: 14px;
  width: auto;
  opacity: 0.9;
}

.pub > p:not(.meta):not(.pub-links) { margin: 0 0 12px; font-size: 16.5px; }

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
}

/* ---------- projects ---------- */
.project { padding: 34px 0; border-top: 1px solid var(--rule); }

.project:first-of-type { border-top: 0; padding-top: 0; }

.project figure { margin: 0 0 18px; }

.project figure img,
.project figure video {
  width: 100%;
  background: #f4f2ef;
  border: 1px solid var(--rule);
}

@media (prefers-color-scheme: dark) {
  .project figure img,
  .project figure video { background: #171717; }
}

.project figcaption {
  margin-top: 9px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.project h3 a { text-decoration: none; }

.project h3 a:hover { text-decoration: underline; }

.project-text p { margin: 0 0 10px; font-size: 16.5px; }

.project-text.wide { max-width: 60ch; }

.status {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}

/* ---------- toolkit ---------- */
.kit {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0 24px;
  margin: 0;
  font-size: 16.5px;
}

.kit dt, .kit dd {
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}

.kit dt {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 14px;
}

.kit dd { color: var(--ink); }

/* ---------- footer ---------- */
footer {
  padding: 34px 0 56px;
  border-top: 1px solid var(--rule);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--faint);
}

.foot-links a { text-decoration-color: var(--rule); }

.fine {
  margin: 0;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--faint);
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .masthead { padding-top: 40px; }
  .masthead-inner { align-items: flex-start; }
  .masthead nav { gap: 14px; }
  .masthead nav a { font-size: 11px; }
  .lined li,
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .when { padding-top: 0; }
  .when br { display: none; }
  .kit { grid-template-columns: 1fr; gap: 0; }
  .kit dt { padding-bottom: 2px; border-top: 1px solid var(--rule); }
  .kit dd { padding-top: 0; border-top: 0; padding-bottom: 14px; }
  .kit dt + dd { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
