.email-copy {
  --email-copy-text: currentColor;
  --email-copy-muted: #c49a7f;
  --email-copy-border: rgba(201, 168, 143, 0.34);
  --email-copy-border-strong: rgba(201, 168, 143, 0.58);
  --email-copy-bg: rgba(201, 168, 143, 0.06);
  --email-copy-bg-hover: rgba(201, 168, 143, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  max-width: 100%;
  vertical-align: middle;
}

.email-copy__value {
  color: var(--email-copy-text);
  text-decoration: none;
  word-break: break-all;
}

.email-copy__button {
  appearance: none;
  border: 1px solid var(--email-copy-border);
  background: var(--email-copy-bg);
  color: var(--email-copy-text);
  border-radius: 999px;
  width: 1.7rem;
  height: 1.7rem;
  min-width: 1.7rem;
  min-height: 1.7rem;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

.email-copy__button::before,
.email-copy__button::after {
  content: "";
  position: absolute;
  border: 1px solid currentColor;
  border-radius: 0.18rem;
  width: 0.48rem;
  height: 0.58rem;
  opacity: 0.9;
  transition: transform 180ms ease, opacity 180ms ease;
}

.email-copy__button::before {
  transform: translate(0.11rem, -0.11rem);
}

.email-copy__button::after {
  transform: translate(-0.11rem, 0.11rem);
  background: transparent;
}

.email-copy__button:hover,
.email-copy__button:focus-visible {
  background: var(--email-copy-bg-hover);
  border-color: var(--email-copy-border-strong);
  box-shadow: 0 0 0 0.18rem rgba(201, 168, 143, 0.08);
}

.email-copy__button:hover::before,
.email-copy__button:focus-visible::before {
  transform: translate(0.16rem, -0.16rem);
}

.email-copy__button:hover::after,
.email-copy__button:focus-visible::after {
  transform: translate(-0.06rem, 0.06rem);
}

.email-copy__button:active {
  transform: scale(0.96);
}

.email-copy__button:focus-visible {
  outline: 2px solid rgba(201, 168, 143, 0.32);
  outline-offset: 2px;
}

.email-copy__hint {
  min-width: 3.5rem;
  font-size: 0.72em;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--email-copy-muted);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  pointer-events: none;
}

.email-copy.is-copied .email-copy__hint {
  opacity: 1;
  transform: translateY(0);
  animation: email-copy-fade 1.8s ease forwards;
}

.email-copy.is-copied .email-copy__button {
  border-color: var(--email-copy-border-strong);
  background: rgba(201, 168, 143, 0.1);
}

.email-copy.is-copied .email-copy__button::before {
  opacity: 0;
  transform: translate(0.22rem, -0.22rem) scale(0.88);
}

.email-copy.is-copied .email-copy__button::after {
  width: 0.62rem;
  height: 0.34rem;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  transform: translateY(-0.02rem) rotate(-45deg);
}

@keyframes email-copy-fade {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  18% {
    opacity: 1;
    transform: translateY(0);
  }
  72% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-3px);
  }
}

@media (max-width: 640px) {
  .email-copy {
    gap: 0.38rem;
  }

  .email-copy__button {
    width: 1.56rem;
    height: 1.56rem;
    min-width: 1.56rem;
    min-height: 1.56rem;
  }
}
