/* =====================================================================
   Yanlai Wu · sketchbook résumé
   Paper (light) + Blueprint (dark). Hand-drawn strokes come from rough.js
   (see main.js); everything here also degrades to CSS-only borders.
   ===================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "LXGW WenKai";
  src: url("../fonts/wenkai.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+2E80-2FFF, U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

/* ------------------------------------------------------------ tokens */
:root {
  --paper: #fbf8f1;
  --card: rgba(255, 253, 248, 0.86);
  --ink: #222226;
  --ink-2: #4a4a54;
  --pencil: #75757f;
  --grid: rgba(34, 34, 38, 0.045);
  --grid-major: rgba(34, 34, 38, 0.02);
  --accent: #2d5bd0;
  --accent-2: #cc4237;
  --marker: rgba(255, 210, 60, 0.55);
  --marker-soft: rgba(255, 210, 60, 0.24);
  --tape: rgba(212, 192, 140, 0.5);
  --shadow: rgba(34, 34, 38, 0.3);
  --on-ink: #fbf8f1;
  --ok: #2c9a62;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .22 0 0 0 0 .18 0 0 0 0 .12 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --f-display: "Fraunces", "LXGW WenKai", Georgia, "Songti SC", serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --f-hand: "Caveat", "LXGW WenKai", "Kaiti SC", "STKaiti", cursive;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 68px;
  color-scheme: light;
}

html[data-theme="blueprint"] {
  --paper: #0e2644;
  --card: rgba(160, 205, 255, 0.045);
  --ink: #eaf2ff;
  --ink-2: #bdd0ec;
  --pencil: #8eaad2;
  --grid: rgba(150, 196, 255, 0.085);
  --grid-major: rgba(150, 196, 255, 0.07);
  --accent: #7cc8ff;
  --accent-2: #ff9d8a;
  --marker: rgba(255, 210, 60, 0.3);
  --marker-soft: rgba(124, 200, 255, 0.12);
  --tape: rgba(190, 215, 255, 0.16);
  --shadow: rgba(124, 200, 255, 0.34);
  --on-ink: #0e2644;
  --ok: #5fe0a0;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .9 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* Chinese mode: handwritten-kai headings, roomier body */
html[data-lang="zh"] {
  --f-display: "LXGW WenKai", "Fraunces", "Kaiti SC", "STKaiti", serif;
  --f-hand: "LXGW WenKai", "Caveat", "Kaiti SC", cursive;
}

/* bilingual switch: both languages are in the DOM, one is shown */
html[data-lang="en"] .zh,
html[data-lang="zh"] .en { display: none !important; }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    var(--grain),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 240px 240px, 140px 140px, 140px 140px, 28px 28px, 28px 28px;
  font: 400 17px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s ease, color 0.4s ease;
}
html[data-lang="zh"] body { font-size: 16.5px; line-height: 1.85; letter-spacing: 0.01em; }

::selection { background: var(--marker); color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.hand { font-family: var(--f-hand); }

:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--on-ink);
  border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ rough layer */
[data-rough] { position: relative; isolation: isolate; }
.rough-svg { position: absolute; pointer-events: none; overflow: visible; z-index: -1; }
.rough-shadow { transition: opacity 0.3s ease; }
[data-shadow-hover] .rough-shadow { opacity: 0; }
[data-shadow-hover]:hover .rough-shadow { opacity: 1; }

/* CSS-only fallback when JS or rough.js is unavailable */
html:not(.js) [data-rough="box"],
html.no-rough [data-rough="box"] {
  border: 1.6px solid var(--ink);
  border-radius: 14px 9px 16px 8px / 9px 15px 10px 14px;
}
html:not(.js) .btn--primary,
html.no-rough .btn--primary { background: var(--ink); }
html:not(.js) [data-rough="circle"],
html.no-rough [data-rough="circle"] { border: 1.6px solid currentColor; border-radius: 50%; }

