/* Welcome screen asking for sound (built by js/sound.js).
   Same palette, type and pill buttons as the rest of the site. */

.sound_gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #101010;
  color: #fff;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.sound_gate.is-visible {
  opacity: 1;
}

/* exit: the panel slides up like the page-transition loader */
.sound_gate.is-leaving {
  opacity: 1;
  transform: translateY(-100%);
  transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}

.sound_gate_inner {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2.5rem;
}

.sound_gate h4 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 115%;
}

/* little equaliser that breathes */
.sound_bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 28px;
}

.sound_bars span {
  width: 3px;
  height: 100%;
  border-radius: 3px;
  background: #fff;
  transform-origin: bottom;
  animation: soundBar 1.4s ease-in-out infinite;
}

.sound_bars span:nth-child(2) { animation-delay: -0.3s; }
.sound_bars span:nth-child(3) { animation-delay: -0.9s; }
.sound_bars span:nth-child(4) { animation-delay: -0.5s; }
.sound_bars span:nth-child(5) { animation-delay: -1.1s; }

@keyframes soundBar {
  0%, 100% { transform: scaleY(0.2); }
  50% { transform: scaleY(1); }
}

.sound_gate_btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* pill with the site's fill-from-bottom hover */
.sg_btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font: inherit;
  font-size: 1.05rem;
  color: #fff;
  background: transparent;
  border: 1.5px solid #fff;
  border-radius: 50px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
}

.sg_btn::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 100%;
  background: #fff;
  border-radius: 100% 100% 0 0;
  z-index: -1;
  transition: top 0.3s ease-in-out, border-radius 0.3s ease-in-out;
}

.sg_btn:hover,
.sg_btn:focus-visible,
.sg_primary {
  color: #101010;
}

.sg_btn:hover::before,
.sg_btn:focus-visible::before,
.sg_primary::before {
  top: 0;
  border-radius: 0;
}

.sg_primary:hover {
  color: #fff;
}

.sg_primary:hover::before {
  top: 100%;
  border-radius: 100% 100% 0 0;
}

.sg_btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 540px) {
  .sound_gate_btns {
    flex-direction: column;
    width: 100%;
  }

  .sg_btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sound_bars span {
    animation: none;
    transform: scaleY(0.6);
  }

  .sound_gate.is-leaving {
    transform: none;
    opacity: 0;
    transition: opacity 0.4s ease;
  }
}
