/* ---------------- keyboard ---------------- */
.slide[data-piano] > .grow {
  flex: 0 1 40px;
}
.kbd {
  position: relative;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  margin-top: 110px;
}
.key {
  position: absolute;
  top: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  transition:
    background 0.25s,
    transform 0.08s,
    box-shadow 0.25s;
}
.key.white {
  height: 100%;
  background: color-mix(in srgb, var(--octave-color) 7%, var(--surface));
  border: 1.5px solid var(--line-strong);
  border-radius: 0 0 12px 12px;
  z-index: 1;
  box-shadow: inset 0 -6px 0 rgb(42 46 53 / 0.05);
}
.key.black {
  height: 62%;
  background: color-mix(in srgb, var(--octave-color) 3%, var(--ink));
  border-radius: 0 0 9px 9px;
  z-index: 2;
  box-shadow: 0 4px 6px rgb(20 24 31 / 0.25);
}
.key .lab {
  white-space: pre;
  text-align: center;
  font: 600 20px var(--font-mono);
  color: var(--ink-soft);
  line-height: 1.15;
  order: 2;
}
.key.black .lab {
  color: #fff;
  font-size: 13px;
}
.key .tag {
  font: 650 22px var(--font-display);
  color: var(--ink);
  order: 1;
}
.key.black .tag {
  color: #fff;
  font-size: 16px;
}
.key.white.hl {
  background: var(--sunk);
}
.key.black.hl {
  background: var(--purple-strong);
}
.key.white.scale {
  background: var(--yellow);
}
.key.black.scale {
  background: var(--yellow-strong);
}
.key.white.chord {
  background: var(--blue);
}
.key.black.chord {
  background: var(--blue-strong);
}
.key.white.root {
  background: var(--coral);
}
.key.black.root {
  background: var(--coral-strong);
}
.slide[data-id='jam'] .key.white:not(.chord) {
  background: var(--surface);
}
.slide[data-id='jam'] .key.black:not(.chord) {
  background: var(--ink);
}
.key.pressed {
  transform: translateY(3px);
  box-shadow:
    0 0 0 4px var(--orange),
    0 0 24px var(--orange);
  z-index: 3;
}
.key.white.pressed {
  z-index: 1;
}
.kbd .arcs {
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 100%;
  height: 110px;
  overflow: visible;
  pointer-events: none;
}
.arclab {
  font: 650 24px var(--font-display);
  fill: var(--ink);
}
.readout {
  font-size: 30px;
  min-height: 44px;
}
.hint {
  font-size: 19px;
  color: var(--ink-faint);
}
kbd {
  font: 600 16px var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 7px;
}
.formula {
  font: 650 34px var(--font-display);
}
.counter {
  font: 650 40px var(--font-display);
  color: var(--coral-strong);
  min-height: 52px;
}

/* chord cards */
.cards {
  display: flex;
  gap: 14px;
}
.dcard,
.jcard {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition:
    opacity 0.4s,
    transform 0.4s var(--ease),
    background 0.3s,
    box-shadow 0.3s;
  border: 3px solid transparent;
}
.dcard {
  opacity: 0;
  transform: translateY(16px);
}
.dcard.shown {
  opacity: 1;
  transform: none;
}
.dcard .nm,
.jcard .nm {
  font: 650 38px var(--font-display);
}
.dcard .rn,
.jcard .rn {
  font: 600 18px var(--font-mono);
  color: var(--ink);
  opacity: 0.6;
}
.dcard.reveal.maj,
.jcard.maj {
  background: var(--coral);
}
.dcard.reveal.min,
.jcard.min {
  background: var(--blue);
}
.dcard.reveal.dim {
  background: var(--sunk);
}
.dcard.lit,
.jcard.lit {
  border-color: var(--ink);
  transform: translateY(-6px);
  box-shadow: var(--shadow-3);
}

/* ---------------- research diagrams ---------------- */
.hidden {
  opacity: 0 !important;
  pointer-events: none;
}
.drow,
.kdot,
.rpoly,
.slope-end,
.legend span {
  transition:
    opacity 0.5s var(--ease),
    transform 0.7s var(--ease);
}
.dot {
  transition: transform 0.7s var(--ease);
  cursor: default;
}
.kdot {
  cursor: default;
}
.rpoly.hidden {
  transform: scale(0.2);
}
.rpoly.faded {
  opacity: 0.3;
}
.rowlab {
  font-size: 21px;
  fill: var(--ink);
}
.rowlab.faint,
.klab.faint {
  fill: var(--ink-faint);
}
.tick {
  font-size: 17px;
  fill: var(--ink-faint);
}
.axislab {
  font-size: 19px;
  fill: var(--ink-soft);
}
.grouplab {
  font: 500 14px var(--font-mono);
  fill: var(--ink-faint);
}
.paneltitle {
  font-size: 23px;
  font-weight: 650;
  fill: var(--ink);
}
.vallab {
  font-size: 21px;
  font-weight: 650;
  fill: var(--ink);
}
.catlab {
  font-size: 21px;
  font-weight: 600;
  fill: var(--ink-soft);
}
.klab {
  font-size: 18px;
  fill: var(--ink);
  font-weight: 600;
}
.arrowlab {
  font-size: 19px;
  font-weight: 700;
}
.corner {
  font-size: 18px;
  fill: var(--ink-faint);
}
.wordlab {
  font: 650 26px var(--font-display);
  fill: var(--ink-soft);
}
.ylab {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 19px;
  color: var(--ink-soft);
  text-align: center;
}
.dlab {
  font-size: 20px;
  font-weight: 600;
  fill: var(--ink);
}
.dlab.sm {
  font-size: 16px;
  font-weight: 500;
  fill: var(--ink-soft);
}
.mathlab {
  font: italic 600 24px 'Times New Roman', serif;
  fill: var(--ink);
}
.dg {
  transition: opacity 0.5s var(--ease);
}
svg [data-s]:not(.on) {
  transform: none;
}

