/*
 * PDX bubbles (wave 12, design section E): small chamfered speech slips over
 * people's heads. Near-black with a thin edge (volt by default; the class
 * tints it), a square pointer, mono type: no balloons, no curves. bubbles.js
 * moves each one with a transform once a frame and never touches layout.
 */
.pdx-bubbles { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.pdx-bubble {
  --bc: var(--volt);
  position: absolute; left: 0; top: 0; width: max-content; max-width: 188px;
  pointer-events: none; will-change: transform;
}
.pdx-bubble[hidden] { display: none; }
.pdx-bubble.is-hid { visibility: hidden; }
.pdx-bubble.is-out { opacity: .5; }
.pdx-bubble-pop { position: relative; transform-origin: 50% 100%; animation: pdx-bub-pop .2s steps(4) both; }
.pdx-bubble-box {
  padding: 1px; background: var(--bc);
  clip-path: polygon(0 5px, 5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%);
}
.pdx-bubble-in {
  padding: 5px 8px 5px; background: rgba(6, 7, 11, .93); color: var(--text);
  font: 500 11px/1.3 var(--font-mono); letter-spacing: .02em; overflow-wrap: anywhere;
  clip-path: polygon(0 4px, 4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}
/* The pointer: an edge-coloured triangle with a dark one inside it. --tx slides it when the box is held inside the screen. */
.pdx-bubble-tail {
  position: absolute; left: calc(50% + var(--tx, 0px)); bottom: -7px; width: 10px; height: 8px; margin-left: -5px;
  background: var(--bc); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pdx-bubble-tail::after {
  content: ''; position: absolute; left: 1.5px; right: 1.5px; top: 0; bottom: 1.5px;
  background: rgba(6, 7, 11, .93); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pdx-bubble.b-business { --bc: var(--cyan); }
.pdx-bubble.b-commuter { --bc: var(--muted); }
.pdx-bubble.b-punk { --bc: var(--volt); }
.pdx-bubble.b-hippie { --bc: var(--cyan); }
.pdx-bubble.b-police { --bc: var(--hot); }
.pdx-bubble.b-police .pdx-bubble-in { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pdx-bubble.b-zombie { --bc: var(--dim); }
.pdx-bubble.b-zombie .pdx-bubble-in { color: var(--muted); font-style: italic; }
.pdx-bubble.t-hot { --bc: var(--hot); }
.pdx-bubble.t-cyan { --bc: var(--cyan); }
.pdx-bubble.t-volt { --bc: var(--volt); }

@keyframes pdx-bub-pop {
  0% { transform: translateY(5px) scale(.85); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .pdx-bubble-pop { animation: none; } }

/* The footer's switch for them (a button made to read like its neighbours). */
.pdx-keys .pdx-bub-key { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-transform: inherit; }
.pdx-keys .pdx-bub-key b { font-weight: inherit; color: var(--volt); }
.pdx-keys .pdx-bub-key[aria-pressed="false"] b { color: var(--hot); }