.ricon { display: block; width: 46px; height: 46px; color: var(--accent); flex: none; }
.ricon svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* ------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  transition: box-shadow 0.3s ease;
}
.nav.is-scrolled { box-shadow: 0 1px 0 color-mix(in srgb, var(--pencil) 35%, transparent); }
.nav__inner {
  width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto;
  height: var(--nav-h); display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand__mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  font: 700 19px/1 "Caveat", cursive; letter-spacing: 0.02em; padding-top: 2px;
}
.brand__name { font: 600 19px/1 var(--f-display); letter-spacing: -0.01em; }
html[data-lang="zh"] .brand__name { font-weight: 500; letter-spacing: 0.08em; font-size: 20px; }

.nav__links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav__link {
  padding: 8px 11px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  text-decoration-line: underline; text-decoration-style: wavy;
  text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 7px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.nav__link:hover { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--accent-2) 55%, transparent); }
.nav__link.is-active { color: var(--ink); text-decoration-color: var(--accent-2); }

.nav__tools { display: flex; align-items: center; gap: 6px; flex: none; }
.lang-btn {
  display: flex; align-items: center; gap: 5px; padding: 8px 8px;
  background: none; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--pencil);
}
.lang-btn__sep { opacity: 0.5; }
.lang-btn:hover { color: var(--ink-2); }
html[data-lang="en"] .lang-btn__opt[data-l="en"],
html[data-lang="zh"] .lang-btn__opt[data-l="zh"] {
  color: var(--ink);
  text-decoration: underline wavy var(--accent-2) 1.5px; text-underline-offset: 6px;
}
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink-2);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.3s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--marker-soft); }
.theme-btn:hover { transform: rotate(-14deg); }
.ui-icon { width: 20px; height: 20px; flex: none; }
.theme-btn__sun { display: none; }
html[data-theme="blueprint"] .theme-btn__sun { display: block; }
html[data-theme="blueprint"] .theme-btn__moon { display: none; }
.menu-btn { display: none; }
.nav__cv { margin-left: 4px; }

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress__bar {
  display: block; height: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border: 0; background: none; cursor: pointer;
  font: 600 15.5px/1.1 var(--f-body); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.3, 1.4);
}
.btn:hover { transform: translate(-1px, -2px) rotate(-0.8deg); }
.btn:active { transform: translate(0, 1px); }
.btn small { font-size: 11px; letter-spacing: 0.1em; opacity: 0.72; font-weight: 700; }
.btn--primary { color: var(--on-ink); }
.btn--small { padding: 9px 14px; gap: 6px; font-size: 14px; }
.btn--small .ui-icon { width: 17px; height: 17px; }

