[data-site-shell] .site-language-cycle {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 180ms ease, transform 180ms ease;
}

[data-site-shell] .site-language-cycle--mobile {
  display: none;
}

[data-site-shell] .site-language-cycle:hover,
[data-site-shell] .site-language-cycle:focus-visible {
  color: var(--site-shell-fg);
  outline: none;
  transform: translateY(-1px);
}

[data-site-shell] .site-language-cycle:focus-visible {
  box-shadow: 0 0 0 1px currentColor inset;
}

[data-site-shell] .site-language-icon-stack {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
}

[data-site-shell] .site-language-icon-layer {
  position: absolute;
  inset: 0;
  display: block;
  background: currentColor;
  -webkit-mask: var(--site-language-icon-url) center / contain no-repeat;
  mask: var(--site-language-icon-url) center / contain no-repeat;
  transform-origin: center;
}

[data-i18n-icon-state="zh"] [data-i18n-icon-layer="current"] {
  --site-language-icon-url: url("./assets/language-icons/language-zh-en.svg");
}

[data-i18n-icon-state="zh"] [data-i18n-icon-layer="next"],
[data-i18n-icon-state="en"] [data-i18n-icon-layer="current"] {
  --site-language-icon-url: url("./assets/language-icons/language-en-ja.svg");
}

[data-i18n-icon-state="en"] [data-i18n-icon-layer="next"],
[data-i18n-icon-state="ja"] [data-i18n-icon-layer="current"] {
  --site-language-icon-url: url("./assets/language-icons/language-ja-zh.svg");
}

[data-i18n-icon-state="ja"] [data-i18n-icon-layer="next"] {
  --site-language-icon-url: url("./assets/language-icons/language-zh-en.svg");
}

[data-site-shell] [data-i18n-icon-layer="current"] {
  opacity: 1;
}

[data-site-shell] [data-i18n-icon-layer="next"] {
  opacity: 0;
}

[data-site-shell] .site-language-cycle.is-switching [data-i18n-icon-layer="current"] {
  animation: site-language-icon-out 330ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

[data-site-shell] .site-language-cycle.is-switching [data-i18n-icon-layer="next"] {
  animation: site-language-icon-in 330ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

[data-site-shell] .site-primary-nav__labels {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.25vw, 36px);
}

html[lang="en"] body {
  font-family: Arial, "Helvetica Neue", "Noto Sans SC", sans-serif;
}

html[lang="ja"] body {
  font-family: "Yu Gothic", "Hiragino Sans", Meiryo, "Noto Sans SC", sans-serif;
  word-break: normal;
}

html[lang="en"] [data-i18n-body-copy],
html[lang="ja"] [data-i18n-body-copy] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

html[lang="en"] p,
html[lang="en"] li,
html[lang="en"] [data-i18n-body-copy] {
  overflow-wrap: anywhere;
}

html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] [data-i18n-body-copy] {
  line-break: strict;
  overflow-wrap: anywhere;
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  max-width: 100%;
  text-wrap: balance;
}

@keyframes site-language-icon-out {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translate3d(-4px, -3px, 0) rotate(-14deg) scale(0.78); }
}

@keyframes site-language-icon-in {
  0% { opacity: 0; transform: translate3d(4px, 3px, 0) rotate(14deg) scale(0.78); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}

@media (min-width: 761px) {
  html[lang="en"] [data-site-shell] .site-primary-nav {
    width: 328px;
    flex: 0 0 328px;
    gap: 14px !important;
  }

  html[lang="ja"] [data-site-shell] .site-primary-nav {
    width: 328px;
    flex: 0 0 328px;
    gap: 14px !important;
  }

  html[lang="en"] [data-site-shell] .site-primary-nav__labels {
    width: 282px;
    min-width: 282px;
    justify-content: space-between;
    gap: 0;
    white-space: nowrap;
  }

  html[lang="ja"] [data-site-shell] .site-primary-nav__labels {
    width: 282px;
    min-width: 282px;
    justify-content: space-between;
    gap: 0;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  html[lang="ja"] body.home-page #intro .hero-title {
    font-size: clamp(27px, 7.2vw, 30px) !important;
  }

  html[lang="en"] [data-site-shell] .brand-name,
  html[lang="ja"] [data-site-shell] .brand-name {
    max-width: none !important;
    overflow: visible !important;
    font-size: 12px !important;
    text-overflow: clip !important;
  }

  html[lang="en"] body.contact-page .contact-map-disclaimer,
  html[lang="ja"] body.contact-page .contact-map-disclaimer {
    right: 4%;
    left: 8%;
  }

  [data-site-shell] .site-language-cycle--mobile {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin-left: auto;
  }

  [data-site-shell] .site-language-cycle--mobile .site-language-icon-stack {
    width: 23px;
    height: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-site-shell] .site-language-cycle,
  [data-site-shell] .site-language-icon-layer {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
