/* The mechanical key button: one big cream keycap on a small space grey macropad, on a black page. The pad and the
   key are a small 3D model the script draws in SVG every frame; the legends are HTML laid on the keycap's faces. */
:root {
  --page: #000000;          /* the page: the desk the pad stands on */
  --text: #eceae4;          /* the words under the pad */
  --muted: #7d7f86;
  --case: #8d929b;          /* the aluminium of the pad */
  --chamfer: #e9edf3;       /* its polished edge */
  --acrylic: #15161a;       /* the smoked band the lights shine through */
  --well: #1c1d22;          /* inside the pad, under the key */
  --cap: #ebe7de;           /* the keycap */
  --legend: #24252a;        /* the words on the keycap */
  --busy: #ffb547;          /* a deploy running */
  --ok: #3ddc84;            /* a deploy done */
  --err: #ff5a52;           /* a deploy cancelled */
  --s: 1;                   /* set by the script: the scale of the drawing */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--text);
  font-family: 'Space Grotesk Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 56px 16px;
}

.deploy {
  display: grid;
  justify-items: center;
  gap: 18px;
}

/* ---------------------------------------------------------------- the pad */
.pad {
  position: relative;
  margin: 6px 0 4px;
  -webkit-tap-highlight-color: transparent;
}

.pad > * {
  position: absolute;
  left: 0;
  top: 0;
}

.pad__case,
.pad__cap {
  overflow: visible;
  pointer-events: none;
}

/* the desk round the pad: its shadow and the light spilled from the band */
.pad__desk {
  pointer-events: none;
}

/* the contact shadow of the keycap, on the case */
.pad__shadow {
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.62);
  transform-origin: 0 0;
  pointer-events: none;
}

.pad__focus {
  stroke: var(--text);
  stroke-width: 2;
  opacity: 0;
}

.pad.is-focus .pad__focus {
  opacity: 1;
}

/* the legends: HTML text the script lays on the keycap's faces, in the model's pixels */
.key__legend,
.key__front {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--legend);
  white-space: nowrap;
  transform-origin: 0 0;
  pointer-events: none;
}

.key__legend {
  font-size: 30px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

.key__legend svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.key__front {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}

.key__front svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the real button: a transparent area over the keycap */
.key {
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.key:focus-visible {
  outline: none;
}

/* ---------------------------------------------------------------- the status under it */
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  min-height: 24px;
  font-size: 15px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

/* the state shows in the colour of the words */
.status__text {
  transition: color 0.3s;
}

[data-tone='busy'] .status__text {
  color: var(--busy);
}

[data-tone='ok'] .status__text {
  color: var(--ok);
}

[data-tone='err'] .status__text {
  color: var(--err);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

kbd {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 7px 2px;
  border-radius: 6px;
  background: #24252b;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 12px;
}