/* ------------------------------------------------------------ hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.9fr);
  gap: clamp(28px, 6vw, 84px); align-items: center;
  padding-block: clamp(36px, 6.5vw, 92px) clamp(28px, 4vw, 52px);
}
.hero__hello {
  display: flex; align-items: flex-end; gap: 6px; margin: 0 0 6px;
  font-size: 30px; line-height: 1; color: var(--accent-2);
  transform: rotate(-2deg); transform-origin: left bottom;
}
html[data-lang="zh"] .hero__hello { font-size: 22px; }
.hero__hello-arrow {
  width: 54px; height: 28px; margin-bottom: -16px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.hero__name {
  position: relative; display: inline-block; margin: 0;
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(56px, 8.6vw, 112px); line-height: 1; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 144;
}
.hero__name > .en, .hero__name > .zh { display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: 0.32em; }
.hero__name-alt {
  font-family: "LXGW WenKai", var(--f-display); font-weight: 500;
  font-size: 0.34em; letter-spacing: 0.06em; color: var(--ink-2);
}
html[data-lang="zh"] .hero__name { letter-spacing: 0.06em; font-weight: 500; }
html[data-lang="zh"] .hero__name-alt { font-family: "Fraunces", serif; font-weight: 500; letter-spacing: -0.01em; font-size: 0.32em; }
.hero__name-line { position: absolute; left: 0.04em; bottom: -0.16em; width: 58%; height: 14px; }

.hero__role {
  margin: 30px 0 0; color: var(--accent);
  font: 650 13.5px/1.5 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase;
}
html[data-lang="zh"] .hero__role { font-size: 15px; letter-spacing: 0.12em; }
.hero__tagline {
  margin: 14px 0 0; max-width: 21em;
  font: 500 clamp(24px, 2.7vw, 34px)/1.28 var(--f-display); letter-spacing: -0.012em;
}
html[data-lang="zh"] .hero__tagline { letter-spacing: 0.03em; line-height: 1.45; }
/* Chinese display lines only break at punctuation or explicit <wbr>, never mid-word */
html[data-lang="zh"] .hero__tagline,
html[data-lang="zh"] .sec-head__title,
html[data-lang="zh"] .contact__title { word-break: keep-all; overflow-wrap: anywhere; }
mark {
  color: inherit; padding: 0 0.1em;
  background: linear-gradient(100deg, transparent 0 1%, var(--marker) 2% 97%, transparent 98%) 0 66% / 100% 46% no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 1.1s cubic-bezier(0.6, 0.1, 0.2, 1) 0.5s;
}
.js [data-reveal]:not(.is-in) mark { background-size: 0% 46%; }
.hero__lede { margin: 18px 0 0; max-width: 36em; color: var(--ink-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.hero-meta {
  list-style: none; margin: 34px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.hero-meta__item { padding: 12px 14px 13px; background: var(--card); }
.hero-meta__label {
  display: block; color: var(--pencil);
  font: 650 11.5px/1.2 var(--f-body); letter-spacing: 0.13em; text-transform: uppercase;
}
html[data-lang="zh"] .hero-meta__label { font-size: 12.5px; letter-spacing: 0.1em; }
.hero-meta__value { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.42; font-weight: 500; }
.hero-meta__item:nth-child(3) .hero-meta__value > span::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 7px 1px 0; border-radius: 50%;
  background: var(--ok); animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

/* portrait: pencil sketch ⇄ photo, with a "detection box" */
.portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 410px); }
.portrait__frame {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.3, 1.3);
}
.portrait__frame:hover { transform: rotate(-1.5deg) scale(1.01); }
.portrait__frame::before {
  content: ""; position: absolute; inset: 3%; border-radius: 50%; background: var(--card);
}
.portrait__ring { position: absolute; inset: 0; border-radius: 50%; }
.portrait__photo, .portrait__sketch {
  position: absolute; inset: 3%; width: 94%; height: 94%; border-radius: 50%; object-fit: cover;
}
.portrait__photo {
  clip-path: circle(0% at 50% 42%);
  transition: clip-path 0.9s cubic-bezier(0.7, 0, 0.2, 1);
}
.portrait__sketch { transition: opacity 0.6s ease 0.2s; }
.portrait.is-photo .portrait__photo { clip-path: circle(72% at 50% 42%); }
.portrait.is-photo .portrait__sketch { opacity: 0; transition-delay: 0s; }
/* on the blueprint the sketch sits on a paper cut-out, like a drawing pinned to the plan */
html[data-theme="blueprint"] .portrait__frame::before { background: #f7f2e6; box-shadow: 0 0 0 6px rgba(247, 242, 230, 0.08); }

.detect { position: absolute; left: 25%; top: 9%; width: 50%; height: 55%; }
.detect__label {
  position: absolute; left: -1px; top: -25px; white-space: nowrap;
  padding: 4px 8px 5px; border-radius: 4px 4px 4px 0;
  background: var(--accent); color: var(--on-ink);
  font: 600 12px/1 var(--f-mono); letter-spacing: 0.02em;
}
.portrait__hint { margin-top: 12px; text-align: center; font-size: 21px; color: var(--pencil); }
html[data-lang="zh"] .portrait__hint { font-size: 16px; }

.annot { color: var(--accent-2); pointer-events: none; }
.annot svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.annot--me {
  position: absolute; right: -9%; top: -3%;
  display: flex; flex-direction: column-reverse; align-items: flex-end;
  font-size: 27px; line-height: 1; transform: rotate(7deg);
}
html[data-lang="zh"] .annot--me { font-size: 20px; }
.annot--me svg { width: 66px; height: 44px; margin-top: 2px; margin-right: 34px; }

/* ------------------------------------------------------------ stats */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
  margin-top: 4px;
}
.stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px; background: var(--card); }
.stat__num { font: 600 46px/1 var(--f-display); letter-spacing: -0.02em; font-family: "Fraunces", Georgia, serif; }
.stat__label { font-size: 15px; line-height: 1.35; font-weight: 600; }
.stat__sub { margin-top: 2px; font-size: 19px; line-height: 1.15; color: var(--accent-2); }
html[data-lang="zh"] .stat__sub { font-size: 15px; }

