.language-switch {
  --switch-surface: #f7f7f2;
  --switch-ink: #24271f;
  --switch-border: #c8cbbf;
  position: relative;
  isolation: isolate;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 88px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid var(--switch-border);
  border-radius: 999px;
  background: var(--switch-surface);
  color: var(--switch-ink);
  font: 600 12px/1 system-ui, sans-serif;
  cursor: pointer;
}

.language-switch[hidden] {
  display: none;
}

.language-switch::before {
  content: "";
  position: absolute;
  inset: 4px 50% 4px 4px;
  z-index: -1;
  border-radius: inherit;
  background: var(--switch-ink);
  transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}

.language-switch[aria-pressed="true"]::before {
  transform: translateX(100%);
}

.language-switch[aria-pressed="false"] span:first-child,
.language-switch[aria-pressed="true"] span:last-child {
  color: var(--switch-surface);
}

.language-switch:focus-visible {
  outline: 2px solid var(--switch-ink);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .language-switch::before {
    transition: none;
  }
}
