/* ---- shared text stage ---- */
.mmtf-stage {
  position: relative; z-index: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; overflow: hidden; box-sizing: border-box;
}
.mmtf-stage[data-align="left"] { justify-content: flex-start; text-align: left; }
.mmtf-stage[data-align="center"] { justify-content: center; text-align: center; }
.mmtf-stage[data-align="right"] { justify-content: flex-end; text-align: right; }
.mm-tf { position: relative; display: block; width: 100%; overflow: hidden; isolation: isolate; }
.mm-tf *, .mm-tf *::before, .mm-tf *::after { box-sizing: border-box; }

.mm-tf .mmtf-words {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--mmtf-gap, 0.55em);
  max-width: 100%; line-height: 1.15; user-select: none; outline: none; font-size: min(var(--mmtf-size, 72px), 13vw);
}
.mm-tf .mmtf-stage[data-align="left"] .mmtf-words { justify-content: flex-start; }
.mm-tf .mmtf-stage[data-align="center"] .mmtf-words { justify-content: center; }
.mm-tf .mmtf-stage[data-align="right"] .mmtf-words { justify-content: flex-end; }
.mm-tf .mmtf-word {
  position: relative; display: inline-block; font-size: 1em; font-weight: var(--mmtf-weight, 900); letter-spacing: -0.04em;
  color: var(--mmtf-text, #f2f2f4); cursor: pointer; outline: none; padding: 0.05em 0.02em; will-change: filter;
  touch-action: manipulation; margin: 0; line-height: 1.15;
}
.mm-tf .mmtf-frame { position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0; will-change: transform, width, height; }
.mm-tf .mmtf-corner {
  position: absolute; width: 1rem; height: 1rem; border: 3px solid var(--mmtf-frame, #22c55e); border-radius: 3px;
  filter: drop-shadow(0 0 4px var(--mmtf-glow, rgba(0, 255, 0, 0.6)));
}
.mm-tf .mmtf-corner--tl { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.mm-tf .mmtf-corner--tr { top: -10px; right: -10px; border-left: 0; border-bottom: 0; }
.mm-tf .mmtf-corner--bl { bottom: -10px; left: -10px; border-right: 0; border-top: 0; }
.mm-tf .mmtf-corner--br { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }
.mm-tf.is-static .mmtf-word, .mm-tf.is-static .mmtf-frame { transition: none !important; cursor: default; }

/* Focus marker shapes (corners stay the default look) */
.mm-tf .mmtf-frame > span { position: absolute; }
.mm-tf .mmtf-frame .mmtf-paren, .mm-tf .mmtf-frame .mmtf-mark { display: none; }
.mm-tf .mmtf-frame:not([data-style="corners"]) .mmtf-corner { display: none; }
.mm-tf .mmtf-paren {
  top: -12%; height: 124%; width: 0.38em; min-width: 9px; border: 3px solid var(--mmtf-frame, #22c55e);
  filter: drop-shadow(0 0 4px var(--mmtf-glow, rgba(0, 255, 0, 0.6)));
}
.mm-tf .mmtf-frame[data-style="parens"] .mmtf-paren { display: block; }
.mm-tf .mmtf-paren--l { left: -0.36em; border-right: 0; border-radius: 1em 0 0 1em; }
.mm-tf .mmtf-paren--r { right: -0.36em; border-left: 0; border-radius: 0 1em 1em 0; }
.mm-tf .mmtf-frame[data-style="pill"] .mmtf-mark {
  display: block; inset: -0.16em -0.42em; border-radius: 999px; border: 3px solid var(--mmtf-frame, #22c55e);
  box-shadow: 0 0 12px var(--mmtf-glow, rgba(0, 255, 0, 0.6));
}
.mm-tf .mmtf-frame[data-style="chip"] .mmtf-mark {
  display: block; inset: -0.14em -0.46em; border-radius: 999px;
  background: color-mix(in srgb, var(--mmtf-frame, #22c55e) 22%, transparent); border: 1.5px solid var(--mmtf-frame, #22c55e);
}
.mm-tf .mmtf-frame[data-style="underline"] .mmtf-mark {
  display: block; left: 0.04em; right: 0.04em; bottom: -0.08em; height: 0.1em; border-radius: 999px;
  background: var(--mmtf-frame, #22c55e); box-shadow: 0 0 10px var(--mmtf-glow, rgba(0, 255, 0, 0.6));
}
.mm-tf .mmtf-frame[data-style="halo"] .mmtf-mark {
  display: block; inset: -0.26em -0.4em; border-radius: 1.05em;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--mmtf-glow, #4ade80) 42%, transparent) 0%, transparent 72%);
}

/* Text entrance (duration and delay per word come from the runtime) */
.mm-tf .mmtf-words.is-waiting .mmtf-word, .mm-tf .mmtf-words.is-waiting .mmtf-frame { visibility: hidden; }
.mm-tf .mmtf-words.is-entering .mmtf-word, .mm-tf .mmtf-words.is-entering .mmtf-frame { animation-fill-mode: backwards; }
.mm-tf .mmtf-words.is-entering[data-in="rise"] .mmtf-word { animation-name: mmtfRise; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
.mm-tf .mmtf-words.is-entering[data-in="blur"] .mmtf-word { animation-name: mmtfSharpen; animation-timing-function: ease; }
.mm-tf .mmtf-words.is-entering[data-in="fade"] .mmtf-word { animation-name: mmtfFade; animation-timing-function: ease; }
.mm-tf .mmtf-words.is-entering .mmtf-frame { animation-name: mmtfFade; animation-timing-function: ease; }
@keyframes mmtfRise { from { opacity: 0; filter: blur(12px); transform: translateY(0.35em); } }
@keyframes mmtfSharpen { from { opacity: 0.4; filter: blur(14px); } }
@keyframes mmtfFade { from { opacity: 0; } }

/* Reduced motion: own toggle or the device setting */
.mm-tf.is-reduced .mmtf-word, .mm-tf.is-reduced .mmtf-frame { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .mm-tf .mmtf-word, .mm-tf .mmtf-frame { transition: none !important; animation: none !important; }
}

/* ---- shared gallery kit ---- */
.mmtf-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.mmtf-bg__img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.mmtf-bg__ov { position: absolute; inset: 0; }
.mmtf-demo {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  min-height: var(--mm-demo-h, clamp(200px, 35vh, 360px)); margin: 0 1rem; border: 2px dotted rgba(140, 140, 160, 0.55); border-radius: 14px;
  color: rgba(160, 160, 180, 0.9); font: 500 13px/1.4 system-ui, sans-serif; letter-spacing: 0.02em;
}
.mmtf-demo--before { margin-bottom: 1rem; }
.mmtf-demo--after { margin-top: 1rem; }
/* Editor scroll room (1.3.4): same heights as the demo pages; editor preview only, never rendered live. */
.mmtf-demo--after { min-height: var(--mm-demo-h-after, 50vh); }
@media (max-width: 640px) { .mmtf-demo--before { min-height: var(--mm-demo-h-sm, clamp(160px, 30vh, 260px)); } }
.mmtf-lb {
  position: fixed; z-index: 100000; inset: 0; display: grid; place-items: center;
  padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
  font-family: inherit;
}
.mmtf-lb[hidden] { display: none !important; }
.mmtf-lb.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.mmtf-lb__card {
  position: relative; z-index: 1; width: min(96vw, 960px); max-height: min(92dvh, 900px);
  display: flex; flex-direction: column; align-items: center; padding-top: 0.75rem;
  background: var(--mmtf-lb-bg, #101014); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(18px) scale(0.96); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mmtf-lb.is-open .mmtf-lb__card { transform: none; }
.mmtf-lb__close:hover, .mmtf-lb__close:focus, .mmtf-lb__close:focus-visible {
  background: rgba(0, 0, 0, 0.7) !important; color: #fff !important; opacity: 1 !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important; outline: none !important; box-shadow: none !important;
}
.mmtf-lb__scrim:hover, .mmtf-lb__scrim:focus { background: rgba(0, 0, 0, 0.66) !important; outline: none !important; box-shadow: none !important; }
.mmtf-lb__media {
  display: block; width: auto !important; height: auto !important; max-width: 100% !important;
  max-height: min(74dvh, 760px); min-height: min(40dvh, 300px); object-fit: contain;
  border: 0 !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important;
}
.mmtf-lb__body { flex: 0 0 auto; align-self: stretch; padding: 0.85rem 1.1rem 1.05rem; overflow-y: auto; text-align: left; }
.mmtf-lb__title { margin: 0 0 0.4rem !important; padding: 0 !important; font-size: 21px !important; font-weight: 600 !important; letter-spacing: -0.02em; line-height: 1.2 !important; color: var(--mmtf-lb-title, #fff) !important; text-transform: none !important; }
.mmtf-lb__desc { margin: 0 !important; padding: 0 !important; font-size: 14px !important; line-height: 1.5 !important; color: var(--mmtf-lb-text, #c8c8d0) !important; }
.mmtf-lb__title[hidden], .mmtf-lb__desc[hidden], .mmtf-lb__link[hidden] { display: none !important; }
.mmtf-lb__link, .mmtf-lb__link:visited {
  display: inline-block; margin-top: 0.8rem; padding: 0.55rem 1.1rem; border-radius: 999px;
  background: var(--mmtf-lb-title, #fff) !important; color: var(--mmtf-lb-bg, #101014) !important;
  font-size: 0.85rem; font-weight: 600; text-decoration: none !important; border: 0 !important; box-shadow: none !important;
}
.mmtf-lb__link:hover, .mmtf-lb__link:focus { opacity: 0.88; text-decoration: none !important; outline: none !important; }
/* ---- end kit ---- */
