@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  src: url("assets/fonts/lora-variable.ttf") format("truetype");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  src: url("assets/fonts/lora-italic-variable.ttf") format("truetype");
}

@font-face {
  font-family: "LiangCN";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/liang-chinese.otf") format("opentype");
}

@font-face {
  font-family: "ChineseTitle";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/chinese-title-51168.otf") format("opentype");
}

@font-face {
  font-family: "ChineseBody";
  font-style: normal;
  font-weight: 400;
  src: url("assets/fonts/chinese-body-51178.otf") format("opentype");
}

:root {
  color-scheme: light;
  --black: #080808;
  --ink: #171717;
  --muted: #555555;
  --lemon: #f4ff3a;
  --lemon-soft: rgba(244, 255, 58, 0.42);
  --deep-yellow: #b59a00;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.54);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --line: rgba(8, 8, 8, 0.14);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Lora", Georgia, serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at 11% 14%, var(--lemon-soft), transparent 28rem),
    radial-gradient(circle at 86% 12%, rgba(0, 0, 0, 0.08), transparent 26rem),
    linear-gradient(135deg, #ffffff 0%, #f7f7f2 47%, #eeeeea 100%);
}

.zh-page {
  font-family: "ChineseBody", "Songti SC", serif;
}

.zh-page h1,
.zh-page h2,
.zh-page .home-title {
  font-family: "ChineseTitle", "Songti SC", serif;
  font-weight: 400;
}

.zh-page .home-title {
  max-width: 15em;
  font-size: clamp(30px, 4vw, 54px);
}

.zh-page .brand,
.zh-page .eyebrow,
.zh-page .contact-card-main h2 {
  font-family: "Lora", Georgia, serif;
}

.zh-page .contact-links a,
.zh-page .lang-toggle,
.zh-page .lang-toggle span {
  font-family: "Lora", Georgia, serif;
}

.lang-toggle.is-en span:last-child {
  font-family: "ChineseBody", "Songti SC", serif;
}

.zh-page .lead,
.zh-page .content-panel p,
.zh-page .contact-card-main p {
  line-height: 1.85;
}

.zh-page .content-panel p {
  font-size: 20px;
}

.zh-page .contact-card-main h2 {
  font-weight: 650;
}

.zh-page .contact-university {
  margin-top: 40px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(8, 8, 8, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 8, 8, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

.glass {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.site-header {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 12px 14px 12px 20px;
  border-radius: 999px;
  transition: border-radius 510ms cubic-bezier(0.2, 0.8, 0.2, 1), padding 510ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.home-header {
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-left: 0;
  font-size: 18px;
  font-weight: 700;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 510ms ease, transform 510ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-cn,
.inline-cn {
  font-family: "LiangCN", "Songti SC", serif;
  font-style: normal;
  font-weight: 400;
}

.brand-cn {
  font-size: 24px;
}

.inline-cn {
  margin-left: 8px;
  font-size: 1.48em;
  font-style: normal;
}

nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  font-size: 14px;
  font-weight: 650;
  transform: translateX(var(--nav-start-shift, 0));
  transition: transform 570ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

nav::before {
  position: absolute;
  top: var(--nav-active-top, 0);
  left: 0;
  height: var(--nav-active-height, 36px);
  width: var(--nav-active-width, 0);
  border-radius: 999px;
  background: var(--black);
  content: "";
  opacity: 0;
  transform: translateX(var(--nav-active-left, 0));
  transition: transform 510ms cubic-bezier(0.2, 0.8, 0.2, 1), top 510ms cubic-bezier(0.2, 0.8, 0.2, 1), width 510ms cubic-bezier(0.2, 0.8, 0.2, 1), height 510ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 330ms ease;
}

nav[data-ready="true"]::before {
  opacity: 1;
}

nav a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  line-height: 1;
  transition: color 330ms ease, transform 330ms ease;
}

nav a:hover {
  color: var(--black);
  transform: translateY(-1px);
}

nav a[aria-current="page"] {
  color: var(--white);
  transform: translateY(-1px);
}

.lang-toggle {
  position: relative;
  min-width: 74px;
  gap: 0;
  margin-left: 8px;
  padding: 4px;
  border: 1px solid rgba(181, 154, 0, 0.38);
  background: rgba(255, 255, 255, 0.42);
  color: var(--deep-yellow);
  overflow: hidden;
  font-size: 12px;
}

.lang-toggle::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--deep-yellow);
  content: "";
  transform: translateX(0);
  transition: transform 510ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lang-toggle.is-zh::before {
  transform: translateX(100%);
}

.lang-toggle span {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 50%;
  min-height: 26px;
  place-items: center;
  color: rgba(8, 8, 8, 0.58);
  transition: color 330ms ease;
}

.lang-toggle.is-en span:first-child,
.lang-toggle.is-zh span:last-child {
  color: var(--white);
}

nav a.lang-toggle:hover {
  color: var(--deep-yellow);
  transform: none;
}

.from-home .brand {
  opacity: 0;
  transform: translateX(-24px);
}

.home-shell {
  min-height: calc(100vh - 94px);
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(290px, 0.72fr);
  align-items: center;
  gap: clamp(34px, 7vw, 108px);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 92px) 0 58px;
}

.home-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--black);
  font-size: clamp(24px, 2.7vw, 36px);
  font-weight: 650;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--black);
  font-size: clamp(32px, 4.6vw, 58px);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: 0;
}

