/* The language switch (lang.js): one round button beside the theme switch,
   on the same surface, showing the current language. A press rolls the code
   to the other language while the page reloads in it. The masthead reserves
   its width in site-chrome.css. */
.theme-corner { display: flex; align-items: flex-start; gap: 10px; }
/* Pages without the site chrome (linktree) get the button on its own. */
.lang-corner { position: fixed; top: 20px; right: 20px; z-index: 65; }
.lang-switch {
  position: relative; flex: none; width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--theme-switch-surface, var(--paper)); color: var(--theme-switch-ink, var(--wine));
  box-shadow: 0 5px 18px var(--palette-shadow, #351d2c1a), inset 0 0 0 .75px var(--theme-switch-line, var(--line));
  transition: scale 160ms cubic-bezier(.22,1,.36,1), color 140ms ease;
}
.lang-switch:active { scale: .97; }
.lang-switch:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.lang-face { position: absolute; inset: 0; border-radius: 50%; overflow: clip; }
.lang-codes { display: grid; transition: translate 320ms cubic-bezier(.22,1,.36,1); }
.lang-codes > span { display: grid; place-items: center; height: 44px; font: 500 12px/1 'IBM Plex Mono', monospace; letter-spacing: .04em; }
.lang-switch[data-lang="pt"] .lang-codes { translate: 0 -44px; }
.lang-tip {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  padding: 7px 10px; width: max-content; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--wine); font: 500 11px/1.4 var(--font-body, Manrope, sans-serif);
  opacity: 0; pointer-events: none; transition: opacity 120ms ease 180ms;
}
.lang-corner .lang-tip { left: auto; right: 0; transform: none; }
.lang-switch:focus-visible .lang-tip { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .lang-switch:hover { color: var(--violet); }
  .lang-switch:hover .lang-tip { opacity: 1; }
}
.lang-switch[data-leaving] .lang-tip { opacity: 0; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .lang-switch, .lang-codes, .lang-tip { transition: none; }
}
