:root {
  --color: #000;
  --paper: #fff;
  --muted: #9a9a9a;
  --line: #e8e8e8;
  --leftW: clamp(9rem, 16vw, 13rem);
  --space: clamp(1rem, 2vw, 2rem);
  --modulePadX: clamp(1.25rem, 5vw, 5rem);
  --modulePadY: clamp(4.5rem, 9vh, 6.5rem);
  --big: clamp(1.4rem, 3vw, 3.3rem);
  --body: clamp(0.95rem, 1.05vw, 1.15rem);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

body {
  width: 100%;
  overflow-x: hidden;
  color: var(--color);
  background: var(--paper);
  font-family: Roboto, HelveticaNeue, Helvetica, "Noto Sans SC", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

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

button,
input {
  border-radius: 0;
  font: inherit;
}

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  background: #000;
  color: #fff;
  padding: 0.75rem 1rem;
}

.skip-link:focus {
  top: 1rem;
}

.artist-identity {
  position: fixed;
  left: var(--modulePadX);
  top: calc(var(--modulePadY) + 2.35rem);
  z-index: 120;
  display: flex;
  align-items: flex-start;
  width: fit-content;
  max-width: calc(var(--leftW) - var(--space));
  padding: 0.75rem 0.7rem;
  background: rgba(255, 255, 255, 0.58);
  color: #000;
  backdrop-filter: blur(12px);
  isolation: isolate;
  transition: background 0.45s ease, color 0.45s ease, transform 0.45s cubic-bezier(0.18, 1, 0.21, 1);
}

.artist-identity::before {
  display: none;
  content: "";
}

body.is-slicing .artist-identity {
  background: rgba(255, 255, 255, 0.58);
  color: #000;
  transform: translateY(-0.2rem);
}

body.is-slicing .side-nav {
  z-index: 120;
}

body.is-slicing .artist-identity::before {
  opacity: 0;
}

.artist-identity a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 1rem;
}

.identity-en,
.identity-cn {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0;
  line-height: 1;
}

.identity-en {
  font-size: clamp(1rem, 1.35vw, 1.42rem);
  font-weight: 700;
  text-transform: uppercase;
}

.identity-cn {
  font-size: clamp(1.45rem, 2.15vw, 2.35rem);
  font-weight: 900;
}

.language-switch {
  position: fixed;
  right: var(--modulePadX);
  top: max(1rem, env(safe-area-inset-top));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.68);
  color: #000;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.language-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 1em;
  opacity: 0.42;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.language-switch a:hover,
.language-switch a.active {
  opacity: 1;
}

.side-nav {
  position: fixed;
  left: var(--modulePadX);
  bottom: var(--modulePadY);
  z-index: 85;
  width: calc(var(--leftW) - var(--space));
  --nav-height: auto;
  height: var(--nav-height);
  --nav-glass-bg: rgba(255, 255, 255, 0.68);
  --nav-active-x: 0px;
  --nav-active-y: 0px;
  --nav-active-w: 0px;
  --nav-active-h: 0px;
  padding: 0.8rem 0.65rem;
  background: var(--nav-glass-bg);
  color: #fff;
  backdrop-filter: blur(12px);
}

.side-nav::after {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: var(--nav-active-w);
  height: var(--nav-active-h);
  background: #000;
  content: "";
  opacity: var(--nav-active-opacity, 0);
  pointer-events: none;
  transform: translate3d(var(--nav-active-x), var(--nav-active-y), 0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1), height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  will-change: transform, width, height;
}

.side-nav ul {
  position: relative;
  display: grid;
  gap: 0.38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav li {
  position: relative;
  width: max-content;
}

.side-nav a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-width: max-content;
  padding: 0.25rem 0.3rem;
  width: fit-content;
  color: rgba(0, 0, 0, 0.56);
  font-size: clamp(0.74rem, 0.85vw, 0.9rem);
  font-weight: 600;
  transition: color 0.35s ease, opacity 0.35s ease;
}

.side-nav a:hover {
  color: rgba(0, 0, 0, 0.9);
}

.side-nav a.is-active {
  color: #fff;
}

.site-module {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #fff;
  isolation: isolate;
}

.module-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-y: contain;
  padding: var(--modulePadY) var(--modulePadX) var(--modulePadY) calc(var(--modulePadX) + var(--leftW));
  scrollbar-width: none;
}

.module-scroll.is-scrollable {
  overflow-y: auto;
}

.module-scroll::-webkit-scrollbar {
  display: none;
}

