:root {
  --ink: #f2ecdc;
  --soft: rgba(242, 236, 220, 0.72);
  --muted: rgba(242, 236, 220, 0.58);
  --gold: #e7c467;
  --gold-soft: rgba(231, 196, 103, 0.42);
  --night: #03142f;
  --scene-progress: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(231, 196, 103, 0.42) rgba(1, 8, 24, 0.8);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--night);
  font-family: "Songti SC", STSong, SimSun, "Microsoft YaHei", serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(1, 10, 31, 0.18), rgba(1, 10, 31, 0.34)),
    url("assets/backgrounds/star-water.webp");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

body.modal-open {
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 0.55rem;
}

::-webkit-scrollbar-track {
  background: rgba(1, 8, 24, 0.82);
}

::-webkit-scrollbar-thumb {
  border: 0.12rem solid rgba(1, 8, 24, 0.82);
  border-radius: 999px;
  background: rgba(231, 196, 103, 0.38);
}

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

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.story {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background: transparent;
}

.scene {
  position: relative;
  width: 100%;
}

[data-reveal] {
  opacity: 1;
  filter: none;
  transform: none;
}

[data-reveal].is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0);
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero-copy {
  position: relative;
  width: 100%;
  height: auto;
  padding: 0 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  color: rgba(246, 239, 222, 0.96);
  font-family: "Bodoni MT", "Baskerville Old Face", Didot, Georgia, serif;
  font-size: 8.6rem;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow:
    0 0 1.6rem rgba(255, 234, 172, 0.15),
    0 0 4.5rem rgba(231, 196, 103, 0.1);
}

.hero-title span {
  display: inline-block;
  opacity: 1;
  filter: none;
  transform: none;
  animation: none;
}

.hero-title span:last-child {
  animation-delay: 0ms;
}

.hero-role {
  margin: 2rem 0 0 0.35rem;
  color: var(--soft);
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes nameArrive {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes roleArrive {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.works {
  min-height: 70svh;
}

.case-filters {
  position: absolute;
  left: 50%;
  top: 1.35rem;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 1.7rem;
  transform: translateX(-50%);
}

.case-filter {
  position: relative;
  padding: 0.35rem 0;
  background: transparent;
  color: rgba(242, 236, 220, 0.52);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.84rem;
  font-weight: 300;
  white-space: nowrap;
  transition: color 180ms ease;
}

.case-filter::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: rgba(231, 196, 103, 0.78);
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.case-filter:hover,
.case-filter:focus-visible,
.case-filter.is-active {
  color: rgba(246, 239, 222, 0.94);
}

.case-filter.is-active::after {
  width: 100%;
}

.gallery-stage {
  position: relative;
  height: 70svh;
  overflow: hidden;
}

.gallery-track {
  position: absolute;
  inset: 2vh 0 8vh;
  perspective: 80rem;
  touch-action: pan-y;
  outline: none;
}

.work-card {
  --card-opacity: 0;
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(43rem, 48vw);
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: rgba(2, 12, 34, 0.72);
  box-shadow: 0 2.2rem 5rem rgba(0, 5, 19, 0.42);
  opacity: var(--card-opacity);
  transform: translate3d(-50%, -50%, 0) scale(0.74);
  transition:
    transform 520ms cubic-bezier(0.18, 0.8, 0.22, 1),
    opacity 380ms ease,
    filter 420ms ease,
    border-color 420ms ease,
    box-shadow 420ms ease;
  will-change: transform, opacity;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) brightness(0.55);
  transition:
    filter 420ms ease,
    transform 520ms cubic-bezier(0.18, 0.8, 0.22, 1);
}

.work-card.is-active {
  --card-opacity: 1;
  z-index: 5;
  border-color: rgba(231, 196, 103, 0.42);
  box-shadow:
    0 2.5rem 6rem rgba(0, 5, 19, 0.48),
    0 0 2.4rem rgba(231, 196, 103, 0.13);
  transform: translate3d(-50%, -50%, 0) scale(1);
}

.work-card.is-active img {
  filter: saturate(0.96) brightness(0.9);
}

.work-card.is-prev {
  --card-opacity: 0.42;
  z-index: 3;
  transform: translate3d(-112%, -50%, -8rem) rotateY(8deg) scale(0.72);
}

.work-card.is-next {
  --card-opacity: 0.42;
  z-index: 3;
  transform: translate3d(12%, -50%, -8rem) rotateY(-8deg) scale(0.72);
}

.work-card.is-far-prev {
  --card-opacity: 0.12;
  z-index: 1;
  transform: translate3d(-150%, -50%, -14rem) rotateY(10deg) scale(0.55);
}

.work-card.is-far-next {
  --card-opacity: 0.12;
  z-index: 1;
  transform: translate3d(50%, -50%, -14rem) rotateY(-10deg) scale(0.55);
}

.work-card.is-hidden {
  pointer-events: none;
  transform: translate3d(-50%, -50%, -18rem) scale(0.45);
}

.work-card.is-active:hover,
.work-card.is-active:focus-visible {
  border-color: rgba(244, 214, 130, 0.72);
  box-shadow:
    0 2.7rem 6.2rem rgba(0, 5, 19, 0.52),
    0 0 3.2rem rgba(231, 196, 103, 0.2);
}

.work-card.is-active:hover img,
.work-card.is-active:focus-visible img {
  filter: saturate(1) brightness(0.98);
  transform: scale(1.012);
}

.auto-cover-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--soft);
  font-size: 0.9rem;
}

