/**
 * AnimateBox.dev — Glitch Text
 * https://animatebox.dev
 *
 * Drag-driven chromatic letter glitch. Theme via --ab-gt-* variables.
 * Default: DM Sans, near-black / white stage; cyan + magenta reserved for RGB ghosts.
 */

.ab-glitch-text {
  --ab-gt-color: #f3f1ec;
  --ab-gt-cyan: #00e5ff;
  --ab-gt-magenta: #ff2bd6;
  --ab-gt-font: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
  --ab-gt-size: clamp(2.8rem, 9vw, 5.5rem);
  --ab-gt-weight: 700;
  --ab-gt-tracking: -0.04em;
  --ab-gt-leading: 1.15em;
  --ab-gt-align: center;

  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  width: 100%;
  color: var(--ab-gt-color);
  font-family: var(--ab-gt-font);
  font-size: var(--ab-gt-size);
  font-weight: var(--ab-gt-weight);
  line-height: var(--ab-gt-leading);
  letter-spacing: var(--ab-gt-tracking);
  text-align: var(--ab-gt-align);
  white-space: pre-wrap;
  user-select: none;
  -webkit-user-select: none;
}

.ab-glitch-text__char {
  position: relative;
  display: inline-block;
  color: inherit;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  white-space: pre;
  isolation: isolate;
}

.ab-glitch-text__char:active,
.ab-glitch-text[data-dragging="true"] .ab-glitch-text__char {
  cursor: grabbing;
}

.ab-glitch-text__layer {
  display: block;
  pointer-events: none;
}

.ab-glitch-text__layer--main {
  position: relative;
  z-index: 2;
  color: inherit;
}

.ab-glitch-text__layer--cyan,
.ab-glitch-text__layer--magenta {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.ab-glitch-text__layer--cyan {
  color: var(--ab-gt-cyan);
}

.ab-glitch-text__layer--magenta {
  color: var(--ab-gt-magenta);
}

.ab-glitch-text__break {
  white-space: pre;
}

.ab-glitch-text[data-reduced="true"] .ab-glitch-text__char {
  cursor: default;
  transform: none !important;
}

.ab-glitch-text[data-reduced="true"] .ab-glitch-text__layer--cyan,
.ab-glitch-text[data-reduced="true"] .ab-glitch-text__layer--magenta {
  display: none;
}
