/* DENIM plays (V34, /denim/): the sound bar under the device, the tools of its column as real buttons, and (no WebGL) the
   pictures of the pair laid over the still window. Script: assets/denim-live.js. Palette: black, white, red, greys. */
.dl-ovl { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.d3--still .dl-ovl { height: max(360px, min(72vh, 640px)); }
.d3--still[data-d3-lay="port"] .dl-ovl { height: max(300px, 52vh); }
.d3--off .dl-ovl { height: 100%; }

/* the bar */
.dl { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 16px); box-sizing: border-box;
  padding: 6px 8px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.94); color: #111;
  box-shadow: 0 1px 0 rgba(17,17,17,.06), 0 10px 26px -14px rgba(17,17,17,.55), inset 0 0 0 1px rgba(17,17,17,.07);
  font-family: Montserrat, system-ui, sans-serif; pointer-events: auto; opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s; will-change: transform; }
.dl-ovl.is-ready .dl { opacity: 1; visibility: visible; transition: opacity .35s ease, visibility 0s; }
.dl-ovl.is-out .dl, .dl-ovl.is-out .dl-tools { opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.dl-tools { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .35s ease, visibility 0s; }

/* the sound button (V34 pass 2, owner: "make muting obvious"): a pill that says what it does.
   off: black, play + LISTEN; loading: a red arc runs round the icon; on: red, a crossed speaker + MUTE (the moving bars sit by the words) */
.dl__snd { position: relative; flex: 0 0 auto; height: 48px; min-width: 48px; padding: 0 18px 0 12px; border: 0; border-radius: 999px; background: #111; color: #fff;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .2s ease, transform .15s ease; }
.dl__lbl { font: 800 12px/1 Montserrat, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.dl__now .dl-eq { display: inline-flex; height: 11px; gap: 2px; margin-right: 6px; vertical-align: -1px; }
.dl__now .dl-eq i { width: 2.5px; background: #D9202C; }
.dl__snd:hover { background: #2a2a2c; }
.dl__snd:active { transform: scale(.95); }
.dl__snd:focus-visible, .dl__tg:focus-visible, .dl__back:focus-visible { outline: 2px solid #D9202C; outline-offset: 3px; }
.dl__snd:disabled { background: #8e8e92; cursor: default; }
.dl__snd svg { width: 24px; height: 24px; display: block; }
.dl__ico { display: grid; place-items: center; }
.dl__ico--on { display: none; }
.dl[data-state="on"] .dl__snd, .dl[data-state="paused"] .dl__snd { background: #D9202C; }
.dl[data-state="on"] .dl__snd:hover { background: #EE2F3B; }
.dl[data-state="on"] .dl__ico--off, .dl[data-state="paused"] .dl__ico--off { display: none; }
.dl[data-state="on"] .dl__ico--on, .dl[data-state="paused"] .dl__ico--on { display: grid; }
.dl__ring { position: absolute; left: 7px; top: 50%; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%; border: 2.5px solid transparent; opacity: 0; transition: opacity .2s ease; }
.dl[data-state="loading"] .dl__ring { opacity: 1; border-top-color: #D9202C; border-right-color: rgba(217,32,44,.35); animation: dl-spin .85s linear infinite; }
.dl-eq { display: flex; align-items: flex-end; gap: 2.5px; height: 18px; }
.dl-eq i { display: block; width: 3.5px; height: 100%; border-radius: 2px; background: #fff; transform-origin: 50% 100%; transform: scaleY(.45); }
.dl[data-state="on"] .dl-eq i { animation: dl-eq 1.25s ease-in-out infinite; }
.dl[data-state="on"] .dl-eq i:nth-child(2) { animation-duration: .95s; animation-delay: -.3s; }
.dl[data-state="on"] .dl-eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.6s; }
.dl[data-state="on"] .dl-eq i:nth-child(4) { animation-duration: .85s; animation-delay: -.15s; }
@keyframes dl-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes dl-spin { to { transform: rotate(360deg); } }

/* what plays now */
.dl__now { margin: 0; min-width: 9.5em; max-width: 15em; font-size: 12.5px; font-weight: 500; line-height: 1.25; color: #2b2b2d; letter-spacing: .01em; }
.dl__now b { font-weight: 800; color: #111; letter-spacing: .02em; }
.dl__dim { display: inline-block; margin-left: 4px; font-weight: 700; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #8a8a8e; }

/* the switches: Drums, DENIM; All tools while one tool plays alone */
.dl__tgs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dl__tg, .dl__back { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1.5px solid #111;
  background: transparent; color: #111; font: 700 11px/1 Montserrat, system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: color .2s ease, border-color .2s ease, background-color .2s ease; white-space: nowrap; }
.dl__tg i { width: 8px; height: 8px; border-radius: 50%; background: #b9b9bd; transition: background-color .2s ease, box-shadow .2s ease; }
.dl__tg[aria-pressed="true"] i { background: #D9202C; box-shadow: 0 0 0 3px rgba(217,32,44,.18); }
.dl__tg[aria-pressed="false"] { color: #707074; border-color: #c4c4c8; }
.dl__tg:hover, .dl__back:hover { background: rgba(17,17,17,.05); }
.dl__back { border-color: #D9202C; color: #D9202C; }
.dl__back[hidden] { display: none; }

/* the tools of the device's column: a real button over each tile */
.dl-tool { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; margin: 0; border: 0; border-radius: 7px; background: transparent no-repeat;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; transition: box-shadow .2s ease; will-change: transform; }
.dl-tool:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.dl-tool:focus-visible { outline: 2px solid #D9202C; outline-offset: 1px; }
.dl-tool[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #D9202C; }

/* no WebGL: the pair, the strap and the lit row over the still window */
.dl-st { position: absolute; display: block; pointer-events: none; }
.dl-st--pair { opacity: 0; transition: opacity .7s ease; }
.dl-st--pair.is-on { opacity: 1; }
.dl-st--strap { opacity: 0; }
.dl-st--strap.is-on { opacity: 1; }
.dl-ovl--still .dl-tool { transform: none !important; }
.d3.dl-on.d3--off .d3__steps { margin-top: 92px; }   /* room for the bar under the still window */

/* phones */
.d3[data-d3-lay="port"] .dl, .d3[data-d3-lay="land"] .dl { gap: 7px; padding: 5px 6px 5px 5px; }
.d3[data-d3-lay="port"] .dl__snd, .d3[data-d3-lay="land"] .dl__snd { height: 42px; min-width: 42px; padding: 0 14px 0 10px; gap: 6px; }
.d3[data-d3-lay="port"] .dl__ring, .d3[data-d3-lay="land"] .dl__ring { left: 5px; width: 32px; height: 32px; margin-top: -16px; }
.d3[data-d3-lay="port"] .dl__lbl, .d3[data-d3-lay="land"] .dl__lbl { font-size: 11px; letter-spacing: .12em; }
.d3[data-d3-lay="port"] .dl__now, .d3[data-d3-lay="land"] .dl__now { min-width: 0; max-width: 7.6em; font-size: 11px; }
.d3[data-d3-lay="port"] .dl[data-state="off"] .dl__now { display: none; }   /* LISTEN says it on a phone; the words come back with the sound */
.d3[data-d3-lay="port"] .dl__tg, .d3[data-d3-lay="port"] .dl__back, .d3[data-d3-lay="land"] .dl__tg, .d3[data-d3-lay="land"] .dl__back { height: 30px; padding: 0 9px; gap: 5px; font-size: 10px; letter-spacing: .1em; }
.d3[data-d3-lay="port"] .dl-tool { border-radius: 4px; }
/* CHECK V34: on phones a tile is about 21 x 25 px; the finger gets a bigger invisible target (the tiles sit ~40 px apart) */
.d3[data-d3-lay="port"] .dl-tool::after, .d3[data-d3-lay="land"] .dl-tool::after { content: ""; position: absolute; top: -6px; bottom: -6px; left: -10px; right: -10px; }
.dl.dl--compact { gap: 5px; padding: 3px 4px 3px 3px; }
.dl.dl--compact .dl__now { display: none; }
.dl.dl--compact .dl__snd { height: 30px; min-width: 30px; padding: 0 10px 0 7px; gap: 4px; }
.dl.dl--compact .dl__snd svg { width: 17px; height: 17px; }
.dl.dl--compact .dl__lbl { font-size: 9.5px; letter-spacing: .1em; }
.dl.dl--compact .dl__ring { left: 3px; width: 25px; height: 25px; margin-top: -12.5px; }
.dl.dl--compact .dl__tg, .dl.dl--compact .dl__back { height: 24px; padding: 0 8px; font-size: 9.5px; }

@media (prefers-reduced-motion: reduce) {
  .dl[data-state="on"] .dl-eq i { animation: none; transform: scaleY(.75); }
  .dl[data-state="on"] .dl-eq i:nth-child(2n) { transform: scaleY(.5); }
  .dl[data-state="loading"] .dl__ring { animation: none; border-color: rgba(217,32,44,.55); border-style: dotted; }
  .dl-st--pair { transition-duration: .3s; }
}
@media print { .dl-ovl { display: none; } }
