/* The hybrid view (hybrid.js): the playlist's tracks written as sheet music, on the Score view's
 * paper — its colors (--paper, --ink, --staff, --sel… in score.css, ivory or black lacquer at
 * night), its textures (--tooth, --mottle, --grain, set by the view from ink.js), its lamp and
 * its ink filter. */

.hy-main {
  grid-template-columns: 200px 1fr;
  grid-template-rows: 28px 26px 1fr;
}
/* The pattern to place, in the pane's toolbar: narrow, so the view's own buttons stay in sight. */
.select.hy-paint {
  max-width: 140px;
}

/* The paper under the lanes and the headers: one color with its tooth, formation and grain, in
 * tiles of different sizes (as the Score view's page). */
.hybrid .scroller,
.hybrid .tracks-head {
  background-color: var(--paper);
  background-image: var(--tooth), var(--mottle), var(--grain);
  background-size:
    256px 256px,
    600px 600px,
    180px 180px;
}
.hybrid .tracks-head {
  border-right: 1px solid rgba(120, 96, 52, 0.35);
  /* The headers' edge warmed a little, as paper tones with age. */
  box-shadow: inset -12px 0 16px -14px rgba(150, 106, 38, 0.5);
}
.hybrid.night .tracks-head {
  border-right-color: rgba(212, 175, 55, 0.2);
  box-shadow: inset -12px 0 16px -14px rgba(212, 175, 55, 0.3);
}
/* The lamp over the paper (score.css), over the lanes only; it stays put while they scroll. */
.hy-lamp {
  grid-column: 2;
  grid-row: 3;
  z-index: 6;
}

