/* ============================================================
   styles.css — Ming Mu personal site
   Design system: Claude UI kit bones + forest-green accent
   ============================================================ */

:root {
  /* Colors */
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f5f3ec;
  --ink: #1f1e1d;
  --ink-2: #3d3c3a;
  --ink-3: #73726c;
  --ink-4: #a5a49d;
  --line: rgba(31,30,29,0.14);
  --line-strong: rgba(31,30,29,0.26);
  --accent: #5f8f56;
  --accent-soft: #eaf1e6;
  --accent-ink: #2c4e26;

  /* Typography */
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", ui-serif, Georgia, "Songti SC", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Shape */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.88em; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px;
  background: rgba(250,249,245,0.7);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.nav--scrolled { border-bottom-color: var(--line); background: rgba(250,249,245,0.88); }
.nav-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nav-name-en { color: var(--ink); }
.nav-name-zh { color: var(--ink-3); font-weight: 500; font-family: var(--font-serif); }
.nav-links { display: inline-flex; align-items: center; gap: 6px; }
.nav-link { padding: 8px 14px; border-radius: var(--radius-pill); color: var(--ink-2); font-size: 14px; transition: background 150ms var(--ease); }
.nav-link:hover { background: var(--surface-2); }
.nav-agent {
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 500;
  transition: transform 150ms var(--ease), filter 150ms var(--ease);
}
.nav-agent:hover { filter: brightness(0.93); transform: translateY(-1px); }
.nav-resume {
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 500;
  font-family: var(--font-mono); letter-spacing: 0.02em;
  transition: transform 150ms var(--ease), filter 150ms var(--ease), background 150ms var(--ease);
}
.nav-resume:hover { filter: brightness(1.2); transform: translateY(-1px); }
.nav-lang { padding: 6px 12px; border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); border: 1px solid var(--line); margin-left: 6px; }
.nav-lang:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- Main layout ---------- */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 72px;
}
.section { margin: 72px 0; }
.section-head { margin-bottom: 28px; }
.section-title {
  font-size: 32px; font-weight: 600; letter-spacing: -0.018em; margin: 0 0 6px;
  font-family: var(--font-serif); color: var(--ink);
}
.section-sub { color: var(--ink-3); font-size: 15.5px; max-width: 64ch; margin: 0; }

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
.chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.chip--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.chip--resume {
  background: var(--ink) !important; color: var(--bg) !important; border-color: transparent !important;
  font-weight: 500;
}
.chip--resume:hover { filter: brightness(1.25); }
.tag {
  display: inline-block; font-size: 11.5px; color: var(--ink-3);
  background: var(--surface-2); padding: 3px 9px; border-radius: var(--radius-pill);
  font-family: var(--font-mono);
}
.cat-tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.cat-tag--lg { font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); padding: 4px 10px; border-radius: var(--radius-pill); }

/* ---------- Hero (shared) ---------- */
.hero { padding: 32px 0 28px; }
.hero-name { display: flex; align-items: baseline; gap: 14px; font-size: 14px; color: var(--ink-3); font-family: var(--font-mono); margin-bottom: 12px; }
.hero-name-en { color: var(--ink); font-weight: 600; font-size: 15px; font-family: var(--font-sans); }
.hero-name-sep { color: var(--ink-4); }
.hero-name-zh { color: var(--ink-2); font-family: var(--font-serif); font-size: 16px; }
.hero-name-big { font-family: var(--font-serif); font-size: 28px; font-weight: 500; color: var(--ink); margin-bottom: 20px; letter-spacing: -0.01em; }
.hero-name-zh-inline { color: var(--ink-3); font-weight: 400; }
.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.12; letter-spacing: -0.028em;
  font-weight: 600; color: var(--ink);
  margin: 0 0 14px; max-width: none; white-space: nowrap;
}
.hero-sub {
  font-size: 15.5px; line-height: 1.55; color: var(--ink-2);
  max-width: none; margin: 0 0 22px; text-wrap: pretty;
}

/* Hero variant: Agent-first (default) */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 18px; max-width: 720px; }
.door {
  position: relative;
  padding: 18px 20px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.door:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 10px 30px -18px rgba(31,30,29,0.2); }
