* {
  box-sizing: border-box;
}

html {
  background: #f7f6f3;
  color: #1f1f1f;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --ink: #1f1f1f;
  --muted: #77736c;
  --faint: #aaa69d;
  --line: #dedbd3;
  --line-strong: #b9b3a7;
  --panel-soft: #e8e5dc;
}

body {
  margin: 0;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 54px);
  height: 74px;
  padding: 0 clamp(22px, 6vw, 78px);
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(247, 246, 243, 0.94);
  border-bottom: 1px solid #dedbd3;
  backdrop-filter: blur(10px);
}

.top-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 22px 0 19px;
  color: #9a9893;
  font: 400 clamp(18px, 2vw, 25px) / 1.2 inherit;
  text-decoration: none;
  cursor: pointer;
}

.top-nav .active {
  color: #202020;
  border-bottom: 2px solid #202020;
}

.chapter-head {
  display: none;
}

.gallery {
  padding: 38px clamp(14px, 3vw, 42px) 58px;
}

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

.masonry-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.photo {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  background: #ebe9e3;
}

.home-page {
  display: grid;
  gap: clamp(34px, 6vw, 84px);
  padding: clamp(22px, 5vw, 72px);
}

.home-cover {
  display: grid;
  min-height: auto;
  place-items: center;
}

.home-photo {
  position: relative;
  width: min(100%, 1360px);
  margin: 0;
  overflow: hidden;
  background: #dedfdf;
}

.home-photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.home-statement {
  display: grid;
  width: min(84vw, 1180px);
  min-height: 330px;
  justify-self: center;
  align-content: center;
  justify-items: center;
  gap: clamp(14px, 2vw, 24px);
  text-decoration: none;
  text-align: center;
}

.home-statement:hover h2,
.home-statement:hover p {
  color: var(--ink);
}

.home-statement h2 {
  margin: 0;
  color: #3f4142;
  font-size: clamp(26px, 3.4vw, 48px);
  font-weight: 200;
  line-height: 1.2;
}

.home-statement p {
  max-width: 900px;
  margin: 0;
  color: #626567;
  font-size: clamp(15px, 1.28vw, 19px);
  font-weight: 200;
  line-height: 1.85;
}

.home-statement-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.home-statement-link:hover {
  border-color: var(--ink);
}

.home-statement-link span {
  color: var(--ink);
}

.home-themes {
  display: grid;
  width: min(86vw, 1040px);
  justify-self: center;
  border-top: 1px solid var(--line);
}

.home-theme {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  min-height: 0;
  padding: clamp(20px, 3vw, 34px) 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.home-theme:hover {
  border-color: var(--line-strong);
}

.home-theme.is-placeholder {
  cursor: default;
}

.home-theme.is-placeholder:hover {
  border-color: var(--line);
}

.theme-number {
  color: var(--faint);
  font-size: 13px;
  line-height: 1.6;
}

.home-theme-copy {
  display: grid;
  gap: 8px;
}

.home-theme-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.home-theme-copy strong {
  display: block;
  font-size: clamp(20px, 2.4vw, 31px);
  font-weight: 300;
  line-height: 1.05;
}

.home-theme-status {
  color: var(--muted);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 200;
  line-height: 1;
  white-space: nowrap;
}

.home-theme-copy em {
  display: block;
  color: var(--muted);
  font-size: clamp(12px, 1vw, 15px);
  font-style: normal;
  line-height: 1.6;
}

.home-theme-preview {
  display: grid;
  width: 100%;
  aspect-ratio: var(--preview-ratio, 16 / 9);
  justify-self: stretch;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  pointer-events: none;
}

.home-theme-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--panel-soft);
}

.home-theme-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #050505;
}

.viewer[hidden] {
  display: none;
}

.viewer img {
  width: auto;
  max-width: 100vw;
  height: auto;
  max-height: 100vh;
  object-fit: contain;
}

.viewer button,
.viewer-save {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
}

.viewer-save {
  top: 16px;
  right: 72px;
  min-width: 62px;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
}

.viewer-close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 34px;
  line-height: 1;
}

.viewer-prev,
.viewer-next {
  top: 50%;
  width: 52px;
  height: 86px;
  transform: translateY(-50%);
  font-size: 58px;
  line-height: 1;
}

.viewer-prev {
  left: 0;
}

.viewer-next {
  right: 0;
}

@media (max-width: 700px) {
  .top-nav {
    height: 58px;
    padding: 0 18px;
    gap: 26px;
  }

  .top-nav button {
    padding: 17px 0 15px;
    font-size: 20px;
  }

  .gallery {
    padding: 18px 8px 38px;
  }

  .masonry-grid,
  .masonry-column {
    gap: 8px;
  }

  .home-page {
    padding: 20px;
  }

  .home-photo {
    width: 100%;
  }

  .home-statement {
    width: 100%;
    min-height: 280px;
    text-align: left;
    justify-items: start;
  }

  .home-theme {
    gap: 16px;
  }

  .home-theme-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .viewer-close {
    top: 10px;
    right: 10px;
  }

  .viewer-save {
    top: 10px;
    right: 62px;
    height: 44px;
    min-width: 58px;
  }

  .viewer-prev,
  .viewer-next {
    width: 42px;
    height: 72px;
  }
}
