:root {
  --paper: #f2ede3;
  --paper-deep: #e5ded1;
  --ink: #171713;
  --muted: #6d685f;
  --line: #c9c0b2;
  --accent: #9b412f;
  --night: #11110f;
  --night-text: #f7f2e8;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong",
    "Noto Serif CJK SC", serif;
  --sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

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

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

::selection {
  background: var(--accent);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  margin: 0 clamp(20px, 5vw, 88px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.wordmark-cn {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.wordmark-en,
.eyebrow,
.frame-caption,
.filter-row,
.works-summary,
.gallery-caption,
.about-index,
.footer-grid,
.lightbox-topbar,
.lightbox-caption {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark-en {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(26px, 3vw, 48px);
  font-size: 12px;
}

.site-nav a {
  position: relative;
  padding: 12px 0;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 7px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
  padding: 10px 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.hero {
  display: grid;
  min-height: calc(100svh - 74px);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 46px);
  padding: clamp(54px, 7vw, 108px) clamp(20px, 5vw, 88px)
    clamp(72px, 8vw, 126px);
}

.hero-copy {
  grid-column: 1 / span 5;
  padding-top: clamp(6px, 3vw, 46px);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.hero h1 {
  max-width: 620px;
  margin: clamp(35px, 5vw, 74px) 0 0;
  font-family: var(--serif);
  font-size: clamp(58px, 7.2vw, 110px);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.hero-intro {
  margin: clamp(30px, 4vw, 58px) 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(30px, 5vw, 72px);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.scroll-cue span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 180ms ease, color 180ms ease;
}

.scroll-cue:hover span {
  background: var(--ink);
  color: var(--paper);
}

.hero-frame {
  align-self: start;
  grid-column: 7 / -1;
  margin: 0;
}

.hero-image-button {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.hero-image-wrap,
.gallery-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--paper-deep);
}

.hero-image-wrap::after,
.gallery-image-wrap::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(23 23 19 / 8%);
  content: "";
  pointer-events: none;
}

.hero-image {
  width: 100%;
}

#hero-image {
  width: 100%;
  height: min(70svh, 810px);
  object-fit: cover;
  transition: filter 450ms ease, transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-image-button:hover #hero-image {
  transform: scale(1.018);
}

.hero-open,
.gallery-open {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  background: rgb(242 237 227 / 92%);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hero-image-button:hover .hero-open,
.photo-button:hover .gallery-open {
  opacity: 1;
  transform: translateY(0);
}

.frame-caption {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding-top: 13px;
  color: var(--muted);
}

.frame-caption b {
  font-weight: 400;
}

.frame-caption span:nth-child(2) {
  color: var(--ink);
  text-align: center;
}

.frame-caption span:last-child {
  text-align: right;
}

.works-section {
  padding: clamp(100px, 12vw, 190px) clamp(20px, 5vw, 88px)
    clamp(120px, 14vw, 220px);
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: end;
  gap: 30px;
  padding-bottom: clamp(38px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(60px, 8vw, 118px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.works-summary {
  display: grid;
  grid-template-columns: auto minmax(130px, 260px);
  gap: 20px;
  align-items: end;
  justify-self: end;
  color: var(--muted);
  text-align: right;
}

.works-summary strong {
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.75;
}

.works-summary p {
  margin: 0;
}

.demo-notice {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 4fr;
  gap: 28px;
  margin-top: 24px;
  padding: 17px 20px;
  border-left: 3px solid var(--accent);
  background: #e8dfd0;
  font-size: 12px;
}

.demo-notice span {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.demo-notice p {
  margin: 0;
  color: var(--muted);
}

.filter-row {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: clamp(28px, 4vw, 58px);
}

.filter-button {
  position: relative;
  padding: 13px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: inherit;
}

.filter-button::after {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.filter-button.is-active {
  color: var(--ink);
}

.filter-button.is-active::after {
  transform: scaleX(1);
}

.filter-button small {
  margin-left: 6px;
  color: var(--accent);
  font-size: 8px;
  vertical-align: super;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(64px, 9vw, 150px) clamp(20px, 3.4vw, 54px);
}

.gallery-loading,
.gallery-empty {
  grid-column: 1 / -1;
  min-height: 300px;
  margin: 0;
  padding-top: 70px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 24px;
}

.gallery-item {
  grid-column: span 6;
  margin: 0;
}

.gallery-item:nth-child(6n + 1) {
  grid-column: span 7;
}

.gallery-item:nth-child(6n + 2) {
  grid-column: span 5;
  margin-top: clamp(40px, 8vw, 120px);
}

.gallery-item:nth-child(6n + 3) {
  grid-column: 2 / span 4;
}

.gallery-item:nth-child(6n + 4) {
  grid-column: 7 / span 6;
  margin-top: clamp(70px, 12vw, 180px);
}

.gallery-item:nth-child(6n + 5) {
  grid-column: span 5;
  margin-top: clamp(30px, 6vw, 90px);
}

.gallery-item:nth-child(6n) {
  grid-column: span 7;
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.gallery-image-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 420ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1),
    filter 300ms ease;
}

.gallery-item:nth-child(6n + 2) .gallery-image-wrap img,
.gallery-item:nth-child(6n + 3) .gallery-image-wrap img,
.gallery-item:nth-child(6n + 5) .gallery-image-wrap img {
  aspect-ratio: 4 / 5;
}

.gallery-image-wrap img.is-loaded {
  opacity: 1;
  transform: none;
}

.photo-button:hover img {
  filter: saturate(0.86) contrast(1.03);
  transform: scale(1.018);
}

.image-fallback {
  display: grid;
  min-height: 320px;
  place-items: center;
  background: #ddd4c6;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
}

.gallery-caption {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  padding-top: 14px;
  color: var(--muted);
}

.gallery-index {
  color: var(--accent);
}

.gallery-caption strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.gallery-caption small {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.gallery-place {
  max-width: 170px;
  text-align: right;
}

.about-section {
  display: grid;
  min-height: 86svh;
  grid-template-columns: 100px minmax(300px, 1.3fr) minmax(280px, 0.7fr);
  gap: clamp(34px, 6vw, 100px);
  align-items: center;
  padding: clamp(100px, 12vw, 180px) clamp(20px, 5vw, 88px);
  background: var(--night);
  color: var(--night-text);
}

.about-index {
  align-self: start;
  padding-top: 10px;
  color: #827e75;
  writing-mode: vertical-rl;
}

.eyebrow-light {
  color: #b86c58;
}

.about-heading h2 {
  max-width: 820px;
  margin: clamp(40px, 6vw, 78px) 0 0;
  font-family: var(--serif);
  font-size: clamp(54px, 7vw, 104px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 1;
}

.about-copy {
  align-self: end;
  max-width: 480px;
  padding-bottom: 7px;
  color: #b9b4aa;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
}

.about-copy p {
  margin: 0;
}

.about-copy p + p {
  margin-top: 28px;
}

.site-footer {
  padding: clamp(95px, 12vw, 190px) clamp(20px, 5vw, 88px) 34px;
  background: var(--paper);
}

.footer-statement {
  margin: 0;
  padding-bottom: clamp(100px, 13vw, 200px);
  font-family: var(--serif);
  font-size: clamp(60px, 9.5vw, 150px);
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  align-items: end;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-meta,
.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links {
  justify-self: center;
}

.footer-records {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  justify-self: end;
}

.mps-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.mps-icon {
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
  object-fit: contain;
}

.footer-grid a {
  transition: color 160ms ease;
}

.footer-grid a:hover {
  color: var(--accent);
}

.lightbox {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  grid-template-rows: 64px minmax(0, 1fr) 76px;
  background: rgb(17 17 15 / 98%);
  color: var(--night-text);
  animation: lightbox-in 180ms ease both;
}

.lightbox-topbar {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
  color: #aaa59b;
}

.lightbox-close {
  justify-self: end;
  padding: 12px 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  letter-spacing: 0.08em;
}

.lightbox-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 20px;
}

.lightbox-stage img {
  width: auto;
  max-width: min(100%, 1600px);
  height: auto;
  max-height: calc(100svh - 180px);
  object-fit: contain;
  animation: image-in 220ms ease both;
}

.lightbox-arrow {
  align-self: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 19px;
  transition: background 160ms ease, color 160ms ease;
}

.lightbox-arrow:hover {
  background: var(--night-text);
  color: var(--night);
}

.lightbox-prev {
  justify-self: center;
}

.lightbox-next {
  grid-column: 3;
  justify-self: center;
}

.lightbox-caption {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgb(255 255 255 / 14%);
  color: #aaa59b;
}

.lightbox-caption strong {
  color: var(--night-text);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.noscript-note {
  position: fixed;
  z-index: 400;
  right: 20px;
  bottom: 20px;
  margin: 0;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
  }
}

@keyframes image-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
}

@media (max-width: 1020px) {
  .hero-copy {
    grid-column: span 6;
  }

  .hero-frame {
    grid-column: 7 / -1;
  }

  .hero h1 {
    font-size: clamp(52px, 7.7vw, 82px);
  }

  .about-section {
    grid-template-columns: 60px 1fr;
  }

  .about-copy {
    grid-column: 2;
    padding-top: 20px;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 62px;
    margin-inline: 20px;
  }

  .wordmark-en {
    display: none;
  }

  .wordmark-cn {
    font-size: 23px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 62px;
    right: -20px;
    left: -20px;
    display: none;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 8px 20px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a::after {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 52px;
    padding: 44px 20px 82px;
  }

  .hero-copy,
  .hero-frame {
    grid-column: 1;
  }

  .hero-copy {
    padding-top: 0;
  }

  .hero h1 {
    margin-top: 34px;
    font-size: clamp(48px, 14vw, 72px);
    line-height: 0.98;
  }

  .hero-intro {
    margin-top: 30px;
    font-size: 16px;
  }

  .scroll-cue {
    margin-top: 28px;
  }

  #hero-image {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .hero-open,
  .gallery-open {
    display: none;
  }

  .frame-caption {
    grid-template-columns: 1fr auto;
  }

  .frame-caption span:nth-child(2) {
    display: none;
  }

  .works-section {
    padding: 96px 20px 126px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 62px;
  }

  .works-summary {
    grid-template-columns: auto 1fr;
    justify-self: stretch;
    text-align: left;
  }

  .works-summary strong {
    font-size: 48px;
  }

  .demo-notice {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .filter-row {
    min-height: 88px;
    gap: 26px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 76px;
  }

  .gallery-item:nth-child(n) {
    grid-column: 1;
    margin-top: 0;
  }

  .gallery-image-wrap img,
  .gallery-item:nth-child(n) .gallery-image-wrap img {
    aspect-ratio: auto;
    max-height: 78svh;
  }

  .gallery-caption {
    grid-template-columns: 34px 1fr auto;
  }

  .gallery-place {
    max-width: 110px;
  }

  .about-section {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 92px 20px;
  }

  .about-index {
    display: none;
  }

  .about-heading h2 {
    margin-top: 40px;
    font-size: 50px;
  }

  .about-copy {
    grid-column: 1;
    padding-top: 50px;
  }

  .site-footer {
    padding: 92px 20px 28px;
  }

  .footer-statement {
    padding-bottom: 90px;
    font-size: 52px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .footer-meta {
    flex-direction: column;
    gap: 4px;
  }

  .footer-links,
  .footer-records {
    justify-self: start;
  }

  .footer-records {
    align-items: flex-start;
  }

  .lightbox {
    grid-template-columns: 52px 1fr 52px;
    grid-template-rows: 58px 1fr 72px;
  }

  .lightbox-topbar {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .lightbox-topbar > span:nth-child(2) {
    display: none;
  }

  .lightbox-arrow {
    width: 38px;
    height: 38px;
  }

  .lightbox-stage {
    padding: 10px 0;
  }

  .lightbox-caption {
    grid-column: 1 / -1;
    padding: 0 16px;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