.case-count {
  margin: 0;
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: 0;
}

.case-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gallery-arrow {
  position: absolute;
  top: 56%;
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(3, 15, 38, 0.48);
  color: rgba(242, 236, 220, 0.74);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(231, 196, 103, 0.18);
  transition:
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
  transform: translateY(-50%);
  pointer-events: auto;
}

.gallery-prev {
  left: 8vw;
}

.gallery-next {
  right: 8vw;
}

.case-count {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  color: var(--ink);
  background: rgba(84, 64, 20, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(231, 196, 103, 0.5),
    0 0 1.4rem rgba(231, 196, 103, 0.12);
  transform: translateY(-50%) scale(1.06);
}

.empty-cases {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  color: var(--soft);
  transform: translate(-50%, -50%);
}

.profile {
  min-height: 78svh;
  padding: 4svh 9vw 7svh;
  display: flex;
  align-items: flex-start;
}

.profile-layout {
  width: min(86rem, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(28rem, 1.25fr) minmax(13rem, 0.62fr);
  gap: clamp(2.5rem, 4.5vw, 5rem);
  align-items: center;
}

.profile-index {
  padding-top: 2rem;
}

.profile-name {
  margin: 0;
}

.profile-name strong {
  color: rgba(246, 239, 222, 0.95);
  font-size: 3.9rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 0 2rem rgba(231, 196, 103, 0.12);
}

.profile-facts {
  margin-top: 3.2rem;
  display: grid;
  gap: 1rem;
}

.profile-facts p {
  margin: 0;
}

.profile-facts span {
  color: var(--soft);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
}

.experience-index {
  display: grid;
  gap: 2.4rem;
}

.experience-index article {
  min-height: 4.8rem;
  padding-left: 0;
  display: grid;
  align-content: center;
  gap: 0.55rem;
}

.experience-index article:nth-child(2),
.experience-index article:nth-child(3) {
  margin-left: 0;
}

.experience-index strong {
  color: rgba(246, 239, 222, 0.92);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.experience-index span {
  color: var(--muted);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.7;
}

.contact-inline {
  display: grid;
  justify-items: start;
  gap: 2rem;
}

.contact-methods {
  margin-top: 0;
  display: grid;
  gap: 0.9rem;
  color: rgba(246, 239, 222, 0.94);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 1.22rem;
  font-weight: 400;
}

.contact-methods a {
  white-space: nowrap;
  transition:
    color 220ms ease,
    text-shadow 220ms ease;
}

.contact-methods a:hover,
.contact-methods a:focus-visible {
  color: var(--ink);
  text-shadow: 0 0 1rem rgba(231, 196, 103, 0.36);
}

.qr-figure {
  width: 9.5rem;
  margin: 0;
  padding: 0.55rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 1.6rem 4rem rgba(0, 5, 19, 0.38),
    0 0 2.4rem rgba(231, 196, 103, 0.12);
}

.qr-figure img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.case-dialog {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #020816;
  color: var(--ink);
}

.case-dialog::backdrop {
  background: rgba(0, 3, 12, 0.86);
  backdrop-filter: blur(0.65rem);
}

.dialog-panel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020816;
}

.dialog-close {
  position: fixed;
  right: 1.2rem;
  top: 1.05rem;
  z-index: 14;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(4, 15, 36, 0.82);
  color: rgba(246, 239, 222, 0.82);
  font-family: Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 200;
  box-shadow: inset 0 0 0 1px rgba(231, 196, 103, 0.22);
}

.pdf-toolbar {
  position: fixed;
  left: 1.3rem;
  top: 1.2rem;
  z-index: 14;
  color: rgba(242, 236, 220, 0.54);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
}

.pdf-stage {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: #020816;
}

.pdf-pages {
  position: relative;
  z-index: 2;
  width: min(100%, 92rem);
  margin: 0 auto;
  padding: 5rem 1rem 4rem;
  display: grid;
  gap: 0.8rem;
}

.pdf-page-shell {
  position: relative;
  width: 100%;
  min-height: 22rem;
  overflow: hidden;
  background: #0b1324;
  box-shadow: 0 0.8rem 2.6rem rgba(0, 0, 0, 0.28);
}

.pdf-page-shell canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.pdf-page-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  color: rgba(242, 236, 220, 0.36);
  transform: translate(-50%, -50%);
}

.pdf-page-shell.is-rendered .pdf-page-loading {
  display: none;
}

.pdf-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  margin: 0;
  color: rgba(242, 236, 220, 0.54);
  transform: translate(-50%, -50%);
}

