/* Conduct the Orchestra — the frame is the product.
 *
 * §8 asks for an interface that is almost not there, because this is going to be recorded and
 * stacked under a reference video. Everything here is either the picture, or type that knows
 * to get out of the way. */

/* An element with the `hidden` attribute must be hidden, full stop. Any rule below that sets
 * `display` on the same element would otherwise quietly win on specificity — which has cost
 * me a stray badge burnt into a recording before. */
[hidden] { display: none !important; }

:root {
  /* Pen and wash on paper. Every value here was light-on-dark until the orchestra became a
   * drawing: black ink over a white room cannot share a page with white type over a dark one,
   * and the type is the half that has to move. `--ink` is now literally ink. */
  --ink: rgba(26, 23, 23, 0.94);
  --ink-dim: rgba(26, 23, 23, 0.58);
  --ink-faint: rgba(26, 23, 23, 0.34);
  --backdrop: #fcfbf8;
  --paper: #fcfbf8;
  /* Panels are paper too, just more opaque — nothing in this app is a dark card any more. */
  --panel: rgba(252, 251, 248, 0.94);
  --hairline: rgba(26, 23, 23, 0.16);
  --accent: #c8542f;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pad: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--backdrop);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--backdrop);
}

/* The camera. Mirrored, because a conductor watching an unmirrored image of themselves is
 * conducting somebody else. Every landmark downstream is in this same mirrored space. */
.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  /* THE ROOM, as it is. No grade at all.
   *
   * This line has been wrong twice in opposite directions. It began as brightness(0.52) for a
   * dark stage; the paper rewrite turned it into grayscale(1) contrast(0.42) brightness(1.5),
   * which bleached the room into a page and the person into a suggestion of one. Then a nudge —
   * still half-desaturated, still lifted. Asked for plainly: "make the background fully visible
   * and not white at all".
   *
   * It can be nothing now, because the paper went where the paper was needed. Each group of
   * musicians paints its own, so the ink no longer depends on the whole frame being pale, and
   * everywhere the drawing is not, the camera is simply the camera.
   *
   * The third of a pixel of blur is not softness — it is the only thing forcing the video onto
   * its own compositing layer. Without a filter of some kind WebKit renders a canvas-backed
   * stream as a one-pixel sliver in a snapshot, which made every test render look as though the
   * camera had failed. It is well under one device pixel and changes nothing you can see. */
  filter: blur(0.3px);
}

.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Above the vignette, deliberately. The vignette's job is to fade the CAMERA into the page;
   * left on top it would also fade the front row of the orchestra, and the front row running
   * off the bottom edge is the thing that puts the viewer inside the curve. */
  z-index: 1;
}

/* A vignette, so type near the edges stays legible over whatever the room is doing. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Gone. This was paper closing in around the whole frame, and it is the single biggest reason
   * the room looked washed out — a full-screen wash cannot be "a bit of whiteness where the
   * drawings are". What legibility it was buying is now bought locally: the musicians paint
   * paper under themselves, and the few pieces of type that float free of a panel carry their
   * own. Left as a rule with nothing in it so the next person can see it was deliberate. */
  background: none;
}

/* ─────────────────────────────────────────────────────────────────── screens */

.screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: var(--pad);
  text-align: center;
  background: rgba(252, 251, 248, 0.88);
  backdrop-filter: blur(18px) saturate(0.7);
  -webkit-backdrop-filter: blur(18px) saturate(0.7);
}

.stage[data-state="idle"] .screen--intro,
.stage[data-state="starting"] .screen--busy,
.stage[data-state="calibrating"] .screen--calibrate,
.stage[data-state="error"] .screen--error { display: flex; }

/* Once the experience is running there is no chrome at all. */
.stage[data-state="waiting"] .screen,
.stage[data-state="conducting"] .screen { display: none; }

.title {
  margin: 0;
  font-size: clamp(30px, 6.2vw, 74px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.title__thin { opacity: 0.42; font-weight: 200; }

.lede {
  margin: 0;
  max-width: 30ch;
  color: var(--ink-dim);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.5;
}

.fineprint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}
/* Shown only when the app's own code never ran, so the dead button has an explanation
   attached to it rather than looking like a page that simply ignores you. */
.fineprint--bad {
  max-width: 46ch;
  color: hsl(8, 72%, 40%);
  line-height: 1.55;
  font-size: 12.5px;
}
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.button {
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  /* Never a `background` transition on something that also gets shown and hidden: the
   * transition starts from the UA button colour and flashes grey. */
  background: rgba(26, 23, 23, 0.045);
  color: var(--ink);
  padding: 14px 30px;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease), opacity 180ms var(--ease);
}
.button:hover { border-color: rgba(26, 23, 23, 0.45); }
.button:active { transform: scale(0.98); }
.button:focus-visible { outline: 2px solid rgba(26, 23, 23, 0.7); outline-offset: 3px; }

