/* ==========================================================================
   hs-black.github.io — shared styles for the home page and article posts.
   Slide decks use assets/slides.css on top of this file.
   ========================================================================== */

:root {
  --bg: #f7f7f5;
  --bg-soft: #efefec;
  --surface: #ffffff;
  --text: #18181b;
  --text-soft: #52525b;
  --text-faint: #8a8a93;
  --border: #e2e2de;
  --accent: #5b4cf0;
  --accent-soft: rgba(91, 76, 240, 0.1);
  --accent-2: #e8590c;
  --code-bg: #f0f0ed;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 720px;
  --gutter: 16px;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d10;
    --bg-soft: #16161b;
    --surface: #17171c;
    --text: #ececf1;
    --text-soft: #a8a8b3;
    --text-faint: #6f6f7a;
    --border: #2a2a31;
    --accent: #8f84ff;
    --accent-soft: rgba(143, 132, 255, 0.14);
    --accent-2: #ff8a4c;
    --code-bg: #1c1c22;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d10;
  --bg-soft: #16161b;
  --surface: #17171c;
  --text: #ececf1;
  --text-soft: #a8a8b3;
  --text-faint: #6f6f7a;
  --border: #2a2a31;
  --accent: #8f84ff;
  --accent-soft: rgba(143, 132, 255, 0.14);
  --accent-2: #ff8a4c;
  --code-bg: #1c1c22;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img, svg, video, canvas { max-width: 100%; }

::selection { background: var(--accent-soft); }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- site header / footer ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.site-logo:hover { text-decoration: none; }
.site-logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.site-nav { display: flex; gap: 18px; font-size: 15px; }
.site-nav a { color: var(--text-soft); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 600; }

.site-footer {
  margin-top: 96px;
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 14px;
}

/* ---------- home ---------- */

.hero { padding: 40px 0 24px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; color: var(--text-soft); max-width: 34em; }

.token-stream {
  margin: 28px 0 8px;
  min-height: 2.4em;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.token-stream .tok {
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) calc(var(--p, 0.5) * 30%), transparent);
  animation: tok-in 0.35s ease-out both;
  white-space: pre;
}
.token-stream .caret {
  width: 9px;
  background: var(--accent);
  border-radius: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes tok-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 50% { opacity: 0; } }

.section-title {
  margin: 56px 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 18px 0;
  color: var(--text);
}
.post-list a:hover { text-decoration: none; }
.post-list a:hover .post-title { color: var(--accent); }
.post-title { font-weight: 600; font-size: 18px; transition: color 0.15s; }
.post-desc { grid-column: 1 / -1; color: var(--text-soft); font-size: 15px; line-height: 1.6; }
.post-meta {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-faint); font-size: 14px; white-space: nowrap;
}

.kind {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.kind.deck { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 40%, transparent); }
.kind.interactive { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- article ---------- */

.post-header { padding: 32px 0 8px; }
.post-header h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.post-header .post-meta { white-space: normal; flex-wrap: wrap; }

.prose { padding-top: 16px; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 {
  margin-top: 2.2em;
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.prose h3 { margin-top: 1.8em; margin-bottom: 0; font-size: 19px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote {
  margin-left: 0; margin-right: 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--code-bg);
}
.prose pre {
  margin-bottom: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 14px;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; font-size: inherit; }

.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-faint);
  text-align: center;
}

.callout {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 15px;
}

/* Box for interactive widgets embedded in an article. */
.demo {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.demo-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit; font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

input[type="range"] { accent-color: var(--accent); }

/* ---------- home: profile ---------- */

.profile {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 28px;
  align-items: center;
  padding: 32px 0 8px;
}
.avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent-soft);
}
.profile h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.profile .role { margin: 6px 0 0; color: var(--text-soft); line-height: 1.5; }
.profile .token-stream { margin: 14px 0 0; min-height: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .profile { grid-template-columns: 1fr; gap: 18px; }
  .avatar { width: 112px; height: 112px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.section-head a { font-size: 14px; }

/* ---------- CV entries (education / experience / awards) ---------- */

.cv { list-style: none; margin: 0; padding: 0; }
.cv > li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cv .what { font-weight: 600; }
.cv .when { color: var(--text-faint); font-size: 14px; white-space: nowrap; }
.cv .where { grid-column: 1 / -1; color: var(--text-soft); font-size: 15px; }
.cv .detail { grid-column: 1 / -1; color: var(--text-soft); font-size: 15px; line-height: 1.65; margin-top: 4px; }
@media (max-width: 560px) {
  .cv > li { grid-template-columns: 1fr; }
}

/* ---------- papers ---------- */

.papers { list-style: none; margin: 0; padding: 0; }
.paper { padding: 20px 0; border-bottom: 1px solid var(--border); }
.paper-title { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 600; }
.paper-authors { margin-top: 6px; color: var(--text-soft); font-size: 15px; line-height: 1.6; }
.paper-authors .me { color: var(--text); font-weight: 600; }
.paper-venue { margin-top: 4px; font-size: 15px; }
.paper-venue .venue { font-weight: 600; color: var(--accent-2); }
.paper-venue .note { color: var(--text-faint); }
.paper-summary { margin-top: 8px; font-size: 15px; line-height: 1.65; }
.paper-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 14px; }
.paper-links summary { color: var(--accent); cursor: pointer; list-style: none; }
.paper-links summary::-webkit-details-marker { display: none; }
.paper-links details { display: contents; }
.paper-links details[open] > :not(summary) { flex-basis: 100%; }
.paper-extra {
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-soft);
}
pre.paper-extra { overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; white-space: pre; }

