.terminal-stage {
  position: relative;
  width: min(600px, 100%);
  height: 500px;
  isolation: isolate;
  margin: 5px auto 0;
}
.terminal-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 105px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #cad9e66e 0%, #dce7ef33 42%, transparent 70%);
  z-index: -2;
}
.terminal-shadow {
  position: absolute;
  width: 320px;
  height: 18px;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, #22354429, transparent 68%);
  filter: blur(3px);
  z-index: -1;
  transition: opacity 0.2s;
}
.terminal-sam {
  position: absolute;
  display: block;
  bottom: 50px;
  left: 50%;
  margin-left: -180px;
  width: 360px;
  height: 246px;
  padding: 0;
  border: 7px solid #ff601f;
  border-radius: 24px;
  background: #10202a;
  color: #fff4df;
  box-shadow:
    inset 0 0 0 1px #20313a,
    0 3px 0 #d84a19;
  cursor: pointer;
  transform-origin: 50% 100%;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.terminal-sam:focus-visible {
  outline: 3px solid #244fde;
  outline-offset: 9px;
}
.terminal-dots {
  position: absolute;
  top: 14px;
  left: 15px;
  display: flex;
  gap: 8px;
}
.terminal-dots i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff661f;
}
.terminal-dots i:last-child {
  background: #fff3dc;
}
.terminal-face {
  position: absolute;
  inset: 0;
}
.terminal-eye {
  position: absolute;
  top: 37%;
  display: block;
  background: #ff6b26;
  width: 25px;
  height: 49px;
  border-radius: 5px;
  transition:
    left 0.5s ease,
    top 0.5s ease,
    width 0.5s ease,
    height 0.5s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
  transform-origin: center;
}
.eye-left {
  left: 29%;
}
.eye-right {
  left: 64%;
}
.terminal-smile {
  position: absolute;
  left: calc(50% - 23px);
  top: 61%;
  width: 46px;
  height: 22px;
  border-bottom: 6px solid #fff3dc;
  border-radius: 0 0 50% 50%;
  transition:
    opacity 0.2s,
    transform 0.3s;
}
.terminal-copy {
  position: absolute;
  top: 68px;
  left: 27px;
  right: 20px;
  white-space: pre-wrap;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: -0.35px;
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff3df;
  pointer-events: none;
}
.terminal-cursor {
  display: inline-block;
  width: 0.58em;
  height: 1.08em;
  background: #ff6b26;
  vertical-align: -0.13em;
  margin-left: 2px;
  animation: terminal-blink 0.75s steps(1, end) infinite;
}
.terminal-sam.morph .eye-left {
  left: 27px;
  top: 71px;
  width: 10px;
  height: 20px;
  border-radius: 1px;
}
.terminal-sam.morph .eye-right {
  opacity: 0;
  transform: scaleY(0.15);
}
.terminal-sam.morph .terminal-smile {
  opacity: 0;
  transform: scale(0.6);
}
.terminal-sam.typing .terminal-face {
  opacity: 0;
}
.terminal-sam.typing .terminal-copy {
  opacity: 1;
}
.terminal-sam.blink .terminal-eye {
  transform: scaleY(0.13);
}
.sam-replay-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.sam-replay-row .play-hint {
  margin: 0;
  animation: none;
  font-size: 12px;
}
.sam-replay-row button {
  border: 0;
  padding: 6px 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.hero-description {
  margin-top: 20px;
}
@keyframes terminal-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
@media (max-width: 480px) {
  .terminal-stage {
    height: 420px;
  }
  .terminal-sam {
    width: 300px;
    height: 212px;
    margin-left: -150px;
    bottom: 40px;
    border-width: 6px;
    border-radius: 21px;
  }
  .terminal-shadow {
    width: 280px;
    bottom: 27px;
  }
  .terminal-eye {
    width: 21px;
    height: 42px;
  }
  .terminal-copy {
    font-size: 14px;
    top: 60px;
    left: 23px;
    right: 14px;
  }
  .terminal-sam.morph .eye-left {
    left: 23px;
    top: 63px;
    width: 8px;
    height: 17px;
  }
  .terminal-dots {
    top: 12px;
    left: 12px;
    gap: 6px;
  }
  .terminal-dots i {
    width: 9px;
    height: 9px;
  }
  .terminal-smile {
    width: 40px;
    left: calc(50% - 20px);
    border-width: 5px;
    height: 19px;
  }
  .sam-replay-row {
    gap: 8px 16px;
  }
}
@media (max-width: 340px) {
  .terminal-sam {
    width: 270px;
    margin-left: -135px;
  }
  .terminal-copy {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .terminal-cursor {
    animation: none;
  }
  .terminal-eye,
  .terminal-smile,
  .terminal-copy {
    transition: none;
  }
}
