@font-face {
  font-family: "Portfolio Sans";
  src: local("HarmonyOS Sans SC"), local("HarmonyOS Sans"), local("OPPOSans"),
    local("PingFang SC"), local("Microsoft YaHei");
}

@font-face {
  font-family: "OPPOSans Web";
  src: url("./assets/OPPOSans-4.0.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Portfolio Sans", system-ui, sans-serif;
  cursor: none;
}

body.is-loading,
body.is-landing { overflow: hidden; }

.page-loader {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  color: #000;
  background: #fff;
  transition: background-color .35s ease;
}
.page-loader.is-travelling {
  background: rgba(255, 255, 255, 0);
}
.loader-yellow-card {
  width: clamp(210px, 19vw, 330px);
  height: auto;
  opacity: 0;
  transform: translateY(28px) rotate(5deg) scale(.58);
  animation: loader-card-pop .68s .08s cubic-bezier(.18, 1.35, .38, 1) forwards;
}
body.is-loading .site-header,
body.is-loading main,
body.is-landing .site-header,
body.is-landing main {
  opacity: 0;
}
body.is-loading .site-header,
body.is-loading main {
  transform: translateY(20px) scale(.985);
}
body.is-landing .site-header,
body.is-landing main { transform: none; }
body.is-loaded main {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .15s ease, transform .15s ease;
}
body.is-loaded .site-header {
  animation: content-pop .6s .04s var(--ease) both;
}
body.is-loaded .hero-copy.reveal {
  animation: hero-content-pop .68s .16s var(--ease) both;
}
body.is-loaded .card-stack.reveal {
  opacity: 1;
  animation: none;
}
body.is-loading .profile-card,
body.is-landing .profile-card { opacity: 0; }
body.is-loaded .card-welcome { opacity: 1; }
body.is-loaded .card-photo {
  animation: content-pop .62s .30s cubic-bezier(.18, 1.18, .38, 1) both;
}
body.is-loaded .card-work {
  animation: content-pop .62s .38s cubic-bezier(.18, 1.18, .38, 1) both;
}
body.is-loaded .card-school {
  animation: content-pop .62s .46s cubic-bezier(.18, 1.18, .38, 1) both;
}

@keyframes loader-card-pop {
  0% { opacity: 0; transform: translateY(28px) rotate(5deg) scale(.58); }
  68% { opacity: 1; transform: translateY(-5px) rotate(-2deg) scale(1.045); }
  100% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
}
@keyframes content-pop {
  0% { opacity: 0; transform: translateY(22px) scale(.965); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hero-content-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(22px) scale(.965); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

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

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 3vw;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    padding .32s var(--ease),
    color .25s ease,
    background-color .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

.site-header a { pointer-events: auto; }

.site-header.is-scrolled {
  padding-top: 18px;
  padding-bottom: 18px;
  color: #000;
  background: rgba(255, 255, 255, .97);
  border-bottom-color: rgba(0, 0, 0, .06);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .035);
  mix-blend-mode: normal;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand,
.site-header nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: currentColor;
}

.site-header nav { gap: 26px; }
.nav-pill {
  padding: 10px 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.magnetic {
  transition: transform .28s var(--ease);
  will-change: transform;
}

.hero {
  position: relative;
  width: 100%;
  height: min(56.25vw, 100svh);
  min-height: 620px;
  overflow: hidden;
  background: #fff;
}

.figma-stage {
  container-type: size;
  position: absolute;
  left: 50%;
  top: 0;
  width: min(100vw, 177.77778vh);
  height: min(56.25vw, 100vh);
  min-width: 1102px;
  min-height: 620px;
  transform: translateX(-50%);
  overflow: hidden;
}

.gradient-field {
  position: absolute;
  z-index: 0;
  left: 8.724%;
  top: -52.934%;
  width: 82.449%;
  height: 87.379%;
}

.dot-field {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 20%;
  width: 60.208%;
  text-align: center;
  transform: translateX(-50%);
}

.intro {
  display: block;
  margin: 0;
  font-family: "OPPOSans Web", "Microsoft YaHei", sans-serif;
  font-size: 2.0833cqw;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
}

.intro > span { display: block; }
.intro strong { font-weight: 500; }

.statement {
  margin: 1.1458cqw 0 0;
  font-size: 3.3333cqw;
  line-height: 1.5;
  font-weight: 750;
  letter-spacing: -.005em;
  white-space: nowrap;
}

.card-stack {
  position: absolute;
  z-index: 3;
  left: 24.58333%;
  top: 58.7963%;
  width: 48.8994%;
  height: 28.9693%;
}

.profile-card {
  position: absolute;
  width: 12.9167cqw;
  height: 12.9167cqw;
  color: #333;
  transform: rotate(calc(var(--tilt) * 1deg));
  transform-origin: center;
  transition: transform .4s var(--ease), filter .4s var(--ease);
  will-change: transform;
}

.profile-card:hover {
  z-index: 20;
  transform: translateY(-.75cqw) rotate(0deg) scale(1.025);
  filter: drop-shadow(0 .6cqw .75cqw rgba(0,0,0,.13));
}

.card-photo {
  left: 0;
  top: 1.7977cqw;
  padding: .625cqw;
  background: #fff;
  border: .10417cqw solid #000;
}

.photo-placeholder {
  width: 100%;
  height: 8.5417cqw;
  background: #bde5ff;
}

.profile-card h2 {
  margin: .62cqw 0 0;
  color: #000;
  font-size: .9375cqw;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.card-work {
  left: 10.8333cqw;
  top: 2.1875cqw;
  padding: 1.18cqw 1.05cqw;
  background: #ffbdf1;
  box-shadow: .052cqw .208cqw .208cqw rgba(0,0,0,.2);
  font-family: "KaiTi", "Portfolio Sans", sans-serif;
}

.card-work h2 {
  height: 1.6667cqw;
  margin: 0 0 .6cqw;
  text-align: center;
  line-height: 0;
}

.card-work h2 img {
  display: block;
  width: 7.2396cqw;
  height: 1.6667cqw;
  margin: 0 auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.card-work ul {
  display: grid;
  gap: .36cqw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-work li {
  display: grid;
  grid-template-columns: .82cqw 1fr;
  align-items: start;
  gap: .34cqw;
}

.card-work li img {
  width: .78125cqw;
  height: .78125cqw;
  margin-top: .11cqw;
}

.card-work li span { display: block; }
.card-work b,
.card-work small {
  display: block;
  font-weight: 400;
  line-height: 1.36;
  white-space: nowrap;
}
.card-work b { font-size: .8333cqw; }
.card-work small { font-size: .57cqw; }

.card-school {
  left: 23.5229cqw;
  top: .454cqw;
}

.stamp-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.school-photo {
  position: absolute;
  left: .9375cqw;
  top: .9375cqw;
  width: 11.0417cqw;
  height: 11.0417cqw;
  overflow: hidden;
  border: .10417cqw solid #000;
}

.school-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-year {
  position: absolute;
  z-index: 2;
  left: 1.56cqw;
  color: #fff;
  font-size: .8333cqw;
  line-height: 1.5;
  font-weight: 800;
}
.school-year.first { top: 1.6cqw; }
.school-year.second { top: 3.06cqw; left: 2.16cqw; }

.card-welcome {
  left: 36.423cqw;
  top: .4756cqw;
  padding: 0;
  background: #fdf5a4;
  box-shadow: .052cqw .208cqw .208cqw rgba(0,0,0,.2);
}

.welcome-title {
  position: absolute;
  left: 1.37cqw;
  top: 2.52cqw;
  width: 8.5417cqw;
  height: 5.5208cqw;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.doodle {
  position: absolute;
  right: 1.18cqw;
  bottom: .92cqw;
  width: 2.99cqw;
  height: 2.31cqw;
}

/* Exact Figma card renders: the transparent bounds already include each
   card's original rotation, typography and shadow. */
.profile-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.profile-card:hover {
  transform: translateY(-.75cqw) scale(1.025);
}
.card-render {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.card-photo {
  left: 0;
  top: 0;
  width: 14.5886cqw;
  height: 14.5886cqw;
}
.card-work {
  left: 10.8333cqw;
  top: 1.0617cqw;
  width: 13.9933cqw;
  height: 13.9933cqw;
}
.card-school {
  left: 22.1738cqw;
  top: .454cqw;
  width: 14.1961cqw;
  height: 14.1961cqw;
}
.card-welcome {
  left: 33.0798cqw;
  top: .4756cqw;
  width: 15.8196cqw;
  height: 15.8196cqw;
}

.reveal {
  opacity: 0;
  animation: reveal .75s var(--ease) forwards;
}
.hero-copy.reveal { animation-name: reveal-copy; }
.card-stack.reveal { animation-delay: .16s; }

.cursor {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  background: #fff;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease;
}
.cursor.is-hovering { width: 38px; height: 38px; }

.about-section {
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.about-stage {
  container-type: inline-size;
  box-sizing: border-box;
  width: min(100vw, 1920px);
  margin: 0 auto;
  padding: 18.8542cqw 10.625cqw 7.2917cqw;
}

.about-header {
  max-width: 1512px;
  margin: 0 auto 4.375cqw;
  text-align: center;
}

.about-kicker {
  margin: 0 0 1.3542cqw;
  color: #666;
  font-family: "Dragon Web", "Segoe Script", cursive;
  font-size: 2.0833cqw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .02em;
}

.about-title {
  margin: 0;
  font-family: "HarmonyOS Sans SC", "HarmonyOS Sans", "Portfolio Sans", sans-serif;
  font-size: 4.1667cqw;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.about-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6.25cqw;
  width: fit-content;
  max-width: 100%;
  min-height: 30.1042cqw;
  margin: 0 auto;
}

.about-photo {
  flex: 0 0 auto;
  margin: 0;
  width: 27.0833cqw;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-photo.scroll-reveal-about-photo.is-visible:hover {
  transform: scale(1.025) rotate(2deg);
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-content {
  flex: 0 0 auto;
  width: 52.8646cqw;
  max-width: 1015px;
  padding-top: 0;
}

.about-values {
  display: grid;
  gap: 1.25cqw;
  margin: 0 0 1.875cqw;
  padding: 0;
  list-style: none;
  font-family: "DingTalk JinBuTi Web", "Microsoft YaHei", sans-serif;
  font-size: 1.875cqw;
  font-weight: 400;
  line-height: 1.5;
}

.about-values li {
  display: flex;
  align-items: center;
  gap: .7292cqw;
}

.about-value-icon {
  flex: 0 0 auto;
  width: 1.875cqw;
  font-size: 1.875cqw;
  line-height: 1;
  text-align: center;
}

.about-copy {
  display: grid;
  gap: 1.25cqw;
  width: 100%;
  max-width: 1015px;
  color: #000;
  font-family: "OPPOSans Web", "Portfolio Sans", sans-serif;
  font-size: 1.4583cqw;
  font-weight: 300;
  line-height: 1.75;
}

.about-copy p { margin: 0; }

.about-resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4167cqw;
  margin-top: 2.0833cqw;
  width: 13.0208cqw;
  height: 3.6458cqw;
  padding: 0;
  border: 1px solid #000;
  border-radius: 999px;
  color: #000;
  background: #fff;
  font-family: "OPPOSans Web", "Portfolio Sans", sans-serif;
  font-size: 1.4583cqw;
  font-weight: 400;
  line-height: 1;
  transition:
    color .28s var(--ease),
    background-color .28s var(--ease),
    border-color .28s var(--ease),
    transform .35s var(--ease);
}

.about-resume:hover {
  transform: translateY(-3px);
}

.about-resume:hover {
  color: #fff;
  background: #000;
  border-color: #000;
}

.about-resume svg {
  width: 1.6667cqw;
  height: 1.6667cqw;
}

.placeholder-section {
  min-height: 100svh;
  padding: 12vw 10vw;
}

.figma-page {
  position: relative;
  display: flex;
  width: 100%;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.figma-page > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#work {
  height: 34vw;
  min-height: 360px;
  max-height: 650px;
}

#work > img {
  object-fit: cover;
  object-position: center center;
}

.project-showcase {
  container-type: inline-size;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
}

/* 仅缩短 Selected Works → 第一张卡片的距离 */
.project-showcase:first-of-type {
  margin-top: -5.0694444444cqw;
}

.project-card {
  position: relative;
  display: block;
  width: 58.5417cqw;
  height: 41.0417cqw;
  padding: 0;
  border: .0521cqw solid rgba(49, 82, 117, .28);
  border-radius: 1.40625cqw;
  color: #06172f;
  background: #fff;
}

.project-card:not(.scroll-reveal-card) {
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
}

a.project-card:hover,
a.project-card.scroll-reveal-card.is-visible:hover {
  transform: translateY(-.35cqw) scale(1) rotate(0deg);
  box-shadow: 0 1.2cqw 3cqw rgba(34, 76, 122, .14);
}

.project-media-frame {
  position: absolute;
  left: 1.5104cqw;
  top: 1.6667cqw;
  width: 55.4167cqw;
  height: 26.0417cqw;
  border: .0521cqw solid rgba(49, 82, 117, .28);
  border-radius: 1.0417cqw;
  overflow: hidden;
}

.project-media {
  display: block;
  width: calc(100% + .1042cqw);
  height: calc(100% + .1042cqw);
  margin: -.0521cqw;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.project-tags {
  position: absolute;
  left: 1.5104cqw;
  top: 28.75cqw;
  display: flex;
  align-items: center;
  gap: 1.0417cqw;
  height: 2.2917cqw;
}

.project-tags span {
  display: inline-flex;
  align-items: center;
  gap: .5208cqw;
  height: 2.2917cqw;
  padding: .3646cqw .8333cqw;
  border-radius: 999px;
  color: #66788f;
  background: #f7f8fc;
  font-size: 1.0417cqw;
  line-height: 1;
  white-space: nowrap;
}

.project-tags .status { color: #20ae88; }
.project-tags .upcoming { color: #e49a3b; }
.project-tags i {
  width: .3125cqw;
  height: .3125cqw;
  border-radius: 50%;
  background: currentColor;
}

.project-card h2 {
  position: absolute;
  left: 1.5104cqw;
  top: 31.5104cqw;
  height: 2.8125cqw;
  margin: 0;
  font-size: 1.875cqw;
  line-height: 1.5;
  font-weight: 750;
  letter-spacing: -.02em;
}

.project-meta {
  position: absolute;
  left: 1.5104cqw;
  top: 35.46875cqw;
  display: grid;
  grid-template-columns: 14.5833cqw 11.6146cqw 1fr;
  width: 35cqw;
  height: 3.4375cqw;
}

.project-meta dl { margin: 0; }
.project-meta dt {
  margin-bottom: .3125cqw;
  color: #7c8ba0;
  font-size: .7292cqw;
}
.project-meta dd {
  margin: 0;
  font-size: .9375cqw;
  font-weight: 500;
  white-space: nowrap;
}
.project-meta .brand-name {
  font-size: 1.25cqw;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.025em;
}
.brand-logo-wrap {
  overflow: visible;
}
.ep-brand-logo {
  display: block;
  width: 16.3542cqw;
  height: 1.9792cqw;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

.project-card[href="./electrophysiology.html"] .brand-logo-wrap {
  transform: translateY(-5px);
}

.mindray-brand-logo {
  display: block;
  width: 5.15625cqw;
  height: 1.25cqw;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

.project-arrow {
  position: absolute;
  right: 1.5104cqw;
  bottom: 2.03125cqw;
  display: grid;
  place-items: center;
  width: 5.2083cqw;
  height: 5.2083cqw;
  border-radius: 50%;
  color: #fff;
  background: #000;
  font-size: 2.2cqw;
  font-weight: 300;
  transition: transform .4s var(--ease);
}
a.project-card:hover .project-arrow {
  transform: translateX(.28cqw);
}
.placeholder-section {
  display: grid;
  place-items: center;
  background: #f4f2ef;
  font-size: clamp(40px, 7vw, 112px);
  font-weight: 700;
  letter-spacing: -.06em;
}
.placeholder-section:last-child { background: #fdf5a4; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(1.25cqw); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-copy {
  from { opacity: 0; transform: translate(-50%, 1.25cqw); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 620px) {
  body { cursor: auto; }
  .cursor { display: none; }
  .site-header { padding: 18px; }
  .site-header nav { gap: 14px; }
  .nav-link { display: none; }
  .loader-yellow-card { width: min(62vw, 280px); }
  .hero {
    height: 100svh;
    min-height: 620px;
  }
  .figma-stage {
    left: 50%;
    top: 0;
    width: 1102px;
    height: 620px;
    transform: translateX(-50%);
  }
  .about-stage {
    width: 100%;
    padding: clamp(80px, 18vw, 362px) clamp(20px, 10vw, 204px) clamp(48px, 7vw, 140px);
  }
  .about-header {
    max-width: none;
    margin-bottom: clamp(40px, 8vw, 84px);
  }
  .about-kicker { font-size: clamp(28px, 8vw, 48px); }
  .about-title { font-size: clamp(34px, 10vw, 88px); }
  .about-body {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    min-height: 0;
  }
  .about-photo {
    width: min(100%, 260px);
  }
  .about-content {
    width: 100%;
    max-width: 1015px;
  }
  .about-values {
    gap: 18px;
    margin-bottom: 24px;
    font-size: clamp(24px, 6vw, 36px);
  }
  .about-value-icon {
    width: auto;
    font-size: 1em;
  }
  .about-copy {
    width: 100%;
    max-width: none;
    gap: 20px;
    font-size: clamp(18px, 5vw, 28px);
  }
  .about-resume {
    margin-top: 28px;
    width: min(100%, 250px);
    height: 70px;
    padding: 0;
    font-size: 28px;
  }
  .about-resume svg {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .page-loader { display: none; }
  body.is-loading { overflow: auto; }
}
