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

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

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

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

.ti__ico {
  display: grid;
  place-items: center;
  color: #ffd23f;
  font-size: 15px;
}

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

.ti__key {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #beb7ad;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.4;
}

.ti__wrap {
  position: relative;
  display: grid;
  height: 116px;
}

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

.ti__ta, .ti__ghost {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 20px;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow: hidden;
}

.ti__ghost {
  background: rgba(0, 0, 0, 0.28);
  color: #fff7e6;
  opacity: 0;
  pointer-events: none;
}

.ti__ln {
  display: block;
}

.ti__tx {
  display: inline-block;
}

.ti__ta {
  background: transparent;
  color: #fff7e6;
  caret-color: #ffd23f;
  resize: none;
}

.ti__ta::selection {
  background: rgba(255, 210, 63, 0.3);
}

.ti__ta:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: -2px;
}

.ti__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.ti__status {
  color: #beb7ad;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.ti__lines {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.18);
  color: #ffd23f;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.ti__note {
  margin: 0;
  color: #beb7ad;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.ti.is-demo .ti__ta {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.ti.is-demo .ti__ghost {
  opacity: 1;
}

.ti.is-demo .ti__ln--sel {
  animation-name: tiBand;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ti.is-demo .ti__ln--sel .ti__tx {
  animation-name: tiIndent;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ti__status {
  display: inline-grid;
}

.ti__stCaret, .ti__stSel {
  grid-area: 1/1;
}

.ti__stSel {
  visibility: hidden;
}

.ti.is-demo .ti__stCaret {
  visibility: hidden;
}

.ti.is-demo .ti__stSel {
  visibility: visible;
}

.ti.is-demo .ti__key--tab {
  animation-name: tiTabLit;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ti.is-demo .ti__key--sft {
  animation-name: tiSftLit;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes tiBand {
  0%, 5% {
    background-color: rgba(255, 210, 63, 0);
  }
  6%, 100% {
    background-color: rgba(255, 210, 63, 0.3);
  }
}
@keyframes tiIndent {
  0%, 20% {
    transform: translateX(0);
  }
  26%, 36% {
    transform: translateX(2ch);
  }
  42%, 56% {
    transform: translateX(4ch);
  }
  62%, 72% {
    transform: translateX(2ch);
  }
  78%, 100% {
    transform: translateX(0);
  }
}
@keyframes tiTabLit {
  0%, 17% {
    background-color: rgba(255, 210, 63, 0);
    color: #beb7ad;
    border-color: rgba(255, 255, 255, 0.24);
  }
  18%, 52% {
    background-color: #ffd23f;
    color: #17141a;
    border-color: #ffd23f;
  }
  53%, 100% {
    background-color: rgba(255, 210, 63, 0);
    color: #beb7ad;
    border-color: rgba(255, 255, 255, 0.24);
  }
}
@keyframes tiSftLit {
  0%, 55% {
    background-color: rgba(255, 210, 63, 0);
    color: #beb7ad;
    border-color: rgba(255, 255, 255, 0.24);
  }
  56%, 84% {
    background-color: #ffd23f;
    color: #17141a;
    border-color: #ffd23f;
  }
  85%, 100% {
    background-color: rgba(255, 210, 63, 0);
    color: #beb7ad;
    border-color: rgba(255, 255, 255, 0.24);
  }
}
@media (max-width: 340px) {
  .ti {
    gap: 4px;
    padding: 8px;
  }
  .ti__wrap {
    height: 88px;
  }
  .ti__ghost, .ti__ta {
    font-size: 11px;
    line-height: 16px;
    padding: 4px;
  }
  .ti__name {
    font-size: 11px;
  }
  .ti__key {
    font-size: 9px;
    padding: 0 4px;
  }
  .ti__ico {
    font-size: 13px;
  }
  .ti__status, .ti__lines, .ti__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ti.is-demo .ti__ln--sel,
  .ti.is-demo .ti__ln--sel .ti__tx,
  .ti.is-demo .ti__key--tab,
  .ti.is-demo .ti__key--sft {
    animation: none !important;
    transform: none !important;
    background-color: transparent !important;
    color: #beb7ad !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
  }
}