/* ------------------------------------------------------------ section heads */
.section { padding-top: clamp(64px, 9vw, 116px); }
.sec-head {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center;
  margin-bottom: clamp(28px, 4vw, 46px);
}
.sec-head__num {
  width: 46px; height: 46px; display: inline-grid; place-items: center;
  font-family: "Caveat", cursive; font-size: 25px; font-weight: 700; color: var(--accent-2);
}
.sec-head__kicker {
  color: var(--pencil);
  font: 650 13px/1 var(--f-body); letter-spacing: 0.18em; text-transform: uppercase;
}
html[data-lang="zh"] .sec-head__kicker { font-size: 14px; letter-spacing: 0.2em; }
.sec-head__title {
  grid-column: 1 / -1; margin: 16px 0 0; max-width: 20em;
  font: 600 clamp(32px, 4.6vw, 56px)/1.08 var(--f-display); letter-spacing: -0.022em;
}
html[data-lang="zh"] .sec-head__title { font-weight: 500; letter-spacing: 0.03em; line-height: 1.3; }
.sec-head__line { grid-column: 1 / -1; display: block; width: min(230px, 45%); height: 12px; margin-top: 10px; }
.sec-head__sub { grid-column: 1 / -1; margin: 14px 0 0; max-width: 40em; color: var(--ink-2); font-size: 18px; }

/* ------------------------------------------------------------ about */
.about {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: start;
}
.about__bio p { margin: 0 0 1.1em; color: var(--ink-2); font-size: 18px; }
.about__bio p:first-child { color: var(--ink); font-size: 20px; line-height: 1.6; }
html[data-lang="zh"] .about__bio p { font-size: 17px; }
html[data-lang="zh"] .about__bio p:first-child { font-size: 18.5px; line-height: 1.85; }
.about__bio strong { color: var(--ink); font-weight: 600; }
.about__bio em {
  font-style: normal; color: var(--ink);
  background: linear-gradient(transparent 62%, var(--marker-soft) 62%, var(--marker-soft) 94%, transparent 94%);
}

.note { padding: 30px 26px 22px; background: var(--card); transform: rotate(1.2deg); }
.note__tape {
  position: absolute; z-index: 2; top: -13px; left: 50%; width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--tape);
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0) ,
    repeating-linear-gradient(0deg, #000 0 3px, transparent 3px 4px);
}
.note__tape--right { left: auto; right: 18px; transform: rotate(7deg); }
.note__title { margin: 0 0 8px; font-size: 30px; line-height: 1.1; font-weight: 700; color: var(--accent-2); }
html[data-lang="zh"] .note__title { font-size: 22px; font-weight: 500; }
.note__list { list-style: none; margin: 0; padding: 0; }
.note__list li {
  position: relative; padding: 9px 0 9px 30px; font-weight: 500; line-height: 1.45;
  border-bottom: 1px dashed color-mix(in srgb, var(--pencil) 40%, transparent);
}
.note__list li:last-child { border-bottom: 0; }
.note__list li::before {
  content: "→"; position: absolute; left: 2px; top: 5px;
  font: 700 24px/1.2 "Caveat", cursive; color: var(--accent);
}

.subhead {
  display: flex; align-items: center; gap: 16px;
  margin: clamp(52px, 7vw, 80px) 0 24px;
  font: 600 27px/1.2 var(--f-display); letter-spacing: -0.01em;
}
html[data-lang="zh"] .subhead { font-weight: 500; font-size: 25px; letter-spacing: 0.04em; }
.subhead::after {
  content: ""; flex: 1; height: 2px; opacity: 0.45;
  background: repeating-linear-gradient(90deg, var(--pencil) 0 7px, transparent 7px 13px);
}

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.pillar { padding: 24px 22px 22px; background: var(--card); transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.3, 1.3); }
.pillar:hover { transform: translate(-2px, -3px) rotate(-0.4deg); }
.pillar__icon { margin-bottom: 14px; }
.pillar__title { margin: 0 0 8px; font: 600 20px/1.28 var(--f-display); }
html[data-lang="zh"] .pillar__title { font-weight: 500; font-size: 21px; letter-spacing: 0.03em; }
.pillar__desc { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.62; }
html[data-lang="zh"] .pillar__desc { font-size: 15px; line-height: 1.8; }

