/* A deliberately lightweight keyboard: five moving light bands rather than a
   full-screen canvas or animated photo layer. */
.lightshow-keyboard {
  position: absolute;
  z-index: 2;
  left: 9vw;
  bottom: 66px;
  width: clamp(390px, 33vw, 540px);
  padding: 10px;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(72, 185, 255, .72);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(3, 15, 39, .96), rgba(6, 43, 78, .9));
  box-shadow: 0 0 10px rgba(44, 150, 255, .72), 0 0 24px rgba(24, 101, 229, .46), inset 0 1px 0 rgba(202, 241, 255, .32), inset 0 0 18px rgba(28, 127, 255, .22);
}

.keyboard-row {
  position: relative;
  display: flex;
  gap: 3px;
  height: 22px;
  margin-bottom: 3px;
  overflow: hidden;
  border-radius: 3px;
}

.keyboard-row:last-child { margin-bottom: 0; }

.keyboard-key {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(92, 192, 255, .55);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(21, 68, 121, .98), rgba(3, 18, 48, .98));
  color: rgba(223, 246, 255, .98);
  font: 700 7px/1 "DM Mono", monospace;
  letter-spacing: -.04em;
  text-shadow: 0 0 3px rgba(203, 246, 255, .98), 0 0 8px rgba(59, 175, 255, .78);
}

.keyboard-key.wide { flex-grow: 1.45; }
.keyboard-key.caps { flex-grow: 1.7; }
.keyboard-key.shift-key { flex-grow: 1.75; }
.keyboard-key.enter-key { flex-grow: 1.7; }
.keyboard-key.space-key { flex-grow: 5.7; }
.keyboard-key.control-key { flex-grow: 1.2; }
.keyboard-key.enter-key {
  border-color: rgba(188, 240, 255, .96);
  background: linear-gradient(180deg, rgba(42, 145, 255, .98), rgba(7, 52, 135, .99));
  box-shadow: 0 0 8px rgba(73, 184, 255, .82), inset 0 0 9px rgba(187, 235, 255, .38);
}

.keyboard-row::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28%;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(0, 109, 255, 0), rgba(27, 147, 255, .48) 22%, rgba(107, 213, 255, .98) 48%, rgba(227, 250, 255, 1) 52%, rgba(67, 178, 255, .5) 80%, rgba(0, 109, 255, 0));
  box-shadow: 0 0 8px rgba(74, 190, 255, .95), 0 0 18px rgba(30, 111, 255, .62);
  transform: translate3d(-140%, 0, 0);
  will-change: transform, opacity;
  animation: keyboard-light-sweep 8.8s linear infinite;
}

.row-2::after { animation-delay: .72s; }
.row-3::after { animation-delay: 1.44s; }
.row-4::after { animation-delay: 2.16s; }
.row-5::after { animation-delay: 2.88s; }

@keyframes keyboard-light-sweep {
  0%, 6% { opacity: 0; transform: translate3d(-140%, 0, 0); }
  10%, 24% { opacity: 1; }
  30%, 100% { opacity: 0; transform: translate3d(470%, 0, 0); }
}

@media (max-width: 750px) {
  /* Return the keyboard to its approved phone position: between the actions
     and the scroll cue, with the left edge aligned to the L in Initialize. */
  .lightshow-keyboard {
    left: 17.35%;
    bottom: 112px;
    width: min(49.1vw, 184px);
    padding: 4px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(44, 150, 255, .7), 0 0 17px rgba(24, 101, 229, .42), inset 0 1px 0 rgba(202, 241, 255, .27), inset 0 0 12px rgba(28, 127, 255, .18);
  }

  .keyboard-row { height: 10px; gap: 1.2px; margin-bottom: 1.2px; border-radius: 1px; }
  .keyboard-key { border-radius: 1px; font-size: 3.7px; border-color: rgba(92, 192, 255, .48); }
  .keyboard-row::after { border-radius: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .keyboard-row::after {
    animation: none;
    opacity: .35;
    transform: translate3d(125%, 0, 0);
  }
}
