@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/IBM-Plex-Sans-Latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "WenKai Name";
  src: url("/assets/fonts/LXGW-WenKai-Name.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+6C88, U+88D4, U+9A81;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #242424;
  --body: #454545;
  --muted: #676767;
  --line: #e5e5e5;
  --link: #252525;
  --social-hover: #f0f0f0;
  --focus: #242424;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-name-zh: "WenKai Name", "Kaiti SC", KaiTi, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
  scrollbar-color: #bcbcbc var(--paper);
  scrollbar-width: thin;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.7; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--link); }
button { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; border-radius: 2px; }
::selection { background: #e8e8e8; color: var(--ink); }
[hidden] { display: none !important; }
svg { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, p { margin: 0; }
h1, h2, .entry-title { text-wrap: balance; }
.page { width: min(1088px, calc(100% - 96px)); margin-inline: auto; }
.page--home { min-height: 100svh; display: flex; flex-direction: column; }
.page--home main { flex: 1; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 2; background: var(--paper); padding: 10px 18px; color: var(--link); }
.skip-link:focus { top: 16px; }

.site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; min-height: 112px; }
.header-identity, .header-navigation { display: flex; align-items: center; }
.header-identity { gap: 20px; }
.header-navigation { gap: 20px; justify-content: flex-end; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; text-decoration: none; }
.wordmark-icon { display: block; flex: none; filter: invert(1) brightness(1.2); }
.wordmark-image { display: block; min-width: 0; width: 152px; height: auto; }
.home-welcome {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: var(--paper);
}
.home-welcome-wordmark {
  width: min(76vw, 540px);
  visibility: hidden;
}
.home-welcome-wordmark > svg { display: block; width: 100%; height: auto; }
.home-welcome[data-playing] .home-welcome-wordmark { visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  .home-welcome { display: none; }
}

.social-links { position: relative; display: flex; align-items: center; flex-shrink: 0; padding-inline: 4px; }
.social-link { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); }
.social-link:hover, .social-link:focus-visible { color: var(--ink); background: var(--social-hover); }
.social-link svg { width: 22px; height: 22px; }
.social-feedback { position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; width: max-content; max-width: min(264px, calc(100vw - 40px)); font-size: 13px; }
.social-feedback:not(:empty) { padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
.social-feedback input { display: block; width: 100%; margin-top: 4px; padding: 4px 6px; border: 1px solid var(--line); color: var(--ink); font: inherit; }
.site-header nav { display: flex; gap: 22px; align-items: center; }
.site-header nav a { position: relative; padding-block: 10px; white-space: nowrap; font-size: 14px; text-decoration: none; color: var(--body); }
.site-header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 7px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease); }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a:hover::after, .site-header nav a[aria-current="page"]::after { transform: scaleX(1); }
.language-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border-left: 1px solid var(--line); padding-left: 20px; white-space: nowrap; text-decoration: none; font-size: 13px; color: var(--muted); }
.language-button:hover { color: var(--link); }