.home-title {
  max-width: 18ch;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1.08;
}

h2 {
  margin: 0;
  color: var(--black);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 560;
  line-height: 1.06;
}

.lead {
  max-width: 720px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.45;
}

.portrait-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 32px;
}

.content-panel::before,
.network-board::before,
.project-card::before,
.contact-board::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.56), transparent 42%);
}

.portrait-card {
  width: min(100%, 320px);
  justify-self: center;
  transform: rotate(1.3deg);
  transition: transform 470ms ease, box-shadow 470ms ease;
}

.portrait-card:hover {
  transform: rotate(0deg) translateY(-5px);
}

.portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 0.78;
  border-radius: 0;
  object-fit: cover;
  object-position: 58% 50%;
  box-shadow: 0 28px 110px rgba(0, 0, 0, 0.1);
  -webkit-mask-image:
    radial-gradient(ellipse 92% 86% at 50% 52%, black 28%, rgba(0, 0, 0, 0.82) 46%, rgba(0, 0, 0, 0.28) 64%, transparent 82%),
    radial-gradient(circle 42% at 14% 18%, black 24%, rgba(0, 0, 0, 0.35) 54%, transparent 78%),
    radial-gradient(circle 42% at 86% 18%, black 24%, rgba(0, 0, 0, 0.35) 54%, transparent 78%),
    radial-gradient(circle 46% at 14% 84%, black 22%, rgba(0, 0, 0, 0.32) 54%, transparent 80%),
    radial-gradient(circle 46% at 86% 84%, black 22%, rgba(0, 0, 0, 0.32) 54%, transparent 80%);
  -webkit-mask-composite: source-over;
  mask-image:
    radial-gradient(ellipse 92% 86% at 50% 52%, black 28%, rgba(0, 0, 0, 0.82) 46%, rgba(0, 0, 0, 0.28) 64%, transparent 82%),
    radial-gradient(circle 42% at 14% 18%, black 24%, rgba(0, 0, 0, 0.35) 54%, transparent 78%),
    radial-gradient(circle 42% at 86% 18%, black 24%, rgba(0, 0, 0, 0.35) 54%, transparent 78%),
    radial-gradient(circle 46% at 14% 84%, black 22%, rgba(0, 0, 0, 0.32) 54%, transparent 80%),
    radial-gradient(circle 46% at 86% 84%, black 22%, rgba(0, 0, 0, 0.32) 54%, transparent 80%);
  mask-composite: add;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(44px, 6vw, 72px) 0 70px;
}

.page-hero {
  margin-bottom: 26px;
}

.page-hero h1 {
  max-width: 900px;
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr);
  align-items: stretch;
  gap: 24px;
}

.content-panel,
.contact-board {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 30px;
}

.content-panel {
  display: grid;
  gap: 22px;
}

.content-panel p,
.contact-board p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.illustration-card {
  display: grid;
  place-items: center;
  margin: 0;
  padding: clamp(8px, 2vw, 18px);
  background: transparent;
}

.illustration-card img {
  display: block;
  width: min(100%, 360px);
  filter: contrast(1.08);
  mix-blend-mode: multiply;
}

.network-board {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.8vw, 30px);
  border-radius: 32px;
}

.network-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.network-header p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.topic-reset {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid rgba(181, 154, 0, 0.56);
  border-radius: 999px;
  background: rgba(181, 154, 0, 0.14);
  color: var(--deep-yellow);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 330ms ease, background 330ms ease;
}

.topic-reset:hover {
  background: var(--deep-yellow);
  color: var(--white);
  transform: translateY(-1px);
}

.topic-network {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  min-height: 370px;
  overflow: visible;
}

.topic-network line {
  fill: none;
  stroke: rgba(8, 8, 8, 0.22);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-dasharray: 6 10;
  animation: link-flow 3.95s linear infinite;
  transition: opacity 330ms ease, stroke 330ms ease, stroke-width 330ms ease;
}

.topic-network line.is-muted {
  opacity: 1;
}

