/* Palette: matte black & champagne gold */
:root {
  color-scheme: dark;
  --ground: #0b0b0c;
  --paper: #141414;
  --soft: #1d1b18;
  --ink: #f2ede3;
  --text: #c9c2b4;
  --muted: #8c8576;
  --rule: #2a2723;
  --accent: #c8a96a;
  --accent-dark: #e3c98f;
  --jelly: #b99a5b;
  --frame: #f5f1e8;
  --gold-line: rgba(200, 169, 106, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  --width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent-dark); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Floating paper card */
.canvas {
  max-width: var(--width);
  margin: 28px auto 64px;
  padding: 0 60px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 48px rgba(205, 150, 75, 0.13), 0 0 120px rgba(190, 110, 50, 0.07);
}

.shell { width: 100%; }

/* Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-links { display: flex; gap: 1.6rem; }

.nav-links a,
.nav-menu-panel a {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.nav-links a:hover,
.nav-menu-panel a:hover { color: var(--accent); }

.nav-menu { position: relative; display: none; }

.nav-menu summary {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: var(--accent);
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary svg { width: 1.15rem; height: 1.15rem; }

.nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 200px;
  padding: 0.4rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
.nav-menu-panel a { display: block; padding: 0.55rem 0.7rem; border-radius: 6px; font-size: 0.85rem; }
.nav-menu-panel a:hover { background: var(--soft); }

/* Intro */
.hero {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
  padding: 2.75rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

.portrait {
  width: 260px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
}

h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--ink); }

