/* Shared language control and matching type stacks. */
.language-switch {
  flex: 0 0 auto;
  min-width: 88px;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(87, 93, 214, 0.2);
  border-radius: 10px;
  color: #3f45a9;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.nav-links .language-switch {
  margin-left: 4px;
}

body.locale-en {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body.locale-en .brand small,
body.locale-en .nav-links,
body.locale-en .eyebrow,
body.locale-en .language-switch {
  letter-spacing: 0.045em;
}

body.locale-en .nav {
  gap: 24px;
}

body.locale-en .nav .brand {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 40%;
}

body.locale-en .nav .brand > span {
  min-width: 0;
  max-width: 100%;
}

body.locale-en .nav .brand strong,
body.locale-en .nav .brand small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.locale-en .nav .brand strong {
  font-size: clamp(16px, 1.55vw, 20px);
}

body.locale-en .nav-links {
  flex: 0 1 auto;
  gap: clamp(14px, 2.1vw, 30px);
  font-size: clamp(12px, 1.1vw, 14px);
}

body.locale-en .hero-strategy-title,
body.locale-en .hero-brand-line {
  letter-spacing: -0.045em;
}

body.locale-en .section-head h2,
body.locale-en .section-title-with-icon h2 {
  letter-spacing: -0.025em;
}

body.locale-zh-tw {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

@media (max-width: 980px) {
  .nav-links .language-switch {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .nav {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    padding: 10px 16px;
  }

  .nav .brand {
    min-width: 0;
    width: calc(100% - 112px);
    max-width: calc(100vw - 112px);
  }

  .nav .brand > span {
    min-width: 0;
    max-width: 100%;
  }

  .nav .brand strong {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.2;
  }

  .nav .brand small {
    display: none;
  }

  body.locale-en .nav .brand {
    max-width: calc(100vw - 112px);
  }

  .nav-links {
    display: contents;
    min-width: 0;
    max-width: none;
    width: auto;
  }

  .nav-links > a {
    display: none;
  }

  .nav-links .language-switch {
    display: block;
    position: absolute;
    top: 12px;
    right: 16px;
    width: 96px;
    max-width: 96px;
  }

  .language-switch {
    min-width: 82px;
    height: 32px;
    font-size: 11px;
  }

  .human-assistant {
    right: 32px;
  }

  body.locale-en .hero-strategy-title {
    font-size: clamp(25px, 6.6vw, 34px);
    line-height: 1.14;
  }

  body.locale-en .hero h2.hero-brand-line {
    font-size: clamp(24px, 6.3vw, 32px);
    line-height: 1.16;
  }

  body.locale-en .hero-copy {
    max-width: 100%;
    font-size: 15px;
    line-height: 1.58;
  }

  body.locale-en .hero-actions a {
    white-space: normal;
    text-align: center;
  }

  main .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  main .case-grid p {
    min-width: 0;
    min-height: 62px;
    padding: 14px 10px;
    overflow-wrap: anywhere;
  }

  main .case-grid p > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  footer {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 16px;
  }

  footer .brand {
    min-width: 0;
    max-width: 100%;
  }

  footer .brand > span,
  footer .brand strong,
  footer .brand small,
  footer > p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  footer .brand strong {
    width: auto;
    white-space: normal;
    font-size: 16px;
    line-height: 1.25;
  }

  footer .brand small {
    display: block;
    font-size: 11px;
    line-height: 1.4;
  }
}
