:root {
  --paper: #f4f4f1;
  --paper-deep: #e9e9e6;
  --ink: #1c1c1a;
  --muted: #77776f;
  --line: rgba(28, 28, 26, 0.16);
  --sage: #8a9b8a;
  --mauve: #9a7e8b;
  --blue-gray: #72808a;
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Alibaba PuHuiTi", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --page-max: 1440px;
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: calc(100% - (var(--gutter) * 2));
  max-width: var(--page-max);
  margin-inline: auto;
}

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 244, 241, 0.9);
  backdrop-filter: blur(18px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  font-size: 15px;
  font-weight: 650;
}

.brand__en {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 52px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--nav-height);
  color: var(--muted);
  font-size: 13px;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 19px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.hero {
  position: relative;
  display: flex;
  min-height: 100svh;
  align-items: flex-end;
  overflow: hidden;
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: clamp(64px, 10vw, 132px);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: saturate(0.62) brightness(0.9);
}

.hero__wash {
  position: absolute;
  inset: 0;
  background: rgba(244, 244, 241, 0.10);
  mix-blend-mode: screen;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.hero h1 {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: 4.75rem;
  font-weight: 400;
  line-height: 1.05;
}

.hero__name-en {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
}

.hero__role {
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 42px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

.button:hover {
  background: transparent;
  color: var(--ink);
}

.button--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button--ghost:hover {
  border-color: var(--ink);
}

.button svg {
  width: 17px;
  height: 17px;
}

.section {
  padding-block: clamp(80px, 12vw, 160px);
}

.section--tight {
  padding-block: clamp(56px, 8vw, 112px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 68px;
}

.section-head__label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1.15;
}

.section-head__note {
  max-width: 390px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.page-hero {
  min-height: 72svh;
  display: flex;
  align-items: flex-end;
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: clamp(64px, 9vw, 118px);
}

.page-hero__eyebrow {
  color: var(--muted);
}

.page-hero h1 {
  max-width: 920px;
  margin: 26px 0 0;
  font-family: var(--serif);
  font-size: 4.25rem;
  font-weight: 400;
  line-height: 1.08;
}

.page-hero__lead {
  max-width: 650px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.page-hero--image {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.page-hero--image::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(244, 244, 241, 0.10);
  content: "";
}

.page-hero--image .container {
  position: relative;
  z-index: 1;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(44px, 8vw, 118px);
  align-items: start;
}

.about-layout__intro {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
}

.about-layout__intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.2;
}

.about-layout__intro p {
  margin: 28px 0 0;
  color: var(--muted);
}

.about-detail {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
}

.about-detail:last-child {
  border-bottom: 1px solid var(--line);
}

.about-detail__label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.about-detail__body {
  margin: 0;
}

.about-detail__body strong {
  display: block;
  font-weight: 600;
}

.about-detail__body span,
.about-detail__body p {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.about-detail__body p {
  margin-bottom: 0;
}

.about-detail__body ul,
.outcome-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.about-detail__body li,
.outcome-list li {
  margin-top: 5px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.contact-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-item {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 0;
}

.contact-item + .contact-item {
  padding-left: clamp(24px, 5vw, 64px);
  border-left: 1px solid var(--line);
}

.contact-item__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.contact-item a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 600;
}

.contact-item a svg {
  width: 18px;
  height: 18px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 48px;
}

.filter-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    color 0.3s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.works-grid,
.featured-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px 24px;
}

.works-grid {
  padding-top: 20px;
}

.featured-grid {
  padding-top: 20px;
}

.project-card {
  min-width: 0;
}

.project-card[data-size="standard"] {
  grid-column: span 4;
}

.project-card[data-size="tall"] {
  grid-column: span 3;
  margin-top: 70px;
}

.project-card[data-size="wide"] {
  grid-column: span 5;
  margin-top: 36px;
}

.project-card__link {
  display: block;
}

.project-card__media {
  background: var(--paper-deep);
}

.project-card__media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: saturate(0.78);
  transition:
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 0.45s ease;
}

.project-card__link:hover .project-card__media img {
  transform: scale(1.045);
  filter: saturate(0.98);
}

.project-card__body {
  position: relative;
  padding-top: 16px;
  padding-right: 34px;
}

.project-card__meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.project-card__body h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.25;
}

.project-card__body p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.project-card__arrow {
  position: absolute;
  right: 0;
  bottom: 2px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.project-card__link:hover .project-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

.project-card__arrow svg {
  width: 16px;
  height: 16px;
}

dialog[data-project-modal] {
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(20, 20, 19, 0.26);
}

dialog[data-project-modal]::backdrop {
  background: rgba(20, 20, 19, 0.56);
  backdrop-filter: blur(7px);
}

.modal-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  min-height: min(720px, calc(100dvh - 48px));
}

.modal-gallery {
  position: relative;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: var(--paper-deep);
}

.modal-gallery img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.modal-close {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(244, 244, 241, 0.7);
  background: rgba(244, 244, 241, 0.9);
  color: var(--ink);
  cursor: pointer;
}

.gallery-btn {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(244, 244, 241, 0.7);
  border-radius: 50%;
  background: rgba(244, 244, 241, 0.84);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

.gallery-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.gallery-btn--prev {
  left: 16px;
}

.gallery-btn--next {
  right: 16px;
}

.gallery-count {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  min-width: 58px;
  padding: 8px 10px;
  background: rgba(244, 244, 241, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.modal-info {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  padding: clamp(28px, 5vw, 60px);
}

.modal-info__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-info h2 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.2;
}

.modal-info__subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.modal-info__description {
  margin: 28px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.85;
}

.modal-info__block {
  margin-top: 26px;
}

.modal-info__block h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-info__block p {
  margin: 0;
  font-size: 13px;
}

.modal-info__tags {
  margin-top: auto;
  padding-top: 36px;
}

.site-footer {
  padding-block: 64px 40px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.site-footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.site-footer h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.7rem;
  font-weight: 400;
}

.site-footer__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-size: 14px;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    right: var(--gutter);
    left: var(--gutter);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px 0;
    border: 1px solid var(--line);
    background: rgba(244, 244, 241, 0.98);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-link {
    height: 54px;
    padding: 0 20px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 3.8rem;
  }

  .page-hero h1 {
    font-size: 3.5rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .about-layout__intro {
    position: static;
  }

  .project-card[data-size="standard"],
  .project-card[data-size="tall"],
  .project-card[data-size="wide"] {
    grid-column: span 6;
    margin-top: 0;
  }

  .project-card[data-size="tall"] {
    margin-top: 52px;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 20px;
    --nav-height: 64px;
  }

  .hero {
    align-items: flex-end;
    padding-top: calc(var(--nav-height) + 30px);
    padding-bottom: 70px;
  }

  .hero__content {
    max-width: none;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero__name-en {
    margin-top: 14px;
  }

  .hero__role {
    margin-top: 24px;
  }

  .hero__actions {
    margin-top: 32px;
  }

  .button {
    min-height: 44px;
    padding-inline: 18px;
  }

  .section {
    padding-block: 72px;
  }

  .section-head {
    display: block;
    margin-bottom: 42px;
  }

  .section-head h2 {
    font-size: 2.4rem;
  }

  .section-head__note {
    margin-top: 20px;
  }

  .page-hero {
    min-height: 58svh;
    padding-top: calc(var(--nav-height) + 28px);
    padding-bottom: 58px;
  }

  .page-hero h1 {
    font-size: 2.55rem;
  }

  .about-detail {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-band {
    grid-template-columns: 1fr;
  }

  .contact-item {
    min-height: 120px;
  }

  .contact-item + .contact-item {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .project-card[data-size="standard"],
  .project-card[data-size="tall"],
  .project-card[data-size="wide"] {
    grid-column: span 12;
    margin-top: 0;
  }

  dialog[data-project-modal] {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .modal-shell {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 20px);
  }

  .modal-gallery {
    min-height: 260px;
  }

  .modal-info {
    overflow: auto;
  }

  .site-footer__top {
    display: block;
  }

  .site-footer__contact {
    align-items: flex-start;
    margin-top: 24px;
  }

  .site-footer__bottom {
    display: block;
  }

  .site-footer__bottom span {
    display: block;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}


/* Homepage portrait composition: photo left, text in the right-side negative space. */
.hero > .hero__content {
  width: min(560px, 42vw);
  max-width: none;
  margin-left: auto;
  margin-right: var(--gutter);
}

@media (min-width: 561px) and (max-width: 980px) {
  .hero > .hero__content {
    width: min(24vw, 210px);
    margin-left: auto;
    margin-right: var(--gutter);
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .hero__name-en,
  .hero__role {
    font-size: 0.82rem;
  }

  .hero__actions {
    gap: 8px;
    margin-top: 26px;
  }

  .hero__actions .button {
    min-height: 42px;
    padding-inline: 12px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .hero > .hero__content {
    width: calc(100% - (var(--gutter) * 2));
    margin-left: var(--gutter);
    margin-right: var(--gutter);
  }
}



/* Works page hero: blurred image behind a light frosted layer. */
.page-hero--frosted {
  background-image: none;
  background-color: var(--paper);
}

.page-hero--frosted::before {
  position: absolute;
  inset: -22px;
  z-index: 0;
  background-image: var(--page-hero-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  filter: blur(8px) saturate(0.7);
  opacity: 0.32;
  transform: scale(1.03);
  pointer-events: none;
}

.page-hero--frosted::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(244, 244, 241, 0.28);
  backdrop-filter: blur(6px);
  content: "";
  pointer-events: none;
}

.page-hero--frosted .container {
  position: relative;
  z-index: 2;
}


/* Smooth the works hero into the project index below. */
.page-hero--frosted {
  padding-bottom: clamp(48px, 5vw, 76px);
}

.page-hero--frosted::before {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.works-index {
  padding-top: 52px;
}

/* Global matte finish: fine grain plus a light neutral veil. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-image: url('../images/matte-grain.png');
  background-repeat: repeat;
  background-size: 180px 180px;
  content: "";
  opacity: 0.028;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(255, 255, 255, 0.03);
  content: "";
  pointer-events: none;
}


/* Slightly reduce featured cards without changing the works page. */
.featured-grid .project-card__media,
.featured-grid .project-card__body {
  width: min(88%, 520px);
  margin-right: auto;
  margin-left: auto;
}
