:root {
  --tectonic-volume-white: #f2f2ef;
  --tectonic-volume-muted: rgba(242, 242, 239, 0.48);
  --tectonic-volume-red: #c61927;
  --tectonic-volume-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tectonic-volume-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --tectonic-volume-enter-duration: 820ms;
  --tectonic-volume-exit-panel-duration: 620ms;
  --tectonic-volume-exit-scrim-duration: 700ms;
  --tectonic-volume-exit-scrim-delay: 120ms;
  --tectonic-volume-modal-duration: 820ms;
}

.tectonic-volume-control {
  position: fixed;
  inset: 0;
  z-index: 17000;
  color: var(--tectonic-volume-white);
  font-family: "Bahnschrift Condensed", "Arial Narrow", "Microsoft YaHei", sans-serif;
  pointer-events: none;
}

html.is-tectonic-interaction-booting .tectonic-volume-control,
html.is-tectonic-interaction-loading .tectonic-volume-control,
body.is-tectonic-interaction-loading .tectonic-volume-control,
body.is-piece-interaction-locked .tectonic-volume-control {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tectonic-volume-control__toggle {
  position: absolute;
  top: var(--tectonic-global-control-edge-y, clamp(1.35rem, 2.2vw, 2.75rem));
  left: var(--tectonic-global-control-edge-x, clamp(1.55rem, 2.4vw, 3.1rem));
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(2.2rem, 2.35vw, 3.25rem);
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--tectonic-volume-white);
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  transform: translate3d(var(--tectonic-piece-volume-shift, 0%), 0, 0) scale(1);
  opacity: var(--tectonic-piece-volume-opacity, 1);
  transform-origin: 50% 50%;
  transition:
    transform 420ms var(--tectonic-volume-ease),
    opacity 320ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.tectonic-volume-control__toggle:hover,
.tectonic-volume-control__toggle:focus-visible {
  transform:
    translate3d(var(--tectonic-piece-volume-shift, 0%), -0.24rem, 0)
    scale(1.075);
}

.tectonic-volume-control__toggle:focus-visible {
  outline: 1px solid rgba(242, 242, 239, 0.72);
  outline-offset: 0.42rem;
}

.tectonic-volume-control__toggle svg {
  display: block;
  width: 74%;
  height: 74%;
  overflow: visible;
}

.tectonic-volume-control__speaker-body,
.tectonic-volume-control__speaker-wave {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.tectonic-volume-control__speaker-body { stroke-width: 1.9; }
.tectonic-volume-control__speaker-wave { stroke-width: 1.45; opacity: 0.82; }

.tectonic-volume-control__toggle::after {
  content: "";
  position: absolute;
  right: 0.08rem;
  bottom: 0.16rem;
  width: 0.28rem;
  height: 0.28rem;
  background: var(--tectonic-volume-red);
  box-shadow: 0 0 0.7rem rgba(198, 25, 39, 0.7);
  transform: scale(0.72);
  transition: transform 420ms var(--tectonic-volume-ease);
}

.tectonic-volume-control__toggle:hover::after,
.tectonic-volume-control__toggle:focus-visible::after,
.tectonic-volume-control[data-open="true"] .tectonic-volume-control__toggle::after {
  transform: scale(1);
}

.tectonic-volume-control__modal {
  position: fixed;
  inset: 0;
  z-index: 2;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear var(--tectonic-volume-modal-duration);
}

.tectonic-volume-control[data-open="true"] .tectonic-volume-control__modal {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

.tectonic-volume-control__scrim {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  cursor: default;
  backdrop-filter: blur(10px);
  will-change: opacity;
  transition:
    opacity var(--tectonic-volume-exit-scrim-duration) var(--tectonic-volume-standard)
    var(--tectonic-volume-exit-scrim-delay);
}

.tectonic-volume-control[data-open="true"] .tectonic-volume-control__scrim {
  opacity: 1;
  transition:
    opacity var(--tectonic-volume-enter-duration) var(--tectonic-volume-standard) 0ms;
}

.tectonic-volume-control__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(21rem, 36vw, 39rem);
  box-sizing: border-box;
  padding: clamp(1.4rem, 2.25vw, 2.65rem) clamp(1.6rem, 2.8vw, 3.6rem);
  color: var(--tectonic-volume-white);
  background: rgba(3, 4, 5, 0.72);
  border-top: 1px solid rgba(242, 242, 239, 0.5);
  border-bottom: 1px solid rgba(242, 242, 239, 0.18);
  box-shadow: 0 1.8rem 6rem rgba(0, 0, 0, 0.46);
  transform: translate3d(calc(-50vw - 100% - 2rem), -50%, 0);
  will-change: transform;
  transition:
    transform var(--tectonic-volume-exit-panel-duration) cubic-bezier(0.4, 0, 1, 1);
}

.tectonic-volume-control__panel::before,
.tectonic-volume-control__panel::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 1px;
  height: 0.72rem;
  background: var(--tectonic-volume-red);
  box-shadow: 0 0 0.8rem rgba(198, 25, 39, 0.42);
}

.tectonic-volume-control__panel::before { left: 0; }
.tectonic-volume-control__panel::after { right: 0; }

.tectonic-volume-control[data-open="true"] .tectonic-volume-control__panel {
  transform: translate3d(-50%, -50%, 0);
  transition:
    transform var(--tectonic-volume-enter-duration) cubic-bezier(0, 0, 0.2, 1);
}

.tectonic-volume-control__heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(1.15rem, 2vw, 2.2rem);
}

