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);
}

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

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

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

.lint__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;
}

.lint__wrap {
  position: relative;
  display: grid;
  height: 156px;
}

.lint__wrap > pre, .lint__wrap > textarea {
  grid-area: 1/1;
}

.lint__ta, .lint__hl {
  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: auto;
  overscroll-behavior: contain;
}

.lint__hl {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.28);
  color: #fff7e6;
  pointer-events: none;
}

.lint__ln {
  display: block;
}

.lint__ln--com {
  color: #beb7ad;
}

.lint__err {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #c2361a;
  text-decoration-thickness: 2px;
  text-decoration-skip-ink: none;
}

.lint__ta {
  position: relative;
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: #ffd23f;
  resize: none;
  -webkit-text-fill-color: transparent;
}

.lint__ta::selection {
  background: rgba(255, 210, 63, 0.32);
}

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

.lint__probe {
  position: absolute;
  visibility: hidden;
  white-space: pre;
}

.lint__scan {
  position: absolute;
  z-index: 0;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 210, 63, 0.14);
  opacity: 0;
  pointer-events: none;
}

.lint__tip {
  position: absolute;
  z-index: 3;
  max-width: 240px;
  box-sizing: border-box;
  padding: 4px 8px;
  border: 1px solid #c2361a;
  border-radius: 12px;
  background: #ffe0d8;
  color: #17141a;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
}

.lint__tip b {
  display: block;
  font-weight: 700;
}

.lint__tip.is-open {
  opacity: 1;
}

.lint__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.lint__chip {
  position: relative;
  box-sizing: border-box;
  padding: 4px 8px;
  border-radius: 999px;
  background: #c2361a;
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.lint__chip[data-n="0"] {
  background: rgba(255, 247, 230, 0.12);
}

.lint__hint {
  flex: 1 1 auto;
  color: #beb7ad;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.lint__countd {
  position: absolute;
  inset: 0;
  display: none;
}

.lint__countd b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.lint.is-demo .lint__scan {
  animation-name: lintScanFade, lintScanMove;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), ease-out;
  animation-iteration-count: infinite, infinite;
}

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

.lint.is-demo .lint__err[data-e="0"] {
  animation-delay: 0.88s;
}

.lint.is-demo .lint__err[data-e="1"] {
  animation-delay: 1.16s;
}

.lint.is-demo .lint__count {
  visibility: hidden;
}

.lint.is-demo .lint__countd {
  display: block;
}

.lint.is-demo .lint__countd b {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.lint.is-demo .lint__countd b:nth-child(1) {
  animation-name: lintChip0;
}

.lint.is-demo .lint__countd b:nth-child(2) {
  animation-name: lintChip1;
}

.lint.is-demo .lint__countd b:nth-child(3) {
  animation-name: lintChip2;
}

.lint.is-demo .lint__tip {
  animation-name: lintTipFadeA, lintTipRise;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.lint.is-demo #tip0 {
  animation-delay: 1.12s, 1.12s;
}

.lint.is-demo #tip1 {
  animation-name: lintTipFadeB, lintTipRise;
  animation-delay: 1.5s, 1.5s;
}

@keyframes lintScanFade {
  0%, 2% {
    opacity: 0;
  }
  3%, 64% {
    opacity: 1;
  }
  65%, 100% {
    opacity: 0;
  }
}
@keyframes lintScanMove {
  0%, 3% {
    transform: translateY(0);
  }
  62%, 100% {
    transform: translateY(var(--scan-y));
  }
}
@keyframes lintErrOn {
  0% {
    text-decoration-color: transparent;
  }
  4%, 100% {
    text-decoration-color: #c2361a;
  }
}
@keyframes lintChip0 {
  0%, 47% {
    opacity: 1;
  }
  48%, 100% {
    opacity: 0;
  }
}
@keyframes lintChip1 {
  0%, 47% {
    opacity: 0;
  }
  48%, 61% {
    opacity: 1;
  }
  62%, 100% {
    opacity: 0;
  }
}
@keyframes lintChip2 {
  0%, 61% {
    opacity: 0;
  }
  62%, 100% {
    opacity: 1;
  }
}
@keyframes lintTipFadeA {
  0%, 14% {
    opacity: 0;
  }
  15%, 32% {
    opacity: 1;
  }
  33%, 100% {
    opacity: 0;
  }
}
@keyframes lintTipFadeB {
  0%, 14% {
    opacity: 0;
  }
  15%, 100% {
    opacity: 1;
  }
}
@keyframes lintTipRise {
  0%, 15% {
    transform: translateY(8px);
  }
  28%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .lint {
    --scan-y: 80px;
    gap: 4px;
    padding: 8px;
  }
  .lint__wrap {
    height: 104px;
  }
  .lint__hl, .lint__ta {
    font-size: 11px;
    line-height: 16px;
    padding: 4px;
  }
  .lint__scan {
    left: 4px;
    right: 4px;
    top: 4px;
    height: 16px;
  }
  .lint__name {
    font-size: 11px;
  }
  .lint__chip, .lint__hint {
    font-size: 10px;
  }
  .lint__tip {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lint.is-demo .lint__scan,
  .lint.is-demo .lint__err,
  .lint.is-demo .lint__tip,
  .lint.is-demo .lint__countd b {
    animation: none !important;
  }
  .lint.is-demo .lint__scan,
  .lint.is-demo .lint__tip {
    opacity: 0 !important;
  }
  .lint.is-demo .lint__err {
    text-decoration-color: #c2361a !important;
  }
  .lint.is-demo .lint__count {
    visibility: visible !important;
  }
  .lint.is-demo .lint__countd {
    display: none !important;
  }
}
