/* Good Friction · the sound switch in the header, beside the language picker, and the wave it plays when it's turned on or off (see sound.js). */
.hdr [data-sound-host] { display: inline-flex; }
.snd { display: inline-flex; align-items: center; gap: 8px; 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; }
.snd .lc { position: relative; }
.snd .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); }
.snd:hover .lc::after { scale: 1 1; }
.snd:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }

/* three bars: lying flat when it's off. when it's on, sound.js moves them from the real music, so they go flat when the track brakes */
.snd .bars { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.snd .bars i { width: 2px; height: 14px; border-radius: 1px; background: currentColor; transform: scaleY(.14); transition: transform .28s var(--ease); }
.snd[data-state="on"] .bars i { transition: transform .06s linear; }
.snd[data-state="wait"] .bars i { transform: scaleY(.4); animation: gf-snd-wait 1s ease-in-out infinite; }
.snd[data-state="wait"] .bars i:nth-child(2) { animation-delay: .15s; }
.snd[data-state="wait"] .bars i:nth-child(3) { animation-delay: .3s; }
@keyframes gf-snd-wait { 50% { opacity: .35; } }

/* phones: only so much header. the word while it's off (flat bars alone read as "more"), the moving icon once it's on */
@media (max-width: 820px) {
  .hdr [data-sound-host] { margin-right: 12px; }
  .snd { justify-content: center; font-size: 12px; letter-spacing: .06em; }
  .snd[data-state="off"] .bars { display: none; }
  .snd:not([data-state="off"]) { min-width: 40px; }
  .snd:not([data-state="off"]) .lc { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* the wave: one canvas, the word on top of it, and the switch on top of the colour */
.snd-canvas { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; }
.snd-word { position: fixed; z-index: 61; left: 0; right: 0; top: 50%; margin-top: -.6em; padding: 0 20px; text-align: center; pointer-events: none;
            font: 400 clamp(52px, 12vw, 190px)/1.2 var(--gf-font-display); letter-spacing: -.03em; }
.snd-word span, .snd-word i { display: inline-block; white-space: pre; font-style: normal; will-change: transform; }
.snd-word.is-on { color: var(--gf-ink); }
.snd-word.is-on i { color: var(--gf-paper); }
.snd-word.is-off { color: var(--gf-paper); }
.snd-word.is-off i { color: var(--gf-heat); }
.snd-word.is-paper { color: var(--gf-ink); }
.snd-word.is-paper i { color: var(--gf-heat); }
.snd-pip { position: fixed; z-index: 62; margin: 0; pointer-events: none; opacity: 0; }
.snd-pip.is-on, .snd-pip.is-paper { color: var(--gf-ink); }
.snd-pip.is-off { color: var(--gf-paper); }
.snd-pip .bars i { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .snd .bars i, .snd .lc::after { transition: none; }
  .snd[data-state="wait"] .bars i { animation: none; }
}
