.markdown-bold-button {
  position: relative;
  width: 26px;
  height: 28px;
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  margin-left: -7px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #52687b;
  background: transparent;
  line-height: 1;
  will-change: color, border-color, background-color, box-shadow, transform;
  animation: markdown-bold-button-cycle 7.2s ease-in-out infinite;
  animation-play-state: paused;
}

.markdown-bold-button::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(38, 160, 214, 0.72);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.72);
  will-change: opacity, transform;
  animation: markdown-bold-ripple-cycle 7.2s ease-out infinite;
  animation-play-state: paused;
}

.markdown-heading-demo {
  position: relative;
  width: max-content;
  max-width: 100%;
  font-weight: 400;
  isolation: isolate;
}

.markdown-heading-normal,
.markdown-heading-bold {
  position: relative;
  z-index: 2;
  display: block;
  will-change: opacity, filter;
  animation-duration: 7.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}

.markdown-heading-normal {
  font-weight: 400;
  animation-name: markdown-normal-heading-cycle;
}

.markdown-heading-bold {
  position: absolute;
  inset: 0;
  font-weight: 850;
  opacity: 0;
  animation-name: markdown-bold-heading-cycle;
}

.markdown-selection {
  position: absolute;
  z-index: 1;
  inset: -2px -3px;
  border-radius: 2px;
  background: rgba(75, 216, 200, 0.6);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right center;
  will-change: opacity, transform;
  animation: markdown-selection-cycle 7.2s ease-in-out infinite;
  animation-play-state: paused;
}

.markdown-demo-cursor {
  position: absolute;
  z-index: 4;
  left: calc(100% + 6px);
  top: calc(100% - 5px);
  width: 18px;
  height: 22px;
  display: block;
  color: #f9fcff;
  opacity: 0;
  filter: drop-shadow(0 2px 2px rgba(6, 22, 35, 0.38));
  pointer-events: none;
  will-change: left, top, opacity;
  animation: markdown-cursor-cycle 7.2s cubic-bezier(0.45, 0, 0.2, 1) infinite;
  animation-play-state: paused;
}

.markdown-demo-cursor svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transform-origin: 3px 3px;
  will-change: transform;
  animation: markdown-cursor-click-cycle 7.2s ease-in-out infinite;
  animation-play-state: paused;
}

.markdown-demo-cursor path {
  fill: currentColor;
  stroke: #183247;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.card-markdown.is-visible .markdown-bold-button,
.card-markdown.is-visible .markdown-bold-button::after,
.card-markdown.is-visible .markdown-heading-normal,
.card-markdown.is-visible .markdown-heading-bold,
.card-markdown.is-visible .markdown-selection,
.card-markdown.is-visible .markdown-demo-cursor,
.card-markdown.is-visible .markdown-demo-cursor svg {
  animation-play-state: running;
}

@keyframes markdown-cursor-cycle {
  0%, 7% {
    left: calc(100% + 6px);
    top: calc(100% - 5px);
    opacity: 0;
  }

  11%, 16% {
    left: calc(100% + 3px);
    top: calc(100% - 5px);
    opacity: 1;
  }

  31%, 38% {
    left: -4px;
    top: calc(100% - 5px);
    opacity: 1;
  }

  50%, 57% {
    left: -8px;
    top: -74px;
    opacity: 1;
  }

  64%, 100% {
    left: -8px;
    top: -74px;
    opacity: 0;
  }
}

@keyframes markdown-cursor-click-cycle {
  0%, 51%, 56%, 100% { transform: scale(1); }
  53.5% { transform: scale(0.78); }
}

@keyframes markdown-selection-cycle {
  0%, 15% {
    opacity: 0;
    transform: scaleX(0);
  }

  17% { opacity: 1; }

  31%, 55% {
    opacity: 1;
    transform: scaleX(1);
  }

  63%, 100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@keyframes markdown-bold-button-cycle {
  0%, 48%, 59%, 100% {
    color: #52687b;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    transform: scale(1);
  }

  51%, 56% {
    color: #0b4561;
    border-color: rgba(38, 160, 214, 0.62);
    background: rgba(75, 216, 200, 0.32);
    box-shadow: 0 0 0 2px rgba(75, 216, 200, 0.12);
    transform: scale(0.94);
  }
}

@keyframes markdown-bold-ripple-cycle {
  0%, 51%, 58%, 100% {
    opacity: 0;
    transform: scale(0.72);
  }

  53% { opacity: 0.8; }

  58% {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes markdown-normal-heading-cycle {
  0%, 54% {
    opacity: 1;
    filter: blur(0);
  }

  60%, 88% {
    opacity: 0;
    filter: blur(0.4px);
  }

  94%, 100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes markdown-bold-heading-cycle {
  0%, 54% {
    opacity: 0;
    filter: blur(0.4px);
  }

  60%, 88% {
    opacity: 1;
    filter: blur(0);
  }

  94%, 100% {
    opacity: 0;
    filter: blur(0.4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .markdown-bold-button,
  .markdown-bold-button::after,
  .markdown-heading-normal,
  .markdown-heading-bold,
  .markdown-selection,
  .markdown-demo-cursor,
  .markdown-demo-cursor svg {
    animation-duration: 10.8s;
  }
}
