/* ══════════════════════════════════════════════════════════════════════
   THE INSTRUMENTS — rivawan.html only (assets/js/rvlab.js)

   Owner-requested 2026-10-22: small, working cards of the sound and
   voice tools built for rivawan.com, on her case page. Each is a port of
   her site's own code — the same tunings, figures and synth — not a
   picture of it. Her light (sand, teal, the maqamat's glows) is printed
   as LIGHT inside each stage, the vitrine rule; the cards themselves are
   ours: obsidian panel, hairline, mono metadata.
   ══════════════════════════════════════════════════════════════════════ */

.rvl{
  --sand:239 226 204;--teal:86 200 176;
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(12px,1.4vw,18px);
}
.rvl__c{
  position:relative;display:flex;flex-direction:column;min-width:0;
  padding:clamp(14px,1.4vw,18px);
  border:1px solid var(--hair);border-radius:10px;
  background:rgba(14,15,18,0.66);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);
  transition:border-color 400ms var(--ease-reveal);
}
.rvl__c.is-on{border-color:rgb(var(--teal) / 0.45)}
.rvl__top{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.rvl__k{font-size:10px;color:rgba(242,243,245,0.55)}
.rvl__src{font-size:9.5px;color:rgba(242,243,245,0.32);white-space:nowrap}
.rvl__t{margin:10px 0 0;font-size:clamp(17px,1.35vw,20px);font-weight:400;letter-spacing:-0.01em;color:var(--vapor)}
.rvl__b{margin:6px 0 0;font-size:13.5px;line-height:1.55;color:rgba(242,243,245,0.66);min-height:4.65em}

/* the stage: where her light is drawn */
.rvl__stage{
  position:relative;margin-top:14px;aspect-ratio:1/0.82;border-radius:8px;overflow:hidden;
  background:radial-gradient(90% 80% at 50% 45%,rgb(var(--teal) / 0.07),transparent 70%),#07090A;
  border:1px solid rgba(242,243,245,0.06);
}
.rvl__stage canvas,.rvl__stage svg{position:absolute;inset:0;width:100%;height:100%;display:block}
/* the plate is round: a square canvas at the stage's height, centred, never stretched */
.rvl__stage canvas{left:50%;right:auto;width:auto;aspect-ratio:1;transform:translateX(-50%)}
.rvl__read{
  position:absolute;left:10px;right:10px;bottom:8px;display:flex;justify-content:space-between;gap:8px;
  font-size:10px;color:rgb(var(--sand) / 0.7);pointer-events:none;
}
.rvl__read b{font-weight:500;color:rgb(var(--sand))}
.rvl__read > *{white-space:nowrap}

/* controls */
.rvl__ctl{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.rvl__btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:34px;padding:0 12px;
  border-radius:999px;cursor:pointer;
  font:400 10.5px var(--font-mono);letter-spacing:0.14em;text-transform:uppercase;
  border:1px solid rgba(242,243,245,0.2);background:rgba(242,243,245,0.03);color:rgba(242,243,245,0.82);
  transition:background 280ms,border-color 280ms,color 280ms,box-shadow 280ms,transform 140ms;
}
.rvl__btn:hover{border-color:rgba(242,243,245,0.5);color:#fff}
.rvl__btn:active{transform:scale(0.96)}
.rvl__btn[aria-pressed="true"]{border-color:rgb(var(--teal));background:rgb(var(--teal) / 0.14);color:#fff;box-shadow:0 0 18px -6px rgb(var(--teal))}
.rvl__btn--wide{flex:1 1 auto}
.rvl__dot{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:0.7}
.rvl__btn[aria-pressed="true"] .rvl__dot{background:rgb(var(--teal));opacity:1;box-shadow:0 0 8px rgb(var(--teal));animation:rvl-pulse 1.4s ease-in-out infinite}
@keyframes rvl-pulse{50%{opacity:0.35}}

/* the plate's maqamat */
.rvl__mq{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:12px}   /* 4 + 3: the Arabic names need the width */
.rvl__mq button{
  min-height:38px;padding:2px 0;border-radius:6px;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  border:1px solid rgba(242,243,245,0.14);background:rgba(242,243,245,0.02);color:rgba(242,243,245,0.7);
  transition:border-color 260ms,background 260ms,color 260ms;
}
.rvl__mq button span{font-size:15px;line-height:1.1}
/* the Latin name lives in the readout and the label; the chip carries the Arabic only */
.rvl__mq button b{display:none}
.rvl__mq button:hover{border-color:rgba(242,243,245,0.45);color:#fff}
.rvl__mq button[aria-pressed="true"]{border-color:rgb(var(--g));background:rgb(var(--g) / 0.16);color:#fff;box-shadow:0 0 14px -5px rgb(var(--g))}

/* the breath */
.rvl__mark{
  position:absolute;left:50%;top:46%;width:46%;aspect-ratio:351/360;transform:translate(-50%,-50%);
  will-change:transform;filter:drop-shadow(0 0 14px rgb(var(--teal) / 0.45));
}
.rvl__mark img{width:100%;height:100%;display:block}
.rvl__ring{
  position:absolute;left:50%;top:46%;width:46%;aspect-ratio:1;border-radius:50%;transform:translate(-50%,-50%) scale(0.9);
  border:1px solid rgb(var(--teal) / 0.5);opacity:0;pointer-events:none;
}
.rvl__c.is-on .rvl__ring{animation:rvl-ring 2.4s cubic-bezier(.2,.7,.2,1) infinite}
.rvl__c.is-on .rvl__ring:nth-of-type(2){animation-delay:1.2s}
@keyframes rvl-ring{0%{opacity:0.7;transform:translate(-50%,-50%) scale(0.9)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.9)}}
.rvl__hold{touch-action:none;user-select:none;-webkit-user-select:none}

/* the harp */
.rvl__harp{touch-action:pan-y;cursor:crosshair}
.rvl__str{fill:none;stroke-linecap:round}
.rvl__nl{fill:rgb(239 226 204 / 0.55);font:400 8.5px var(--font-mono);letter-spacing:0.08em;text-anchor:middle}

.rvl__note{display:block;margin-top:14px;text-align:right;font-size:10px;color:rgba(242,243,245,0.36)}

@media (max-width:1180px){ .rvl{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:640px){
  .rvl{grid-template-columns:minmax(0,1fr)}
  .rvl__b{min-height:0}
}
@media (prefers-reduced-motion:reduce){
  .rvl__c.is-on .rvl__ring,.rvl__btn[aria-pressed="true"] .rvl__dot{animation:none}
}
