/* Soundtrack controls and entry dialog. */

.audio-toggle {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 48px 1fr 16px;
  align-items: center;
  gap: 12px;
  width: 280px;
  min-height: 76px;
  padding: 10px 17px;
  border: 1px solid #454142;
  border-radius: 999px;
  background: #211f20;
  color: #fff;
  font-family: "DM Sans", Arial, sans-serif;
  cursor: pointer;
  box-shadow:
    0 14px 32px #0003,
    inset 0 1px 2px #ffffff12;
  text-align: left;
  transform: scale(0.605);
  transform-origin: right bottom;
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.audio-toggle:hover:not(:disabled) {
  transform: scale(0.605) translateY(-3px);
  border-color: #71696a;
}

.audio-toggle:focus-visible {
  outline: 3px solid #e8b11a;
  outline-offset: 4px;
}

.audio-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.audio-record {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid #302b2c;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #e8b11a 0 16%,
    #0d0d0d 17% 19%,
    #151313 20% 43%,
    #3c3327 44% 48%,
    #151313 49% 69%,
    #3c3327 70% 74%,
    #151313 75%
  );
  box-shadow:
    0 0 0 4px #171515,
    0 0 0 7px #312b2c,
    inset 0 0 9px #000;
}

.audio-record span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #090909;
  box-shadow: 0 0 0 1px #a86f00;
}

.audio-toggle-copy {
  display: grid;
  gap: 5px;
  text-align: left;
  text-transform: uppercase;
}

.audio-toggle-title {
  color: #898485;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.audio-toggle-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}

.audio-equalizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 18px;
}

.audio-equalizer i {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: #e8b11a;
  transform: scaleY(0.55);
  transform-origin: center;
}

.audio-toggle.is-playing .audio-equalizer i {
  animation: audio-bars 0.65s ease-in-out infinite alternate;
}

.audio-toggle.is-playing .audio-equalizer i:nth-child(2) {
  animation-delay: 0.2s;
}

.audio-toggle.is-playing .audio-equalizer i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes audio-bars {
  to {
    transform: scaleY(1.8);
  }
}

.audio-status {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry-gate {
  width: min(470px, calc(100vw - 36px));
  max-width: none;
  padding: 0;
  overflow: visible;
  border: 1px solid #e8b11a38;
  border-radius: 20px;
  background: transparent;
  color: #fff;
  box-shadow: 0 25px 80px #0005;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition:
    opacity 0.35s ease,
    transform 0.35s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.entry-gate[open]:not(.is-entering):not(.is-closing) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.entry-gate[open].is-entering,
.entry-gate.is-closing {
  pointer-events: none;
}

.entry-gate::backdrop {
  background: #1119;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  transition:
    background-color 0.35s ease,
    backdrop-filter 0.35s ease;
}

.entry-gate[open].is-entering::backdrop,
.entry-gate.is-closing::backdrop {
  background: #1110;
  backdrop-filter: blur(0);
}

.entry-gate-card {
  padding: clamp(34px, 7vw, 58px) 24px 32px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 100%, #311c17 0%, #1a1514 60%, #171515 100%);
  text-align: center;
}

.entry-gate-eyebrow {
  margin: 0 0 20px;
  color: #a9a09d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.entry-gate-eyebrow span {
  color: #e8b11a;
}

.entry-gate h2 {
  margin: 0;
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(48px, 12vw, 76px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.025em;
}

.entry-gate h2 em {
  color: #e8b11a;
  font-style: normal;
}

.entry-gate-description {
  margin: 21px 0 22px;
  color: #b7afad;
  font-size: 12px;
}

.entry-gate-play {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 22px;
  border: 1px solid #e8b11a55;
  border-radius: 999px;
  background: #e8b11a12;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

.entry-gate-play:hover:not(:disabled) {
  border-color: #e8b11a;
  background: #e8b11a24;
}

.entry-gate-play:focus-visible,
.entry-gate-silent:focus-visible {
  outline: 2px solid #e8b11a;
  outline-offset: 4px;
}

.entry-gate-play:disabled {
  cursor: wait;
  opacity: 0.65;
}

.entry-gate-play span {
  color: #e8b11a;
  font-size: 16px;
}

.entry-gate-silent {
  display: block;
  margin: 14px auto 0;
  padding: 5px 8px;
  border: 0;
  background: none;
  color: #a9a09d;
  font-size: 10px;
  cursor: pointer;
}

.entry-gate-silent:hover {
  color: #fff;
}

.entry-gate-status {
  min-height: 1em;
  margin: 12px 0 0;
  color: #e8b11a;
  font-size: 11px;
}

@media (max-width: 680px) {
  .audio-toggle {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    grid-template-columns: 42px 1fr 14px;
    gap: 0;
    width: min(280px, calc(100vw - 32px));
    min-height: 70px;
    padding: 9px 15px;
  }

  .audio-record {
    width: 38px;
  }

  .entry-gate-card {
    padding: 36px 18px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-toggle.is-playing .audio-equalizer i {
    animation: none;
    transform: scaleY(1.4);
  }
  .entry-gate,
  .entry-gate::backdrop {
    transition-duration: 0.01ms;
  }
}