[data-network-active-links] line.is-active {
  stroke: var(--deep-yellow);
  stroke-width: 2.8;
  stroke-dasharray: 8 10;
  opacity: 0.92;
  filter: drop-shadow(0 4px 8px rgba(244, 255, 58, 0.45));
}

.keyword-node {
  cursor: pointer;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.12));
  transition: filter 330ms ease, opacity 330ms ease;
}

.keyword-node circle {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(8, 8, 8, 0.72);
  stroke-width: 1.5;
  transition: fill 330ms ease, stroke 330ms ease, transform 330ms ease;
}

.keyword-node.is-core circle,
.keyword-node.is-active circle {
  fill: var(--lemon);
  stroke: var(--black);
  stroke-width: 2.4;
}

.keyword-node.is-related circle {
  fill: rgba(255, 255, 255, 0.9);
  stroke: var(--black);
}

.keyword-node.is-muted {
  opacity: 0.22;
  filter: none;
}

.keyword-node.is-muted circle {
  fill: rgba(255, 255, 255, 0.42);
  stroke: rgba(8, 8, 8, 0.28);
}

.keyword-node:hover circle {
  fill: var(--lemon);
  transform: scale(1.08);
}

.keyword-node text {
  fill: var(--black);
  font-size: 13px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 5px;
}

.keyword-node:hover,
.keyword-node.is-active,
.keyword-node.is-related {
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.2));
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: 28px;
  transition: transform 370ms ease, background 370ms ease, opacity 330ms ease;
}

.project-card:hover {
  background: rgba(244, 255, 58, 0.18);
  transform: translateY(-5px);
}

.project-card[hidden] {
  display: none;
}

.project-card h2 {
  max-width: 16ch;
  margin-bottom: 18px;
  font-size: clamp(23px, 2.15vw, 34px);
}

.project-card p,
.project-card li,
.project-card button {
  color: var(--muted);
  font-size: 18px;
}

.project-card p {
  margin: 0 0 20px;
}

.project-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-card button {
  padding: 6px 10px;
  border: 1px solid rgba(181, 154, 0, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  color: var(--deep-yellow);
  cursor: pointer;
  transition: background 330ms ease, border-color 330ms ease, color 330ms ease, transform 330ms ease;
}

.project-card button:hover,
.project-card button.is-active {
  border-color: var(--deep-yellow);
  background: rgba(181, 154, 0, 0.13);
  color: var(--deep-yellow);
  transform: translateY(-1px);
}

@keyframes link-flow {
  to {
    stroke-dashoffset: -44;
  }
}

.cv-viewer {
  overflow: visible;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  background: transparent;
}

.cv-pages {
  display: grid;
  justify-items: center;
  gap: 22px;
  width: 100%;
  background: transparent;
}

.cv-page {
  display: block;
  max-width: 100%;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

.cv-loading {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.contact-board {
  display: grid;
  gap: 30px;
  align-items: center;
}

.contact-card-main {
  display: grid;
  gap: 8px;
  color: #001f5b;
  text-align: center;
}

.contact-card-main p {
  margin: 0;
  color: #001f5b;
  font-size: clamp(17px, 1.6vw, 23px);
}

.contact-card-main h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin: 0;
  color: #001f5b;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
}

.contact-cn {
  font-family: "LiangCN", "Lora", serif;
  font-size: 1.18em;
  font-weight: 400;
}

.contact-university {
  margin-top: 28px;
  color: #001f5b;
  font-size: clamp(18px, 1.7vw, 24px);
  font-variant: normal;
  letter-spacing: 0;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.contact-links a {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
  transition: border-color 330ms ease, color 330ms ease, transform 330ms ease;
}

.contact-links a:hover {
  color: var(--black);
  border-color: rgba(8, 8, 8, 0.34);
  transform: translateY(-2px);
}

.reveal {
  animation: rise-in 870ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.delay-1 {
  animation-delay: 270ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 28px;
  }

  .brand {
    margin-left: 13px;
  }

  nav {
    justify-content: flex-start;
  }

  .home-shell,
  .about-layout,
  .contact-board {
    grid-template-columns: 1fr;
  }

  .about-layout .illustration-card {
    order: -1;
  }

  .about-layout .illustration-card img {
    width: min(50%, 180px);
  }

  .portrait-card {
    max-width: 280px;
    transform: none;
  }

  .network-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card h2 {
    font-size: clamp(25px, 5.4vw, 43px);
  }

  .contact-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-network {
    min-height: 330px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .home-shell,
  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  nav a {
    padding-inline: 10px;
  }

  .lead {
    font-size: 21px;
  }

  .cv-viewer {
    min-height: 560px;
  }

  .brand {
    flex-wrap: wrap;
  }

  .keyword-node text {
    font-size: 17px;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }
}

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