:root {
  /* ── palette ── */
  --bg: #fcfcfa;
  --fg: #1a2028;
  --muted: #5b6572;
  --card: #ffffff;
  --line: #e4e6e9;
  --accent: #0b6e6e;
  --accent-soft: #e3f1f0;
  --code-bg: #f2f3f4;

  /* ── type scale: the ONE global hierarchy (single source of truth) ──
     Every text element below maps onto one of these levels. Don't invent a
     one-off size in a component; pick the level it belongs to.
       L0  hero      — page headline, used once
       L1  --fs-h2   — section title (h2.sec): the 6 pillars
       kicker        — small label above a title (eyebrow), always uppercase accent
       L2  --fs-h3   — card / block / timeline / sub-block title
       lead          — a lead paragraph directly under a title
       body (17px)   — running text
       L3  --fs-sm   — card body, list detail, captions
       fine          — footnotes, notes, footer, meta */
  --fs-hero: 2.6rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.08rem;
  --fs-lead: 1.12rem;
  --fs-sm: .92rem;
  --fs-fine: .86rem;
  --fs-kicker: .76rem;

  /* ── spacing rhythm ── */
  --sp-sec: 60px;     /* section vertical padding */
  --gap: 18px;        /* card-grid gutter */
  --sp-stack: 14px;   /* default gap between stacked paragraphs */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --fg: #e8eaed;
    --muted: #9aa4b0;
    --card: #191d24;
    --line: #2a2f38;
    --accent: #4fc3bd;
    --accent-soft: #16302f;
    --code-bg: #1f242c;
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* bilingual: paired .en/.zh elements, html[data-lang] decides visibility */
html[data-lang="zh"] .en { display: none !important; }
html:not([data-lang="zh"]) .zh { display: none !important; }
#langToggle {
  cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 4px 14px; font-size: var(--fs-fine); font-weight: 600;
  margin-left: 22px; vertical-align: baseline;
}
#langToggle:hover { color: var(--accent); border-color: var(--accent); }

/* marketplace mode: utm_source=upwork/fiverr hides direct contact (platform policy);
   .platform links (Upwork profile, GitHub) stay visible in all modes */
html[data-nocontact] .direct { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 17px;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══ shared hierarchy primitives — everything reuses these, no per-place forks ═══ */
/* L2 title: one size for every card / block / sub-block heading */
.card h3, .how h3, .focus h3, .caps h3, .finance h3, .tl-card h3 {
  font-size: var(--fs-h3); font-weight: 700; color: var(--fg); letter-spacing: -.005em;
}
/* kicker: one eyebrow treatment everywhere a small label sits above a title */
.focus .k, .card .dir, .engage-label {
  display: block; font-size: var(--fs-kicker); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px;
}

/* header */
header.site {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; justify-content: space-between; align-items: baseline; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); letter-spacing: .01em; }
nav a { margin-left: 22px; color: var(--muted); font-size: .95rem; }
nav a:hover { color: var(--accent); text-decoration: none; }

/* hero (L0) */
.hero { padding: 84px 0 64px; }
.hero h1 { font-size: var(--fs-hero); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.sub { color: var(--muted); font-size: var(--fs-lead); max-width: 640px; }
.hero .cta { margin-top: 30px; }
.cta a.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: .98rem;
}
.cta a.btn:hover { opacity: .9; text-decoration: none; }
.cta a.ghost { margin-left: 16px; color: var(--muted); font-size: .98rem; }

/* sections (L1) */
section { padding: var(--sp-sec) 0; border-top: 1px solid var(--line); }
h2.sec { font-size: var(--fs-h2); margin-bottom: 10px; letter-spacing: -.01em; }
p.sec-sub { color: var(--muted); margin-bottom: 32px; max-width: 620px; }

/* case cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.card a.body { color: var(--fg); padding: 20px; display: block; flex: 1; }
.card a.body:hover { text-decoration: none; }
.card .thumb { aspect-ratio: 16/9; background: var(--accent-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: var(--fs-sm); }
.card .dir { color: var(--muted); }   /* case-card kicker stays muted (a tag, not a call-out) */

/* how i work */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); }
.how div {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
}
.how h3 { margin-bottom: 8px; }
.how h3 .n { color: var(--accent); font-family: ui-monospace, monospace; margin-right: 8px; }
.how p { color: var(--muted); font-size: var(--fs-sm); }

/* focus areas (3 directions) */
.focus { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.focus > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.focus h3 { margin: 4px 0 8px; }
.focus p { color: var(--muted); font-size: var(--fs-sm); }
.focus .pain { color: var(--fg); font-size: var(--fs-sm); margin-top: 10px; font-style: italic; opacity: .85; }

/* capabilities menu (card grid — ordered high-depth first) */
.caps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--gap); }
.caps li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 16px; }
.caps .ic { display: block; width: 26px; height: 26px; margin-bottom: 12px; color: var(--accent); }
.caps .ic svg { width: 100%; height: 100%; display: block; }
.caps h3 { margin-bottom: 6px; }
.caps p { color: var(--muted); font-size: var(--fs-sm); }
.capscta { color: var(--muted); max-width: 640px; font-size: var(--fs-sm); }

/* who I am / trust bio */
.bio p { max-width: 680px; color: var(--fg); margin-bottom: 16px; }
.bio .lead { font-size: var(--fs-lead); }
.bio strong { color: var(--accent); font-weight: 600; }

