:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #10131a;
  --panel-2: #151922;
  --ink: #f3efe4;
  --muted: #9ea6b4;
  --soft: #6f7788;
  --line: rgba(255, 255, 255, 0.12);
  --gold: #d8ad64;
  --teal: #53d6cf;
  --red: #d35a4a;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(83, 214, 207, 0.08), transparent 28%),
    linear-gradient(250deg, rgba(211, 90, 74, 0.1), transparent 34%),
    var(--bg);
  font-family:
    "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(300px, 25vw) 1fr;
  min-height: 100vh;
}

.profile-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  height: 100vh;
  padding: 38px 32px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(216, 173, 100, 0.09), transparent 34%),
    rgba(9, 11, 15, 0.9);
  border-right: 1px solid var(--line);
  box-shadow: 28px 0 70px var(--shadow);
  backdrop-filter: blur(18px);
}

.identity h1,
.hero h2,
.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0;
}

.identity h1 {
  margin-top: 10px;
  font-family: "Lantinghei SC", "FZLanTingHeiS-R-GB", "FZLanTingHeiS-DB-GB", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  font-size: clamp(42px, 4vw, 72px);
  line-height: 0.95;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.role {
  max-width: 12em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  overflow: hidden;
}

.quick-stats div {
  min-width: 0;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
}

.quick-stats div:last-child {
  border-right: 0;
}

.quick-stats strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.quick-stats span {
  display: block;
  margin-top: 7px;
  color: var(--soft);
  font-size: 11px;
  text-transform: uppercase;
}

.resume-block {
  padding-top: 2px;
}

.resume-block h2 {
  margin: 0 0 11px;
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.resume-block p,
.resume-block li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.resume-block p {
  margin: 0;
}

.resume-block ul,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resume-block li {
  margin-bottom: 9px;
}

.timeline {
  display: grid;
  gap: 15px;
}

.timeline li {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(216, 173, 100, 0.5);
}

.timeline span,
.timeline em {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

.timeline strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 14px;
}

.compact p {
  color: #c9ced8;
}

.resume-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: auto;
  padding: 0 18px;
  color: #17120a;
  text-decoration: none;
  background: var(--gold);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.resume-link:hover {
  background: #edc780;
  box-shadow: 0 16px 36px rgba(216, 173, 100, 0.18);
  transform: translateY(-2px);
}

.portfolio {
  min-width: 0;
}

.section-band {
  padding-inline: clamp(22px, 5vw, 80px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.95fr);
  gap: clamp(28px, 6vw, 86px);
  align-items: center;
  min-height: 92vh;
  padding-top: 54px;
  padding-bottom: 68px;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h2 {
  max-width: 850px;
  margin-top: 18px;
  font-size: clamp(52px, 7vw, 128px);
  line-height: 0.9;
}

.hero-copy > p:last-of-type {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.top-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: 0;
  padding-top: 22px;
  padding-bottom: 18px;
  background: rgba(8, 9, 12, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.filter-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.filter-button:hover,
.filter-button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(216, 173, 100, 0.6);
  transform: translateY(-2px);
}

.hero-stage {
  position: relative;
  min-height: 650px;
}

.hero-stage::before {
  position: absolute;
  inset: 10% 6% 3% 2%;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-image {
  position: absolute;
  inset: 0 13% 0 auto;
  width: min(390px, 72%);
  height: 88%;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(var(--hover-scale, 1));
  transition: transform 260ms ease;
}

.hero-image.secondary {
  inset: auto auto 5% 0;
  width: min(300px, 56%);
  height: 66%;
  object-position: center;
}

.hero-stage:hover .hero-image {
  --hover-scale: 1.015;
}

.hero-caption {
  position: absolute;
  right: 4%;
  bottom: 9%;
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  background: rgba(8, 9, 12, 0.78);
  border-left: 3px solid var(--gold);
}

.hero-caption span {
  color: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
}

.hero-caption strong {
  font-size: 15px;
}

.case-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding-top: 18px;
  padding-bottom: 28px;
  background: rgba(255, 255, 255, 0.04);
  border-block: 1px solid var(--line);
}

.case-strip article {
  min-height: 210px;
  padding: 34px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 62%),
    rgba(8, 9, 12, 0.72);
}

.case-strip span,
.workflow-grid span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-strip h3,
.workflow-grid h3 {
  margin: 12px 0 10px;
  font-size: 24px;
}

.case-strip h3 {
  line-height: 1.15;
}

.case-strip p,
.workflow-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.gallery-section {
  padding-top: 36px;
  padding-bottom: 58px;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading h2 {
  font-size: clamp(36px, 5vw, 76px);
  line-height: 0.96;
}

.workflow-section .section-heading h2 {
  font-family: "Lantinghei SC", "FZLanTingHeiS-R-GB", "FZLanTingHeiS-DB-GB", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

.section-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.gallery-grid.placeholder-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.masonry-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.masonry-appendix {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 38px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.appendix-heading {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}

.appendix-heading small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.appendix-heading strong {
  color: var(--ink);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1;
}

.art-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  cursor: pointer;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
}

.art-card.wide {
  min-height: 0;
}

.art-card.tall {
  min-height: 0;
}

.art-card.featured {
  min-height: 0;
}

.art-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.96) contrast(1.03);
  transition: filter 260ms ease;
}

.art-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84), transparent 48%);
  opacity: 0.86;
  transition: opacity 250ms ease;
}

