/* The Markov chain card: same dark card and palette as the Docker
 * diagrams. Blue chips are the pair of words the chain is looking at,
 * green chips the words that could follow (data-p holds the odds), amber
 * the one it picked. In the text, bright words were a choice and dim
 * words were the only option. */

.mk-card {
  display: block;
  margin: 2rem 0 2.5rem;
  padding: 26px 28px 14px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--demo-bg, #191919);
  color: var(--demo-fg, #e8e8e8);
  cursor: pointer;
}
.mk-card figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em 1em;
  margin-top: 18px;
  color: var(--demo-muted, #aaa);
  font-size: 0.9rem;
}
.mk-card figcaption strong { color: var(--demo-fg, #e8e8e8); }
.mk-card .mk-hint { margin-left: auto; color: var(--demo-faint, #777); font-size: 0.9rem; }
.mk-card > .mk-hint { display: block; margin-top: 14px; text-align: right; }
.mk-card.mk-paused .mk-hint::after { content: " · paused"; color: #fbbf24; }

/* --- The pair, and what could follow it ------------------------------ */
.mk-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 8px;
}
.mk-label {
  flex: none;
  width: 3.2em;
  padding-top: 4px;
  color: var(--demo-faint, #777);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mk-context, .mk-options { display: flex; flex-wrap: wrap; gap: 6px; }

.mk-chip {
  --tint: 160, 160, 160;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  padding: 0.15em 0.6em;
  border: 1px solid rgba(var(--tint), 0.5);
  border-radius: 999px;
  background: linear-gradient(rgba(var(--tint), 0.16), rgba(var(--tint), 0.16)), var(--demo-bg, #191919);
  font-size: 15px;
  white-space: nowrap;
  animation: mk-pop 0.12s ease-out both;
}
.mk-chip[data-p]::after {
  content: attr(data-p);
  color: rgb(var(--tint));
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.mk-chip.t-ctx  { --tint: 96, 165, 250; }
.mk-chip.t-opt  { --tint: 52, 211, 153; opacity: 0.75; }
.mk-chip.t-more { border-style: dashed; color: var(--demo-faint, #888); }
.mk-chip.t-pick {
  --tint: 251, 191, 36;
  border-color: rgb(var(--tint));
  box-shadow: 0 0 10px rgba(var(--tint), 0.45);
  font-weight: 600;
}

/* --- The endless text ------------------------------------------------ */
.mk-text {
  height: 15em;
  margin-top: 16px;
  padding-top: 4em;
  overflow: hidden;
  font-size: 1.05rem;
  line-height: 1.6;
  mask-image: linear-gradient(transparent, #000 45%);
}
.mk-text p { margin: 0 0 0.8em; }
.mk-forced { color: var(--demo-dim, #7d7d7d); }
.mk-choice { color: var(--demo-fg, #f2f2f2); }
.mk-new {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}
.mk-caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: #fbbf24;
  animation: mk-blink 1s steps(1) infinite;
}

@keyframes mk-pop {
  from { opacity: 0; translate: 0 -6px; }
}
@keyframes mk-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mk-card * { animation: none !important; }
}
