.acoustics-demo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--accent);
}
.acoustics-demo > svg { position: absolute; display: block; max-width: none; overflow: visible; }
.cover:has(.acoustics-demo) .cover-inner { position: relative; z-index: 1; }
.acoustics-ring { fill: none; stroke: color-mix(in srgb, var(--spark) 82%, #fff); stroke-linecap: round; }
.acoustics-ring-calm { stroke: color-mix(in srgb, var(--accent) 85%, #fff); }
.acoustics-ring-far { opacity: .42; }
.acoustics-ring-halo { opacity: .16; }
.acoustics-halo { fill: none; stroke: color-mix(in srgb, var(--night) 55%, transparent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 1 1; }
.acoustics-layer { fill: none; stroke: color-mix(in srgb, var(--accent) 60%, #fff); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 1 1; }
.acoustics-sweep { fill: none; stroke: #fff; stroke-width: 4.4; stroke-linecap: round; stroke-dasharray: .08 1.2; }
.acoustics-layer-b { stroke: var(--accent); stroke-width: 1.8; }
[data-head] { fill: #fff; }
.acoustics-caption {
  position: absolute;
  /* Under the rear bumper: the rings around the wheel stay in view. */
  left: 37%;
  bottom: clamp(.9rem, 2.1vw, 2.1rem);
  z-index: 2;
  display: inline-flex;
  gap: .75rem;
  align-items: center;
  color: var(--on-dark);
  background: linear-gradient(115deg, color-mix(in srgb, var(--night-deep) 95%, transparent), color-mix(in srgb, var(--night-2) 88%, transparent));
  border: 1px solid var(--line-dark-strong);
  border-radius: .45rem;
  padding: .36rem .85rem .36rem .35rem;
  text-shadow: none;
}
.acoustics-caption:not(:has(button:not([hidden], .acoustics-sound))) { padding-left: .85rem; }
.acoustics-caption button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-dark-strong);
  border-radius: 50%;
  color: var(--accent);
  background: var(--night-3);
}
.acoustics-caption button:hover { background: color-mix(in srgb, var(--accent) 22%, var(--night)); }
.acoustics-caption button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* The sound toggle stands beside the caption, which keeps its size, so the rings stay in view. It is held from below, so it stays put when the caption gets a line taller. */
.acoustics-caption .acoustics-sound { position: absolute; right: calc(100% + .55rem); bottom: .36rem; }
/* The toggle is lit while the road is heard. */
.acoustics-sound[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.acoustics-sound[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--accent) 84%, #fff); }
.acoustics-caption > span:not(.acoustics-meter) { display: grid; gap: .1rem; text-align: left; }
.acoustics-meter { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 2px; height: 1.35rem; }
.acoustics-meter i { width: 3px; height: 100%; border-radius: 2px; background: linear-gradient(to top, var(--accent), color-mix(in srgb, var(--spark) 70%, var(--accent))); transform: scaleY(var(--level, .2)); transform-origin: bottom; }
.acoustics-topic { color: var(--muted-on-dark); font: 600 .72rem/1.2 Roboto, Arial, sans-serif; }
.acoustics-phase { min-width: 10.1em; font: 660 .9rem/1.18 Roboto, Arial, sans-serif; letter-spacing: -.012em; }
.acoustics-note { color: var(--muted-on-dark); font: 500 .66rem/1.2 Roboto, Arial, sans-serif; }
@media (max-width: 680px) {
  .acoustics-caption { bottom: .6rem; left: var(--gutter, 5vw); right: auto; gap: .5rem; padding: .2rem .65rem .2rem .2rem; }
  .acoustics-caption .acoustics-sound { right: auto; left: .2rem; bottom: 3.7rem; }
  .acoustics-topic { font-size: .69rem; }
  .acoustics-phase { font-size: .83rem; }
}
@media print { .acoustics-demo,.acoustics-caption { display: none; } }
