:root {
  --bg: #050505;
  --surface: #0b0b0b;
  --surface-raised: #111111;
  --text: #f2f1ed;
  --muted: #85857f;
  --faint: #555550;
  --line: #242422;
  --line-strong: #41413e;
  --sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", serif;
  --source-serif: "Source Han Serif SC", "Source Han Serif CN", "思源宋体", "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --page-padding: clamp(1.25rem, 4vw, 5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.menu-open,
body.dialog-open {
  overflow: hidden;
}

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

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

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

button {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-200%);
}

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

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.4rem;
  padding: 0 var(--page-padding);
  border-bottom: 1px solid transparent;
  background: var(--bg);
  transition:
    min-height 300ms ease,
    border-color 300ms ease,
    background-color 300ms ease;
}

.site-header.is-scrolled {
  min-height: 4.4rem;
  border-color: var(--line);
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.brand-subtitle {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.06em;
}

.site-nav {
  display: flex;
  gap: clamp(1.4rem, 3vw, 3.2rem);
}

.site-nav a {
  position: relative;
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 180ms ease;
}

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

.site-nav a:hover {
  color: var(--text);
}

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

.category-bar {
  position: relative;
  z-index: 19;
  display: flex;
  min-height: 3.1rem;
  align-items: center;
  gap: 2rem;
  padding: 0 var(--page-padding);
  border-bottom: 1px solid var(--line);
  background: #080808;
}

.category-bar-label {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

.category-bar-links {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.6rem);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-bar-links::-webkit-scrollbar {
  display: none;
}

.category-bar-link {
  flex: 0 0 auto;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: #aaa9a4;
  cursor: pointer;
  font-family: var(--source-serif);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  transition: color 180ms ease;
}

.category-bar-link:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 5.4rem);
  overflow: hidden;
  grid-template-columns: minmax(4rem, 0.2fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  padding: clamp(3.5rem, 7vw, 7rem) var(--page-padding) 2.5rem;
}

.hero::after {
  position: absolute;
  right: -14vw;
  bottom: -35vw;
  width: 68vw;
  height: 68vw;
  border: 1px solid #171715;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.hero-number {
  align-self: start;
  padding-top: 0.9rem;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.eyebrow {
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.about h2,
.contact h2,
.viewer-panel h2,
.category-dialog h2 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
}

.hero h1 {
  max-width: 12em;
  font-family: var(--source-serif);
  font-size: clamp(3.8rem, 10vw, 10.5rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.085em;
  white-space: pre-line;
  -webkit-text-stroke: 2px currentColor;
}

.hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  grid-column: 2;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-top: clamp(4rem, 8vw, 8rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero-intro {
  max-width: 31rem;
  margin: 0;
  color: #aaa9a4;
  font-size: clamp(0.87rem, 1.1vw, 0.98rem);
  line-height: 1.9;
}

.scroll-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.scroll-link:hover {
  color: var(--text);
}

.section {
  padding: clamp(6rem, 11vw, 10rem) var(--page-padding);
  border-top: 1px solid var(--line);
}

.section--categories {
  padding-top: clamp(4rem, 7vw, 6rem);
  background: #080808;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: clamp(2.8rem, 5vw, 5rem);
}

.section-heading .eyebrow {
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-size: clamp(2.6rem, 5vw, 5.3rem);
  line-height: 1;
  letter-spacing: -0.065em;
}

.section-note {
  max-width: 20rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.7;
}

.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2.6rem);
}

.album-card,
.category-card {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.album-cover,
.category-cover {
  position: relative;
  overflow: hidden;
  background: var(--surface-raised);
}

.album-cover {
  aspect-ratio: 4 / 5;
}

.category-cover {
  aspect-ratio: 4 / 3;
}

.album-cover::after,
.category-cover::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  content: "";
  pointer-events: none;
  transition: border-color 350ms var(--ease);
}

.album-cover img,
.category-cover img {
  height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.02);
  transition:
    transform 900ms var(--ease),
    filter 500ms ease;
}

.album-card:hover img,
.category-card:hover img {
  filter: saturate(1) contrast(1.03);
  transform: scale(1.025);
}

.album-card:hover .album-cover::after,
.category-card:hover .category-cover::after {
  border-color: rgba(255, 255, 255, 0.45);
}

.featured-photo-card .album-cover {
  aspect-ratio: 4 / 5;
}

.featured-photo-card:nth-child(3n + 2) .album-cover {
  aspect-ratio: 3 / 4;
}

.featured-photo-card .album-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.album-stack {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.48);
  color: #fff;
  font-family: var(--serif);
  font-size: 0.68rem;
  backdrop-filter: blur(8px);
}