/* frames moving along a pipeline */
.frames rect {
  animation: slide 3.2s linear infinite;
}
@keyframes slide {
  from {
    transform: translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  to {
    transform: translateX(180px);
    opacity: 0;
  }
}
.masked {
  animation: pulse 1.6s ease-in-out infinite;
}
.glow-coral {
  animation: glowc 1.8s ease-in-out infinite;
}
.glow-blue {
  animation: glowb 1.8s ease-in-out infinite;
}
@keyframes glowc {
  50% {
    fill: var(--coral);
  }
}
@keyframes glowb {
  50% {
    fill: var(--blue);
  }
}

/* tokens on the problem slide */
.token {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 600;
  margin: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.token.lost {
  background: transparent;
  box-shadow: none;
  border: 2px dashed var(--line-strong);
  color: var(--ink-faint);
  text-decoration: line-through;
}

/* spectrograms */
.specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.spec {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 578 / 525;
  cursor: crosshair;
  box-shadow: var(--shadow-1);
}
.spec img {
  width: 100%;
  height: 100%;
  display: block;
}
.lens {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow-3);
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.lens.show {
  opacity: 1;
}
.spec-cap {
  font-size: 22px;
  font-weight: 600;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.spec-cap i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
audio {
  width: 100%;
  height: 36px;
  margin-top: 6px;
}

.slide:is([data-id='recon'], [data-id='slopes']) .seg {
  padding: 0;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
}
.slide:is([data-id='recon'], [data-id='slopes']) .seg button {
  padding: 10px 20px 8px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  box-shadow: none;
}
.slide:is([data-id='recon'], [data-id='slopes']) .seg button + button {
  border-left: 1px solid var(--line-strong);
}
.slide:is([data-id='recon'], [data-id='slopes']) .seg button:hover {
  background: var(--surface);
}
.slide:is([data-id='recon'], [data-id='slopes']) .seg button.on {
  background: color-mix(in srgb, var(--blue-strong) 7%, var(--surface));
  color: var(--blue-strong);
  border-bottom-color: var(--blue-strong);
}
.slide:is([data-id='recon'], [data-id='slopes']) .seg button:focus-visible {
  outline: 2px solid var(--blue-strong);
  outline-offset: -4px;
}

.setup-columns {
  display: grid;
  grid-template-columns: .9fr 1.3fr 1.1fr;
  gap: 24px;
  align-items: stretch;
}
.setup-columns > .col {
  min-width: 0;
}
.setup-columns > .col + .col {
  border-left: 1px solid var(--line-strong);
  padding-left: 24px;
}
.setup-augmentations {
  gap: 12px;
}
.augmentation-example + .augmentation-example {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.augmentation-example img {
  display: block;
  width: 100%;
  height: 66px;
  margin-top: 6px;
  border-radius: 4px;
}
.augmentation-example audio {
  display: block;
  height: 30px;
  margin-top: 4px;
}

/* 2x2 design grid */
.grid2 {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 10px;
  font-size: 20px;
}
.grid2 .h {
  font: 600 16px var(--font-mono);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.grid2 .c {
  border-radius: var(--radius-md);
  padding: 16px 14px;
  font-weight: 650;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  border-top: 6px solid var(--cc);
  min-height: 92px;
}
.grid2 .c small {
  display: block;
  font-weight: 450;
  color: var(--ink-soft);
  font-size: 16px;
  margin-top: 4px;
}
.big-q {
  font: 650 60px var(--font-display);
  line-height: 1.15;
  max-width: 1300px;
}
canvas {
  width: 100%;
  display: block;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.vlab {
  font: 500 16px var(--font-mono);
  color: var(--ink-faint);
}

/* Outline slide: the first box glides down, the second stomps. */
.boxc {
  padding: 40px 44px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 96px;
  text-align: center;
}
.boxc h3 {
  font-size: 44px;
  margin: 0 0 18px;
}
.boxc p {
  font-size: 30px;
  margin: 0;
  max-width: 560px;
}
.fly[data-s]:not(.on) {
  opacity: 0;
  transform: translateY(-760px);
  transition: none;
}
.fly[data-s].on {
  transition:
    transform 1.1s cubic-bezier(0.22, 0.8, 0.25, 1),
    opacity 0.4s;
}
.stomp[data-s]:not(.on) {
  opacity: 0;
  transform: translateY(-900px);
  transition: none;
}
.stomp[data-s].on {
  transform-origin: 50% 100%;
  animation: stomp 1.05s both;
}
@keyframes stomp {
  0% {
    transform: translateY(-900px);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: ease-out;
  }
  56% {
    transform: translateY(0) scale(1.05, 0.86);
  }
  70% {
    transform: translateY(-22px) scale(0.99, 1.02);
  }
  84% {
    transform: translateY(0) scale(1.02, 0.96);
  }
  100% {
    transform: none;
  }
}
.agenda.shake {
  animation: shake 0.4s 0.5s both;
}
@keyframes shake {
  20% {
    transform: translate(-6px, 5px);
  }
  40% {
    transform: translate(5px, -4px);
  }
  60% {
    transform: translate(-3px, 3px);
  }
  80% {
    transform: translate(2px, -1px);
  }
}
