:root {
  --paper: #f3f2f2;
  --paper-bright: #faf9f6;
  --ink: #201f1d;
  --soft-ink: rgba(32, 31, 29, .72);
  --faint-ink: rgba(32, 31, 29, .44);
  --rule: rgba(32, 31, 29, .16);
  --gold: #b68235;
  --gold-dark: #7d5411;
  --focus: #9e6210;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; }
body { margin: 0; background: #e9e8e7; color: var(--ink); font-family: "Lora", Georgia, serif; -webkit-font-smoothing: antialiased; }
*, *::before, *::after { box-sizing: border-box; }
section[id], footer[id] { scroll-margin-top: 78px; }
a { color: inherit; text-underline-offset: 4px; }
button, a { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: rgba(182, 130, 53, .28); }

.site-shell { min-height: 100vh; background: var(--paper); }
.site-shell[data-lang="zh"] { font-family: "Noto Serif SC", "Songti SC", STSong, serif; }
.site-shell [lang="en"] { font-family: "Lora", Georgia, serif; }
.site-shell [lang="zh"] { font-family: "Noto Serif SC", "Songti SC", STSong, serif; letter-spacing: .015em; }
.site-shell[data-lang="zh"] .body-copy { font-family: "Noto Serif SC", "Songti SC", STSong, serif; line-height: 1.9; letter-spacing: .015em; }
.site-shell[data-lang="zh"] .main-nav,
.site-shell[data-lang="zh"] .resume-link,
.site-shell[data-lang="zh"] .button,
.site-shell[data-lang="zh"] .filter-button,
.site-shell[data-lang="zh"] .project-links,
.site-shell[data-lang="zh"] .footer-links { font-family: "Noto Serif SC", "Songti SC", STSong, serif; letter-spacing: .015em; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--rule); background: rgba(243, 242, 242, .96); }
.header-inner { width: min(1160px, calc(100% - 88px)); min-height: 66px; margin: 0 auto; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand img { width: 31px; height: 31px; object-fit: contain; mix-blend-mode: multiply; }
.brand span { font: 600 18px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: .04em; }
.main-nav { display: flex; align-items: baseline; gap: 21px; margin-left: auto; font: 400 13px/1 "Lora", Georgia, serif; }
.main-nav a { padding: 11px 0; color: var(--ink); text-decoration: none; transition: color 160ms ease; }
.main-nav a:hover { color: var(--gold-dark); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.resume-link { color: var(--gold-dark); font: 600 12px/1 "Cormorant Garamond", Georgia, serif; text-decoration: none; white-space: nowrap; }
.resume-link:hover { color: var(--gold); text-decoration: underline; }
.language-toggle, .menu-toggle { display: inline-grid; place-items: center; min-width: 40px; height: 34px; padding: 0 9px; border: 1px solid var(--rule); border-radius: 4px; background: transparent; cursor: pointer; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.language-toggle { font: 600 12px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: .08em; }
.language-toggle:hover, .menu-toggle:hover { border-color: var(--gold); color: var(--gold-dark); background: rgba(182, 130, 53, .06); }
.menu-toggle { display: none; }

main { width: min(1160px, calc(100% - 88px)); margin: 0 auto; }
.hero-section { display: grid; grid-template-columns: 1.45fr .55fr; gap: 64px; padding: 68px 0 48px; border-bottom: 1px solid var(--rule); }
.hero-copy { min-width: 0; }
.eyebrow { color: var(--gold); font: 600 10px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: .2em; text-transform: uppercase; }
.hero-section h1 { max-width: 850px; margin: 18px 0 0; white-space: pre-line; font: 400 clamp(56px, 7.1vw, 86px)/.96 "Cormorant Garamond", Georgia, serif; letter-spacing: -.025em; }
.site-shell[data-lang="zh"] .hero-section h1 { font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-size: clamp(44px, 5.8vw, 72px); font-weight: 500; line-height: 1.2; letter-spacing: .01em; }
.hero-intro { max-width: 64ch; margin: 27px 0 0; color: var(--soft-ink); font: 400 15px/1.78 "Lora", Georgia, serif; text-align: justify; }
.site-shell[data-lang="zh"] .hero-intro { font-size: 14px; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 15px; border: 1px solid var(--rule); border-radius: 4px; text-decoration: none; font: 600 13px/1.2 "Cormorant Garamond", Georgia, serif; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.button-primary { color: var(--gold-dark); border-color: var(--gold); }
.button-primary:hover { color: var(--paper-bright); background: var(--gold); }
.button-quiet:hover { border-color: var(--ink); background: rgba(32, 31, 29, .05); }
.hero-aside { align-self: end; padding-left: 28px; border-left: 1px solid var(--rule); }
.evidence-list { margin-top: 10px; }
.evidence-item { padding: 12px 0; border-top: 1px solid var(--rule); }
.evidence-item strong { display: block; color: var(--ink); font: 400 29px/1 "Cormorant Garamond", Georgia, serif; }
.evidence-item span { display: block; margin-top: 5px; color: var(--faint-ink); font: 400 11px/1.45 "Lora", Georgia, serif; }
.hero-aside-note { margin: 18px 0 0; color: var(--faint-ink); font: 400 12px/1.7 "Lora", Georgia, serif; }

.section-block { padding: 58px 0 0; }
.section-intro { display: grid; grid-template-columns: 1.06fr .94fr; gap: 44px; align-items: end; padding-bottom: 24px; }
.section-intro h2 { margin: 14px 0 0; white-space: pre-line; font: 400 60px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.02em; }
.site-shell[data-lang="zh"] .section-intro h2 { font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-size: 43px; font-weight: 500; line-height: 1.35; letter-spacing: .01em; }
.section-intro p { max-width: 64ch; margin: 0; color: var(--soft-ink); font: 400 14px/1.78 "Lora", Georgia, serif; text-align: justify; }
.site-shell[data-lang="zh"] .section-intro p { font-size: 13px; line-height: 1.95; }
.section-meta { display: flex; justify-content: space-between; padding: 0 5px 8px; color: var(--faint-ink); font: 400 11px/1 "Lora", Georgia, serif; font-feature-settings: "tnum"; }
.career-ledger, .project-ledger { border-top: 1px solid var(--rule); }
.career-entry { border-bottom: 1px solid var(--rule); }
.career-entry summary { display: grid; grid-template-columns: 70px minmax(170px, .82fr) minmax(280px, 1.45fr) 112px 22px; gap: 20px; align-items: start; padding: 24px 6px; cursor: pointer; list-style: none; transition: background-color 160ms ease; }
.career-entry summary::-webkit-details-marker { display: none; }
.career-entry summary:hover { background: rgba(32, 31, 29, .035); }
.career-year { padding-top: 4px; color: var(--gold); font: 400 13px/1 "Cormorant Garamond", Georgia, serif; }
.career-company strong { display: block; font: 600 26px/1.05 "Cormorant Garamond", Georgia, serif; }
.career-company em { display: block; margin-top: 4px; color: var(--faint-ink); font: 400 14px/1.45 "Cormorant Garamond", Georgia, serif; font-style: normal; }
.career-company small { display: block; margin-top: 9px; color: var(--gold); font: 600 9px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: .16em; text-transform: uppercase; }
.career-summary { color: var(--soft-ink); font: 400 13px/1.75 "Lora", Georgia, serif; }
.career-summary small { display: block; margin-top: 7px; color: var(--faint-ink); font: 400 10.5px/1.5 "Lora", Georgia, serif; }
.career-impact { padding-top: 3px; text-align: right; color: var(--gold-dark); font: 400 17px/1.2 "Cormorant Garamond", Georgia, serif; }
.career-impact small { display: block; margin-top: 5px; color: var(--faint-ink); font: 400 10px/1.35 "Lora", Georgia, serif; }
.career-chevron { display: grid; place-items: start end; padding-top: 3px; color: var(--gold); transition: transform 180ms var(--ease-out); }
.career-entry[open] .career-chevron { transform: rotate(180deg); }
.career-detail { display: grid; grid-template-columns: 70px minmax(280px, 1.45fr) 1fr; gap: 20px; padding: 0 6px 26px 96px; animation: detail-in 220ms var(--ease-out) both; }
.career-detail-meta { color: var(--faint-ink); font: 400 11px/1.7 "Lora", Georgia, serif; }
.career-detail ul { margin: 0; padding-left: 18px; color: var(--soft-ink); font: 400 13px/1.78 "Lora", Georgia, serif; }
.career-detail li + li { margin-top: 6px; }
.career-detail-stack { align-self: start; padding-top: 2px; color: var(--gold-dark); font: 400 11px/1.65 "Lora", Georgia, serif; }
@keyframes detail-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.projects-block { padding-top: 72px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 8px; }
.filter-button { min-height: 30px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 4px; background: transparent; color: var(--soft-ink); cursor: pointer; font: 400 12px/1 "Lora", Georgia, serif; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.filter-button:hover, .filter-button.is-active { color: var(--gold-dark); border-color: var(--gold); background: rgba(182, 130, 53, .04); }
.filter-count { align-self: center; margin-left: auto; color: var(--faint-ink); font: 400 11px/1 "Lora", Georgia, serif; }
.project-entry { display: grid; grid-template-columns: 70px minmax(180px, .82fr) minmax(280px, 1.35fr) 170px; gap: 20px; align-items: start; padding: 24px 6px; border-bottom: 1px solid var(--rule); transition: background-color 160ms ease; }
.project-entry:hover { background: rgba(32, 31, 29, .035); }
.project-year { padding-top: 4px; color: var(--gold); font: 400 13px/1 "Cormorant Garamond", Georgia, serif; }
.project-name h3 { margin: 0; font: 600 26px/1.05 "Cormorant Garamond", Georgia, serif; }
.project-name p { margin: 4px 0 0; color: var(--faint-ink); font: 400 14px/1.45 "Noto Serif SC", "Songti SC", serif; }
.project-name small { display: block; margin-top: 9px; color: var(--gold); font: 600 9px/1 "Cormorant Garamond", Georgia, serif; letter-spacing: .16em; text-transform: uppercase; }
.project-description { color: var(--soft-ink); font: 400 13px/1.8 "Lora", Georgia, serif; }
.site-shell[data-lang="zh"] .project-description { line-height: 1.95; }
.project-description span { display: block; margin-top: 7px; color: var(--faint-ink); font: 400 10.5px/1.55 "Lora", Georgia, serif; }
.project-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 8px 11px; padding-top: 3px; }
.project-links a, .project-status { display: inline-flex; align-items: center; gap: 4px; color: var(--gold-dark); font: 500 11px/1.4 "Cormorant Garamond", Georgia, serif; text-decoration: none; }
.project-links a:hover { color: var(--gold); text-decoration: underline; }
.project-status { color: var(--faint-ink); }
.case-link { width: 100%; justify-content: flex-end; margin-top: 3px; }

.split-block { display: grid; grid-template-columns: 170px 1fr; gap: 48px; padding-top: 72px; }
.section-side { display: flex; flex-direction: column; gap: 9px; color: var(--soft-ink); font: 400 12px/1.5 "Lora", Georgia, serif; }
.section-side .is-current { color: var(--gold-dark); }
.section-content h2, .education-block h2, .site-footer h2 { margin: 14px 0 0; font: 400 42px/1.1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.015em; }
.site-shell[data-lang="zh"] .section-content h2, .site-shell[data-lang="zh"] .education-block h2, .site-shell[data-lang="zh"] .site-footer h2 { font-family: "Noto Serif SC", "Songti SC", STSong, serif; font-size: 31px; font-weight: 500; line-height: 1.55; letter-spacing: .01em; }
.section-lead { max-width: 62ch; margin: 18px 0 0; color: var(--soft-ink); font: 400 13px/1.85 "Lora", Georgia, serif; }
.skill-table { margin-top: 26px; border-top: 1px solid var(--rule); }
.skill-row { display: grid; grid-template-columns: 190px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.skill-row strong { color: var(--soft-ink); font: 600 11px/1.5 "Cormorant Garamond", Georgia, serif; letter-spacing: .09em; text-transform: uppercase; }
.skill-row span { color: var(--ink); font: 400 13px/1.7 "Lora", Georgia, serif; }
.site-shell[data-lang="zh"] .skill-row strong, .site-shell[data-lang="zh"] .skill-row span { font-family: "Noto Serif SC", "Songti SC", STSong, serif; letter-spacing: .015em; }
.site-shell[data-lang="zh"] .skill-row span { line-height: 1.9; }

.education-block { padding: 72px 0 74px; }
.education-block > h2 { max-width: 680px; }
.education-list { margin-top: 28px; border-top: 1px solid var(--rule); }
.education-row { display: flex; justify-content: space-between; gap: 28px; padding: 20px 6px; border-bottom: 1px solid var(--rule); }
.education-row h3 { margin: 0; font: 600 24px/1.1 "Cormorant Garamond", Georgia, serif; }
.education-row p { margin: 6px 0 0; color: var(--soft-ink); font: 400 13px/1.6 "Lora", Georgia, serif; }
.education-meta { flex: 0 0 150px; color: var(--faint-ink); text-align: right; font: 400 12px/1.7 "Lora", Georgia, serif; font-feature-settings: "tnum"; }
.site-shell[data-lang="zh"] .education-row h3, .site-shell[data-lang="zh"] .education-row p { font-family: "Noto Serif SC", "Songti SC", STSong, serif; }

.site-footer { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; padding: 42px max(44px, calc((100vw - 1160px) / 2)) 38px; border-top: 1px solid var(--rule); background: #ecebea; }
.site-footer h2 { max-width: 610px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-top: 7px; }
.footer-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-dark); font: 400 14px/1.5 "Lora", Georgia, serif; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-note { grid-column: 1 / -1; margin: 22px 0 0; color: var(--faint-ink); font: 400 11px/1.5 "Lora", Georgia, serif; }

@media (max-width: 980px) {
  .header-inner, main { width: min(100% - 56px, 760px); }
  .main-nav { position: fixed; top: 66px; right: 0; left: 0; display: none; flex-direction: column; gap: 0; padding: 10px 28px 18px; border-bottom: 1px solid var(--rule); background: var(--paper); }
  .main-nav.is-open { display: flex; }
  .main-nav a { min-height: 44px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
  .menu-toggle { display: inline-grid; }
  .resume-link { display: none; }
  .hero-section { grid-template-columns: 1fr; gap: 34px; }
  .hero-aside { padding-left: 0; border-left: 0; }
  .section-intro { grid-template-columns: 1fr; gap: 22px; }
  .career-entry summary { grid-template-columns: 56px minmax(165px, .8fr) minmax(230px, 1.25fr) 90px 20px; gap: 14px; }
  .project-entry { grid-template-columns: 56px minmax(170px, .85fr) minmax(230px, 1.25fr) 130px; gap: 14px; }
  .split-block { grid-template-columns: 1fr; gap: 26px; }
  .section-side { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px 18px; }
  .section-side .eyebrow { width: 100%; }
  .site-footer { grid-template-columns: 1fr; padding-right: 28px; padding-left: 28px; }
  .footer-links { align-items: flex-start; }
}

@media (max-width: 680px) {
  .header-inner, main { width: calc(100% - 40px); }
  .header-inner { min-height: 60px; }
  .main-nav { top: 60px; padding-right: 20px; padding-left: 20px; }
  .brand span { font-size: 16px; }
  .brand img { width: 28px; height: 28px; }
  .hero-section { gap: 28px; padding: 40px 0 22px; }
  .hero-section h1 { font-size: 52px; }
  .site-shell[data-lang="zh"] .hero-section h1 { font-size: 38px; }
  .hero-intro { font-size: 14px; }
  .section-block, .split-block { padding-top: 50px; }
  #experience { padding-top: 34px; }
  .section-intro h2 { font-size: 48px; }
  .site-shell[data-lang="zh"] .section-intro h2 { font-size: 32px; }
  .career-entry summary { grid-template-columns: 45px 1fr 20px; gap: 12px; }
  .career-summary, .career-impact { grid-column: 2; text-align: left; }
  .career-impact { padding-top: 0; }
  .career-chevron { grid-column: 3; grid-row: 1; }
  .career-detail { grid-template-columns: 1fr; gap: 12px; padding: 0 6px 24px 57px; }
  .project-entry { grid-template-columns: 45px 1fr; gap: 12px; }
  .project-description, .project-links { grid-column: 2; }
  .project-links { justify-content: flex-start; }
  .filter-count { width: 100%; margin-left: 0; padding-top: 7px; }
  .skill-row { grid-template-columns: 1fr; gap: 5px; }
  .education-row { display: block; }
  .education-meta { margin-top: 9px; text-align: left; }
  .site-footer { padding-top: 36px; padding-bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