/* ------------------------------------------------------------ skills */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.skill { padding: 22px 22px 22px; background: var(--card); }
.skill__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.skill__icon { width: 38px; height: 38px; }
.skill__title { margin: 0; font: 600 19.5px/1.2 var(--f-display); }
html[data-lang="zh"] .skill__title { font-weight: 500; font-size: 20px; letter-spacing: 0.04em; }
.skill__note { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.skill__note::before { content: "★ "; color: var(--accent-2); }

.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block; padding: 5px 12px;
  font-size: 14px; font-weight: 500; line-height: 1.4;
  border: 1.5px solid color-mix(in srgb, var(--ink) 72%, transparent);
  border-radius: 16px 12px 18px 11px / 11px 18px 12px 16px;
  background: color-mix(in srgb, var(--paper) 65%, transparent);
}
.pill:nth-child(3n + 2) { border-radius: 12px 18px 13px 17px / 17px 12px 18px 13px; }
.pill:nth-child(3n) { border-radius: 18px 13px 15px 16px / 13px 16px 18px 12px; }
.pill--daily { background: var(--marker); border-color: var(--ink); }
.pill--quiet {
  padding: 3px 10px; font-size: 13px; color: var(--ink-2);
  border-color: color-mix(in srgb, var(--pencil) 65%, transparent);
}
.annot--daily {
  position: absolute; right: 18px; top: -15px; padding: 0 6px;
  font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--accent-2);
  background: var(--paper); transform: rotate(4deg);
}
html[data-lang="zh"] .annot--daily { font-size: 16px; font-weight: 500; }

/* ------------------------------------------------------------ timeline */
.tl { position: relative; list-style: none; margin: 0; padding: 0; }
.tl::before {
  content: ""; position: absolute; left: 195px; top: 10px; bottom: 10px; width: 2px; opacity: 0.5;
  background: repeating-linear-gradient(to bottom, var(--pencil) 0 7px, transparent 7px 13px);
}
.tl__item { display: grid; grid-template-columns: 180px 32px minmax(0, 1fr); align-items: start; margin-bottom: 26px; }
.tl__item:last-child { margin-bottom: 0; }
.tl__when {
  padding: 19px 18px 0 0; text-align: right;
  font-size: 23px; font-weight: 700; line-height: 1.15; color: var(--accent-2);
}
html[data-lang="zh"] .tl__when { font-size: 17px; font-weight: 500; font-family: "Caveat", "LXGW WenKai", cursive; }
.tl__dot { width: 16px; height: 16px; margin-top: 25px; justify-self: center; }
.tl__card { margin-left: 14px; padding: 22px 26px 20px; background: var(--card); }
.tl__role { margin: 0; font: 600 21px/1.3 var(--f-display); }
html[data-lang="zh"] .tl__role { font-weight: 500; font-size: 22px; letter-spacing: 0.03em; }
.tl__org { margin: 6px 0 14px; font-size: 15px; color: var(--ink-2); }
.tl__org strong { color: var(--ink); font-weight: 600; }
.tl__sep { margin: 0 8px; color: var(--pencil); }
.tl__bullets { list-style: none; margin: 0 0 16px; padding: 0; }
.tl__bullets li { position: relative; margin-bottom: 7px; padding-left: 22px; font-size: 16px; color: var(--ink-2); }
.tl__bullets li::before {
  content: ""; position: absolute; left: 3px; top: 0.78em; width: 9px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: rotate(-10deg);
}
.pills--small .pill { font-size: 12.5px; }