.album-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

.album-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.55vw, 1.45rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.album-meta {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.album-index {
  color: var(--faint);
  font-family: var(--serif);
  font-size: 0.68rem;
}

.category-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
}

.category-name {
  margin: 0;
  font-family: var(--source-serif);
  font-size: clamp(1.05rem, 1.45vw, 1.32rem);
  font-weight: 600;
}

.category-english {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.category-count {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.loading-message,
.error-message {
  grid-column: 1 / -1;
  min-height: 12rem;
  margin: 0;
  padding: 4rem 0;
  color: var(--muted);
  font-family: var(--serif);
  text-align: center;
}

.about {
  display: grid;
  grid-template-columns: minmax(12rem, 0.32fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(7rem, 13vw, 13rem) var(--page-padding);
  border-top: 1px solid var(--line);
}

.about-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.about-place {
  margin: 0;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 0.7rem;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

.about-portrait {
  width: min(100%, 15rem);
  margin: 0;
}

.about-portrait img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.02);
}

.about-portrait figcaption {
  padding-top: 0.7rem;
  color: var(--muted);
  font-family: var(--source-serif);
  font-size: 0.67rem;
  letter-spacing: 0.05em;
}

.about-main h2 {
  max-width: 12em;
  font-size: clamp(3rem, 6.8vw, 7.4rem);
  line-height: 0.98;
  letter-spacing: -0.075em;
}

.about-text {
  display: grid;
  max-width: 50rem;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 4rem;
  margin-top: clamp(3rem, 6vw, 6rem);
  margin-left: auto;
}

.about-text p {
  margin: 0;
  color: var(--muted);
  font-family: var(--source-serif);
  font-size: 0.8rem;
  line-height: 1.95;
  white-space: pre-line;
}

.about-text .about-lead {
  grid-column: 1 / -1;
  max-width: 34em;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-family: var(--source-serif);
  font-size: clamp(1.05rem, 1.65vw, 1.35rem);
  line-height: 1.85;
}

.about-lead strong {
  font-weight: 700;
}

.contact {
  padding: clamp(6rem, 12vw, 11rem) var(--page-padding) 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--text);
  color: var(--bg);
}

.contact .eyebrow {
  color: #6b6a65;
}

.contact h2 {
  max-width: 10em;
  margin-bottom: 3rem;
  font-size: clamp(3.3rem, 8vw, 9rem);
  line-height: 0.98;
  letter-spacing: -0.082em;
}

.email-link {
  display: inline-block;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(5, 5, 5, 0.35);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  text-decoration: none;
}

.contact-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(6rem, 12vw, 12rem);
  padding-top: 1.4rem;
  border-top: 1px solid rgba(5, 5, 5, 0.2);
}

.social-links {
  display: flex;
  gap: 1.6rem;
}

.social-links a,
.back-to-top {
  color: #575650;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 180ms ease;
}

.social-links a:hover,
.back-to-top:hover {
  color: var(--bg);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  padding: 1.4rem var(--page-padding);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}

.album-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #030303;
}

.album-dialog[open] {
  display: flex;
  flex-direction: column;
}

.viewer-topbar {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.viewer-topbar button,
.category-dialog-header button {
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
}

.viewer-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem);
}

.viewer-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 2.2rem 4rem;
  background: #030303;
}

.viewer-stage > img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 8rem);
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.viewer-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.55);
  color: var(--text);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    border-color 180ms ease,
    background-color 180ms ease;
}

