html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.br {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 400px);
  padding: 12px;
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 16px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.br__bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.br__ico {
  display: grid;
  place-items: center;
  color: #2f6df6;
  font-size: 15px;
}

.br__name {
  flex: 1 1 auto;
  color: #17141a;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
}

.br__pill {
  display: grid;
  justify-items: center;
}

.br__pill > * {
  grid-area: 1/1;
}

.br__state, .br__sv {
  padding: 4px 8px;
  border-radius: 999px;
  background: #0a4fe8;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.br__sv {
  opacity: 0;
}

.br__wrap {
  position: relative;
  display: grid;
  overflow: hidden;
  box-sizing: border-box;
  height: 56px;
  background: #ffffff;
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 8px;
}

.br__wrap > * {
  grid-area: 1/1;
}

.br__ta, .br__hl {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}

.br__hl {
  overflow: hidden;
  background: transparent;
  color: #17141a;
}

.br__ln {
  display: block;
}

.br__pp {
  color: #0a4fe8;
  font-weight: 700;
}

.br__ta {
  background: transparent;
  color: transparent;
  caret-color: #17141a;
  resize: none;
  overflow: auto;
  scrollbar-width: none;
}

.br__ta::-webkit-scrollbar {
  display: none;
}

.br__ta::selection {
  background: rgba(10, 79, 232, 0.2);
}

.br__ta:focus-visible {
  outline: 2px solid #0a4fe8;
  outline-offset: -2px;
}

.br__caret, .br__pline, .br__ping {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 20px;
  pointer-events: none;
  opacity: 0;
}

.br__caret {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 2px;
  height: 20px;
  background: #17141a;
  z-index: 2;
}

.br__pline {
  position: absolute;
  bottom: 8px;
  left: calc(8px + 4ch);
  width: 2ch;
  height: 2px;
  background: #0a4fe8;
  transform-origin: left center;
  z-index: 1;
}

.br__ping {
  position: absolute;
  top: 8px;
  left: calc(8px + 4ch);
  width: 2ch;
  height: 20px;
  border: 2px solid #0a4fe8;
  border-radius: 4px;
  z-index: 1;
}

.br__keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.br__k {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  height: 26px;
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.05);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.br__kt {
  color: rgba(23, 20, 26, 0.72);
}

.br__kfill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0a4fe8;
  color: #ffffff;
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.br__k.is-on .br__kfill {
  opacity: 1;
}

