:root {
  --sound-edge: 15px;
  --sound-stack-step: 53px;
}

/* Keep the speaker above the slow-scroll button. */
.site-sound {
  --sound-rise: var(--sound-stack-step);
  position: fixed;
  z-index: 19;
  right: max(var(--sound-edge), env(safe-area-inset-right, 0px));
  bottom: calc(max(var(--sound-edge), env(safe-area-inset-bottom, 0px)) + var(--sound-rise));
}

.sound-only .site-sound { --sound-rise: 0px; }

.linkwarden-view {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: #eeeae0;
}

.linkwarden-view iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.show-linkwarden { overflow: hidden; }
.show-linkwarden .drift-control { display: none; }
.show-linkwarden .site-sound { z-index: 41; }

.quiet-footer-bottom {
  padding-inline-end: max(0px, calc(max(var(--sound-edge), env(safe-area-inset-right, 0px)) + var(--sound-stack-step) - var(--gutter, 5vw)));
}

.site-music-credit {
  margin-top: 0;
  padding: 0 110px 22px 0;
  color: #d3d4c6;
  font-size: .73rem;
  line-height: 1.6;
}

.site-music-credit a,
.lw-footer .site-music-credit a {
  display: inline;
  min-height: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.site-sound[hidden],
.site-sound .sound-control[hidden] { display: none; }

.site-sound .sound-control {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 1px solid #e7e2d48c;
  border-radius: 12px;
  color: #f8f4e9;
  background: #252c35;
  box-shadow: 0 3px 14px #2129382b;
  cursor: pointer;
  touch-action: manipulation;
}

.site-sound .sound-control[data-sound-playing="true"] {
  color: var(--citron, #ccd77d);
  border-color: #ccd77d91;
}

.site-sound .sound-control svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.site-sound .sound-control [data-sound-dot],
.site-sound .sound-control [data-sound-waves],
.site-sound .sound-control [data-sound-slash] { display: none; }

.site-sound .sound-control[data-sound-playing="neutral"] [data-sound-dot],
.site-sound .sound-control[data-sound-playing="true"] [data-sound-waves],
.site-sound .sound-control[data-sound-playing="false"] [data-sound-slash] { display: inline; }

.site-sound .sound-control:focus-visible {
  outline: 2px solid #f8f4e9;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #252c35;
}

@media (hover: hover) and (pointer: fine) {
  .site-sound .sound-control:hover { background: #3b4534; }
}

@media (prefers-reduced-motion: no-preference) {
  .site-sound .sound-control {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, scale .22s ease;
  }

  .site-sound .sound-control:active { scale: .94; }
}

@media (max-width: 720px) {
  :root { --sound-edge: 11px; }
}