.door-title { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 4px; font-family: var(--font-serif); }
.door-sub { color: var(--ink-3); font-size: 13px; }
.door-arrow { position: absolute; right: 18px; top: 18px; font-family: var(--font-mono); color: var(--ink-4); font-size: 16px; transition: transform 200ms var(--ease), color 200ms var(--ease); }
.door:hover .door-arrow { color: var(--accent); transform: translateX(3px); }
.door--agent { background: var(--accent-soft); border-color: transparent; }
.door--agent .door-title, .door--agent .door-sub { color: var(--accent-ink); }
.door--agent .door-arrow { color: var(--accent); }

/* Hero variant: Minimal */
.hero-contact { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* Hero variant: Terminal */
.hero--terminal .term {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #1f1e1d;
  margin: 24px 0;
}
.term-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #2a2926; border-bottom: 1px solid rgba(255,255,255,0.06); }
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-path { margin-left: 10px; color: #888681; font-family: var(--font-mono); font-size: 12px; }
.term-body {
  margin: 0; padding: 24px 28px; color: #dad7ce;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.65;
  white-space: pre-wrap;
}

/* Hero variant: Collage */
.hero--collage { position: relative; padding: 80px 0; overflow: hidden; border-radius: var(--radius-lg); }
.collage-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 8px; padding: 16px; opacity: 0.18; }
.collage-tile { border-radius: var(--radius-sm); display: flex; align-items: flex-end; padding: 12px; animation: collage-in 700ms var(--ease-out) both; }
.collage-label { font-family: var(--font-mono); font-size: 11px; color: #fff; letter-spacing: 0.02em; }
@keyframes collage-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.collage-front { position: relative; z-index: 1; padding: 0 20px; }

/* Hero variant: Big Numbers */
.hero--numbers { text-align: center; padding: 60px 0; }
.hero-name-small { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); margin-bottom: 36px; }
.big-num { font-family: var(--font-serif); font-size: clamp(120px, 16vw, 240px); line-height: 0.9; color: var(--ink); letter-spacing: -0.04em; font-weight: 600; animation: bignum 500ms var(--ease-out); }
@keyframes bignum { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.big-num-approx { font-size: 0.3em; color: var(--ink-3); vertical-align: super; margin-right: 0.2em; font-family: var(--font-mono); font-weight: 400; }
.big-num-label { font-size: 18px; color: var(--ink-2); margin-top: 24px; max-width: 40ch; margin-left: auto; margin-right: auto; }
.big-num-dots { display: inline-flex; gap: 10px; margin-top: 36px; }
.big-num-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background 200ms var(--ease), transform 200ms var(--ease); }
.big-num-dots .dot--on { background: var(--accent); transform: scale(1.3); }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 20px 0; margin-top: 36px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats--compact { margin-top: 20px; padding: 14px 0; }
.stat { padding: 6px 14px 6px 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--font-serif); font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1;
}
.stat-approx { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); font-weight: 400; margin-right: 3px; vertical-align: middle; }
.stat-label { margin-top: 6px; color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }

