/* The capsule changes width; its flex neighbours follow that same continuous layout. */
.hero #hero-title .headline-first {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: .24em;
  margin-bottom: .14em;
}

.hero #hero-title .headline-first > span:first-child {
  flex: 0 0 auto;
  line-height: 1.15;
}

.hero #hero-title .word-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  max-width: 100%;
  padding: .08em .36em .12em;
  margin: 0;
  border: 1px solid #dfedc8;
  border-radius: 999px;
  background: #f3ffdc;
  color: #0b0b0b;
  overflow: visible;
}

.hero #hero-title .word-window {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--localized-width, max-content);
  max-width: none;
  min-width: 0;
  height: 1.22em;
  font-size: var(--localized-font-size, 1em);
  line-height: 1.4;
  overflow: visible;
  transition: width 620ms cubic-bezier(.22, .68, .18, 1);
}

.hero #localization-word {
  display: block;
  width: max-content;
  max-width: none;
  justify-self: center;
  white-space: nowrap;
  font-size: 1em;
  line-height: 1.4;
  letter-spacing: -.045em;
  overflow: visible;
  transform-origin: center;
}

.hero #localization-word[lang="ja"] {
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: -.045em;
}

.hero #hero-title .hero-word-measure {
  position: absolute;
  inset: 0 auto auto 0;
  width: max-content;
  max-width: none;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: -.045em;
  line-height: 1.4;
  contain: layout style;
}

.hero #hero-title .word-window.is-sizing { transition: none; }

@media (max-width: 959px) {
  .hero #hero-title .headline-first {
    flex-direction: column;
    gap: .12em;
    margin-bottom: .2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero #hero-title .word-window { transition: none; }
  .hero #localization-word { will-change: auto; }
}