/* career timeline (visual rail + nodes + cards) */
.timeline { list-style: none; position: relative; margin: 30px 0 8px; padding: 0 0 0 32px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--line)); }
.timeline > li { position: relative; margin-bottom: 16px; }
.timeline > li::before {
  content: ""; position: absolute; left: -32px; top: 17px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-sizing: border-box;
}
.tl-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; }
.tl-when {                              /* date chip (kicker-family, chip form) */
  display: inline-block; font-family: ui-monospace, monospace; font-size: var(--fs-fine); font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 9px; margin-bottom: 9px;
}
.tl-card h3 { margin: 0; }               /* L2 title — the emphasis (能力主干) */
.tl-co { color: var(--muted); font-size: var(--fs-fine); margin: 9px 0 0; padding-left: 12px; border-left: 2px solid var(--accent-soft); } /* 公司:独立层 */
.tl-body { color: var(--muted); font-size: var(--fs-sm); margin: 10px 0 0; max-width: 640px; } /* 正文 */
.timeline > li.mile .tl-card { background: transparent; border: 0; padding: 3px 0; }
.timeline > li.mile h3 { font-size: var(--fs-sm); color: var(--accent); }   /* milestone — de-emphasized sub-level */
.timeline > li.mile .tl-body { margin-top: 4px; }
@media (max-width: 560px) { .timeline { padding-left: 28px; } .tl-card { padding: 13px 15px; } }

/* Working together — three groups: terms / payments / start.
   .engage-label is the group kicker; it carries extra top space to separate groups. */
.engage-label { margin: 38px 0 12px; }
.engage-label:first-of-type { margin-top: 0; }
.terms { list-style: none; padding: 0; margin: 0; max-width: 660px; }
.terms li { position: relative; padding: 0 0 10px 26px; color: var(--fg); font-size: var(--fs-sm); }
.terms li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.finance { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 18px 20px; max-width: 680px; }
.finance h3 { margin-bottom: 8px; }
.finance p { color: var(--muted); font-size: var(--fs-sm); margin-bottom: 10px; }
.finance > p:first-of-type { margin-bottom: 14px; }
.finance .fine { font-size: var(--fs-fine); opacity: .9; margin-top: 12px; margin-bottom: 0; }
/* three-document accordion (native <details>, no JS) */
.finance details { border-top: 1px solid var(--line); }
.finance details:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.finance summary {
  cursor: pointer; list-style: none; display: flex; align-items: center;
  padding: 11px 0; font-size: var(--fs-sm); font-weight: 600; color: var(--fg);
}
.finance summary::-webkit-details-marker { display: none; }
.finance summary::after { content: "+"; margin-left: auto; padding-left: 12px; color: var(--accent); font-weight: 700; font-size: 1.1rem; }
.finance details[open] summary::after { content: "–"; }
.finance summary:hover { color: var(--accent); }
.finance details > p { margin: 2px 0 12px; font-size: var(--fs-sm); }

/* contact (inside #engage · Start here) — systematic stack spacing, no inline margins.
   margin-BOTTOM keeps stacking order-independent, so it never overrides the
   .engage-label group's top spacing (which is a lower-specificity rule). */
.contact .platform { margin-top: 16px; }
.contact p { max-width: 620px; }
.contact .direct > p { margin-bottom: var(--sp-stack); }
.contact .mail { font-size: 1.2rem; font-weight: 600; margin: 2px 0 var(--sp-stack); }

/* contact form */
.msgform {
  max-width: 560px; margin: 16px 0 8px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 12px;
}
.msgform textarea, .msgform button, .msgform .note { grid-column: 1 / -1; }
@media (max-width: 520px) { .msgform { grid-template-columns: 1fr; } }
.msgform input, .msgform textarea {
  width: 100%; font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px;
}
.msgform textarea { min-height: 120px; resize: vertical; }
.msgform input:focus, .msgform textarea:focus { outline: none; border-color: var(--accent); }
.msgform button {
  justify-self: start; background: var(--accent); color: #fff; border: 0;
  border-radius: 8px; padding: 11px 24px; font-weight: 600; font-size: .98rem; cursor: pointer;
}
.msgform button:hover { opacity: .9; }
.msgform button:disabled { opacity: .55; cursor: default; }
.msgform .note { color: var(--muted); font-size: var(--fs-fine); min-height: 1.2em; margin: 0; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: var(--fs-fine); }

/* case study pages */
article.case { padding: 56px 0 24px; }
article.case h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 10px; }
article.case p.lede { color: var(--muted); font-size: var(--fs-lead); margin-bottom: 8px; }
.tags { margin: 18px 0 8px; }
.tags span {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: 3px 10px; font-size: .8rem; font-weight: 600;
  margin: 0 8px 8px 0;
}
article.case h2 { font-size: 1.3rem; margin: 40px 0 12px; }
article.case p, article.case li { color: var(--fg); }
article.case ul { padding-left: 22px; margin: 12px 0; }
article.case li { margin-bottom: 8px; }
article.case .muted { color: var(--muted); }
figure { margin: 26px 0; }
figure img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
figure figcaption { color: var(--muted); font-size: var(--fs-fine); margin-top: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.proof {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 18px 20px; margin: 26px 0;
}
.proof strong { color: var(--accent); }
code { background: var(--code-bg); border-radius: 5px; padding: 2px 6px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.back { display: inline-block; margin: 24px 0 56px; color: var(--muted); font-size: var(--fs-sm); }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: var(--fs-sm); }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
th { background: var(--code-bg); }
.tablewrap { overflow-x: auto; }