/* ------------------------------------------------------------ publications */
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.pub {
  display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px;
  padding: 22px 26px 18px 16px; background: var(--card);
}
.pub__idx { padding-top: 1px; text-align: center; font: 700 30px/1 "Caveat", cursive; color: var(--accent-2); }
.pub__title { margin: 0; max-width: 44em; font: 600 20px/1.36 var(--f-display); }
html[data-lang="zh"] .pub__title { font-weight: 500; font-size: 21px; letter-spacing: 0.02em; }
.pub__title a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.35s ease;
}
.pub__title a:hover { background-size: 100% 1.5px; }
.pub__orig { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--pencil); }
.pub__venue {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
  margin: 8px 0 0; font-size: 15px; color: var(--ink-2);
}
.pub__venue strong { color: var(--accent); font-weight: 600; }
.pub__year { font: 700 21px/1 "Caveat", cursive; color: var(--pencil); }
.pub__desc { margin: 8px 0 0; max-width: 60em; color: var(--ink-2); font-size: 15.5px; }
.pub__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pub__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pub__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14.5px; font-weight: 600; color: var(--accent); text-decoration: none;
}
.pub__link:hover { text-decoration: underline wavy currentColor 1.4px; text-underline-offset: 5px; }
.pub__link .ui-icon { width: 16px; height: 16px; }
.stamp {
  position: absolute; right: 22px; top: -15px; padding: 3px 12px 4px;
  font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--accent-2);
  background: var(--paper); transform: rotate(-4deg);
}
html[data-lang="zh"] .stamp { font-size: 15px; font-weight: 500; letter-spacing: 0.1em; }

/* ------------------------------------------------------------ education + honors */
.edu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.edu__schools { display: grid; gap: 20px; }
.school { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding: 22px 22px 20px; background: var(--card); }
.school__name { margin: 0; font: 600 21px/1.25 var(--f-display); }
html[data-lang="zh"] .school__name { font-weight: 500; font-size: 22px; letter-spacing: 0.05em; }
.school__degree { margin: 4px 0 0; font-size: 15.5px; font-weight: 600; }
.school__meta { margin: 4px 0 0; font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--accent-2); }
html[data-lang="zh"] .school__meta { font-size: 15.5px; font-weight: 500; }
.school__note { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }

.honors { padding: 24px 24px 10px; background: var(--card); }
.honors__title { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font: 600 21px/1.2 var(--f-display); }
html[data-lang="zh"] .honors__title { font-weight: 500; font-size: 22px; letter-spacing: 0.05em; }
.honors__icon { width: 38px; height: 38px; }
.honors__list { list-style: none; margin: 0; padding: 0; }
.honor {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 12px 0;
  border-top: 1px dashed color-mix(in srgb, var(--pencil) 45%, transparent);
}
.honor:first-child { border-top: 0; }
.honor__year { font: 700 22px/1.25 "Caveat", cursive; color: var(--accent-2); }
.honor__body strong { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.honor__name { display: block; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* ------------------------------------------------------------ contact */
.contact {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  padding-bottom: clamp(56px, 8vw, 100px);
}
.contact__text .sec-head__num { vertical-align: middle; margin-right: 12px; }
.contact__title {
  margin: 18px 0 0;
  font: 600 clamp(42px, 6.4vw, 78px)/1.02 var(--f-display); letter-spacing: -0.028em;
}
html[data-lang="zh"] .contact__title { font-weight: 500; letter-spacing: 0.04em; line-height: 1.2; }
.contact__sub { margin: 18px 0 0; max-width: 32em; font-size: 18px; color: var(--ink-2); }
.contact__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.ccard { padding: 30px 26px 16px; background: var(--card); transform: rotate(-1deg); }
.ccard__title { margin: 0 0 8px; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--accent-2); }
html[data-lang="zh"] .ccard__title { font-size: 22px; font-weight: 500; }
.ccard__list { margin: 0; }
.ccard__row {
  display: grid; grid-template-columns: 30px 118px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 11px 0; border-top: 1px dashed color-mix(in srgb, var(--pencil) 45%, transparent);
}
.ccard__row:first-child { border-top: 0; }
.ccard__icon { width: 28px; height: 28px; }
.ccard dt { font-size: 12.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pencil); }
html[data-lang="zh"] .ccard dt { font-size: 13.5px; letter-spacing: 0.06em; }
.ccard dd { margin: 0; font-size: 15.5px; font-weight: 500; overflow-wrap: anywhere; }
.ccard dd a { text-decoration: none; background: linear-gradient(var(--marker), var(--marker)) 0 100% / 100% 2px no-repeat; transition: background-size 0.25s ease; }
.ccard dd a:hover { background-size: 100% 100%; }

