/* Figma geometry; button labels use the requested Inter Medium. */
.keyboard {
  --key-face-inset: max(10px, 1cqw);
  --key-flat-inset: max(12px, 1.20482cqw);
}

.keyboard .keyboard-key,
.mobile-keyboard .keyboard-key,
.mobile-keyboard-actions .keyboard-key {
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-variation-settings: normal;
  letter-spacing: -.008em;
}

.keyboard .keyboard-key-label {
  font-size: clamp(.75rem, 1.25cqw, .875rem);
  line-height: 2;
  letter-spacing: -.008em;
}

.keyboard .keyboard-key-face {
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--key-face-inset);
}

.keyboard .keyboard-key-face .keyboard-key-label {
  position: absolute;
  left: var(--key-face-inset);
  bottom: var(--key-face-inset);
  align-self: flex-end;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}

.keyboard-key-icon {
  position: absolute;
  top: var(--key-face-inset);
  right: var(--key-face-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22.49px;
  height: 22.49px;
}

.keyboard-key-icon .figma-icon { width: auto; height: auto; }
.keyboard .keyboard-settings { padding: var(--key-flat-inset); }
.keyboard .keyboard-settings .keyboard-key-label { line-height: 1.6064286cqw; }
.keyboard .keyboard-settings > .figma-icon {
  top: var(--key-flat-inset);
  right: var(--key-flat-inset);
}

/* The original Boosty mark is used as a single-color icon on the orange key. */
.keyboard-boosty-icon {
  position: absolute;
  top: var(--key-face-inset);
  right: var(--key-face-inset);
  width: 18.3058px;
  height: 22.49px;
  background: currentColor;
  -webkit-mask: url('./assets/boosty-mark.svg') center / contain no-repeat;
  mask: url('./assets/boosty-mark.svg') center / contain no-repeat;
}

@supports not (text-box-trim: trim-both) {
  .keyboard .keyboard-key-face .keyboard-key-label { line-height: 1; }
}

@media (max-width: 760px) and (min-width: 561px) {
  .keyboard-row { min-height: 56px; }
}

.mobile-keyboard-actions { display: none; }

@media (max-width: 560px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--header-height) - env(safe-area-inset-top, 0px));
    padding: 48px 0 max(24px, env(safe-area-inset-bottom, 0px));
  }
  .hero .hero-copy {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 160px;
  }
  .hero .keyboard-stage { flex: none; margin-top: 0; padding-top: 32px; }
  .mobile-keyboard { --key-face-inset: 12px; width: 100%; }
  .mobile-spacebar .keyboard-key-face { align-items: flex-start; justify-content: space-between; }
  .mobile-spacebar .keyboard-key-label,
  .mobile-keyboard-actions .keyboard-key-label {
    position: absolute;
    left: var(--key-face-inset);
    bottom: var(--key-face-inset);
    align-self: flex-end;
    font-size: .875rem;
    line-height: 1;
    letter-spacing: -.008em;
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
  }
  .mobile-keyboard-actions {
    --key-face-inset: 12px;
    display: block;
    flex: none;
    padding-top: 24px;
    container-type: inline-size;
  }
  .mobile-keyboard-actions .mobile-keyboard-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 0;
  }
  .mobile-keyboard-actions .keyboard-key {
    grid-column: auto;
    height: 72px;
    min-height: 72px;
    padding: 1px 1px 3px;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
  }
  .mobile-keyboard-actions .mobile-author,
  .mobile-keyboard-actions .mobile-author:hover {
    color: #fff;
    background: linear-gradient(#b094eb, #5f3f95);
  }
  .mobile-keyboard-actions .mobile-author .keyboard-key-face {
    background: linear-gradient(#69479f, #9b76df);
    border-color: transparent;
  }
  .mobile-keyboard-actions .mobile-author .keyboard-key-face:after {
    background: linear-gradient(#e1cfff80, #c5a7e455 55%, #7a56ba80);
  }
  .mobile-keyboard-actions .keyboard-boosty,
  .mobile-keyboard-actions .keyboard-boosty:hover {
    color: #211108;
    background: linear-gradient(#ffb27e, #d7461b);
  }
  .mobile-keyboard-actions .keyboard-key-face {
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px;
    border-width: 1px;
    border-radius: 7px;
  }
  .mobile-keyboard-actions .keyboard-key-face:after { inset: -1px; padding: 1px; }
  .mobile-keyboard-actions .keyboard-key:active { padding-top: 2px; padding-bottom: 2px; }
  .mobile-keyboard-actions .keyboard-key-icon .figma-icon { width: auto; height: auto; }
  .mobile-github {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    margin-top: 12px;
    padding: 6px 12px;
    border: 1px solid #ffffff0d;
    border-radius: 8px;
    background: #ffffff03;
    color: #959597;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 20px;
  }
  .mobile-github:hover { background: #ffffff08; color: #ededf1; }
  .mobile-github-icon { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
  .mobile-github-icon img { flex: none; max-width: none; transform: scale(.7114273); }
}

/* Download and Boosty are one weight above the other Inter Medium labels. */
.keyboard-key.keyboard-dictate,
.keyboard-key.keyboard-boosty { font-weight: 600; }
