
.terminal-heading {
  position: relative;
  isolation: isolate;
}
.terminal-heading .terminal-glyph {
  position: relative;
  display: inline;
  color: inherit;
}
.terminal-heading .statement-line { position: relative; }
.terminal-heading[data-terminal-phase]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.65em -1em -.5em -.42em;
  background:
    repeating-linear-gradient(180deg, transparent 0 2px, #62d58b14 2px 3px),
    radial-gradient(ellipse at 33% 50%, #1a683229, transparent 76%);
  mask-image: radial-gradient(ellipse at 37% 51%, #000 9%, transparent 73%);
  opacity: 0;
  transition: opacity calc(.42s / var(--terminal-speed)) ease-out;
}
.terminal-heading[data-terminal-phase="typing"]::before {
  opacity: .82;
}
.terminal-heading .terminal-glyph {
  transition: color calc(.38s / var(--terminal-speed)) ease-out,
              text-shadow calc(.38s / var(--terminal-speed)) ease-out;
}
.terminal-heading[data-terminal-phase="typing"] .terminal-glyph {
  color: #a1e2b6;
  text-shadow: 0 0 .085em #66e29880, 0 0 .21em #25ad6280;
  transition: none;
}
.terminal-heading[data-terminal-phase="typing"] :is(.statement-razem, em) .terminal-glyph {
  color: #50da91;
}
.terminal-heading[data-terminal-phase="waiting"] .terminal-glyph,
.terminal-heading[data-terminal-phase="typing"] .terminal-glyph:not(.is-typed) {
  visibility: hidden;
}
.terminal-heading[data-terminal-phase="typing"] .terminal-caret::after,
.terminal-heading[data-terminal-phase="typing"] .terminal-leading-caret::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(100% + .07em);
  bottom: -.065em;
  height: max(2px, .061em);
  width: .47em;
  background: #53d88c;
  box-shadow: 0 0 .15em #41d783a6;
}
.terminal-heading[data-terminal-phase="typing"] .terminal-leading-caret::after {
  inset-inline-start: 0;
  visibility: visible;
  animation: terminal-blink calc(.32s / var(--terminal-speed)) steps(1, end) 1 both;
}
.terminal-heading[data-terminal-phase="typing"] .terminal-caret.is-waiting::after {
  animation: terminal-blink calc(.47s / var(--terminal-speed)) steps(1, end) infinite;
}
@keyframes terminal-blink {
  0%, 66% { opacity: 1; }
  67%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .terminal-heading[data-terminal-phase] .terminal-glyph {
    visibility: visible;
    color: inherit;
    text-shadow: none;
    transition: none;
  }
  .terminal-heading[data-terminal-phase]::before,
  .terminal-heading[data-terminal-phase] .terminal-caret::after,
  .terminal-heading[data-terminal-phase] .terminal-leading-caret::after { display: none; }
}