.tectonic-volume-control__eyebrow {
  display: block;
  color: rgba(242, 242, 239, 0.62);
  font-family: var(--tectonic-ui-small-en, "Bahnschrift", "Arial", sans-serif);
  font-size: clamp(0.58rem, 0.52vw, 0.74rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tectonic-volume-control__value {
  min-width: 3ch;
  font-family: var(--tectonic-ui-small-en, "Bahnschrift", "Arial", sans-serif);
  font-size: clamp(2.3rem, 3.9vw, 4.7rem);
  font-weight: 500;
  line-height: 0.78;
  letter-spacing: -0.08em;
  text-align: right;
}

.tectonic-volume-control__slider-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.85rem, 1.4vw, 1.55rem);
  width: 100%;
  color: rgba(242, 242, 239, 0.6);
  transition: color 260ms ease-out;
}

.tectonic-volume-control__slider-row:hover,
.tectonic-volume-control__slider-row:focus-within,
.tectonic-volume-control__slider-row.is-dragging {
  color: var(--tectonic-volume-white);
}

.tectonic-volume-control__edge-icon {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  transform: translate3d(var(--tectonic-volume-icon-shift, 0), 0, 0) scale(1);
  transition: transform 420ms var(--tectonic-volume-ease);
}

.tectonic-volume-control__edge-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.tectonic-volume-control__slider {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 2.7rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
}

.tectonic-volume-control__slider:active { cursor: grabbing; }
.tectonic-volume-control__slider:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0.43rem -0.48rem;
  border: 1px solid rgba(242, 242, 239, 0.42);
  pointer-events: none;
}

.tectonic-volume-control__track-shell {
  position: relative;
  width: 100%;
  height: 7px;
  transform: scaleX(1) scaleY(1);
  transform-origin: left center;
  will-change: transform;
}

.tectonic-volume-control__slider-row:hover .tectonic-volume-control__track-shell,
.tectonic-volume-control__slider-row:focus-within .tectonic-volume-control__track-shell,
.tectonic-volume-control__slider-row.is-dragging .tectonic-volume-control__track-shell {
  height: 10px;
}

.tectonic-volume-control__track {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(242, 242, 239, 0.2);
  box-shadow: inset 0 0 0 1px rgba(242, 242, 239, 0.1);
}

.tectonic-volume-control__range {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--tectonic-volume-percent, 17%);
  border-radius: inherit;
  background: var(--tectonic-volume-white);
  box-shadow: 0 0 1rem rgba(220, 235, 242, 0.34);
}

.tectonic-volume-control__range::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 4px;
  height: 140%;
  background: var(--tectonic-volume-red);
  transform: translate(50%, -50%);
  box-shadow: 0 0 0.72rem rgba(198, 25, 39, 0.75);
}

.tectonic-volume-control__scale {
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 2.35rem 0;
  color: rgba(242, 242, 239, 0.34);
  font-family: var(--tectonic-ui-small-en, "Bahnschrift", "Arial", sans-serif);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

@media (max-width: 760px) {
  .tectonic-volume-control__toggle {
    top: 1.25rem;
    left: 1.2rem;
  }

  .tectonic-volume-control__panel {
    width: min(88vw, 32rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tectonic-volume-control,
  .tectonic-volume-control *,
  .tectonic-volume-control *::before,
  .tectonic-volume-control *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