.button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  padding: 8px 14px;
}
.button--quiet:hover { color: var(--ink-dim); border-color: var(--hairline); }

.status { margin: 0; color: var(--ink-dim); font-size: 16px; }
.status--bad { color: hsl(8, 72%, 42%); max-width: 40ch; line-height: 1.5; }

/* ──────────────────────────────────────────────────────────── calibration */

.calibrate__step {
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.calibrate__prompt {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(21px, 3.4vw, 34px);
  font-weight: 300;
  line-height: 1.24;
}
.calibrate__hint { margin: 0; color: var(--ink-dim); font-size: 14px; max-width: 30ch; }
.calibrate__warn { margin: 0; color: hsl(8, 72%, 42%); font-size: 13px; }

.calibrate__bar {
  width: min(280px, 62vw);
  height: 2px;
  background: rgba(26, 23, 23, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.calibrate__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: 2px;
}

/* ──────────────────────────────────────────────────────────────── in-frame */

.hud {
  position: absolute;
  left: 50%;
  bottom: clamp(64px, 13vh, 132px);
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-size: clamp(15px, 2.1vw, 22px);
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: none;
  opacity: 0;
  transition: opacity 420ms var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.hud.is-visible { opacity: 1; }

.badge {
  position: absolute;
  /* Below the tempo meter, which now hangs in the middle of the top edge. Both were centred at
     the very top and a screenshot caught them printed over each other — and this one is the
     message that says the orchestra failed to start, so it is the last thing that should be
     hard to read. */
  top: calc(var(--pad) + 216px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  color: var(--ink-dim);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────── debug */

.debug {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  z-index: 5;
  margin: 0;
  padding: 14px 18px;
  max-height: calc(100vh - 2 * var(--pad));
  overflow: auto;
  border-radius: 10px;
  background: rgba(252, 251, 248, 0.93);
  border: 1px solid var(--hairline);
  color: rgba(26, 23, 23, 0.95);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.44;
  white-space: pre;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.debughint {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 5;
  margin: 0;
  color: rgba(26, 23, 23, 0.5);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* The key controls. Always visible — unlike the debug keys these are part of the instrument,
   and a control nobody knows about is a control that does not exist. Kept quiet enough to stay
   out of a video frame. */
.keyhint {
  position: fixed;
  right: 18px;
  bottom: 14px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(26, 23, 23, 0.52);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 6;
}
.keyhint b { font-weight: 620; color: rgba(26, 23, 23, 0.66); }
.stage[data-state="ended"] .keyhint, .stage[data-state="idle"] .keyhint { opacity: 0; }


@media (prefers-reduced-motion: reduce) {
  .button, .hud { transition-duration: 1ms; }
}

/* ───────────────────────────────────────────────────── the orchestra, seated
 *
 * §"CORE INTERACTION" wants musicians on a stage, not a row of buttons. These ARE buttons —
 * focusable, labelled, keyboard-reachable — but there is nothing left of a button in them.
 * Each is an empty box laid exactly over the players inkOrchestra draws for that section, from
 * the same `sectionBounds`. You click the drawing, and the drawing is what responds: the ink
 * darkens as the conductor brings a section in.
 *
 * The pool of light this used to be has gone with the dark stage. What replaces it, and the
 * only thing drawn here at all, is a soft disc of PAPER behind each name — because a name
 * printed over a picture needs a halo to stay legible, and on paper a halo is white, not black.
 *
 * --lit    how far the conductor has brought this section in
 * --listen how hard the singer is singing at it right now
 */

.seating {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.stage[data-state="conducting"] .seating,
.stage[data-state="waiting"] .seating { pointer-events: auto; }

.seat {
  --lit: 0;
  --listen: 0;
  --seat-size: 1;
  /* left/top/width/height come from sectionBounds, inline: the hit area IS the drawn group. */
  position: absolute;
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

/* The section being SUNG at. Nothing but that — the paper that used to be poured here is now on
 * the label itself, where it can be relied on, and `--lit` is carried by the ink of the players.
 * A halo that did three jobs was doing none of them clearly. */
.seat__glow {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%) scale(calc(1 + 0.12 * var(--listen)));
  width: 96%;
  height: 44%;
  border-radius: 50%;
  pointer-events: none;
  opacity: var(--listen);
  background:
    radial-gradient(ellipse at 50% 60%,
      rgba(200, 84, 47, 0.30) 0%,
      rgba(200, 84, 47, 0.12) 48%,
      rgba(200, 84, 47, 0) 78%);
  transition: transform 120ms var(--ease);
}

/**
 * The section's name.
 *
 * Hangs below the box rather than inside it: the box is the players and nothing else, and the
 * tiers are stacked barely a head apart, so padding one out to fit a word underneath pushed its
 * click target up into the row behind.
 *
 * It sits on its OWN paper rather than borrowing the pool under the row. Measured on a slice
 * straight down through the violas: the pool holds 238–244 down to y=0.63 and the label ran from
 * 0.627 to 0.642 — its top edge caught the last of the paper and its bottom half hung off into
 * the room. Reported as "it hangs on the edge and it's very difficult to see", which is exactly
 * what that is. Given a pill of its own it does not matter where the pool ends, and the name can
 * tuck up against the rail instead of hiding under it.
 */
.seat__label {
  position: absolute;
  top: 100%;
  /* Tucked up against the rail rather than floating below it. The name belongs to the row it
   * labels, and a word sitting in clear space under the drawing reads as a caption for the room. */
  margin-top: -16px;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: clamp(9px, 0.86vw, 12px);
  font-weight: 700;
  letter-spacing: 0.13em;
  white-space: nowrap;
  color: rgba(26, 23, 23, calc(0.74 + 0.26 * var(--lit)));
  transition: color 200ms var(--ease);
}

.seat__badge {
  position: absolute;
  top: 2%;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.seat:hover .seat__label { color: rgba(26, 23, 23, 1); background: rgba(252, 251, 248, 0.97); }
.seat:focus-visible {
  outline: 2px solid rgba(26, 23, 23, 0.7);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Selected: the name in vermillion, matching the bracket inkOrchestra draws under the row.
 * The drawing says which section you are talking to; this only has to agree with it. */
.seat.is-selected .seat__label {
  color: var(--accent);
  letter-spacing: 0.24em;
}
.seat.is-selected .seat__label { animation: seatpulse 2.2s ease-in-out infinite; }
.seat.is-taught .seat__label { color: rgba(26, 23, 23, calc(0.6 + 0.4 * var(--lit))); }

@keyframes seatpulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────── microphone */

.mic {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mic__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(150, 55%, 38%);
}
.mic.is-listening .mic__dot { background: var(--accent); }
.mic__level {
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: rgba(26, 23, 23, 0.14);
  overflow: hidden;
}
.mic__level b {
  display: block;
  width: 0%;
  height: 100%;
  background: currentColor;
  border-radius: 2px;
}

.endbtn {
  position: absolute;
  bottom: var(--pad);
  left: var(--pad);
  z-index: 4;
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-faint);
  padding: 7px 16px;
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.endbtn:hover { color: var(--ink); border-color: rgba(26, 23, 23, 0.4); }

/* ── matching a clip ─────────────────────────────────────────────────────────────────────────
   Quiet, in the corner, next to the only other button that lives over the picture. The readout
   is the important half: it says what the app THINKS it heard, so a wrong reading is visible
   rather than just audible. */
.endbtn--clip { left: calc(var(--pad) + 132px); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.clip {
  position: absolute;
  bottom: calc(var(--pad) + 34px);
  left: var(--pad);
  z-index: 4;
  max-width: 44ch;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  color: var(--ink-dim);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.45;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.clip[data-tone="bad"] { color: hsl(8, 72%, 42%); border-color: rgba(200, 84, 47, 0.4); }

.clip__clear {
  position: absolute;
  bottom: calc(var(--pad) + 78px);
  left: var(--pad);
  z-index: 4;
  appearance: none;
  border: 0;
  background: none;
  padding: 2px 0;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Drop a file anywhere on the picture. The whole stage is the target, so the cue is the whole
   stage — a dashed rectangle would be a second, competing interface. */
.stage.is-dropping::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 8;
  border: 2px dashed rgba(200, 84, 47, 0.55);
  border-radius: 18px;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────── the end of a session */

.stage[data-state="ended"] .screen--ended { display: flex; }

.ended__summary {
  margin: 0;
  max-width: 42ch;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}
.ended__timeline {
  margin: 0;
  max-height: 34vh;
  overflow: auto;
  padding: 14px 20px;
  border-radius: 10px;
  background: rgba(26, 23, 23, 0.04);
  color: var(--ink-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  text-align: left;
  white-space: pre;
}
.ended__actions { display: flex; gap: 12px; align-items: center; }

/* ── how to conduct ─────────────────────────────────────────────────────────────────────────
   The gestures are a standard language, but a language nobody has been taught is just a set of
   things that do not work. This is the only opaque panel in the app: everything else is drawn
   over the camera and has to survive a white wall, but instructions you read need to sit still
   and be legible, so they get a solid card rather than glowing ink. */
.guide {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(252, 251, 248, 0.86);
  backdrop-filter: blur(8px);
}
.guide[hidden] { display: none; }
.guide__card {
  max-width: 720px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 28px 30px 24px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f6f4ef);
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 70px rgba(26, 23, 23, 0.18);
  color: #1a1717;
}
.guide__title { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.guide__lede { margin: 0 0 20px; color: rgba(26, 23, 23, 0.62); font-size: 14px; }
.guide__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 620px) { .guide__cols { grid-template-columns: 1fr; } }
.guide__col h3 { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: rgba(26, 23, 23, 0.9); }
.guide__col p { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: rgba(26, 23, 23, 0.72); }
.guide__tag {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 620;
}
/* Two different colours because the two hands are two different instruments. The same hue for
   both would undo the one idea this panel exists to teach. */
.guide__tag--time { background: rgba(40, 96, 168, 0.12); color: #2a5f9e; }
.guide__tag--feel { background: rgba(200, 84, 47, 0.13); color: var(--accent); }

.guide__pattern { width: 100%; max-width: 190px; display: block; margin: 4px auto 2px; }
.guide__pattern .p-line {
  fill: none;
  stroke: #2a5f9e;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.guide__pattern .p-dot { fill: #2a5f9e; }
.guide__pattern .p-num {
  fill: rgba(26, 23, 23, 0.55);
  font-size: 11px;
  font-family: inherit;
  text-anchor: middle;
}
.guide__list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: rgba(26, 23, 23, 0.78); }
.guide__note { font-size: 12px !important; color: rgba(26, 23, 23, 0.5) !important; }
.guide__both {
  margin: 22px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(26, 23, 23, 0.045);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(26, 23, 23, 0.78);
}
.guide__both b { display: block; color: #1a1717; font-weight: 600; }
.guide__first {
  margin: 16px 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: hsl(150, 45%, 30%);
}
.guide__go { width: 100%; }
.guide__hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(26, 23, 23, 0.4);
}

/* ── the tempo meter ─────────────────────────────────────────────────────────────────────────
   One number, read at a glance, with both hands busy. Solid rather than glowing: every other
   overlay in this app is additive light that has to survive a white wall, but a figure you are
   trying to READ should sit on something opaque and stop moving. */
.tempo {
  position: fixed;
  /* Hung centrally at the top, so it sits directly above the person conducting rather than off
     in a corner — you are looking straight ahead at the camera, and a number in the corner is a
     number you have to go and find. It cleared the mic badge by living below it when it was
     right-aligned; centred, it clears it by being nowhere near it. */
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 232px;
  padding: 14px 16px 12px;
  border-radius: 14px;
  background: rgba(252, 251, 248, 0.94);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 40px rgba(26, 23, 23, 0.14);
  backdrop-filter: blur(10px);
  color: #1a1717;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tempo[hidden] { display: none; }
.tempo__head { display: flex; align-items: center; gap: 8px; }
.tempo__label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(26, 23, 23, 0.5);
}
/* Beats at the orchestra's tempo. Seeing the rate is worth more than reading it. */
.tempo__pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(200, 84, 47, calc(0.20 + 0.80 * var(--flash, 0)));
  box-shadow: 0 0 calc(2px + 10px * var(--flash, 0)) rgba(200, 84, 47, calc(0.5 * var(--flash, 0)));
  flex: none;
}
.tempo__big { display: flex; align-items: baseline; gap: 7px; margin: 2px 0 10px; }
.tempo__big b { font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.tempo__big span { font-size: 11px; letter-spacing: 0.1em; color: rgba(26, 23, 23, 0.45); }

.tempo__track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(26, 23, 23, 0.10);
  margin-bottom: 18px;
}
.tempo__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #4a4442, #1d1a1a);
  transition: width 90ms linear;
}
/* Where YOUR beat sits, so you can watch the orchestra chase it. */
.tempo__you {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: var(--accent);
  transform: translateX(-1px);
}
.tempo__min, .tempo__max {
  position: absolute;
  top: 10px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(26, 23, 23, 0.38);
}
.tempo__min { left: 0; }
.tempo__max { right: 0; }

.tempo__rows { margin: 0; font-size: 11px; }
.tempo__rows > div { display: flex; justify-content: space-between; padding: 2px 0; }
.tempo__rows dt { color: rgba(26, 23, 23, 0.48); letter-spacing: 0.03em; }
.tempo__rows dd { margin: 0; color: rgba(26, 23, 23, 0.8); }
.tempo__rows dd b { font-weight: 600; color: #1a1717; }
.tempo__note {
  margin: 9px 0 0;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26, 23, 23, 0.42);
}
.tempo.is-pinned { border-color: rgba(200, 84, 47, 0.45); }
.tempo.is-pinned .tempo__note { color: var(--accent); }
.tempo.is-pinned .tempo__fill { background: linear-gradient(90deg, #e0906d, var(--accent)); }