.profile-intro, .home-section { display: grid; grid-template-columns: clamp(160px, 19vw, 224px) minmax(0, 1fr); align-items: start; gap: clamp(40px, 7vw, 100px); }
.profile-intro { padding-block: clamp(32px, 5vw, 64px) clamp(32px, 4vw, 52px); }
.profile-avatar { display: block; width: min(100%, 176px); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.profile-copy { container-type: inline-size; }
h1 { font-size: clamp(38px, 4.1vw, 48px); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 28px; }
.profile-copy h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px clamp(8px, 2.1cqi, 20px); margin: 0; font-size: clamp(19px, 6.7cqi, 48px); line-height: 1.18; }
.profile-name-en { letter-spacing: -0.02em; }
.profile-name-zh { font-family: var(--font-name-zh); font-weight: 400; line-height: 1.25; letter-spacing: 0.025em; white-space: nowrap;}
.profile-bio { max-width: 60ch; margin-top: 16px; color: var(--body); font-size: 17px; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-line; }
.home-section { row-gap: 24px; padding-block: clamp(24px, 4vw, 40px); border-top: 1px solid var(--line); }
.home-section:last-child { padding-bottom: 0; }
.home-section h2 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.project-comparison {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-comparison figure { margin: 0; }
.project-comparison img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1128 / 488;
  object-fit: contain;
  border: 1px solid var(--line);
  filter: grayscale(1);
}
.project-comparison figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.skill-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; line-height: 1.5; }
.skill-legend li { display: flex; align-items: center; gap: 6px; }
.skill-level-marker {
  flex: none;
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.skill-level-marker[data-level="proficient"] { border-width: 4px; }
.skill-groups { display: grid; gap: 20px; }
.skill-group + .skill-group { padding-top: 18px; border-top: 1px solid var(--line); }
.skill-group h3 { margin: 0 0 10px; color: var(--body); font-size: 14px; font-weight: 600; line-height: 1.5; }
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.skill-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: background-color 160ms var(--ease);
}
.skill-icon { flex: none; object-fit: contain; }
.skill-level-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) {
  .skill-label:hover { background-color: var(--social-hover); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .skill-icon { transition: transform 160ms var(--ease); }
  .skill-label:hover .skill-icon { transform: translateY(-2px); }
}

.intro-lead { max-width: 540px; font-size: 19px; line-height: 1.7; color: var(--body); }

.entry { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.entry + .entry { border-top: 0; }
.entry-link { display: flex; align-items: flex-start; gap: 24px; list-style: none; padding-block: 16px 19px; }
.entry-link { text-decoration: none; }
.entry-copy { display: block; flex: 1; min-width: 0; }
.entry-title { display: block; font-size: 17px; font-weight: 500; line-height: 1.55; }
.entry-description { display: block; font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 5px; }
.entry-date { color: var(--muted); font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.home-entry { min-height: 44px; gap: 16px; padding-block: 0; }
.home-entry svg { margin-top: 4px; }
.home-entry:is(:hover, :focus-visible) .entry-title { text-decoration: underline; }
.home-now-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: clamp(18px, 3vw, 32px); }
.home-now { max-width: 60ch; color: var(--body); line-height: 1.85; }
.home-now-sketch { display: block; width: clamp(176px, 19vw, 236px); height: auto; }
.project-facts { margin: 24px 0; display: flex; gap: 48px; font-size: 13px; }
.project-facts dt { color: var(--muted); margin-bottom: 3px; }
.project-facts dd { margin: 0; color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--link); font-size: 14px; }
.note-signature { font-size: 18px; color: var(--ink); padding-top: 4px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 92px; padding-block: 24px 36px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.site-footer a { display: inline-flex; align-items: center; gap: 8px; padding-block: 8px; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.article-page { max-width: 680px; padding-top: clamp(26px, 5vw, 54px); }
.article-page header { margin-bottom: 32px; }
.article-page header time { display: block; margin-top: 16px; font-size: 13px; color: var(--muted); }
.article-page > .text-link { margin-bottom: 24px; }
.article-prose { color: var(--body); line-height: 1.85; overflow-wrap: anywhere; }
.article-prose > * + * { margin-top: 1em; }
.article-prose :is(h2, h3) { color: var(--ink); line-height: 1.4; }
.article-prose h2 { font-size: 22px; }
.article-prose h3 { font-size: 18px; }
.article-prose a { color: var(--link); }
.article-prose img { max-width: 100%; height: auto; }
.article-prose pre { overflow-x: auto; padding: 16px; }

html[lang="zh-CN"] h1 { letter-spacing: 0; font-weight: 500; }
html[lang="zh-CN"] .intro-lead { line-height: 1.9; font-size: 18px; }

@media (max-width: 820px) {
  .page { width: calc(100% - 48px); }
  .site-header { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 8px; padding-block: 20px 8px; }
  .header-identity, .header-navigation { justify-content: space-between; }
  .profile-intro, .home-section { column-gap: 40px; }
}

@media (max-width: 600px) {
  .profile-intro, .home-section { grid-template-columns: minmax(0, 1fr); }
  .profile-intro { gap: 18px; padding-block: 26px 28px; }
  .home-section { gap: 22px; }
  .home-now-content { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .home-now-sketch { width: min(200px, 100%); justify-self: center; }
  .profile-avatar { width: min(30vw, 128px); }
  .project-comparison { grid-template-columns: minmax(0, 1fr); }
  .profile-bio { font-size: 16px; }
  .site-footer { margin-top: 48px; }
}

@media (max-width: 480px) {
  .page { width: calc(100% - 40px); }
  .header-identity { gap: 8px; }
  .header-navigation { gap: 12px; }
  .wordmark { gap: 8px; }
  .wordmark-icon { width: 22px; height: 22px; }
  .wordmark-image { width: clamp(104px, 31vw, 134px); }
  .social-links { padding-inline: 0; }
  .social-link { width: 40px; height: 44px; }
  .social-link svg { width: 20px; height: 20px; }
  .site-header nav { gap: clamp(10px, 3vw, 16px); }
  .site-header nav a { font-size: 13px; }
  .language-button { padding-left: 10px; font-size: 12px; }
  h1 { font-size: 39px; margin-bottom: 24px; }
  .intro-lead { font-size: 17px; line-height: 1.8; }
  .entry-title { font-size: 16px; }
  .entry-description { font-size: 13px; }
  .entry-date { display: none; }
  .project-facts { gap: 30px; flex-wrap: wrap; }
  .site-footer { padding-bottom: 28px; }
}

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