brand-mark {
  --brand-mark-accent: #b9b0ff;
  display: inline-flex;
  color: inherit;
}

:root[data-theme='light'] brand-mark {
  --brand-mark-accent: #6a5af0;
}

brand-mark svg {
  display: block;
  overflow: visible;
}

brand-mark [glyph],
brand-mark [body],
brand-mark [echo] {
  transform-box: fill-box;
  transform-origin: center;
}

brand-mark [glyph] {
  stroke: currentColor;
  stroke-width: 0;
}

brand-mark [echo] {
  opacity: 0;
  color: var(--brand-mark-accent);
}

brand-mark [sheen] {
  opacity: 0;
}

/* Every moment sits behind this, so reduced motion never sees one even if a class slips through. */
@media (prefers-reduced-motion: no-preference) {
  brand-mark[moment='wave'] [glyph] {
    animation: brand-mark-bob 0.5s ease-in-out both;
  }
  brand-mark[moment='wave'] [glyph='a'] {
    animation-delay: 0.08s;
  }
  brand-mark[moment='wave'] [glyph='r'] {
    animation-delay: 0.16s;
  }

  brand-mark[moment='glint'] [sheen] {
    opacity: 1;
    animation: brand-mark-sweep 1.3s ease-in-out both;
  }

  brand-mark[moment='flip'] [glyph] {
    animation: brand-mark-flip 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  brand-mark[moment='flip'] [glyph='a'] {
    animation-delay: 0.07s;
  }
  brand-mark[moment='flip'] [glyph='r'] {
    animation-delay: 0.14s;
  }

  brand-mark[moment='redraw'] [glyph] {
    stroke-width: 0.8;
    stroke-dasharray: var(--length);
    animation:
      brand-mark-unfill 0.3s ease-in both,
      brand-mark-trace 1.1s ease-in-out 0.3s both,
      brand-mark-refill 0.35s ease-out 1.35s both;
  }

  brand-mark[moment='look'] [glyph='a'] {
    transform-origin: 50% 100%;
    animation: brand-mark-look 1.8s ease-in-out both;
  }

  brand-mark[moment='blink'] [glyph='a'] {
    animation: brand-mark-blink 0.9s ease-in-out both;
  }

  brand-mark[moment='tip'] [glyph='a'] {
    transform-origin: 100% 100%;
    animation: brand-mark-tip 1.4s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  }
  brand-mark[moment='tip'] [glyph='r'] {
    animation: brand-mark-shoved 1.4s ease-out both;
  }

  brand-mark[moment='coin'] [glyph='a'] {
    animation: brand-mark-coin 1s ease-in-out both;
  }

  brand-mark[moment='stretch'] [body] {
    transform-origin: 50% 100%;
    animation: brand-mark-stretch 1.6s ease-in-out both;
  }

  brand-mark[moment='kick'] [glyph='r'] {
    transform-origin: 0% 100%;
    animation: brand-mark-kick 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  }
  brand-mark[moment='kick'] [glyph='k'] {
    animation: brand-mark-kicked 0.9s ease-out both;
  }

  brand-mark[moment='duck'] [glyph] {
    animation: brand-mark-duck 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  brand-mark[moment='duck'] [glyph='a'] {
    animation-delay: 0.1s;
  }
  brand-mark[moment='duck'] [glyph='r'] {
    animation-delay: 0.2s;
  }

  brand-mark[moment='bump'] [glyph='a'] {
    animation: brand-mark-bump-a 1.2s ease-in-out both;
  }
  brand-mark[moment='bump'] [glyph='r'] {
    animation: brand-mark-bump-r 1.2s ease-in-out both;
  }
  brand-mark[moment='bump'] [glyph='k'] {
    animation: brand-mark-bump-k 1.2s ease-in-out both;
  }

  brand-mark[moment='echo'] [echo] {
    animation: brand-mark-echo 1.6s ease-out both;
  }

  brand-mark[moment='tilt'] [body] {
    animation: brand-mark-tilt 1.6s ease-in-out both;
  }
}

@keyframes brand-mark-bob { 40% { transform: translateY(-3px) } }
@keyframes brand-mark-sweep { from { transform: translateX(-40px) } to { transform: translateX(120px) } }
@keyframes brand-mark-flip { 50% { transform: scaleX(0) } }
@keyframes brand-mark-unfill { to { fill-opacity: 0 } }
@keyframes brand-mark-trace { from { stroke-dashoffset: var(--length) } }
@keyframes brand-mark-refill { from { fill-opacity: 0 } }
@keyframes brand-mark-look { 20%, 40% { transform: skewX(9deg) } 60%, 80% { transform: skewX(-9deg) } 100% { transform: none } }
@keyframes brand-mark-blink { 10%, 40% { transform: scaleY(1) } 20%, 50% { transform: scaleY(0.12) } 30%, 60% { transform: scaleY(1) } }
@keyframes brand-mark-tip { 30% { transform: rotate(16deg) } 45% { transform: rotate(-4deg) } 60% { transform: rotate(2deg) } 75% { transform: none } }
@keyframes brand-mark-shoved { 22% { transform: none } 32% { transform: translateX(3px) } 60% { transform: none } }
@keyframes brand-mark-coin { 25% { transform: scaleX(0) } 50% { transform: scaleX(-1) } 75% { transform: scaleX(0) } }
@keyframes brand-mark-stretch { 35%, 55% { transform: scale(1.07, 0.9) } 75% { transform: scale(0.98, 1.03) } }
@keyframes brand-mark-kick { 30% { transform: skewX(-14deg) } 60% { transform: none } }
@keyframes brand-mark-kicked { 25% { transform: none } 40% { transform: translateY(-3px) } 60% { transform: none } }
@keyframes brand-mark-duck { 30%, 60% { transform: translateY(6px) scaleY(0.6); opacity: 0.25 } }
@keyframes brand-mark-bump-a { 20% { transform: translateX(-2px) } 35% { transform: translateX(3px) } 55% { transform: translateX(-3px) } 75% { transform: none } }
@keyframes brand-mark-bump-r { 30% { transform: none } 38% { transform: translateX(3px) } 55% { transform: none } }
@keyframes brand-mark-bump-k { 48% { transform: none } 56% { transform: translateX(-3px) } 72% { transform: none } }
@keyframes brand-mark-echo { 0% { opacity: 0.8; transform: translate(0, 0) } 30%, 70% { opacity: 0.6; transform: translate(2.5px, 2.5px) } 100% { opacity: 0; transform: translate(0, 0) } }
@keyframes brand-mark-tilt { 30%, 60% { transform: rotate(-4deg) translateY(-1px) } }
