:root {
  --z80-d: 46px;
  --z80-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --z80-ease-io: cubic-bezier(0.65, 0.05, 0.36, 1);
  --z80-edge: max(1.25rem, env(safe-area-inset-bottom));
}

.z80 {
  --z-bg: rgba(255, 248, 232, 0.82);
  --z-line: rgba(31, 61, 54, 0.14);
  --z-ink: var(--ink, #1f3d36);
  --z-muted: rgba(31, 61, 54, 0.58);
  --z-accent: var(--accent, #f0a35e);

  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: var(--z80-edge);
  z-index: 40;
  display: grid;
  grid-template-columns: 0fr var(--z80-d);
  align-items: center;
  height: var(--z80-d);
  border-radius: 999px;
  background-color: var(--z-bg);
  box-shadow: inset 0 0 0 1px var(--z-line);
  backdrop-filter: blur(12px) saturate(140%);
  color: var(--z-ink);
  text-decoration: none;
  transform-origin: calc(100% - var(--z80-d) / 2) 50%;
  -webkit-tap-highlight-color: transparent;
  transition:
    grid-template-columns 0.75s var(--z80-ease-out),
    background-color 0.45s,
    box-shadow 0.45s,
    color 0.45s,
    opacity 0.55s var(--z80-ease-out),
    transform 0.9s var(--z80-ease-out),
    visibility 0s linear 0.9s;
}

.js .z80:not(.is-on) {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 1.1rem, 0) scale(0.88);
}

.z80.is-on {
  transition-delay: 0s;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.z80__label {
  min-width: 0;
  overflow: hidden;
}

.z80__text {
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  width: max-content;
  padding: 0 0.25rem 0 1.15rem;
  white-space: nowrap;
  font: 600 0.62rem / 1 "Nunito", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--z-muted);
  opacity: 0;
  transform: translate3d(0.7rem, 0, 0);
  transition: opacity 0.35s, transform 0.7s var(--z80-ease-out), color 0.4s;
}

.z80__text b {
  font: 700 0.92rem / 1 "Fredoka", sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--z-ink);
}

.z80__disc {
  position: relative;
  display: grid;
  place-items: center;
  height: var(--z80-d);
  border-radius: 50%;
}

.z80__mark {
  width: auto;
  height: calc(var(--z80-d) * 0.5);
  overflow: visible;
  fill: none;
  stroke: currentcolor;
  stroke-width: 5.43;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.z80__pad {
  fill: currentcolor;
  stroke: none;
  transform-box: fill-box;
  transform-origin: center center;
  transition: fill 0.4s;
}

.z80:focus-visible {
  outline: 2px solid var(--leaf-deep, #4f8f78);
  outline-offset: 3px;
  grid-template-columns: 1fr var(--z80-d);
}

.z80:focus-visible .z80__text {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

@media (hover: hover) {
  .z80:hover {
    grid-template-columns: 1fr var(--z80-d);
  }

  .z80:hover .z80__text {
    opacity: 1;
    transform: none;
    transition-delay: 0.1s;
  }

  .z80:hover .z80__pad {
    fill: var(--z-accent);
    transition-delay: calc(var(--i) * 70ms);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .z80__line {
    stroke-dasharray: 1;
  }

  .js .z80__line {
    stroke-dashoffset: 1;
    opacity: 0;
    transition:
      stroke-dashoffset var(--t) var(--z80-ease-io) var(--s),
      opacity 0s linear var(--s);
  }

  .js .z80.is-drawn .z80__line {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  .js .z80:not(.is-drawn) .z80__pad {
    transform: scale(0);
  }

  .js .z80.is-drawn .z80__pad {
    animation: z80-pad 0.9s var(--z80-ease-out) var(--s) backwards;
  }
}

@keyframes z80-pad {
  0% {
    transform: scale(0);
    fill: var(--z-accent);
  }
  40% {
    transform: scale(1.28);
    fill: var(--z-accent);
  }
  100% {
    transform: none;
    fill: currentcolor;
  }
}

@media (max-width: 767px) {
  :root {
    --z80-d: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .z80,
  .z80__text,
  .z80__line,
  .z80__pad {
    transition: none !important;
    animation: none !important;
  }

  .js .z80__line {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  .js .z80:not(.is-drawn) .z80__pad,
  .js .z80.is-drawn .z80__pad {
    transform: none;
  }
}

@media print {
  .z80 {
    display: none;
  }
}
