/* Good Friction · the language picker in the built site's header, and the spread between languages (see i18n.js). */

/* ---------- the picker: "en" opens a hello in each language ---------- */
.hdr [data-lang-host] { display: inline-flex; }
.lw { position: relative; }
.lang { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 2px; border: 0; background: none; color: inherit; cursor: pointer;
        font: 500 13px/1 var(--gf-font-mono); letter-spacing: .08em; text-transform: uppercase; }
.lang i { width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; transition: rotate .3s var(--ease), margin .3s var(--ease); }
.lang[aria-expanded="true"] i { rotate: 225deg; margin-top: 4px; }
.lang .lc { position: relative; }
.lang .lc::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: currentColor; scale: 0 1; transform-origin: 0 50%; transition: scale .3s var(--ease); }
.lang:hover .lc::after, .lang[aria-expanded="true"] .lc::after { scale: 1 1; }
.lang:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }

.lp { position: absolute; top: calc(100% + 12px); right: -14px; z-index: 30; width: 300px; padding: 10px; border-radius: 18px; background: var(--gf-white);
      box-shadow: inset 0 0 0 1px var(--gf-sand), 0 18px 40px -18px rgba(21, 20, 18, .18); color: var(--gf-ink); text-align: left;
      opacity: 0; translate: 0 -6px; transition: opacity .2s var(--ease), translate .3s var(--ease); }
.lp.on { opacity: 1; translate: 0 0; }
.lp .lt { padding: 6px 12px 10px; color: var(--gf-graphite); }
.li { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; width: 100%; padding: 10px 12px 10px 30px; border: 0; border-radius: 10px;
      background: none; color: var(--gf-ink); cursor: pointer; text-align: left; transition: background .15s; }
.li .hi { font: 400 30px/1.05 var(--gf-font-display); letter-spacing: -.02em; }
.li .nm { color: var(--gf-graphite); }
.li::before { content: ""; position: absolute; left: 13px; top: 50%; width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: var(--gf-ink); scale: 0; transition: scale .3s var(--ease); }
.li[aria-checked="true"]::before { scale: 1; }
.li:hover, .li:focus-visible { background: var(--gf-bone); outline: none; }
.li:focus-visible { box-shadow: inset 0 0 0 2px var(--gf-ink); }
/* the hellos arrive one after another */
.lp .li { opacity: 0; translate: 0 6px; transition: background .15s, opacity .3s var(--ease), translate .4s var(--ease); }
.lp.on .li { opacity: 1; translate: 0 0; }
.lp.on .li:nth-of-type(2) { transition-delay: 0s, .03s, .03s; } .lp.on .li:nth-of-type(3) { transition-delay: 0s, .06s, .06s; }
.lp.on .li:nth-of-type(4) { transition-delay: 0s, .09s, .09s; } .lp.on .li:nth-of-type(5) { transition-delay: 0s, .12s, .12s; }

/* phones: the links go into the menu; the picker stays in the header, beside "menu" */
@media (max-width: 820px) {
  .hdr nav { display: flex; margin-left: auto; margin-right: 20px; }
  .hdr nav > a { display: none; }
  .lp { right: -64px; width: min(300px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) { .lp, .lp .li, .lang i, .lang .lc::after { transition: none; } }

/* ---------- the switch: an orange circle pours out of the button, the page changes language behind it, and the circle
   shrinks back into the button (see i18n.js). Only transforms move, so the graphics card runs it smoothly ---------- */
.gf-pour-el, html.gf-pour::before { position: fixed; z-index: 200; border-radius: 50%; background: #FF4A1C; pointer-events: none; will-change: transform; }
html.gf-pour::before { content: ""; left: calc(var(--gx) - var(--gr)); top: calc(var(--gy) - var(--gr)); width: calc(var(--gr) * 2); height: calc(var(--gr) * 2); }
html.gf-pour.gf-out::before { animation: gf-pour-out .64s cubic-bezier(.55, 0, .2, 1) forwards; }
@keyframes gf-pour-out { to { transform: scale(0); } }