/* A track's header: its title row, then each staff's clef, key and time. */
.hy-head {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(120, 96, 52, 0.22);
  cursor: pointer;
}
.hy-head.sel {
  background: linear-gradient(90deg, var(--range), transparent 70%);
}
.hy-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 10px;
}
.hy-title .t-num {
  font: 500 9px/1 var(--mono);
  color: var(--ink-soft);
  width: 14px;
}
.hy-title .t-name {
  flex: 1;
  font: 600 13px/1 var(--serif);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hy-title .ch-mute {
  width: 9px;
  height: 9px;
}
.hy-clefs {
  position: absolute;
  left: 0;
  overflow: visible;
  pointer-events: none;
}
/* A staff's name: italic, in its channel's color as ink (deepened on paper, lightened at night). */
.hy-sname {
  font: italic 600 11px var(--serif);
  letter-spacing: 0.02em;
  fill: color-mix(in srgb, var(--ch) 55%, var(--ink));
}
/* A staff in the header: a click picks its channel. */
.hy-pick {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 0 6px 6px 0;
}
.hy-pick:hover {
  background: var(--range);
}
.hy-pick.on {
  box-shadow: inset 3px 0 0 var(--sel);
}

/* What a press would act on, as the pointer's shape. */
.hy-content.k-tab,
.hy-content.k-clip {
  cursor: move;
}
.hy-content.k-edge {
  cursor: ew-resize;
}
.hy-content.k-note {
  cursor: grab;
}
.hy-content.k-write {
  cursor: crosshair;
}
.hy-content.k-strip {
  cursor: copy;
}
.hybrid .track-lane {
  border-bottom-color: rgba(120, 96, 52, 0.22);
}
.hybrid .track-lane:nth-child(odd) {
  background: rgba(120, 96, 52, 0.025);
}
.hybrid.night .track-lane {
  border-bottom-color: rgba(212, 175, 55, 0.1);
}
.hybrid.night .track-lane:nth-child(odd) {
  background: rgba(212, 175, 55, 0.015);
}
/* The beats, faintly, in the paper's own brown (gold at night). */
.hy-grid {
  background-image:
    linear-gradient(90deg, rgba(120, 96, 52, 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 96, 52, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 96, 52, 0.035) 1px, transparent 1px);
}
.hybrid.night .hy-grid {
  background-image:
    linear-gradient(90deg, rgba(212, 175, 55, 0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(212, 175, 55, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.025) 1px, transparent 1px);
}

/* A clip: a wash of its pattern's color behind its music, its tab along the top. */
.hy-clip {
  position: absolute;
  box-sizing: border-box;
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, transparent), color-mix(in srgb, var(--c) 5%, transparent));
  border: 1px solid color-mix(in srgb, var(--c) 55%, #7a6040);
  box-shadow: 0 1px 3px rgba(80, 60, 30, 0.12);
}
.hybrid.night .hy-clip {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, transparent), color-mix(in srgb, var(--c) 6%, transparent));
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: none;
}
.hy-clip.sel {
  border-color: var(--sel);
  box-shadow:
    0 0 12px var(--hot-glow),
    inset 0 0 0 1px var(--range-line);
}
.hy-clip.muted {
  filter: grayscale(0.9) opacity(0.55);
}
.hy-tab {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 16px;
  padding: 2px 7px;
  border-radius: 5px 5px 0 0;
  font: 700 10px/12px var(--sans);
  color: #fffaf0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #5a4630), color-mix(in srgb, var(--c) 60%, #2a2016));
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hybrid.night .hy-tab {
  color: #1d1406;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, white 15%), color-mix(in srgb, var(--c) 70%, black 30%));
  text-shadow: none;
}
.hy-clip.audio .hy-tab {
  font-style: italic;
}
.hy-edge {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
}
.hy-clip.sel .hy-edge {
  background: linear-gradient(90deg, transparent, var(--range));
}

/* The music, in the Score view's ink, through its filter (wet or dry: ink.js). */
.hy-staves {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.hy-staves,
.hy-clefs {
  text-rendering: geometricPrecision;
  shape-rendering: geometricPrecision;
}
.hy-staves .glyphs,
.hy-clefs .glyphs {
  font-family: "Bravura";
}
.hy-lines {
  fill: var(--staff);
}
.hy-ink {
  fill: var(--ink);
}
/* Night paper: the music gives the light, as in the Score view (score.css). */
.hybrid.night:not(.no-glow) .hy-glow {
  --ink: #fff4d8;
  filter: drop-shadow(0 0 0.1px rgba(255, 242, 205, 0.9)) drop-shadow(0 0 0.3px rgba(255, 214, 140, 0.55)) drop-shadow(0 0 0.7px rgba(255, 190, 100, 0.22));
}
/* How long each note sounds: a thin bar of its channel's color behind it. */
.hy-dur {
  fill: color-mix(in srgb, var(--ch) 70%, var(--ink));
  opacity: 0.3;
}
.hy-band {
  stroke-width: 0.6;
}
.hy-tag {
  font: italic 700 11px var(--serif);
  letter-spacing: 0.02em;
}
.hy-sel {
  fill: var(--sel);
  filter: drop-shadow(0 0 calc(var(--sp) * 0.35) var(--sel));
}
.hy-hot {
  fill: var(--sel);
  opacity: 0.8;
  filter: drop-shadow(0 0 calc(var(--sp) * 0.3) var(--sel)) drop-shadow(0 0 calc(var(--sp) * 0.7) var(--hot-glow));
}
/* The light over a still-wet drop of ink: broad and faint, with a small soft highlight at its heart. */
.hy-sheen {
  fill: var(--gloss);
  filter: blur(calc(var(--sp) * 0.09));
}
.hy-gloss {
  fill: var(--gloss);
  filter: blur(calc(var(--sp) * 0.025));
}
.hy-ghost {
  fill: var(--sel);
  opacity: 0.4;
}
.hy-ghost.on-scale {
  fill: var(--on-scale);
  opacity: 0.75;
}
.hy-ghost.off-scale {
  fill: var(--off-scale);
  opacity: 0.8;
}
.hy-empty {
  position: absolute;
  left: 24px;
  top: 24px;
  color: var(--ink-soft);
  font: italic 15px var(--serif);
}
.hybrid .playhead {
  background: var(--sel);
  box-shadow: 0 0 6px var(--hot-glow);
}

/* ---------------------------------------------------------------- chords and scales */

/* The strip of chord and scale markers under the ruler (the same paper, a little deeper). */
.hy-chords-corner {
  letter-spacing: 0.16em;
}
.hy-chords {
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  background-image: var(--tooth), var(--mottle), var(--grain);
  background-size:
    256px 256px,
    600px 600px,
    180px 180px;
  box-shadow:
    inset 0 -1px 0 rgba(120, 96, 52, 0.3),
    inset 0 6px 8px -6px rgba(80, 60, 30, 0.25);
  cursor: copy;
}
.hy-chords-in {
  position: absolute;
  inset: 0;
}
/* A marker: its name where it starts, its band to the next marker. */
.hy-chord {
  position: absolute;
  top: 3px;
  bottom: 3px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 6px;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  border-left: 2px solid color-mix(in srgb, var(--sel) 70%, var(--ink));
  border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, var(--range), transparent 85%);
  cursor: grab;
}
.hy-chord.on {
  background: linear-gradient(90deg, color-mix(in srgb, var(--sel) 22%, transparent), transparent 90%);
  box-shadow: inset 0 0 0 1px var(--range-line);
}
.hy-chord-name {
  font: 700 15px/19px var(--serif);
  color: var(--ink);
}
.hy-chord-name.scale {
  font: italic 600 13px/19px var(--serif);
  color: var(--ink-soft);
}
.hy-chord-scale {
  font: italic 500 11px/19px var(--serif);
  color: var(--ink-soft);
}
.hy-chord-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed color-mix(in srgb, var(--sel) 30%, transparent);
  pointer-events: none;
}
.hy-chord-line.hot {
  border-left: 1px solid var(--range-line);
}

/* A marker's scale, while the pointer is on it: its notes as ghost notes, the chord's own darker. */
.hy-scale-note {
  fill: var(--ink);
  opacity: 0.22;
}
.hy-scale-tone {
  fill: var(--sel);
  opacity: 0.42;
}
