:root {
  --ink: #1f2933;
  --muted: #5f6b78;
  --line: #dde3ea;
  --bg: #fbfbf8;
  --card: #ffffff;
  --head: #13263a;
  --accent: #c2185b;
  --accent-soft: #f6dbe5;
  --blue: #3f7cac;
  --maxw: 1080px;
  --radius: 10px;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; background: var(--bg); line-height: 1.6; font-size: 17px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }

/* header */
.site-head { background: var(--head); color: #fff; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.brand { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: 13px; color: #b9c6d3; letter-spacing: .3px; }
nav a { color: #dfe7ef; margin-left: 22px; font-weight: 600; font-size: 15px; }
nav a.active, nav a:hover { color: #fff; text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* profile hero */
.hero { background: #fff; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 200px 1fr; gap: 36px; padding-top: 40px; padding-bottom: 36px; align-items: center; }
.portrait { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); display: flex; align-items: center;
  justify-content: center; font-size: 64px; font-weight: 700; color: var(--accent); }
.hero h1 { margin: 0 0 4px; font-size: clamp(30px, 6vw, 40px); line-height: 1.15; font-family: "Source Serif 4", Georgia, serif; }
.hero .role { font-size: 20px; color: var(--accent); font-weight: 600; margin: 0 0 10px; }
.hero .aff { margin: 0; color: var(--muted); font-size: 16px; }
.chips { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 14px; background: var(--bg); color: var(--ink); }
.chip:hover { border-color: var(--accent); text-decoration: none; }

/* sections */
main { padding: 8px 0 48px; }
section { padding: 28px 0 8px; }
h2 { font-family: "Source Serif 4", Georgia, serif; font-size: 28px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
h2::after { content: ""; display: block; width: 56px; height: 3px; background: var(--accent); margin-top: 8px; margin-bottom: -11px; }
h3 { font-size: 19px; margin: 0 0 6px; }
.lead p { max-width: 820px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .what { font-weight: 600; }
.timeline .where { color: var(--muted); }

/* publications */
.pub { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pub .t { font-weight: 600; overflow-wrap: anywhere; }
.pub .a { overflow-wrap: anywhere; }
.pub .a { color: var(--muted); font-size: 15px; }
.pub .a b { color: var(--ink); }
.pub .j { font-size: 15px; }
.pub .j i { color: var(--ink); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.year { margin-top: 26px; color: var(--accent); font-size: 20px; }
.tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.tools input { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; background: #fff; }
.muted { color: var(--muted); }

/* tutorials */
.series-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.series-head img { width: 320px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.ep { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.ep:hover { border-color: var(--accent); text-decoration: none; }
.ep img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.ep .body { padding: 12px 14px 14px; }
.ep .code { display: inline-block; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 10px; font-size: 14px; }
.ep .dur { float: right; color: var(--muted); font-size: 14px; }
.ep h3 { margin: 8px 0 4px; font-size: 17px; }
.ep p { margin: 0; color: var(--muted); font-size: 14.5px; }
.player { background: #000; border-radius: var(--radius); overflow: hidden; }
.player video { display: block; width: 100%; }
.pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; background: #fff; color: var(--ink); font-weight: 600; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* workshop pages (rendered Markdown) */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 28px 24px; }
.doc table { border-collapse: collapse; margin: 12px 0; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.doc th { background: #f1f4f7; }
.doc pre { background: #f3f5f8; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 14px; }
.doc code { font-family: Consolas, "DejaVu Sans Mono", monospace; font-size: 14px; }
.doc blockquote { margin: 12px 0; padding: 4px 16px; border-left: 4px solid var(--accent-soft); background: #fdf7f9; }
.doc img { border: 1px solid var(--line); border-radius: 6px; }
.side { font-size: 15px; }
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout > * { min-width: 0; }
.side ul { list-style: none; padding: 0; margin: 0; }
.side li a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.side li a.active, .side li a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

footer { background: var(--head); color: #b9c6d3; font-size: 14px; }
footer .wrap { padding: 22px 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a { color: #dfe7ef; }

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .portrait { margin: 0 auto; width: 150px; height: 150px; font-size: 48px; }
  .chips { justify-content: center; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .layout { grid-template-columns: 1fr; }
  nav a { margin-left: 14px; }
  .site-head .wrap { flex-direction: column; align-items: flex-start; gap: 6px; }
  .series-head img { width: 100%; }
  .doc { padding: 4px 16px 18px; }
}
