:root {
  --bg: #f2f2f2;
  --tile: #ffffff;
  --ink: #141416;
  --muted: #8b8b92;
  --line: rgba(20, 20, 22, 0.07);
  --accent: #4f46e5;
  --key: min(23vw, 17vh, 132px);
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.board {
  display: grid;
  justify-items: center;
  gap: clamp(14px, 3.4vh, 28px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, var(--key));
  gap: clamp(18px, 4.2vh, 34px) clamp(14px, 4vw, 30px);
}

.cell {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.key {
  position: relative;
  width: var(--key);
  height: var(--key);
  border: 1px solid var(--line);
  border-radius: calc(var(--key) * 0.26);
  background: var(--tile);
  box-shadow: 0 1px 1px rgba(20, 20, 22, 0.04), 0 10px 24px -12px rgba(20, 20, 22, 0.22);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* the soft highlight on the top edge, a child so GSAP can move the key */
.key::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
}

.key:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

.key.is-on { background: #fbfbfe; }

.icon {
  position: relative;
  width: 44%;
  height: 44%;
  overflow: visible;
}

.icon path {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.key.is-on .icon path { stroke: var(--accent); }

.label {
  position: relative;
  height: 1.5em;
  line-height: 1.5em;
  overflow: hidden;
  font-size: clamp(11px, 1.6vh, 13px);
  font-weight: 520;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.label span { display: inline-block; }

.hint {
  font-size: clamp(11px, 1.5vh, 13px);
  color: var(--muted);
  opacity: 0.8;
}

.pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.pointer path { fill: #111; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; }