/* ---------- Forum list ---------- */
.forum {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.forum-row {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 28px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: background 150ms var(--ease);
  opacity: 0; transform: translateY(28px);
  cursor: pointer;
}
.forum-row.is-shown { opacity: 1; transform: translateY(0); transition: opacity 600ms var(--ease-out), transform 640ms cubic-bezier(.22,.61,.36,1), background 150ms var(--ease); }
@media (prefers-reduced-motion: reduce) { .forum-row { opacity: 1; transform: none; } }
.forum-row:last-child { border-bottom: 0; }
.forum-row:hover { background: var(--surface-2); }
.forum-row--pinned { background: rgba(95,143,86,0.04); }
.forum-row--pinned:hover { background: rgba(95,143,86,0.08); }

.forum-cell--marker { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.pin { font-size: 14px; }
.forum-cell--title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.forum-title {
  font-family: var(--font-serif); font-size: 19px; font-weight: 600;
  color: var(--ink); line-height: 1.3; letter-spacing: -0.012em;
  text-wrap: pretty;
}
.forum-row:hover .forum-title { color: var(--accent-ink); }
.forum-oneliner { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
.forum-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.forum-cell--meta { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.meta-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.meta-read { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

/* ---------- Demos ---------- */
.demos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.demo-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0; transform: translateY(8px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out), border-color 200ms var(--ease);
}
.demo-card.is-shown { opacity: 1; transform: translateY(0); }
.demo-card:hover { border-color: var(--line-strong); }
.demo-frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.demo-iframe { width: 100%; height: 100%; border: 0; transition: opacity 400ms var(--ease); background: var(--surface); }
.demo-skeleton { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-family: var(--font-serif); font-weight: 500; font-size: 18px; padding: 20px; text-align: center; }
.demo-skel-accent { position: absolute; top: 20px; left: 20px; width: 8px; height: 8px; border-radius: 50%; }
.demo-open {
  position: absolute; top: 12px; right: 12px;
  padding: 5px 11px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.92); color: var(--ink); font-size: 12px; font-family: var(--font-mono);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px -4px rgba(0,0,0,0.15);
}
.demo-card:hover .demo-open { opacity: 1; transform: translateY(0); }
.demo-body { padding: 18px 20px 22px; }
.demo-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em; }
.demo-desc { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin-bottom: 12px; }
.demo-url { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.demo-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ---------- Agent modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(31,30,29,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 180ms var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: 100%; max-width: 560px;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  box-shadow: 0 24px 80px -24px rgba(0,0,0,0.25);
  animation: rise 260ms var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--ink-3); font-size: 22px; line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-kicker { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 10px; }
.modal-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--ink); margin: 0 0 8px; letter-spacing: -0.015em; }
.modal-sub { color: var(--ink-3); font-size: 14.5px; margin: 0 0 20px; }
.modal-prompt {
  position: relative;
  background: #1f1e1d; border-radius: var(--radius);
  padding: 18px 20px; padding-right: 80px;
  margin-bottom: 20px;
}
.modal-prompt pre {
  margin: 0; color: #dad7ce; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.btn-copy {
  position: absolute; top: 14px; right: 14px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 12px; font-family: var(--font-mono);
}
.btn-copy:hover { background: rgba(255,255,255,0.18); }
.modal-endpoints { padding-top: 4px; }
.modal-endpoints-title { font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 8px; }
.endpoints-list { list-style: none; padding: 0; margin: 0; }
.endpoints-list li { padding: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.endpoints-list code { color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 4px; }
.endpoints-list a:hover code { background: var(--accent); color: #fff; }

/* ---------- Project detail page ---------- */
.project { max-width: 740px; margin: 0 auto; padding: 32px 0 60px; }
.back-link { display: inline-block; padding: 6px 0; color: var(--ink-3); font-size: 13.5px; font-family: var(--font-mono); margin-bottom: 24px; }
.back-link:hover { color: var(--accent); }
.project-meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; }
.project-title { font-family: var(--font-serif); font-size: clamp(34px, 4.5vw, 48px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); margin: 0 0 16px; text-wrap: pretty; }
.project-oneliner { color: var(--ink-2); font-size: 18px; line-height: 1.55; margin: 0 0 32px; max-width: 62ch; }
.project-facts { display: flex; flex-wrap: wrap; gap: 24px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.project-facts > div { display: flex; flex-direction: column; gap: 4px; }
.fact-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.fact-val { font-size: 14px; color: var(--ink); }

.preview {
  background: var(--accent-soft); border-radius: var(--radius-lg);
  padding: 28px 32px; margin-bottom: 48px;
}
.preview-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 14px; }
.preview-p { color: var(--ink); font-size: 16.5px; line-height: 1.65; margin: 0 0 14px; text-wrap: pretty; }
.preview-p:last-child { margin-bottom: 0; }

.longform { color: var(--ink-2); font-size: 16.5px; line-height: 1.72; }
.md-h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 600; color: var(--ink); letter-spacing: -0.018em; margin: 48px 0 18px; line-height: 1.2; text-wrap: pretty; }
.md-h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.012em; margin: 36px 0 14px; line-height: 1.3; }
.md-h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 24px 0 10px; }
.md-p { margin: 0 0 16px; text-wrap: pretty; }
.md-list { padding-left: 24px; margin: 0 0 18px; }
.md-list li { margin-bottom: 8px; }
.md-hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.md-bq { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 20px; margin: 20px 0; color: var(--ink); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16px; }
.md-code { background: var(--surface-2); padding: 2px 7px; border-radius: 4px; color: var(--ink); font-size: 0.88em; border: 1px solid var(--line); }
.md-table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 14.5px; }
.md-table th, .md-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md-table th { font-weight: 600; color: var(--ink); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.longform strong { color: var(--ink); font-weight: 600; }
.longform em { font-style: italic; color: var(--ink-2); }
.project-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ---------- About page ---------- */
.about { max-width: 740px; margin: 0 auto; padding: 32px 0 60px; }
.about-title { font-family: var(--font-serif); font-size: 56px; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); margin: 0 0 32px; }
.about-intro { margin-bottom: 32px; }
.about-intro-p { font-family: var(--font-serif); font-size: 19px; line-height: 1.65; color: var(--ink); margin: 0 0 16px; max-width: 62ch; text-wrap: pretty; }
.about-contact { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.about-section-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--ink); margin: 40px 0 18px; letter-spacing: -0.012em; }

