/**
 * GADMATH glitch wordmark — global (landing, PIN, post-auth chrome, any container).
 * Pack version: 20261013-gadmath-parity-e (one tier · driver + rider + all sw-* shells).
 * Auto-sizes to any container font-size via 'em' scaling.
 */
/* Hard lock: Orbitron + weight beat driver monospace / rider * { font-family } resets */
sw-gadmath-brand,
.cp77-gadmath-type,
.cp77-gadmath-type .gadmath-brand,
.cp77-gadmath-type .gadmath-glitch-unit,
.cp77-gadmath-type .gadmath-face,
.cp77-gadmath-type .gadmath-o-swap,
.cp77-gadmath-type .gadmath-glitch-unit::before,
.cp77-gadmath-type .gadmath-glitch-unit::after,
.shield-gate-wordmark,
.gadmath-login-wordmark,
#shieldGateWordmark,
#riderShieldGateWordmark,
#gadmathLoginWordmark,
#riderGadmathLoginWordmark,
#mtsGadmathBrand,
#riderGadmathBrand,
#gadmathPageWordmark,
#gadmathIntakeWordmark {
  font-family: var(--cp77-display-font) !important;
  font-weight: 900 !important;
  font-style: normal !important;
  text-transform: uppercase;
}

sw-gadmath-brand {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.gadmath-brand {
  display: inline-block;
  white-space: nowrap;
  overflow: visible;
  line-height: 1;
}

.gadmath-glitch-unit {
  position: relative;
  display: inline-block;
  letter-spacing: var(--gadmath-track, 0.36em);
  padding-left: var(--gadmath-track, 0.36em);
  overflow: visible;
  animation: gadHackSkew 4.6s infinite;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.gadmath-glitch-unit:not([data-ghost])::before,
.gadmath-glitch-unit:not([data-ghost])::after {
  content: "GADMATH";
}

.gadmath-glitch-unit[data-ghost]::before,
.gadmath-glitch-unit[data-ghost]::after {
  content: attr(data-ghost);
}

.gadmath-glitch-unit::before,
.gadmath-glitch-unit::after {
  position: absolute;
  left: 0;
  top: 0;
  padding-left: inherit;
  letter-spacing: inherit;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.gadmath-glitch-unit::before {
  color: rgba(255, 42, 109, 0.85);
  text-shadow: 0.12em 0 rgba(255, 42, 109, 0.9);
  animation: gadGlitchRgbA 4.6s infinite;
}

.gadmath-glitch-unit::after {
  color: rgba(252, 238, 9, 0.75);
  text-shadow: -0.12em 0 rgba(5, 217, 232, 0.85);
  animation: gadGlitchRgbB 4.6s infinite;
}

.gadmath-face,
.gadmath-o-swap {
  display: inline-block;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  text-shadow: inherit;
  line-height: inherit;
}

.gadmath-o-swap {
  position: absolute;
  left: 0;
  top: 0;
  padding-left: inherit;
  letter-spacing: inherit;
  opacity: 0;
  animation: gadmathOSwap 4.6s infinite;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.gadmath-o-swap .gadmath-o-letter {
  color: #fce609;
  text-shadow:
    0 0 0.36em rgba(252, 238, 9, 0.95),
    0 0 0.8em rgba(255, 42, 109, 0.5);
}

.gadmath-face {
  animation: gadmathFaceHold 4.6s infinite;
}

.gadmath-scan {
  position: absolute;
  inset: -0.15em -0.3em;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(5, 217, 232, 0.12) 2px,
    rgba(5, 217, 232, 0.12) 3px
  );
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: gadScanBurst 4.6s infinite;
}

/* Base type styling — inherits container font-size by default, can be overridden via --gadmath-size */
sw-gadmath-brand,
.cp77-gadmath-type {
  --gadmath-track: 0.36em;
  font-size: var(--gadmath-size, inherit);
  line-height: 1;
  font-family: var(--cp77-display-font) !important;
  font-weight: 900;
  font-style: normal;
  letter-spacing: var(--gadmath-track);
  text-indent: 0;
  text-transform: uppercase;
  color: var(--cp77-cyan);
  text-shadow:
    0 0 0.22em rgba(5, 217, 232, 0.95),
    0 0 0.72em rgba(5, 217, 232, 0.55),
    0 0 1.45em rgba(123, 44, 191, 0.35),
    0.08em 0 0 rgba(255, 42, 109, 0.45),
    -0.08em 0 0 rgba(252, 238, 9, 0.25);
  -webkit-font-smoothing: antialiased;
  overflow: visible;
}

/* Default sizes for gate and login headers */
.shield-gate-wordmark,
.gadmath-login-wordmark {
  --gadmath-size: clamp(20px, 5.8vw, 28px);
}

/* Post-auth: GADMATH lands into top chrome after PIN (driver + rider) */
.cp77-gadmath-type.cp77-gadmath-land {
  animation: cp77GadmathChromeLand 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.mts-driver-name.cp77-gadmath-land,
.mts-member-name.cp77-gadmath-land {
  animation: cp77GadmathChromeLand 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

@keyframes cp77GadmathChromeLand {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(1.14);
    filter: blur(4px);
  }
  58% {
    opacity: 1;
    transform: translateY(3px) scale(0.97);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes gadmathOSwap {
  0%, 48%, 86%, 100% { opacity: 0; clip-path: inset(0 0 0 0); transform: translate(0); }
  52%, 82% { opacity: 1; clip-path: inset(0 0 0 0); transform: translate(0); }
}

@keyframes gadmathFaceHold {
  0%, 48%, 86%, 100% { opacity: 1; transform: translate(0); filter: none; }
  52%, 82% { opacity: 0; }
}

.gadmath-ao-glyph {
  display: inline-block;
  transition: color 80ms ease, text-shadow 80ms ease, transform 80ms ease;
}

.gadmath-ao-glyph.is-godmath-o {
  color: #fcee0a !important;
  text-shadow:
    0 0 0.38em rgba(252, 238, 10, 0.98),
    0.08em 0 0 rgba(255, 42, 109, 0.92),
    -0.08em 0 0 rgba(0, 240, 255, 0.92) !important;
  transform: scale(1.08) skewX(-6deg);
}

@keyframes gadGlitchRgbA {
  0%, 53%, 90%, 100% { opacity: 0; transform: translate(0); }
  56%, 84% { opacity: 0.72; transform: translate(0.09em, -0.04em); }
  70% { opacity: 0.45; transform: translate(-0.11em, 0.06em); }
}

@keyframes gadGlitchRgbB {
  0%, 53%, 90%, 100% { opacity: 0; transform: translate(0); }
  58%, 82% { opacity: 0.64; transform: translate(-0.09em, 0.04em); }
  74% { opacity: 0.42; transform: translate(0.08em, -0.06em); }
}

@keyframes gadScanBurst {
  0%, 54%, 89%, 100% { opacity: 0; }
  56%, 85% { opacity: 0.88; }
}

@keyframes gadHackSkew {
  0%, 53%, 90%, 100% { transform: skewX(0deg); }
  55.5% { transform: skewX(-6deg) translateX(-0.06em); }
  60% { transform: skewX(4deg) translateX(0.06em); }
  72% { transform: skewX(-2deg); }
  84% { transform: skewX(5deg) translateX(-0.05em); }
  87% { transform: skewX(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .gadmath-glitch-unit,
  .gadmath-glitch-unit::before,
  .gadmath-glitch-unit::after,
  .gadmath-face,
  .gadmath-o-swap,
  .gadmath-scan,
  .cp77-gadmath-type.cp77-gadmath-land,
  .mts-driver-name.cp77-gadmath-land,
  .mts-member-name.cp77-gadmath-land {
    animation: none !important;
  }
  .gadmath-o-swap { display: none; }
}
