:root {
  --paper: #fbfaf7;
  --ink: #161514;
  --panel-width: 280px;
  --text-width: 760px;
  --feature-landscape-width: 900px;
  --feature-portrait-width: 450px;
  --project-media-gap: 43px;
  --font-body: Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-garamond: "TouchGrass Garamond", Garamond, Georgia, "Times New Roman", serif;
  --font-baosong: "TouchGrass BaoSong", "FZBaoSong", FangSong, STSong, serif;
}

@font-face {
  font-family: "TouchGrass Garamond";
  src: url("assets/fonts/EBGaramond-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "TouchGrass Garamond";
  src: url("assets/fonts/EBGaramond-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "TouchGrass BaoSong";
  src: url("assets/fonts/FZBaoSong.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

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

img {
  user-select: none;
  -webkit-user-drag: none;
}

.page-view[hidden] {
  display: none;
}

.page-view {
  height: 100vh;
}

.home {
  position: relative;
  overflow: hidden;
  background: #17120f;
  color: #fff;
}

.home-backgrounds,
.home-slide {
  position: absolute;
  inset: 0;
}

.home-backgrounds {
  z-index: 0;
}

.home-slide {
  opacity: 0;
  background-position: center;
  background-size: cover;
  transition: opacity 0ms linear;
}

.home-slide::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, 0.2);
}

.home-slide.is-active {
  opacity: 1;
}

.home-link,
.home-brand,
.language-switch {
  position: absolute;
  z-index: 1;
  font-size: clamp(14px, 1.2vw, 20px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.menu-toggle,
.mobile-menu {
  display: none;
}

.home-projects {
  top: 48%;
  left: 20px;
  transform: translateY(-50%);
}

.home-brand {
  top: 48%;
  left: 50%;
  display: flex;
  justify-content: center;
  width: min(560px, 45vw);
  transform: translate(-50%, -50%);
  font-family: var(--font-garamond);
  font-size: clamp(24px, calc(1.2vw + 10px), 30px);
  font-weight: 400;
  pointer-events: none;
  text-align: center;
}

html[lang="zh-CN"] .home-brand {
  width: min(100vw, 1200px);
  font-family: var(--font-baosong);
}

.home-brand-text {
  display: inline-flex;
  gap: 80px;
  justify-content: center;
  padding-left: 0;
  letter-spacing: 0;
}

.home-brand-character {
  display: inline-block;
}

.home-about {
  top: 48%;
  right: 20px;
  transform: translateY(-50%);
}

.language-switch {
  right: 18px;
  bottom: 20px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

.project-language {
  position: fixed;
  z-index: 30;
  color: var(--ink);
}

.language-switch span + span::before {
  content: "/";
  padding-right: 8px;
}

.mobile-menu[hidden] {
  display: none;
}

.site-shell {
  display: grid;
  grid-template-columns: var(--panel-width) minmax(0, 1fr);
  height: 100vh;
  overflow-y: auto;
}

.project-panel,
.about-panel {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 32px 26px 96px 24px;
  background: rgba(251, 250, 247, 0.98);
}

.project-tabs,
.about-tabs {
  overflow: visible;
  padding-right: 0;
  font-size: clamp(11px, 0.95vw, 16px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-tabs a,
.about-tabs a {
  display: block;
  width: 100%;
  margin-bottom: 0.34em;
  white-space: normal;
}

.project-category {
  display: block;
  width: fit-content;
  margin: 0 0 2px;
  font-weight: 700;
  line-height: 1.16;
  white-space: nowrap;
}

.project-category + a {
  margin-top: 0;
}

.project-tabs a + .project-category {
  margin-top: 18px;
}

.project-tabs a:hover,
.project-tabs .active,
.about-tabs a:hover,
.about-tabs .active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-tabs,
.about-tabs .active {
  font-weight: 400;
}

html[lang="zh-CN"] .project-tabs a {
  font-size: clamp(12px, 1vw, 17px);
}

html[lang="zh-CN"] .project-category {
  margin-bottom: 0.34em;
}

.back-link {
  position: fixed;
  bottom: 22px;
  left: 20px;
  z-index: 30;
  display: inline-block;
  padding: 0;
  background: var(--paper);
  font-size: clamp(14px, 1.2vw, 20px);
  font-weight: 700;
  text-transform: uppercase;
}

.article-back-link {
  display: none;
}

.project-content {
  min-width: 0;
}

.about-content {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  padding: 32px clamp(28px, 6vw, 120px) 220px;
  background: var(--paper);
}

.about-section {
  width: min(760px, 100%);
  margin: 0 auto;
}

.awards-section {
  width: min(1180px, 100%);
}

.about-text {
  display: grid;
  gap: 18px;
}

.about-logo {
  display: block;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  object-fit: contain;
}

.about-text p {
  margin: 0;
  font-size: clamp(14px, 1.15vw, 18px);
  font-weight: 400;
  line-height: 1.28;
}

html[lang="zh-CN"] .about-text p {
  line-height: 1.58;
}

.about-contact {
  display: grid;
  gap: 0;
  margin-top: 36px;
}

.about-contact a {
  color: inherit;
  text-decoration: none;
}

.about-contact a:hover {
  text-decoration: underline;
}

.about-text[lang="zh-CN"],
html[lang="zh-CN"] .about-text[lang="en"] {
  display: none;
}

html[lang="zh-CN"] .about-text[lang="zh-CN"] {
  display: grid;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.award-card {
  min-width: 0;
}

.award-carousel {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
}

.award-carousel img {
  position: absolute;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 700ms ease;
}

.award-carousel img.is-active {
  opacity: 1;
}

.award-caption {
  display: grid;
  gap: 2px;
  padding: 10px 6px 0;
  text-align: center;
}

.award-caption p {
  margin: 0;
  font-size: clamp(12px, 1vw, 16px);
  line-height: 1.22;
}

.award-caption em {
  font-family: inherit;
  font-style: italic;
}

.project-article {
  display: flex;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding: 32px clamp(28px, 6vw, 120px) 220px;
  background: var(--paper);
}

.project-article[hidden] {
  display: none !important;
}

.project-hero,
.project-text-columns {
  width: min(var(--text-width), 100%);
  margin: 0 auto;
}

.project-hero {
  margin-bottom: var(--project-media-gap);
}

.project-hero h1 {
  max-width: var(--text-width);
  margin: 0 0 28px;
  font-family: var(--font-garamond);
  font-size: 30px;
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
  text-transform: uppercase;
}

html[lang="zh-CN"] .project-hero h1 {
  font-family: var(--font-baosong);
  letter-spacing: 3px;
}

.project-meta {
  display: grid;
  max-width: var(--text-width);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}

.project-meta dt,
.project-meta dd {
  margin: 0;
  font-size: clamp(12px, 1vw, 16px);
  line-height: 1.22;
}

.project-meta dt {
  font-weight: 700;
}

html[lang="zh-CN"] .project-meta dt,
html[lang="zh-CN"] .project-meta dd {
  line-height: 1.45;
}

.project-text-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.project-text-columns p {
  margin: 0;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.28;
  text-indent: 0;
}

html[lang="zh-CN"] .project-text-columns p {
  line-height: 1.58;
}

.project-article em {
  font-family: inherit;
  font-style: italic;
}

.project-text-columns p:empty {
  display: none;
}

.project-figure {
  width: min(1120px, 100%);
  margin: var(--project-media-gap) auto;
}

.is-feature-image {
  width: min(var(--feature-landscape-width), 100%);
  margin: 0 auto var(--project-media-gap);
}

.project-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.project-text-columns .project-figure {
  width: 100%;
  margin: calc(var(--project-media-gap) - 18px) 0;
  justify-self: center;
}

.project-text-columns .project-figure + .project-figure {
  margin-top: -28px;
}

.project-figure.is-narrow {
  width: min(var(--feature-portrait-width), 100%);
  margin: 0 auto var(--project-media-gap);
}

.project-figure.is-vertical-set {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  justify-self: center;
}

.project-figure.is-vertical-set img {
  width: 100%;
  justify-self: center;
}

@media (max-width: 1024px) {
  .home {
    height: 100vh;
  }

  .home-link,
  .home-brand,
  .language-switch {
    font-size: 28px;
  }

  .home-brand {
    top: 50%;
    width: min(86vw, 620px);
    transform: translate(-50%, -50%);
    font-size: clamp(27px, 5vw, 37px);
  }

  .home-projects,
  .home-about,
  .project-language {
    display: none;
  }

  .menu-toggle {
    position: absolute;
    top: 32px;
    left: 50%;
    z-index: 2;
    display: flex;
    width: 38px;
    height: 30px;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    transform: translateX(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    height: 3px;
    background: #fff;
  }

  .home-language {
    right: auto;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: block;
    background: var(--paper);
    color: #000;
  }

  .mobile-menu-inner {
    position: absolute;
    top: 49%;
    left: 50%;
    display: flex;
    width: min(86vw, 620px);
    flex-direction: column;
    align-items: center;
    gap: 34px;
    transform: translate(-50%, -50%);
    text-align: center;
  }

  .mobile-menu-inner,
  .mobile-menu-inner a {
    font-size: clamp(27px, 5vw, 38px);
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
  }

  .menu-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-close::before,
  .menu-close::after {
    position: absolute;
    top: 15px;
    left: 0;
    width: 32px;
    height: 3px;
    content: "";
    background: #000;
  }

  .menu-close::before {
    transform: rotate(45deg);
  }

  .menu-close::after {
    transform: rotate(-45deg);
  }

  .menu-language {
    right: auto;
    bottom: 24px;
    left: 50%;
    color: #000;
    transform: translateX(-50%);
    font-size: 24px;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  .site-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

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

  .project-article {
    padding: 32px 44px 180px;
  }

  .project-meta {
    grid-template-columns: 1fr;
  }

  .project-text-columns {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 700px) {
  :root {
    --project-media-gap: 54px;
  }

  .site-shell {
    display: block;
    height: 100vh;
    overflow-y: auto;
  }

  .project-panel,
  .about-panel {
    position: relative;
    min-height: 100vh;
    padding: 40px 24px 96px 30px;
  }

  .project-tabs,
  .about-tabs {
    overflow: visible;
    padding-right: 0;
    font-size: 24px;
    line-height: 1.5;
  }

  html[lang="zh-CN"] .project-tabs a {
    font-size: 25px;
  }

  html[lang="zh-CN"] .project-category {
    margin-bottom: 0.34em;
  }

  .back-link {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
  }

  .project-article,
  .about-content {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    height: 100vh;
    overflow-y: auto;
    padding: 56px 18px 140px;
    background: var(--paper);
  }

  .about-content {
    min-height: 100vh;
  }

  .awards-grid {
    grid-template-columns: 1fr;
  }

  .site-shell.article-open .project-article,
  .site-shell.about-open .about-content {
    display: block;
  }

  .article-back-link {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: block;
    padding: 18px 20px 24px;
    background: var(--paper);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
  }

  .project-hero,
  .project-text-columns {
    width: 100%;
  }

  .project-hero h1 {
    font-size: 30px;
  }

  .project-meta,
  .project-text-columns {
    grid-template-columns: 1fr;
  }

  .project-meta {
    gap: 8px;
  }

  .project-text-columns p {
    font-size: 16px;
    line-height: 1.32;
  }

  html[lang="zh-CN"] .project-text-columns p {
    line-height: 1.55;
  }

  html[lang="zh-CN"] .about-text p {
    line-height: 1.55;
  }

  .project-figure {
    width: 100%;
    margin: var(--project-media-gap) 0;
  }

  .project-text-columns .project-figure,
  .project-figure.is-vertical-set {
    width: 100%;
  }

  .project-figure.is-narrow {
    width: min(var(--feature-portrait-width), 100%);
  }

  .project-figure.is-vertical-set {
    grid-template-columns: 1fr;
  }
}
