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

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

.term {
  box-sizing: border-box;
  width: 288px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: #17141a;
  cursor: pointer;
}

.term:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.term__head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  color: rgba(255, 247, 230, 0.72);
  background: rgba(255, 247, 230, 0.08);
}

.term__name {
  font-size: 11px;
  font-weight: 700;
  color: #fff7e6;
}

.term__body {
  box-sizing: border-box;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 18px;
  color: #fff7e6;
}

.term__line {
  white-space: nowrap;
}

.term__prompt {
  color: #ff4d1f;
  font-weight: 700;
}

.term__cmd {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 24ch;
}

.term__cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 0;
  vertical-align: -2px;
  background: #fff7e6;
  animation-name: term-blink;
  animation-duration: 1s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.term__out {
  margin-top: 4px;
  opacity: 1;
  transform: translateY(0);
}

.term__out .n {
  color: #6ec8ff;
}

.term__out .c {
  color: rgba(255, 247, 230, 0.72);
}

.term.is-demo .term__cmd {
  animation-name: term-type;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.term.is-demo #term-out1 {
  animation-name: term-out1;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.term.is-demo #term-out2 {
  animation-name: term-out2;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes term-type {
  0% {
    width: 0ch;
    animation-timing-function: steps(24, end);
  }
  44% {
    width: 24ch;
    animation-timing-function: steps(1, end);
  }
  86% {
    width: 24ch;
    animation-timing-function: steps(1, end);
  }
  100% {
    width: 0ch;
  }
}
@keyframes term-out1 {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  50% {
    opacity: 0;
    transform: translateY(8px);
    animation-timing-function: ease-out;
  }
  64% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  86% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes term-out2 {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  66% {
    opacity: 0;
    transform: translateY(8px);
    animation-timing-function: ease-out;
  }
  80% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  86% {
    opacity: 1;
    transform: translateY(0);
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (max-width: 340px) {
  .term {
    width: 100%;
  }
  .term__body {
    font-size: 10px;
    line-height: 16px;
    padding: 8px;
  }
  .term__cursor {
    height: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .term.is-demo .term__cmd,
  .term.is-demo #term-out1,
  .term.is-demo #term-out2,
  .term__cursor {
    animation: none !important;
  }
  .term.is-demo .term__cmd {
    width: 24ch;
  }
  .term.is-demo #term-out1,
  .term.is-demo #term-out2 {
    opacity: 1;
    transform: translateY(0);
  }
}