.module-cut {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.module-cut::before {
  position: absolute;
  inset: 0;
  background: #000;
  clip-path: polygon(0 calc(100% - 1px), 1px 100%, 100% 1px, calc(100% - 1px) 0);
  content: "";
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
}

.site-module.is-transitioning .module-cut::before {
  animation: cutLine 1.2s cubic-bezier(0.18, 1, 0.21, 1);
}

.cover-layout {
  display: grid;
  min-height: calc(100vh - var(--modulePadY) * 2);
  place-items: center;
}

.cover-image {
  width: min(78vw, 62rem);
  margin-left: auto;
}

.cover-image img {
  width: 100%;
  max-height: calc(100vh - var(--modulePadY) * 2);
  object-fit: contain;
}

.text {
  color: #000;
  font-size: var(--body);
  line-height: 1.8;
}

.text p {
  padding-bottom: 0.85rem;
}

.text p:last-child {
  padding-bottom: 0;
}

.biography-text {
  max-width: min(52rem, 76%);
  margin-left: auto;
  column-width: 26rem;
  column-gap: clamp(2rem, 5vw, 5rem);
}

.download {
  break-inside: avoid;
  margin-top: 1.5rem;
}

.btn,
.press-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  padding: 0.75rem 1.1rem;
  background: #fff;
  color: #000;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.press-card a:hover .btn {
  background: #000;
  color: #fff;
}

.masonry {
  position: relative;
  min-height: 20rem;
}

.masonry-item {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--masonry-col, 30%);
  margin: 0;
}

.artwork-card,
.listing-card,
.contact-address,
.contact-methods {
  background: #fff;
}

.artwork-card img,
.listing-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.listing-card a {
  display: block;
  width: 100%;
  text-align: left;
}

.card-text {
  display: block;
  width: 100%;
  padding-top: 0.8rem;
  color: #000;
  font-size: 0.95rem;
  line-height: 1.65;
  text-align: left;
}