.exp { margin-bottom: 28px; }
.exp-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin-bottom: 10px; }
.exp-role { font-weight: 600; color: var(--ink); font-size: 17px; }
.exp-company { color: var(--ink-2); font-size: 15px; }
.exp-period { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.exp-list { padding-left: 20px; margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.exp-list li { margin-bottom: 8px; }

.edu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.edu { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.edu-school { font-weight: 600; color: var(--ink); font-size: 15.5px; margin-bottom: 3px; }
.edu-degree { color: var(--ink-2); font-size: 14px; margin-bottom: 3px; }
.edu-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.skill-group { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.skill-cat { font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 12px; }
.skill-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  width: 280px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.25);
  padding: 14px 16px 16px;
  animation: rise 220ms var(--ease-out);
}
.tweaks-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tweaks-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.tweaks-close { width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); font-size: 18px; line-height: 1; }
.tweaks-close:hover { background: var(--surface-2); color: var(--ink); }
.tweaks-section { margin-top: 12px; }
.tweaks-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.tweaks-row { display: flex; gap: 8px; align-items: center; }
.tweaks-row.wrap { flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; transition: border-color 150ms var(--ease), transform 150ms var(--ease); }
.swatch:hover { transform: scale(1.06); }
.swatch--on { border-color: var(--ink); transform: scale(1.08); }
.tweak-btn { padding: 5px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); font-size: 12px; border: 1px solid transparent; }
.tweak-btn:hover { border-color: var(--line); }
.tweak-btn--on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ---------- Footer ---------- */
.footer {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 28px 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--ink-3);
}
.footer-l { font-family: var(--font-mono); }
.footer-r { display: flex; gap: 18px; }
.footer-r a:hover { color: var(--ink); }
.footer-r code { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { padding: 12px 20px; }
  .main { padding: 16px 20px 48px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { border-right: 0; padding: 10px 0; }
  .doors { grid-template-columns: 1fr; }
  .demos { grid-template-columns: 1fr; }
  .edu-list, .skills { grid-template-columns: 1fr; }
  .forum-row { grid-template-columns: 80px 1fr; gap: 14px; padding: 18px 18px; }
  .forum-cell--meta { grid-column: 2; text-align: left; flex-direction: row; gap: 12px; }
  .footer { padding: 22px 20px; flex-direction: column; align-items: flex-start; }
  .hero-tagline { font-size: clamp(30px, 8.5vw, 44px); white-space: normal; max-width: 16ch; }
  .hero-sub { max-width: 90%; }
}
@media (max-width: 560px) {
  .nav-links { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .nav-agent { padding: 6px 10px; font-size: 13px; }
  .nav-resume { display: none; }
  .nav-lang { padding: 4px 8px; font-size: 11px; margin-left: 2px; }
  .nav-name-zh { display: none; }
  .project-title { font-size: 30px; }
  .about-title { font-size: 42px; }
  .modal { padding: 24px 20px 20px; }
  .tweaks { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Desk pet 小爪 — knowledge-base chat widget
   ============================================================ */
.pet { position: fixed; right: 22px; bottom: 22px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

.pet-fab {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(31,30,29,0.22), 0 2px 6px rgba(31,30,29,0.14);
  animation: pet-bob 3.2s ease-in-out infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pet-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 16px 34px rgba(31,30,29,0.28); }
.pet-fab:active { transform: scale(0.97); }
.pet-mascot { display: block; }
@keyframes pet-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.pet-fab-pulse {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0.6; animation: pet-pulse 2.4s ease-out infinite; pointer-events: none;
}
@keyframes pet-pulse { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.5); opacity: 0; } }

.pet-panel {
  width: 360px; max-width: calc(100vw - 36px); height: 520px; max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(31,30,29,0.24); display: flex; flex-direction: column; overflow: hidden;
  animation: pet-in 0.2s ease;
}
@keyframes pet-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.pet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.pet-head-mascot { color: var(--accent); display: flex; }
.pet-head-text { flex: 1; min-width: 0; }
.pet-head-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.pet-head-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.pet-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.pet-close:hover { color: var(--ink); }

.pet-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.pet-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.pet-msg--assistant { align-self: flex-start; background: var(--surface-2); color: var(--ink-2); border-bottom-left-radius: 5px; }
.pet-msg--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.pet-msg--loading { color: var(--ink-3); font-style: italic; }

.pet-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.pet-input {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px;
  font: inherit; font-size: 13.5px; line-height: 1.4; max-height: 110px; background: var(--surface);
  color: var(--ink); outline: none; font-family: var(--font-sans);
}
.pet-input:focus { border-color: var(--accent); }
.pet-send {
  border: none; background: var(--accent); color: #fff; border-radius: 12px; padding: 9px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity 0.15s ease;
}
.pet-send:disabled { opacity: 0.4; cursor: not-allowed; }
.pet-agentline { padding: 0 14px 12px; font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }

@media (max-width: 520px) {
  .pet { right: 14px; bottom: 14px; }
  .pet-panel { height: min(560px, calc(100vh - 96px)); }
}

/* ============================================================
   Keyword ticker (hero marquee)
   ============================================================ */
.ticker {
  position: relative; width: 100%; max-width: 720px; margin: 20px auto 26px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track { display: flex; width: max-content; will-change: transform; animation: ticker-scroll 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  flex: none; margin-right: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 5px 13px; white-space: nowrap;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   Hero cinematic background montage
   ============================================================ */
.hero.hero--agent {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 22px; padding: 46px 44px 40px;
  box-shadow: 0 24px 60px rgba(31,30,29,0.16); border: 1px solid var(--line);
}
.hero.hero--agent > :not(.hero-bg) { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-bg-frame {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; will-change: opacity, transform; animation: heroMontage 24s ease-in-out infinite;
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(102deg, rgba(250,249,245,0.99) 0%, rgba(250,249,245,0.95) 38%, rgba(250,249,245,0.84) 66%, rgba(250,249,245,0.66) 100%);
}
@keyframes heroMontage {
  0%   { opacity: 0; transform: scale(1.06); }
  3%   { opacity: 0.42; }
  22%  { opacity: 0.42; }
  27%  { opacity: 0; transform: scale(1.13); }
  100% { opacity: 0; transform: scale(1.13); }
}
@media (max-width: 760px) {
  .hero.hero--agent { padding: 32px 22px 30px; border-radius: 18px; }
  .hero-scrim { background: linear-gradient(178deg, rgba(250,249,245,0.975) 0%, rgba(250,249,245,0.93) 55%, rgba(250,249,245,0.82) 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg-frame { animation: none !important; opacity: 0; transform: none; }
  .hero-bg-frame:first-child { opacity: 0.42; }
}

/* ============================================================
   Forum row hover icon — "drops out" of the card
   ============================================================ */
.forum-row { position: relative; }
.forum-icon {
  position: absolute; right: 22px; top: 50%; z-index: 2;
  transform: translateY(-50%) scale(0.5) rotate(-14deg);
  font-size: 30px; line-height: 1; opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  filter: drop-shadow(0 8px 12px rgba(31,30,29,0.22));
}
.forum-row:hover .forum-icon { opacity: 1; transform: translateY(20px) scale(1.2) rotate(12deg); }
@media (max-width: 760px) { .forum-icon { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .forum-icon { transition: opacity .2s ease; }
  .forum-row:hover .forum-icon { transform: translateY(-50%) scale(1) rotate(0); }
}

/* ============================================================
   Stay celebration — fireworks + Duolingo-style toast
   ============================================================ */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1400; pointer-events: none; }
.streak-toast {
  position: fixed; top: 18px; right: 18px; z-index: 1600;
  display: flex; align-items: center; gap: 12px; max-width: 330px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #58cc02;
  border-radius: 14px; padding: 12px 16px 12px 14px;
  box-shadow: 0 16px 40px rgba(31,30,29,0.22);
  animation: streakIn .5s cubic-bezier(.34,1.56,.64,1);
}
.streak-emoji { font-size: 30px; line-height: 1; animation: streakPop .6s ease; }
.streak-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.streak-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
@keyframes streakIn { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }
@keyframes streakPop { 0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ============================================================
   Page transition fade-in
   ============================================================ */
.page-fade { animation: pageFade 0.42s cubic-bezier(.22,.61,.36,1) both; }
@keyframes pageFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-fade { animation: none; } }

/* "See all cases" CTA (home teaser) */
.cases-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
  font-weight: 600; font-size: 14px; color: var(--accent-ink); cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: var(--radius-pill); text-decoration: none;
  transition: gap 0.2s ease, background 0.2s ease;
}
.cases-cta:hover { gap: 12px; background: #e2ecdd; }
.cases-cta-arrow { transition: transform 0.2s ease; }

/* Case image gallery (project detail pages) */
.case-gallery-title { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin: 28px 0 10px; }
.case-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; }
.case-shot { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.case-shot:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,30,29,0.14); }
.case-shot img { width: 100%; height: auto; display: block; }

/* Case media embeds (audio / video / iframe) */
.case-media { display: flex; flex-direction: column; gap: 20px; margin: 10px 0 4px; }
.case-audio { width: 100%; max-width: 540px; margin-top: 8px; display: block; }
.case-video { width: 100%; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); background: #000; display: block; }
.case-embed-wrap { position: relative; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.case-embed { width: 100%; height: 520px; border: 0; display: block; background: #fff; }
.case-embed-open { position: absolute; top: 10px; right: 10px; font-size: 11.5px; background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; text-decoration: none; color: var(--ink-2); }
.case-embed-open:hover { background: #fff; }

/* ============================================================
   CV / Resume page (inline preview + ← → switch)
   ============================================================ */
.cv { max-width: 920px; margin: 0 auto; }
.cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 4px; flex-wrap: wrap; }
.cv-title { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 40px); font-weight: 600; color: var(--ink); }
.cv-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.cv-tab { border: none; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13px; padding: 6px 16px; border-radius: var(--radius-pill); cursor: pointer; transition: background 0.18s ease, color 0.18s ease; }
.cv-tab--on { background: var(--accent); color: #fff; }
.cv-hint { font-size: 12.5px; color: var(--ink-4); font-family: var(--font-mono); margin-bottom: 18px; }
.cv-stage { display: flex; align-items: center; justify-content: center; gap: 12px; perspective: 1800px; }
.cv-arrow { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 22px; line-height: 1; cursor: pointer; transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
.cv-arrow:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); transform: scale(1.08); }
.cv-paper { width: 100%; max-width: 680px; aspect-ratio: 210 / 297; background: #fff; border-radius: 10px; box-shadow: 0 36px 80px rgba(31,30,29,0.24), 0 6px 16px rgba(31,30,29,0.10); overflow: hidden; animation: cvFlip 0.5s cubic-bezier(.22,.61,.36,1); will-change: transform, opacity; }
.cv-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
@keyframes cvFlip { from { opacity: 0; transform: translateY(14px) rotateY(8deg); } to { opacity: 1; transform: none; } }
.cv-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
@media (max-width: 640px) { .cv-arrow { display: none; } .cv-paper { max-width: 100%; } }
@media (prefers-reduced-motion: reduce) { .cv-paper { animation: none; } }

/* About — journey comic (4 panels + caption bubbles) */
.comic { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 720px; margin: 8px 0 26px; }
.comic-panel {
  position: relative; margin: 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(31,30,29,0.1);
  background: var(--surface-2); aspect-ratio: 1 / 1;
  animation: comicPop 560ms var(--ease-out) both;
}
.comic-panel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.comic-bubble {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; font-family: var(--font-serif); font-size: 14px; color: var(--ink);
  line-height: 1.4; box-shadow: 0 6px 16px rgba(31,30,29,0.12);
}
.comic-num {
  position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(31,30,29,0.2);
}
@keyframes comicPop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 560px) { .comic { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .comic-panel { animation: none; } }

/* ============================================================
   Feedback 2026-06-03 batch — Lucide icons, ticker categories,
   frontier-timeline chip, demo cover thumb
   ============================================================ */
/* Twemoji colorful emoji icons (rendered as <img>) */
.icon { display: inline-block; vertical-align: -0.18em; flex: none; }
.chip .icon { vertical-align: -0.16em; margin-right: 2px; }

/* keyword ticker — color-coded by category (tool / method / vibe) */
.ticker-item--tool { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.ticker-item--vibe { background: var(--surface-2); border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); font-family: var(--font-serif); font-style: italic; }
/* (method keeps the base white mono-chip look, so the three categories read distinctly) */

/* forum drop-out icon is now an SVG — color it, size it to match the old emoji prominence */
.forum-icon { color: var(--accent); }
.forum-icon .icon { width: 30px; height: 30px; }
.pin { color: var(--accent); line-height: 0; font-size: 0; }
.pin .icon { vertical-align: middle; }

/* "tech emerged → I adopted it" timeline chip on a case card */
.forum-frontier {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; width: fit-content;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: var(--radius-pill); padding: 3px 11px;
}
.forum-frontier .ff-tech { font-weight: 600; }
.forum-frontier .ff-date { color: var(--ink-3); }
.forum-frontier .ff-line { color: var(--accent); letter-spacing: -2px; opacity: .55; }
.forum-frontier .ff-mine { font-weight: 600; }
@media (max-width: 760px) { .forum-frontier .ff-line { display: none; } }

/* demo cover image (for GitHub-backed demos that can't be iframed) */
.demo-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ============================================================
   2026-06-08 — nav 简历 CTA + micro-interaction enrichment
   ============================================================ */
/* 简历 nav button: black, stands out */
.nav-cv {
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  transition: transform 160ms var(--ease), box-shadow 200ms var(--ease), background 160ms var(--ease);
}
.nav-cv:hover { background: #000; color: #fff; transform: translateY(-1px); box-shadow: 0 9px 22px -9px rgba(31,30,29,0.55); }

/* hero entrance — staggered fade-up so the opening feels alive on arrival */
@keyframes heroRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero--agent .hero-name,
.hero--agent .hero-tagline,
.hero--agent .hero-sub,
.hero--agent .ticker,
.hero--agent .doors,
.hero--agent .hero-contact { animation: heroRise 640ms var(--ease-out) both; }
.hero--agent .hero-name    { animation-delay: 40ms; }
.hero--agent .hero-tagline { animation-delay: 110ms; }
.hero--agent .hero-sub     { animation-delay: 190ms; }
.hero--agent .ticker       { animation-delay: 270ms; }
.hero--agent .doors        { animation-delay: 340ms; }
.hero--agent .hero-contact { animation-delay: 410ms; }

/* forum row hover: accent bar slides in on the left + a livelier icon pop */
.forum-row::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
  transform: scaleY(0); transform-origin: center; opacity: 0;
  transition: transform 300ms cubic-bezier(.22,.61,.36,1), opacity 200ms ease;
}
.forum-row:hover::before { transform: scaleY(1); opacity: 1; }
.forum-row:hover .forum-icon { transform: translateY(22px) scale(1.4) rotate(10deg); }
.forum-row:hover .forum-title { color: var(--accent-ink); }

/* chips: icon gently pops on hover */
.chip { transition: border-color 150ms var(--ease), transform 150ms var(--ease), background 150ms var(--ease); }
.chip .icon { transition: transform 220ms cubic-bezier(.34,1.56,.64,1); }
.chip:hover .icon { transform: scale(1.2) rotate(-5deg); }

@media (prefers-reduced-motion: reduce) {
  .hero--agent .hero-name, .hero--agent .hero-tagline, .hero--agent .hero-sub,
  .hero--agent .ticker, .hero--agent .doors, .hero--agent .hero-contact { animation: none; }
  .forum-row::before { display: none; }
}
