/* ═══ Home Button — Permanent Asset (do not overwrite) ═══ */

/* ── Wrapper: fixed top-left, below ticker ───────────────── */
.hm-wrap {
  position: fixed;
  top: calc(3.5rem + env(safe-area-inset-top, 0px));
  left: 1.25rem;
  z-index: 10001;
  animation: hm-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s both;
}

@keyframes hm-enter {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── Button: circle that expands to pill on hover ────────── */
.hm-btn {
  position: relative;
  height: 42px;
  width: 42px;
  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 9, 14, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    width 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: width, transform;
  animation: hm-beacon 8s ease-in-out 5s infinite;
}

/* ── Subtle beacon pulse ─────────────────────────────────── */
@keyframes hm-beacon {
  0%, 100% {
    box-shadow:
      0 2px 10px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  50% {
    box-shadow:
      0 2px 10px rgba(0, 0, 0, 0.4),
      0 0 12px rgba(251, 191, 36, 0.10),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

/* ── Hover: expand to pill ───────────────────────────────── */
.hm-btn:hover,
.hm-btn:focus-visible {
  width: 112px;
  animation: none;
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.08),
    0 0 24px rgba(251, 191, 36, 0.14),
    0 4px 16px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hm-btn:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.6);
  outline-offset: 2px;
}

.hm-btn:active {
  transform: scale(0.92);
  transition-duration: 0.1s;
}

/* ── Shimmer sweep on hover ──────────────────────────────── */
@keyframes hm-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.hm-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(251, 191, 36, 0.10) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  pointer-events: none;
  opacity: 0;
}

.hm-btn:hover::after {
  opacity: 1;
  animation: hm-shimmer 0.65s ease-in-out forwards;
}

/* ── Icon container ──────────────────────────────────────── */
.hm-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hm-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hm-btn:hover .hm-icon svg {
  transform: translateX(-2px);
}

/* ── Label text ──────────────────────────────────────────── */
.hm-label {
  padding-right: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.03em;
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.22s ease 0.18s,
    transform 0.22s ease 0.18s;
  pointer-events: none;
  user-select: none;
}

.hm-btn:hover .hm-label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .hm-wrap {
    top: calc(3rem + env(safe-area-inset-top, 0px));
    left: 0.85rem;
  }

  .hm-btn {
    height: 38px;
    width: 38px;
    border-radius: 19px;
  }

  .hm-btn:hover {
    width: 102px;
  }

  .hm-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .hm-icon svg {
    width: 14px;
    height: 14px;
  }

  .hm-label {
    font-size: 0.68rem;
    padding-right: 12px;
  }
}