/* ------------------------------------------------------------ footer + toast */
.footer { padding-bottom: 34px; }
.footer__line { display: block; width: 100%; height: 10px; }
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding-top: 16px; font-size: 14px; color: var(--pencil);
}
.footer__copy { margin: 0; }
.footer__top { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.footer__top:hover { color: var(--ink); }
.footer__top .ui-icon { width: 16px; height: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; pointer-events: none;
  padding: 10px 18px; border-radius: 12px 9px 13px 10px;
  background: var(--ink); color: var(--on-ink); font-size: 14.5px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ reveal */
.js [data-reveal] { opacity: 0; translate: 0 16px; transition: opacity 0.7s ease, translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .nav__link { padding: 8px 8px; font-size: 14.5px; }
  .nav__inner { gap: 12px; }
}

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .nav__links {
    position: absolute; top: calc(var(--nav-h) - 4px); left: var(--gutter); right: var(--gutter);
    display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 10px;
    background: var(--paper); border: 1.6px solid var(--ink);
    border-radius: 14px 10px 16px 12px / 10px 16px 12px 14px;
    box-shadow: 6px 7px 0 color-mix(in srgb, var(--ink) 16%, transparent);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link { padding: 12px 14px; font-size: 16.5px; }
  .nav__tools { margin-left: auto; }

  .hero { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(68%, 330px); margin-top: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr; }
  .note { max-width: 520px; }
  .pillars, .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu, .contact { grid-template-columns: 1fr; }
  .ccard { max-width: 560px; }
}

@media (max-width: 720px) {
  .hero-meta { grid-template-columns: 1fr; }
  .tl::before { left: 7px; }
  .tl__item { grid-template-columns: 16px minmax(0, 1fr); column-gap: 16px; }
  .tl__when { grid-column: 2; grid-row: 1; padding: 0 0 8px; text-align: left; }
  .tl__dot { grid-column: 1; grid-row: 1; margin-top: 6px; }
  .tl__card { grid-column: 2; margin-left: 0; padding: 20px 20px 18px; }
  .pub { grid-template-columns: 1fr; gap: 4px; padding: 22px 20px 16px; }
  .pub__idx { text-align: left; font-size: 25px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  html[data-lang="zh"] body { font-size: 16px; }
  .nav__cv { display: none; }
  .brand__name { font-size: 17px; }
  .lang-btn { padding: 8px 4px; }
  .hero__role { margin-top: 24px; font-size: 12.5px; }
  .pillars, .skills { grid-template-columns: 1fr; }
  .stats { gap: 14px; }
  .stat { padding: 14px 14px 12px; }
  .stat__num { font-size: 36px; }
  .stat__label { font-size: 14px; }
  .about__bio p:first-child { font-size: 18.5px; }
  .annot--me { right: -24%; top: 4%; font-size: 23px; }
  .annot--me svg { width: 48px; height: 34px; margin-right: 22px; }
  .ccard { padding: 28px 18px 12px; }
  .ccard__row { grid-template-columns: 28px minmax(0, 1fr); row-gap: 0; }
  .ccard__icon { grid-row: span 2; align-self: start; margin-top: 2px; }
  .ccard dt, .ccard dd { grid-column: 2; }
  .btn { padding: 12px 18px; }
  .contact__cta .btn--primary { font-size: 14.5px; }
}

@media (max-width: 340px) {
  .brand__name { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
}

@media print {
  .nav, .toast, .portrait__hint, .annot, .skip { display: none !important; }
  body { background: #fff; }
  .js [data-reveal] { opacity: 1; translate: none; }
  .section { padding-top: 32px; break-inside: avoid-page; }
}