/* ---------- projects ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
a.card:hover { border-color: var(--accent); text-decoration: none; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.card p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--text-soft); }
.card .meta { margin-top: auto; padding-top: 4px; font-size: 13px; color: var(--text-faint); }

/* ---------- blog archive ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 8px; }
.filters button {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.year {
  margin: 40px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- long-form helpers (tables, controls, series nav) ---------- */

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
.prose th, .prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; color: var(--text-soft); border-bottom-color: var(--text-faint); }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Wide tables scroll inside this box instead of the page. */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 480px; }

.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.prose .katex { position: relative; }

.prose details {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.prose details > summary { cursor: pointer; font-weight: 600; }
.prose details[open] > summary { margin-bottom: 8px; }

.callout.warn { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.callout > :first-child { margin-top: 0; }
.callout > * + * { margin-top: 0.6em; }

/* Table of contents at the top of long posts. */
.toc {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
}
.toc ol { margin: 6px 0 0; padding-left: 1.4em; }
.toc li + li { margin-top: 2px; }

/* Rows of labelled controls inside a .demo. */
.ctrls { display: grid; gap: 10px; margin: 12px 0; }
.ctrl {
  display: grid;
  grid-template-columns: minmax(7em, auto) 1fr minmax(4.5em, auto);
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.ctrl input[type="range"] { width: 100%; }
.ctrl output, .ctrl .val { font-family: var(--font-mono); font-size: 14px; text-align: right; }
.ctrl select, .demo select, .demo input[type="number"] {
  font: inherit; font-size: 14px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
}
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-soft);
  font: inherit; font-size: 14px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.readout > div { padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); }
.readout .k { display: block; font-size: 12px; color: var(--text-faint); }
.readout .v { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
@media (max-width: 560px) {
  .ctrl { grid-template-columns: 1fr auto; }
  .ctrl input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
}

/* Series navigation, filled in by /assets/series.js. */
.series {
  margin: 8px 0 24px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
}
.series summary { cursor: pointer; color: var(--text-soft); }
.series summary b { color: var(--text); }
.series ol { margin: 8px 0 0; padding-left: 1.6em; }
.series li + li { margin-top: 2px; }
.series li[aria-current] { font-weight: 600; }
.series li[aria-current] a { color: var(--text); }
.series-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}
.series-pager a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.series-pager a:hover { border-color: var(--accent); text-decoration: none; }
.series-pager small { display: block; color: var(--text-faint); font-size: 12px; }
.series-pager .next { grid-column: 2; text-align: right; }

/* ---------- home (two-column layout) ---------- */

.wrap.wide { max-width: 1100px; }

.home-page {
  background:
    radial-gradient(900px 420px at 12% -8%, var(--accent-soft), transparent 70%),
    radial-gradient(700px 360px at 100% 0%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

.home {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 8px;
}
.home-side { position: sticky; top: 24px; display: grid; gap: 16px; }
.home-main > section + section { margin-top: 8px; }

.id-card {
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.id-card .avatar { width: 132px; height: 132px; }
.id-card h1 { margin: 16px 0 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.id-card .role { margin: 6px 0 0; color: var(--text-soft); font-size: 15px; line-height: 1.5; }
.id-card .tagline { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--accent); font-weight: 500; }

.icon-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.icon-links a {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}
.icon-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.icon-links svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.now-card {
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-size: 15px;
  line-height: 1.6;
}
.now-card p { margin: 6px 0 0; }
.now-card .muted { color: var(--text-faint); font-size: 13px; }
.now-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.intro { padding-top: 12px; }
.lede {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.lede em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro .prose { padding-top: 8px; color: var(--text-soft); }
.intro .chips { margin-top: 20px; }

/* Experience / education timeline */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute; left: 6px; top: 10px; bottom: 10px;
  width: 2px; background: var(--border);
}
.timeline > li { position: relative; padding: 4px 0 22px 34px; }
.timeline > li::before {
  content: "";
  position: absolute; left: 0; top: 10px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-faint);
}
.timeline > li.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; }
.timeline .what { font-weight: 650; font-size: 17px; }
.timeline .when { color: var(--text-faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.timeline .where { color: var(--accent); font-size: 15px; font-weight: 500; }
.timeline .detail { margin: 6px 0 0; color: var(--text-soft); font-size: 15px; line-height: 1.65; }

/* Paper cards */
.paper-cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.paper-cards > li {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.15s, transform 0.15s;
}
.paper-cards > li:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); }
.venue-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 1px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.paper-cards .paper-title { font-size: 17px; }
.paper-cards .paper-venue { font-size: 14px; }

/* Series cards */
.series-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 8px 0 8px;
}
.series-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.series-card::after {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.series-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.series-card h3 { margin: 0; font-size: 17px; line-height: 1.4; }
.series-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-soft); }
.sc-count { font-size: 12px; font-weight: 600; color: var(--text-faint); }