.card-text strong {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.card-text h2 {
  padding-bottom: 0.25rem;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
}

.card-text p {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  direction: ltr;
}

.listing-meta,
.listing-meta span {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  direction: ltr;
}

.press-card a {
  display: flex;
  align-items: flex-start;
  min-height: 14rem;
  flex-direction: column;
  justify-content: space-between;
  background: #f4f4f4;
  padding: var(--space);
}

.press-card .card-text {
  padding-top: 0;
}

.contact-layout {
  display: grid;
  min-height: calc(100vh - var(--modulePadY) * 2);
  grid-template-columns: minmax(18rem, 1fr) minmax(18rem, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.contact-address p {
  margin-bottom: 1rem;
  font-size: var(--big);
  font-weight: 800;
  line-height: 1.15;
}

.address-image {
  position: relative;
  display: grid;
  min-height: clamp(14rem, 36vw, 28rem);
  place-items: center;
  overflow: hidden;
  background: #eee;
}

.address-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.address-image.is-placeholder span {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  place-items: center;
  border: 1px solid #999;
  border-radius: 50%;
  color: #777;
  font-size: 2rem;
  font-weight: 300;
}

.contact-methods {
  display: grid;
  gap: 1.4rem;
  align-content: end;
}

.email-link {
  width: fit-content;
  font-size: clamp(1.3rem, 3vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.email-link:hover {
  text-decoration: underline;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid #000;
  padding-bottom: 0.15rem;
  font-size: 0.95rem;
}

.social-link img {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.75rem);
  z-index: 3;
  width: min(25vw, calc(100vw - 2rem));
  height: min(25vw, calc(100vw - 2rem));
  max-width: none;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.4rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.social-link:hover img,
.social-link.is-previewing img,
.social-link:focus img,
.social-link:focus-visible img {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.copyright {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.copyright a {
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid currentColor;
  line-height: 1.2;
}

.detail-page {
  min-height: 100vh;
  overflow-x: hidden;
  scroll-snap-type: none;
}

.detail-main {
  min-height: 100vh;
  padding: var(--modulePadY) var(--modulePadX) var(--modulePadY) calc(var(--modulePadX) + var(--leftW));
}

.detail-back {
  position: fixed;
  right: var(--modulePadX);
  top: var(--modulePadY);
  z-index: 80;
  border-bottom: 1px solid #000;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-article {
  display: grid;
  grid-template-columns: minmax(12rem, 0.38fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  max-width: 82rem;
  margin: 0 auto;
}

.detail-header {
  grid-column: 2;
}

.detail-kicker {
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-header h1 {
  max-width: 14ch;
  font-size: clamp(2.8rem, 8vw, 8rem);
  font-weight: 900;
  line-height: 0.94;
}

.detail-meta {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: end;
  color: #000;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 700;
  line-height: 1.45;
}

.detail-meta p + p {
  margin-top: 0.65rem;
}

.detail-hero {
  grid-column: 2;
  width: 100%;
  margin-top: clamp(2rem, 8vh, 5rem);
}

.detail-hero img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  object-position: left center;
}

.detail-body {
  grid-column: 2;
  max-width: 42rem;
  padding: clamp(2rem, 7vh, 5rem) 0;
}

.detail-source {
  margin-top: 2rem;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(38px) scale(0.94);
  transition: opacity 0.85s cubic-bezier(0.18, 1, 0.21, 1), transform 0.85s cubic-bezier(0.18, 1, 0.21, 1);
  transition-delay: calc(var(--i, 0) * 60ms);
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.masonry-item[data-reveal] {
  transform: translate3d(var(--masonry-x, 0), var(--masonry-y, 0), 0) scale(0.94);
  transform-origin: center top;
}

.masonry-item[data-reveal].visible {
  transform: translate3d(var(--masonry-x, 0), var(--masonry-y, 0), 0) scale(1);
}

.slice-transition {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
}

.slice-transition::before,
.slice-transition::after {
  position: absolute;
  inset: 0;
  background: #000;
  content: "";
  opacity: 0.88;
}

.slice-transition::before {
  clip-path: polygon(0 0, 100% 0, 100% 2px, 2px 100%, 0 100%);
}

.slice-transition::after {
  clip-path: polygon(calc(100% - 2px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(100% - 2px));
}

body.is-slicing .slice-transition {
  animation: sliceOverlay 1.45s linear;
}

body.is-slicing .slice-transition::before {
  animation: sliceUpper 1.45s linear;
}

body.is-slicing .slice-transition::after {
  animation: sliceLower 1.45s linear;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  grid-template-columns: 20% 1fr 20%;
  grid-template-rows: 1fr auto;
  gap: var(--space);
  padding: var(--space);
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-caption {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  line-height: 1.7;
}

.lightbox-caption h2 {
  margin-bottom: 1rem;
}

.lightbox-frame {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.lightbox-frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - var(--space) * 2);
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 1.35rem;
  cursor: pointer;
}

.lightbox-close {
  right: var(--space);
  top: var(--space);
}

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

.lightbox-prev {
  left: var(--space);
}

.lightbox-next {
  right: var(--space);
}

@keyframes cutLine {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  30%,
  62% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(0);
  }
}

@keyframes sliceOverlay {
  0% {
    opacity: 0;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  18%,
  64% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes sliceUpper {
  0% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  18%,
  58% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  100% {
    transform: translate(-16vw, -16vh);
  }
}

@keyframes sliceLower {
  0% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  18%,
  58% {
    transform: translate(0, 0);
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  100% {
    transform: translate(16vw, 16vh);
  }
}

@media (max-width: 780px) {
  :root {
    --leftW: 0rem;
    --modulePadX: 1rem;
    --modulePadY: 4.5rem;
  }

  .artist-identity {
    left: 0;
    top: 0;
    width: fit-content;
    max-width: calc(100vw - 2rem);
  }

  .identity-en,
  .identity-cn {
    writing-mode: horizontal-tb;
  }

  .artist-identity a {
    display: grid;
    gap: 0.1rem;
  }

  .language-switch {
    left: auto;
    right: 1rem;
    top: 1rem;
  }

  .side-nav {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: auto;
    padding: 0.65rem 1rem;
  }

  .side-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav ul::-webkit-scrollbar {
    display: none;
  }

  .side-nav a {
    font-size: clamp(0.74rem, 3.4vw, 0.95rem);
    white-space: nowrap;
  }

  .module-scroll {
    padding-right: var(--modulePadX);
    padding-left: var(--modulePadX);
    padding-bottom: 7rem;
  }

  .cover-layout,
  .contact-layout {
    min-height: 0;
    height: 100%;
  }

  .cover-image {
    width: 100%;
    margin: auto;
  }

  .biography-text {
    max-width: none;
    margin-left: 0;
    column-width: auto;
  }

  .masonry-item {
    width: 100%;
  }

  .contact-layout {
    display: block;
    padding-top: 3.5rem;
  }

  .detail-main {
    padding: 8rem 1rem 7rem;
  }

  .detail-back {
    right: 1rem;
    top: 4.2rem;
  }

  .detail-article {
    display: block;
  }

  .detail-header h1 {
    max-width: none;
    font-size: clamp(2.5rem, 15vw, 5rem);
  }

  .detail-meta {
    margin-top: 1.25rem;
  }

  .detail-hero {
    margin-top: 2rem;
  }

  .contact-methods {
    margin-top: 2rem;
  }

  .lightbox {
    display: block;
    grid-template-columns: none;
    grid-template-rows: none;
    padding: 0;
    touch-action: pan-y;
  }

  .lightbox-caption {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    max-height: 28vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.65rem 0.75rem;
    backdrop-filter: blur(12px);
  }

  .lightbox-frame {
    position: absolute;
    inset: 3.25rem 1rem 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }

  .lightbox-frame img {
    max-height: 100%;
  }

  .lightbox-prev,
  .lightbox-next {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
    color: #000;
    font-size: 2rem;
    backdrop-filter: blur(12px);
    top: calc((3.25rem + (100vh - 30vh)) / 2);
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-close {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
    color: #000;
    backdrop-filter: blur(12px);
  }
}
