/* The cabinet: steel, powder-coated in a deep red enamel. One soft light from above: the face is
   brightest along the top and falls off steadily toward the foot. */
.dp {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 46% at 50% -6%, rgb(255 206 196 / 0.3), transparent 72%),
    linear-gradient(#8a1b27, #6d121c 34%, #540c15 68%, #41080f);
  font-family: "Barlow Condensed", sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* the powder coat: a very fine, even grain, a little lighter and darker than the enamel */
.dp::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  1.5 1.5 1.5 0 -1.75'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23p)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: 0.9;
  pointer-events: none;
}

.dp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the column heads, printed on the enamel above the window */
.dp-heads {
  position: absolute;
  inset: 12px 0 auto;
  height: 16px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(255 238 232 / 0.86);
}
.dp-heads span {
  position: absolute;
  top: 0;
}
.dp-heads .mid {
  translate: -50% 0;
  margin-left: 0.07em;
}
.dp-heads .end {
  margin-right: -0.14em;
}

/* The window: the matrix sits behind a pane of black glass, let into the cabinet face. The steel
   round it throws a shadow on the pane, and the pane's polished edge catches the light. */
.dp-window {
  position: absolute;
  left: 12px;
  top: 36px;
  width: 516px;
  height: 340px;
  border-radius: 3px;
  overflow: hidden;
  background: #050506;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.5),
    0 0 0 2px #2a0509,
    0 1.5px 0 2px rgb(255 205 195 / 0.3),
    0 -1px 0 2px rgb(0 0 0 / 0.35);
}
.dp-matrix {
  position: absolute;
  left: 0;
  top: 0;
  width: 516px;
  height: 340px;
}
.dp-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgb(0 0 0 / 0.75), transparent 9px),
    linear-gradient(104deg, rgb(255 255 255 / 0.05) 0%, rgb(255 255 255 / 0.018) 31%, transparent 31.15%);
  pointer-events: none;
}

/* ---- the page keys: a row of stainless push buttons, as wide as the window ---- */

.dp-nav {
  position: absolute;
  inset: 398px 12px auto;
}
.dp-keys {
  display: flex;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dp-slot {
  display: block;
}

/* the bezel: brushed stainless with a turned chamfer, standing a little proud of the enamel */
.dp-key {
  position: relative;
  display: block;
  width: 96px;
  height: 126px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.07) 0 1px, transparent 1px 2px, rgb(0 0 0 / 0.05) 2px 3px, transparent 3px 5px),
    linear-gradient(#f4f6f8, #cfd4da 16%, #a4aab2 46%, #c3c8ce 70%, #868c95);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgb(255 255 255 / 0.35),
    inset 0 -1.5px 0 rgb(40 44 52 / 0.55),
    0 0 0 1px rgb(30 3 6 / 0.75),
    0 2px 2px rgb(16 0 2 / 0.7),
    0 6px 7px rgb(16 0 2 / 0.5),
    0 14px 16px -3px rgb(16 0 2 / 0.55);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* the button itself: a black pane with the legend's LEDs behind it, seated in the bezel */
.dp-cap {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #050506;
  box-shadow:
    0 0 0 1px #1c1e22,
    0 1.5px 0 1px rgb(255 255 255 / 0.85),
    0 -1px 0 1px rgb(60 64 72 / 0.8),
    inset 0 3px 5px #000,
    inset 0 0 0 1px rgb(255 255 255 / 0.05);
  transition: box-shadow 0.07s ease-out;
}
.dp-legend {
  display: block;
  width: 72px;
  height: 99px;
  overflow: visible;
  transition: translate 0.07s ease-out;
}
.dp-legend circle {
  transition: fill 0.12s;
}
.dp-legend .dark circle {
  fill: #0b0b0d;
}
.dp-legend .glow {
  display: none;
}
/* a key that isn't the page shows its legend at low power */
.dp-legend .lit circle {
  fill: #33353b;
}
.dp-key:hover .lit circle {
  fill: #7a7e88;
}

/* pressed: the pane goes in under the bezel */
.dp-key:active .dp-cap {
  box-shadow:
    0 0 0 1px #1c1e22,
    0 1.5px 0 1px rgb(255 255 255 / 0.85),
    0 -1px 0 1px rgb(60 64 72 / 0.8),
    inset 0 7px 9px #000,
    inset 0 0 0 1px rgb(255 255 255 / 0.03);
}
.dp-key:active .dp-legend {
  translate: 0 1.5px;
}

/* the page on the board: its key is lit at full power */
.dp-key[data-current] .lit circle {
  fill: #fff;
}
.dp-key[data-current] .glow {
  display: block;
  fill: rgb(196 216 255);
  filter: blur(3.2px);
  opacity: 0.85;
}

/* a step at either end does nothing: its chevron goes dark */
.dp-key[data-disabled] {
  cursor: default;
}
.dp-key[data-disabled] .lit circle {
  fill: #17181b;
}
.dp-key[data-disabled]:active .dp-cap {
  box-shadow:
    0 0 0 1px #1c1e22,
    0 1.5px 0 1px rgb(255 255 255 / 0.85),
    0 -1px 0 1px rgb(60 64 72 / 0.8),
    inset 0 3px 5px #000,
    inset 0 0 0 1px rgb(255 255 255 / 0.05);
}
.dp-key[data-disabled]:active .dp-legend {
  translate: none;
}

/* focus: a white ring round the bezel, clear of it */
.dp-key:focus-visible::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid #fff;
  border-radius: 13px;
  box-shadow: 0 0 10px rgb(255 255 255 / 0.35);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .dp-cap,
  .dp-legend,
  .dp-legend circle {
    transition: none;
  }
}