/* Awards */
.awards { list-style: none; margin: 8px 0 0; padding: 0; }
.awards li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.awards .when { color: var(--text-faint); font-size: 14px; }
.medal { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); }
.medal.gold { background: #e3a008; box-shadow: 0 0 0 3px color-mix(in srgb, #e3a008 25%, transparent); }

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; gap: 24px; }
  .home-side { position: static; }
  .id-card { display: grid; grid-template-columns: auto 1fr; gap: 0 20px; text-align: left; align-items: center; }
  .id-card .avatar { grid-row: span 3; width: 104px; height: 104px; }
  .id-card h1 { margin: 0; }
  .icon-links { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .id-card { grid-template-columns: 1fr; text-align: center; }
  .id-card .avatar { grid-row: auto; margin: 0 auto; }
  .id-card h1 { margin-top: 12px; }
  .icon-links { grid-template-columns: 1fr 1fr; }
}

/* ---------- animation play / scrub bar (assets/anim.js) ---------- */
.anim-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-faint);
}
.anim-bar button {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.anim-bar button:hover { border-color: var(--accent); }
.anim-bar input[type="range"] { flex: 1; min-width: 80px; }
.anim-bar .anim-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- taxonomy: category + tags, related posts (assets/posts.js) ---------- */
.post-tax { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.post-tax .cat {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}
.tag { color: var(--text-faint); font-size: 13px; }
.tag:hover { color: var(--accent); text-decoration: none; }

.related {
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.related h2 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; }
.related h3 { margin: 8px 0 4px; font-size: 14px; color: var(--text-soft); }
.related ul { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.related li { padding: 4px 0; }
.related li .kind { margin-left: 4px; vertical-align: 1px; }
.link-card {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
}
.link-card[hidden] { display: none; }
.link-card .kind { justify-self: start; }
.link-card .lc-cat { color: var(--accent); font-size: 12px; }
.link-card b { font-size: 15px; color: var(--text); }
.link-card .lc-desc { color: var(--text-soft); }
.link-card > .kind + .lc-cat { margin-top: -4px; }