.br__note {
  margin: 0;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.br.is-demo .br__txt {
  animation-name: brType;
  animation-duration: 2s;
  animation-timing-function: steps(4, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.br.is-demo .br__pp {
  animation-name: brPp;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.br.is-demo .br__caret {
  animation-name: brCaretO, brCaretX;
  animation-duration: 0.5s, 2s;
  animation-timing-function: steps(1, end), ease-out;
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.br.is-demo .br__pline {
  animation-name: brUlO, brUlX;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), ease-out;
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.br.is-demo .br__ping {
  animation-name: brPing;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.br.is-demo .br__state {
  color: transparent;
}

.br.is-demo .br__sv {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.br.is-demo .br__sv--1 {
  animation-name: brSv1;
}

.br.is-demo .br__sv--2 {
  animation-name: brSv2;
}

.br.is-demo .br__sv--3 {
  animation-name: brSv3;
}

.br.is-demo .br__kfill, .br.is-demo .br__k {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.br.is-demo .br__kfill {
  animation-timing-function: steps(1, end);
}

.br.is-demo .br__k {
  animation-timing-function: ease-out;
  transition: none;
}

.br.is-demo .br__k:nth-child(1) .br__kfill {
  animation-name: brKf1;
}

.br.is-demo .br__k:nth-child(2) .br__kfill {
  animation-name: brKf2;
}

.br.is-demo .br__k:nth-child(3) .br__kfill {
  animation-name: brKf3;
}

.br.is-demo .br__k:nth-child(4) .br__kfill {
  animation-name: brKf4;
}

.br.is-demo .br__k:nth-child(1) {
  animation-name: brKp1;
}

.br.is-demo .br__k:nth-child(2) {
  animation-name: brKp2;
}

.br.is-demo .br__k:nth-child(3) {
  animation-name: brKp3;
}

.br.is-demo .br__k:nth-child(4) {
  animation-name: brKp4;
}

@keyframes brType {
  0%, 2% {
    clip-path: inset(0 100% 0 0);
  }
  14%, 100% {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes brPp {
  0%, 9% {
    opacity: 0;
    transform: scale(1.35);
  }
  10%, 12% {
    opacity: 1;
    transform: scale(1.35);
  }
  13%, 59% {
    opacity: 1;
    transform: scale(1);
  }
  60%, 71% {
    opacity: 0;
    transform: scale(1);
  }
  72%, 74% {
    opacity: 1;
    transform: scale(1.35);
  }
  75%, 100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes brCaretO {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes brCaretX {
  0%, 9% {
    transform: translateX(4ch);
  }
  10%, 34% {
    transform: translateX(5ch);
  }
  40%, 51% {
    transform: translateX(6ch);
  }
  56%, 59% {
    transform: translateX(5ch);
  }
  60%, 71% {
    transform: translateX(4ch);
  }
  72%, 100% {
    transform: translateX(5ch);
  }
}
@keyframes brUlO {
  0%, 9% {
    opacity: 0;
  }
  10%, 59% {
    opacity: 1;
  }
  60%, 71% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
@keyframes brUlX {
  0%, 10% {
    transform: scaleX(0);
  }
  16%, 59% {
    transform: scaleX(1);
  }
  60%, 72% {
    transform: scaleX(0);
  }
  78%, 100% {
    transform: scaleX(1);
  }
}
@keyframes brPing {
  0%, 9% {
    opacity: 0;
    transform: scale(0.8);
  }
  10% {
    opacity: 0.9;
    transform: scale(0.8);
  }
  17%, 71% {
    opacity: 0;
    transform: scale(1.5);
  }
  72% {
    opacity: 0.9;
    transform: scale(0.8);
  }
  79%, 100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
@keyframes brSv1 {
  0%, 9% {
    opacity: 0;
  }
  10%, 34% {
    opacity: 1;
  }
  35%, 71% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
@keyframes brSv2 {
  0%, 34% {
    opacity: 0;
  }
  35%, 51% {
    opacity: 1;
  }
  52%, 100% {
    opacity: 0;
  }
}
@keyframes brSv3 {
  0%, 51% {
    opacity: 0;
  }
  52%, 71% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes brKf1 {
  0%, 9% {
    opacity: 0;
  }
  10%, 34% {
    opacity: 1;
  }
  35%, 100% {
    opacity: 0;
  }
}
@keyframes brKf2 {
  0%, 34% {
    opacity: 0;
  }
  35%, 51% {
    opacity: 1;
  }
  52%, 100% {
    opacity: 0;
  }
}
@keyframes brKf3 {
  0%, 51% {
    opacity: 0;
  }
  52%, 71% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes brKf4 {
  0%, 71% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
@keyframes brKp1 {
  0%, 9% {
    transform: translateY(0);
  }
  10% {
    transform: translateY(2px);
  }
  14%, 100% {
    transform: translateY(0);
  }
}
@keyframes brKp2 {
  0%, 34% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(2px);
  }
  39%, 100% {
    transform: translateY(0);
  }
}
@keyframes brKp3 {
  0%, 51% {
    transform: translateY(0);
  }
  52% {
    transform: translateY(2px);
  }
  56%, 100% {
    transform: translateY(0);
  }
}
@keyframes brKp4 {
  0%, 71% {
    transform: translateY(0);
  }
  72% {
    transform: translateY(2px);
  }
  76%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .br {
    gap: 4px;
    padding: 8px;
  }
  .br__wrap {
    height: 36px;
  }
  .br__keys {
    gap: 4px;
  }
  .br__k {
    height: 24px;
    font-size: 10px;
  }
  .br__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .br.is-demo .br__txt, .br.is-demo .br__pp, .br.is-demo .br__caret,
  .br.is-demo .br__pline, .br.is-demo .br__ping, .br.is-demo .br__sv,
  .br.is-demo .br__kfill, .br.is-demo .br__k {
    animation: none !important;
  }
  .br.is-demo .br__txt {
    clip-path: none !important;
  }
  .br.is-demo .br__pp {
    opacity: 1 !important;
    transform: none !important;
  }
  .br.is-demo .br__caret, .br.is-demo .br__pline, .br.is-demo .br__ping {
    opacity: 0 !important;
  }
  .br.is-demo .br__sv {
    opacity: 0 !important;
  }
  .br.is-demo .br__state {
    color: #ffffff !important;
  }
  .br.is-demo .br__kfill {
    opacity: 0 !important;
  }
}
