:root {
  --footer-gold: #c09968;
  --footer-ink: #dfdad4;
  --footer-muted: #958d80;
  --footer-line: rgba(223, 218, 212, 0.72);
}

.footer {
  background: #000;
  color: var(--footer-ink);
  font-family: "Noto Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

html[lang="en"] .footer {
  font-family: "Inter", "Noto Sans", "Source Sans 3", sans-serif;
}

.footer-inner {
  display: grid;
  padding: clamp(38px, 4.3vw, 64px) clamp(22px, 4.8vw, 82px) 0;
}

.footer-screen {
  min-height: 0;
}

.footer-contact-intro {
  border-top: 1px solid var(--footer-line);
  padding-top: clamp(24px, 2.4vw, 38px);
}

.footer-contact-intro h2 {
  margin: 0;
  color: var(--footer-ink);
  font-size: clamp(19px, 1.35vw, 27px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.footer-contact-lines {
  display: grid;
  gap: 2px;
  margin-top: clamp(26px, 3vw, 46px);
}

.footer-contact-lines p {
  min-width: 0;
  margin: 0;
  color: var(--footer-ink);
  font-size: clamp(15px, 1.08vw, 19px);
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer-contact-lines a {
  color: var(--footer-ink);
  text-decoration: underline;
  text-decoration-color: rgba(223, 218, 212, 0.42);
  text-underline-offset: 0.18em;
  transition: color 0.24s ease, text-decoration-color 0.24s ease;
}

.footer-contact-lines a:hover,
.footer-contact-lines a:focus-visible {
  color: var(--footer-gold);
  text-decoration-color: var(--footer-gold);
}

.footer-locations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(34px, 5.3vw, 96px);
  align-items: start;
  margin-top: clamp(44px, 4.8vw, 78px);
  padding-bottom: clamp(48px, 5vw, 82px);
}

.footer-office {
  min-width: 0;
}

.footer-office h3 {
  min-width: 0;
  margin: 0 0 clamp(22px, 2.3vw, 38px);
  color: var(--footer-ink);
  font-size: clamp(19px, 1.35vw, 27px);
  font-weight: 500;
  line-height: 1.2;
}

.footer-office address {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--footer-ink);
  font-size: clamp(14px, 1.05vw, 18px);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer-office address > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  border-top: 1px solid var(--footer-line);
  padding: clamp(18px, 1.8vw, 26px) 0 clamp(22px, 2.2vw, 34px);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 74px);
  color: var(--footer-ink);
  font-size: clamp(12px, 0.92vw, 16px);
  font-weight: 500;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.1vw, 18px);
  width: max-content;
  max-width: 100%;
}

.footer-social > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 30px;
  padding: 0;
  color: var(--footer-ink);
  font-size: clamp(12px, 0.92vw, 16px);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.24s ease;
}

.footer-social > a:hover,
.footer-social > a:focus-visible {
  color: var(--footer-gold);
  outline: 0;
}

.footer-social .footer-wechat-link {
  isolation: isolate;
}

.footer-wechat-label {
  display: inline-block;
}

.footer-wechat-preview {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: calc(100% + 14px);
  display: block;
  width: min(clamp(156px, 18vw, 220px), calc(100vw - 24px));
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.footer-wechat-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer-social .footer-wechat-link:hover .footer-wechat-preview,
.footer-social .footer-wechat-link:focus-visible .footer-wechat-preview {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-social-icon svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.footer-social-icon .instagram-dot {
  fill: currentColor;
  stroke: none;
}

@media (max-width: 900px) {
  .footer-inner {
    padding: 32px 18px 0;
  }

  .footer-contact-intro {
    padding-top: 24px;
  }

  .footer-contact-intro h2 {
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.06em;
  }

  .footer-contact-lines {
    gap: 0;
    margin-top: 8px;
  }

  .footer-contact-lines p {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 3px;
    font-size: 10px;
    line-height: 1.25;
    letter-spacing: 0.04em;
  }

  .footer-contact-lines p > span {
    min-width: 0;
    max-width: 100%;
  }

  .footer-contact-lines a {
    max-width: 100%;
    white-space: nowrap;
  }

  /* Override the homepage's older spacing rules as well as secondary pages. */
  .footer .footer-locations {
    margin-top: 36px !important;
    padding-bottom: 28px !important;
  }

  .footer-locations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .footer-office h3 {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.06em;
  }

  .footer-office address {
    gap: 0;
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: 0.04em;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .footer-legal {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
  }

  html[lang="zh-CN"] .footer-legal {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    gap: 8px;
    white-space: nowrap;
  }

  .footer .footer-social {
    display: flex !important;
    width: max-content !important;
    gap: 16px !important;
    justify-self: center;
    justify-content: center !important;
  }

  .footer-social > a {
    min-width: 32px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 400;
  }
}

@media (max-width: 560px) {
  .footer-locations {
    grid-template-columns: 1fr;
  }

  .footer-wechat-preview {
    width: min(58vw, 180px);
  }
}

@media (max-width: 360px) {
  .footer-inner {
    padding-inline: 16px;
  }
}
