/* =========================
   Blob button (UPDATED)
   - стекло всегда, с “затуханием к краям”
   - при hover стекло исчезает (чтобы заливка canvas читалась чище)
   - canvas выше стекла
   - порядок слоёв: ::before (glass) < canvas < text < cursor
   ========================= */

.blub-wrapper {
  justify-self: end;
  position: relative;
  width: 170px;
}

.blub-button {
  position: absolute;
  top: 50%;
  right: 0;
  margin-top: -85px;

  width: 170px;
  height: 170px;

  display: inline-block;
  text-decoration: none;
  color: var(--text);
  outline: none;
  isolation: isolate;
}

.blub-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
  border-radius: 999px;
}

/* =========================
   Glass layer (always on)
   ========================= */

.blub-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;

  /* стекло */
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  -webkit-mask-image: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0) 100%
  );

  mask-image: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity var(--duration) var(--ease);
}

.blub-button:hover::before {
  opacity: 0;
}

@supports not (
  (-webkit-mask-image: radial-gradient(black, transparent)) or
    (mask-image: radial-gradient(black, transparent))
) {
  .blub-button::before {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.blub-canvas {
  position: absolute;
  top: -30px;
  left: -30px;
  width: 230px;
  height: 230px;

  display: block;
  pointer-events: none;
  z-index: 1;
}

/* =========================
   Text
   ========================= */

.btn-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  font-size: 0.66rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;

  pointer-events: none;
  width: 120px;

  z-index: 2;
}

/* =========================
   Cursor inside blob
   ========================= */

.custom-cursor {
  pointer-events: none;
  position: absolute;

  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;

  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s linear;

  z-index: 3;
}

@media (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }

  [data-cursor],
  [data-cursor] * {
    cursor: auto !important;
  }
}

@media (max-width: 990px) {
  .blub-wrapper,
  .custom-cursor {
    display: none;
  }
}
