/* Osmo Supply effects applied to the templates' existing button sizes and palette. */
.button:is(.btn-animate-chars, .button-013, .button-016, .button-084) {
  position: relative;
  isolation: isolate;
  background: transparent;
}

.button:is(.button-013, .button-016) { --button-radius: 2.5em; }

.btn-animate-chars__bg,
.button-013__bg,
.button-013__bg-hover,
.button-016__bg {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--button-fill);
  pointer-events: none;
}

/* Balance — individual characters roll over as the background draws in. */
.btn-animate-chars {
  --stagger-ease: cubic-bezier(.625, .05, 0, 1);
}

.btn-animate-chars__bg {
  inset: calc(.125em * var(--button-active, 0));
  transition: inset .6s var(--stagger-ease);
}

.btn-animate-chars [data-button-animate-chars] {
  display: inline-block;
  overflow: clip;
  line-height: 1.3;
  white-space: nowrap;
}

.btn-animate-chars [data-button-animate-chars] > span {
  display: inline-block;
  white-space: pre;
  text-shadow: 0 1.3em currentColor;
  transform: translateY(calc(-1.3em * var(--button-active, 0))) rotate(.001deg);
  transition: transform .6s var(--stagger-ease) var(--character-delay, 0s);
}

/* Performance — the label rolls as a single line. */
.button-016 {
  --button-016-ease: cubic-bezier(.785, .135, .15, .86);
  overflow: clip;
}

.button-016__inner { display: grid; place-items: center; }

.button-016__text {
  text-shadow: 0 2lh currentColor;
  translate: 0 calc(-2lh * var(--button-active, 0));
  transition: translate .3s var(--button-016-ease);
}

.button-016__bg {
  background: color-mix(in srgb, var(--button-fill), var(--button-hover-fill) calc(100% * var(--button-active, 0)));
  transition: background-color .325s var(--button-016-ease);
}

/* Power — a solid second face slides in while the first face scales down. */
.button.button-084 {
  --button-084-ease: cubic-bezier(.32, .72, 0, 1);
  display: inline-grid;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.button-084__container {
  display: grid;
  overflow: clip;
  border-radius: inherit;
}

.button-084__default,
.button-084__hover {
  display: grid;
  grid-area: 1 / 1;
  border-radius: inherit;
}

.button-084__default {
  scale: calc(1 - .1 * var(--button-active, 0));
  transform-origin: 50% 95%;
  transition: scale .35s var(--button-084-ease) calc(.05s * var(--button-active, 0));
}

.button-084__hover {
  z-index: 1;
  translate: 0 calc(101% * (1 - var(--button-active, 0)));
  transition: translate .45s var(--button-084-ease) calc(.05s * var(--button-active, 0));
}

.button-084__bg,
.button-084__inner { grid-area: 1 / 1; }
.button-084__bg { border-radius: inherit; background: var(--button-fill); }
.button-084__bg.is--hover { background: var(--button-hover-fill); }

.button-084__inner {
  position: relative;
  display: grid;
  place-items: center;
  padding: .65rem var(--button-padding-inline);
}

/* Studio — the colour expands from inside the pill with a soft overshoot. */
.button-013 {
  --button-013-ease: cubic-bezier(.19, .69, .33, 1.33);
  transition: scale .15s cubic-bezier(.4, 0, .2, 1);
}

.button-013__bg-hover {
  inset: -.125em;
  background: var(--button-hover-fill);
  clip-path: inset(calc(1em - .875em * var(--button-active, 0)) round var(--button-radius));
  opacity: var(--button-active, 0);
  transition:
    clip-path .4s var(--button-013-ease) calc(.05s * var(--button-active, 0)),
    opacity .15s cubic-bezier(.215, .61, .355, 1) calc(.05s * var(--button-active, 0));
}

@media (prefers-reduced-motion: no-preference) {
  .button:focus-visible { --button-active: 1; }
  .button-013:active { scale: .955 .925; }

  @media (hover: hover) and (pointer: fine) {
    .button:hover { --button-active: 1; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .button:is(.btn-animate-chars, .button-013, .button-016, .button-084),
  .button:is(.btn-animate-chars, .button-013, .button-016, .button-084) span {
    transition: none;
  }
}