.pdf-stage.is-ready .pdf-loading {
  display: none;
}

.pdf-file-fallback {
  width: 100%;
  height: calc(100svh - 4rem);
  border: 0;
}

.viewer-watermark {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-content: start;
  gap: 5rem 2rem;
  padding: 8rem 0;
  opacity: 0.11;
  transform: rotate(-22deg) scale(1.18);
  transform-origin: center;
}

.viewer-watermark span {
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .hero-title {
    font-size: 6.8rem;
  }

  .profile-layout {
    grid-template-columns: minmax(12rem, 0.7fr) minmax(23rem, 1.2fr) minmax(11rem, 0.56fr);
    gap: 3vw;
  }

  .profile-name strong {
    font-size: 3.6rem;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 100svh;
  }

  .hero-copy {
    padding: 0 1.4rem;
    justify-content: center;
  }

  .hero-title {
    display: flex;
    gap: 0.7rem;
    font-size: 4.1rem;
    line-height: 1;
    white-space: nowrap;
  }

  .hero-title span {
    display: inline-block;
  }

  .hero-title span:last-child {
    margin-left: 0;
  }

  .hero-role {
    margin: 1.25rem 0 0 0.15rem;
    font-size: 0.92rem;
  }

  .works {
    min-height: 55svh;
  }

  .case-filters {
    top: 0.7rem;
    gap: 1.25rem;
  }

  .case-filter {
    font-size: 0.76rem;
  }

  .gallery-stage {
    height: 55svh;
  }

  .gallery-track {
    inset: 2svh 0 7svh;
  }

  .work-card {
    top: 50%;
    width: 76vw;
    border-radius: 0.4rem;
  }

  .work-card.is-prev {
    transform: translate3d(-121%, -50%, -6rem) rotateY(6deg) scale(0.7);
  }

  .work-card.is-next {
    transform: translate3d(21%, -50%, -6rem) rotateY(-6deg) scale(0.7);
  }

  .work-card.is-far-prev,
  .work-card.is-far-next {
    --card-opacity: 0;
  }

  .gallery-prev {
    left: 0.7rem;
  }

  .gallery-next {
    right: 0.7rem;
  }

  .case-count {
    top: calc(50% + 21.5vw - 0.45rem);
    bottom: auto;
  }

  .gallery-arrow {
    top: 50%;
  }

  .profile {
    min-height: auto;
    padding: 7svh 1.4rem 8svh;
    align-items: flex-start;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 3.6rem;
  }

  .profile-index {
    padding-top: 0;
  }

  .profile-name strong {
    font-size: 3.35rem;
  }

  .profile-facts {
    margin-top: 2rem;
  }

  .experience-index {
    gap: 3rem;
  }

  .experience-index article {
    padding-left: 0;
  }

  .experience-index article:nth-child(2),
  .experience-index article:nth-child(3) {
    margin-left: 0;
  }

  .experience-index strong {
    font-size: 1.2rem;
  }

  .experience-index span {
    font-size: 0.78rem;
  }

  .contact-methods {
    margin-top: 0;
    display: grid;
    gap: 0.7rem;
    font-size: 0.96rem;
  }

  .qr-figure {
    width: 8.8rem;
    margin: 0;
  }

  .pdf-pages {
    padding: 4rem 0.35rem 2rem;
    gap: 0.4rem;
  }

  .pdf-page-shell {
    min-height: 10rem;
  }

  .viewer-watermark {
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 1.4rem;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 3.75rem;
  }

  .hero-title span:last-child {
    margin-left: 0;
  }

  .hero-role {
    margin-left: 0.15rem;
  }

  .work-card {
    width: 76vw;
  }

  .profile-name strong {
    font-size: 3rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  [data-reveal] {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