.art-card:hover img {
  filter: saturate(1.12) contrast(1.06);
}

.art-card:hover::after {
  opacity: 0.68;
}

.art-card figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 2;
  display: grid;
  gap: 7px;
}

.art-card small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.art-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.art-card span {
  color: var(--muted);
  font-size: 13px;
}

.placeholder-card {
  grid-column: 1 / -1;
  min-height: 200px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.placeholder-card h3 {
  margin: 0 0 12px;
}

.placeholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  white-space: normal;
}

.workflow-section {
  padding-top: 38px;
  padding-bottom: 80px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.workflow-grid article {
  padding: 28px;
  background: rgba(14, 17, 24, 0.92);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 34px;
  pointer-events: none;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.lightbox.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.lightbox figure {
  position: relative;
  width: min(100%, 1280px);
  height: 100%;
  margin: 0;
}

.lightbox img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: auto;
  max-width: calc(100vw - 188px);
  height: auto;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.lightbox figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  justify-content: center;
  color: var(--muted);
}

.lightbox figcaption strong {
  color: var(--ink);
  font-size: 18px;
}

.lightbox button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  transition: background 180ms ease, transform 180ms ease;
}

.lightbox button:hover {
  background: rgba(216, 173, 100, 0.22);
  transform: scale(1.04);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  font-size: 30px;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  z-index: 2;
  font-size: 34px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(-50%) scale(1.04);
}

@media (max-width: 1180px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    position: relative;
    height: auto;
    padding: 28px 24px;
  }

  .resume-link {
    margin-top: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stage {
    min-height: 620px;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .section-band {
    padding-inline: 18px;
  }

  .profile-panel {
    gap: 16px;
    padding: 24px;
  }

  .identity h1 {
    font-size: 46px;
  }

  .role {
    margin-top: 8px;
    font-size: 16px;
  }

  .quick-stats {
    grid-template-columns: 1fr 1fr;
  }

  .quick-stats div:nth-child(2) {
    border-right: 0;
  }

  .quick-stats div:last-child {
    grid-column: span 2;
    border-top: 1px solid var(--line);
  }

  .resume-block:nth-of-type(n+3) {
    display: none;
  }

  .resume-block p,
  .resume-block li {
    font-size: 13px;
  }

  .resume-link {
    min-height: 42px;
    margin-top: 0;
  }

  .hero h2 {
    font-size: clamp(44px, 13vw, 72px);
  }

  .hero-stage {
    min-height: 520px;
  }

  .case-strip,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .masonry-appendix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid.placeholder-mode {
    grid-template-columns: 1fr;
  }

  .art-card,
  .art-card.wide,
  .art-card.tall,
  .art-card.featured,
  .placeholder-card {
    min-height: 0;
  }

  .placeholder-card {
    min-height: 200px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox figure {
    height: 100%;
  }

  .lightbox img {
    max-width: calc(100vw - 104px);
    max-height: calc(100vh - 128px);
  }

  .lightbox-prev {
    left: 16px;
  }

  .lightbox-next {
    right: 16px;
  }
}

@media (max-width: 540px) {
  .profile-panel {
    gap: 20px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-stage {
    min-height: 430px;
  }

  .hero-image {
    right: 4%;
    width: 68%;
  }

  .hero-image.secondary {
    width: 52%;
  }

  .hero-caption {
    right: 0;
    bottom: 2%;
  }

  .art-card,
  .art-card.wide,
  .art-card.tall,
  .art-card.featured {
    min-height: 0;
  }

  .gallery-grid,
  .masonry-appendix {
    grid-template-columns: 1fr;
  }
}

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