.viewer-arrow:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.viewer-arrow--prev {
  left: 1rem;
}

.viewer-arrow--next {
  right: 1rem;
}

.image-position {
  position: absolute;
  right: 1.3rem;
  bottom: 1rem;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.viewer-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.4rem 1.7rem 1.7rem;
  border-left: 1px solid var(--line);
  background: #080808;
}

.viewer-info {
  overflow-y: auto;
}

.viewer-panel h2 {
  margin-bottom: 1.3rem;
  font-size: clamp(2rem, 3.5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.viewer-description {
  margin: 0;
  color: var(--muted);
  font-family: var(--source-serif);
  font-size: 0.8rem;
  line-height: 1.9;
}

.viewer-caption {
  margin: 1.5rem 0 0;
  color: var(--text);
  font-family: var(--source-serif);
  font-size: 0.9rem;
  line-height: 1.85;
}

.viewer-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--source-serif);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.thumbnail-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.thumbnail {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: var(--surface-raised);
  cursor: pointer;
  opacity: 0.5;
  transition:
    border-color 180ms ease,
    opacity 180ms ease;
}

.thumbnail img {
  height: 100%;
  object-fit: cover;
}

.thumbnail:hover,
.thumbnail.is-active {
  border-color: var(--text);
  opacity: 1;
}

.category-dialog {
  width: min(92vw, 92rem);
  max-width: none;
  max-height: 90dvh;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: #080808;
}

.category-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.category-dialog h2 {
  font-size: clamp(2.7rem, 5vw, 5rem);
  letter-spacing: -0.065em;
}

.noscript-message {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  padding: 1rem;
  background: var(--text);
  color: var(--bg);
  text-align: center;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }

  .category-bar {
    gap: 1rem;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 13vw, 7rem);
  }

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

  .viewer-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }

  .viewer-stage {
    padding: 2rem 3.5rem;
  }

  .about {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 4.7rem;
  }

  .brand-subtitle {
    display: none;
  }

  .menu-toggle {
    position: relative;
    z-index: 2;
    display: flex;
    width: 2rem;
    height: 2rem;
    padding: 0.45rem 0.2rem;
    flex-direction: column;
    justify-content: space-between;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span:not(.sr-only) {
    display: block;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform 250ms ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(0.55rem) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    transform: translateY(-0.55rem) rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    z-index: 1;
    inset: 0;
    display: flex;
    padding: 7rem var(--page-padding) 3rem;
    background: var(--bg);
    flex-direction: column;
    gap: 1.4rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
      opacity 250ms ease,
      transform 250ms ease;
  }

  .site-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav a {
    color: var(--text);
    font-size: 2.7rem;
    letter-spacing: -0.05em;
  }

  .hero {
    min-height: 88dvh;
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .category-bar {
    min-height: 2.8rem;
  }

  .category-bar-label {
    display: none;
  }

  .hero-number {
    display: none;
  }

  .hero-copy {
    align-self: start;
  }

  .hero h1 {
    font-size: clamp(3.3rem, 17vw, 5.5rem);
    line-height: 0.96;
  }

  .hero-bottom {
    grid-column: 1;
    align-items: flex-start;
    flex-direction: column;
    gap: 2rem;
    margin-top: 4rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.2rem;
  }

  .section-note {
    max-width: 17rem;
  }

  .three-grid {
    grid-template-columns: 1fr;
    gap: 2.7rem;
  }

  .category-grid {
    gap: 2rem;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-side {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
  }

  .about-portrait {
    width: min(46%, 12rem);
    margin-left: auto;
  }

  .about-text {
    grid-template-columns: 1fr;
  }

  .about-text .about-lead {
    grid-column: auto;
  }

  .contact h2 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .contact-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .viewer-layout {
    overflow-y: auto;
    grid-template-columns: 1fr;
  }

  .viewer-stage {
    min-height: 55dvh;
    padding: 1.8rem 2.7rem;
  }

  .viewer-stage > img {
    max-height: 62dvh;
  }

  .viewer-panel {
    min-height: 36dvh;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .category-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
  }
}

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