@font-face {
  font-family: "Keyboard Space Grotesk";
  src: url("fonts/SpaceGrotesk.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

/* Only the former right-hand visual is replaced. Its box never enters the flow. */
#home .hero-art.hero-keyboard {
  top: -25px;
  right: 0;
  width: 57%;
  height: auto;
  aspect-ratio: 1.68;
  z-index: 2;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  -webkit-mask-image: none;
  mask-image: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* Two local radial light images: a wide ambient wash and a brighter base glow.
   Screen blending lifts their overlap; both stay behind the opaque keyboard. */
#home .hero-art.hero-keyboard::before {
  content: "";
  position: absolute;
  inset: -2% 1% 6% 4%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 68% 60% at 52% 58%,
      rgb(180 143 242 / .28) 0%,
      rgb(152 111 217 / .15) 30%,
      rgb(123 82 183 / .045) 56%,
      rgb(123 82 183 / 0) 82%),
    radial-gradient(ellipse 52% 38% at 57% 76%,
      rgb(173 102 247 / .22) 0%,
      rgb(153 88 226 / .115) 30%,
      rgb(134 74 202 / .035) 56%,
      rgb(134 74 202 / 0) 82%);
  background-blend-mode: screen;
  filter: blur(clamp(10px, 1.5vw, 22px));
}
#home .hero-keyboard canvas,
#home .hero-keyboard .keyboard-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  filter: none;
}
.hero-keyboard canvas { pointer-events: none; }
.hero-keyboard[data-renderer="webgl"] .keyboard-poster { visibility: hidden; }
.keyboard-controls { position: absolute; inset: 0; pointer-events: none; }
.keyboard-controls button {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font: 500 10px "Keyboard Space Grotesk", sans-serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: pan-y;
  /* These accessible hit areas follow the projected 3D keycaps. */
  -webkit-tap-highlight-color: transparent;
}
.keyboard-controls button:focus-visible {
  outline: none;
}
.keyboard-focus-ring {
  position: absolute;
  overflow: visible;
  visibility: hidden;
  pointer-events: none;
  fill: none;
  stroke-linejoin: round;
}
.keyboard-controls:has(button:focus-visible) .keyboard-focus-ring { visibility: visible; }
.keyboard-focus-ring polygon { vector-effect: non-scaling-stroke; }
.keyboard-focus-ring polygon:first-child { stroke: var(--bg); stroke-width: 6px; }
.keyboard-focus-ring polygon:last-child { stroke: var(--ink); stroke-width: 2px; }
@media (forced-colors: active) {
  .keyboard-focus-ring polygon:first-child { stroke: Canvas; }
  .keyboard-focus-ring polygon:last-child { stroke: CanvasText; }
}
.hero-keyboard[data-renderer="fallback"] .keyboard-controls button:hover,
.hero-keyboard[data-renderer="fallback"] .keyboard-controls button[data-pressed] {
  background: rgb(200 150 255 / .14);
  border-radius: 12px;
}
@media (min-width: 901px) and (max-width: 1150px) {
  #home .hero-art.hero-keyboard { top: 27px; width: 50%; }
}
@media (min-width: 601px) and (max-width: 900px) {
  #home .hero-art.hero-keyboard { top: 60px; width: 43%; }
}
@media (max-width: 600px) {
  #home .hero-art.hero-keyboard { top: 61px; right: -3px; width: min(56%, 210px); }
}