h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.22em;
  margin-bottom: 1.1rem;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  letter-spacing: -0.04em;
  line-height: 1;
}
h1 .alt { color: var(--muted); font-size: 0.55em; letter-spacing: -0.02em; }
h1 .surname {
  color: var(--accent);
  background: linear-gradient(180deg, #f3d98b 0%, #d4af37 55%, #a8792a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
h1 .zh {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 0.5em;
  letter-spacing: 0.02em;
  color: var(--text);
}

.hero-text p { max-width: 640px; margin: 0 0 0.75rem; color: var(--text); }
.hero-text strong { color: var(--ink); font-weight: 600; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  color: var(--accent);
  border: 1px solid var(--rule);
  border-radius: 50%;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.links a:hover {
  color: var(--accent-dark);
  border-color: var(--jelly);
  background: var(--soft);
  transform: translateY(-1px);
}
.links svg { width: 1.05rem; height: 1.05rem; }

/* Sections, numbered 01, 02, ... */
main { counter-reset: section; }

.section {
  padding: 2.75rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  counter-increment: section;
}
.section:last-child { border-bottom: 0; }

.section h2 { margin-bottom: 1.25rem; font-size: 1.75rem; line-height: 1.2; }
.section h2::before {
  content: counter(section, decimal-leading-zero);
  display: block;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.rows { border-top: 1px solid var(--rule); }

.row {
  padding: 1.3rem 0 1.3rem 1rem;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s, background 0.15s;
}
.row:last-child { border-bottom: 0; }
.row:is(:hover, :focus-within) { border-left-color: var(--jelly); }

.row h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 400; line-height: 1.35; color: var(--ink); }
.row p { margin: 0.3rem 0 0; max-width: 780px; color: var(--text); font-size: 0.93rem; }
.row .sub { color: var(--muted); }

.split { display: flex; justify-content: space-between; gap: 2rem; }
.split time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Experience logos */
.exp { justify-content: flex-start; gap: 1.1rem; }
.exp .exp-body { flex: 1; min-width: 0; }

.logo {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-top: 0.15rem;
  overflow: hidden;
  background: var(--frame);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
}
.logo img { width: 100%; height: 100%; object-fit: contain; }

/* News */
.news { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.news li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 0.8rem 0 0.8rem 1rem;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s;
}
.news li:last-child { border-bottom: 0; }
.news li:hover { border-left-color: var(--jelly); }

.news time {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 2.3;
  font-variant-numeric: tabular-nums;
}
.news p { margin: 0; color: var(--text); font-size: 0.93rem; }

/* Publications */
.pub {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 2rem;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.pub-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 250px;
  height: 158px;
  overflow: hidden;
  background: var(--frame);
  border: 1px solid var(--gold-line);
  border-radius: 12px;
}

.pub-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.18s;
}
a.pub-image:hover img { transform: scale(1.03); }

.row .kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pub h3 { margin-top: 0.3rem; font-size: 1.4rem; }
.pub h3 a { color: var(--ink); text-decoration: none; }
.pub h3 a:hover { color: var(--accent); }
.pub .pub-title { color: var(--ink); }
.pub .authors { color: var(--muted); font-size: 0.86rem; }
.pub .authors b { color: var(--ink); font-weight: 700; }

.pub .pub-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.7rem; }
.pub-links a {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.pub-links a::after { content: " \2197"; }
.pub-links a:hover { color: var(--accent-dark); }

.note { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.8rem; }

/* Footer */
.footer {
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  .canvas { margin: 0; padding: 0 16px; border: 0; border-radius: 0; box-shadow: none; }
  .nav-links { display: none; }
  .nav-menu { display: block; }

  .hero {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0 1.25rem;
    padding: 2rem 0 2.25rem;
  }
  .portrait { width: 110px; margin-bottom: 1.25rem; border-radius: 12px; }
  .hero-text { display: contents; }
  .hero-text h1 { grid-column: 2; align-self: center; font-size: 2.3rem; margin-bottom: 1.25rem; }
  .hero-text p, .links { grid-column: 1 / -1; }

  .section { padding: 2.25rem 0 2rem; }
  .section h2 { font-size: 1.55rem; }
  .row { padding-left: 0.75rem; }
  .news li { grid-template-columns: 1fr; gap: 0; padding-left: 0.75rem; }
  .exp { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 0.9rem; row-gap: 0.1rem; }
  .exp .logo { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; }
  .exp time { grid-column: 2; grid-row: 1; }
  .exp .exp-body { grid-column: 2; grid-row: 2; }
  .split { flex-direction: column; gap: 0.15rem; }
  .split time { order: -1; }
  .pub { grid-template-columns: 1fr; gap: 1rem; }
  .pub-image { width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .pub h3 { font-size: 1.25rem; }
}

/* ===== Sunset on the beach ===== */

/* Dusk sky behind everything: sky → glowing horizon → dark sea */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 38% at 50% 62%, rgba(255, 176, 84, 0.26), rgba(222, 104, 44, 0.12) 45%, transparent 75%),
    linear-gradient(to bottom, #0a0a0d 0%, #150f12 34%, #2b1810 57%, #47290f 61.5%, #140e0a 63%, #0b0b0c 100%);
}

/* Shared metal + grain textures */
:root {
  --gilt: linear-gradient(135deg, #cdb27a 0%, #8f6c33 32%, #6a4f24 50%, #b4935a 70%, #d2bb8a 82%, #7d5f2c 100%);
  --gilt-bright: linear-gradient(135deg, #e0c995 0%, #b4935a 35%, #8f6c33 52%, #d2bb8a 72%, #e6d4aa 85%, #9c7a3e 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fine film grain over the whole page, like heavy paper */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: var(--grain);
  background-size: 140px 140px;
  mix-blend-mode: overlay;
  opacity: 0.09;
}

/* Card lets a little of the dusk light through, edged in gilt */
.canvas {
  --pad: 60px;
  position: relative;
  isolation: isolate;
  background: rgba(20, 20, 20, 0.88);
}

.canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: 1.5px;
  border-radius: inherit;
  pointer-events: none;
  /* Rim rests near-black; bands of gold light circulate clockwise
     (down the right side, up the left), turning each stretch of edge
     from black to gold and back again. */
  --rim: linear-gradient(to bottom,
    rgba(58, 44, 24, 0.55) 0%,
    rgba(58, 44, 24, 0.55) 26%,
    rgba(143, 108, 51, 0.75) 40%,
    rgba(222, 196, 140, 0.95) 49%,
    rgba(240, 220, 172, 1) 50%,
    rgba(222, 196, 140, 0.95) 51%,
    rgba(143, 108, 51, 0.75) 60%,
    rgba(58, 44, 24, 0.55) 74%,
    rgba(58, 44, 24, 0.55) 100%);
  background: var(--rim) left 0 top 0 / 50.5% 1400px repeat-y, var(--rim) right 0 top 0 / 50.5% 1400px repeat-y;
  animation: rim-flow 7s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Fine inner hairline: a double gilt frame */
.canvas::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 20;
  border: 1px solid rgba(185, 154, 91, 0.16);
  border-radius: 17px;
  pointer-events: none;
}

.logo,
.pub-image {
  border: 1px solid transparent;
  background: linear-gradient(var(--frame), var(--frame)) padding-box, var(--gilt) border-box;
}

.topbar {
  background: rgba(20, 19, 18, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}

/* Hero = the sky at sunset; its bottom edge is the horizon */
.hero {
  position: relative;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, #4a3518 14%, #8f6c33 34%, #b4935a 52%, #d6bd85 74%, #b4935a 84%, #6a4f24 94%, transparent 100%) 1;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--pad));
  right: calc(-1 * var(--pad));
  pointer-events: none;
  background:
    radial-gradient(circle 34px at 74% 100%, rgba(245, 210, 150, 0.55), rgba(235, 175, 100, 0.25) 60%, transparent 100%),
    radial-gradient(ellipse 34% 62% at 74% 100%, rgba(240, 180, 105, 0.22), rgba(220, 120, 55, 0.1) 45%, transparent 75%),
    linear-gradient(to bottom, transparent 0%, rgba(120, 52, 40, 0.07) 50%, rgba(214, 132, 56, 0.14) 100%);
}

/* Sun's reflection on the water: an irregular glitter path that widens toward the viewer */
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 100%;
  left: 74%;
  width: 300px;
  height: 110px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(235, 200, 140, 0.38) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(to bottom, transparent 0 5px, rgba(225, 170, 100, 0.2) 5px 6px, transparent 6px 13px);
  --wedge: conic-gradient(from 158deg at 50% -55%, transparent 0deg, #000 9deg, #000 35deg, transparent 44deg);
  --fade: linear-gradient(to bottom, #000 5%, transparent 95%);
  -webkit-mask-image: var(--wedge), var(--fade);
  -webkit-mask-composite: source-in;
  mask-image: var(--wedge), var(--fade);
  mask-composite: intersect;
  animation: ripple 3.5s linear infinite, glint 5s ease-in-out infinite;
}

@keyframes rim-flow {
  to { background-position: left 0 top -1400px, right 0 top 1400px; }
}
@keyframes ripple { to { background-position: 0 9px, 0 13px; } }
@keyframes glint { 50% { opacity: 0.55; } }

/* Surname as gold foil: metallic banding + fine grain + a slow sweep of light */
h1 .surname {
  background-image:
    var(--grain),
    linear-gradient(105deg, transparent 38%, rgba(255, 245, 220, 0.3) 48%, transparent 58%),
    linear-gradient(180deg, #e6d2a0 0%, #cfb177 26%, #a8854a 48%, #94733d 54%, #c4a46a 68%, #d9c08c 80%, #9c7a42 100%);
  background-size: 140px 140px, 260% 100%, 100% 100%;
  background-position: 0 0, 100% 0, 0 0;
  background-blend-mode: soft-light, normal, normal;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 55%, 100% { background-position: 0 0, 0 0, 0 0; } }

/* Gold details */
.section { border-image: linear-gradient(90deg, transparent, rgba(122, 84, 20, 0.45) 18%, rgba(243, 217, 139, 0.5) 50%, rgba(122, 84, 20, 0.45) 82%, transparent) 1; }
.section h2::before { color: var(--accent); }

.row:is(:hover, :focus-within),
.news li:hover { background: linear-gradient(90deg, rgba(212, 175, 55, 0.07), transparent 65%); }
.news li { transition: border-color 0.15s, background 0.15s; }

.links a,
.nav-menu summary {
  border: 1px solid transparent;
  background: linear-gradient(#15130f, #15130f) padding-box, var(--gilt) border-box;
}
.links a:hover {
  border-color: transparent;
  background: linear-gradient(#211a10, #211a10) padding-box, var(--gilt-bright) border-box;
  box-shadow: 0 0 12px rgba(200, 160, 90, 0.18);
}

@media (max-width: 760px) {
  .canvas { --pad: 16px; }
  .canvas::after, .canvas::before { display: none; }
  .hero::after { width: 200px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::after, h1 .surname, .canvas::after { animation: none; }
}
