/* ═══════════════════════════════════════════════════════════════
   KMS Brand Title Hover Tooltip — KelvinKMS.com → 凱爾文世界
   Desktop mouse hover only (@media hover: hover)
   ═══════════════════════════════════════════════════════════════ */

/* 1. 基礎樣式 */
.kms-brand-hover-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  text-align: center;
}

.kms-brand-hover-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 36px);
  transform: translateX(-50%) translateY(8px) scale(0.96);
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 36px;
  border-radius: 28px;
  background: linear-gradient(
    145deg,
    rgba(12, 28, 48, 0.88),
    rgba(8, 52, 72, 0.82)
  );
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(0, 210, 255, 0.35);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 210, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #e8f8ff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.28s;
}

.kms-brand-hover-tip__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(0, 234, 211, 0.18),
    transparent 70%
  );
  pointer-events: none;
}

.kms-brand-hover-tip__star {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-size: 26px;
  line-height: 1;
  color: #ffe978;
  text-shadow:
    0 0 8px rgba(255, 230, 120, 0.9),
    0 0 18px rgba(0, 234, 211, 0.65);
  filter: drop-shadow(0 0 6px rgba(255, 215, 80, 0.75));
  animation: kms-brand-star-twinkle 1.5s ease-in-out infinite;
}

.kms-brand-hover-tip__star--right {
  animation-delay: 0.75s;
}

@keyframes kms-brand-star-twinkle {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.88) rotate(0deg);
    filter: drop-shadow(0 0 4px rgba(255, 230, 120, 0.45));
  }

  50% {
    opacity: 1;
    transform: scale(1.2) rotate(12deg);
    filter:
      drop-shadow(0 0 10px rgba(255, 248, 180, 1))
      drop-shadow(0 0 22px rgba(0, 234, 211, 0.85));
  }
}

.kms-brand-hover-tip__text {
  position: relative;
  z-index: 1;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 210, 255, 0.35);
  font-family: var(--kms-font-kai, "KaiTi", "STKaiti", serif);
}

/* 2. 布局樣式 — 上方箭頭 */
.kms-brand-hover-tip::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 24px;
  height: 24px;
  background: linear-gradient(
    135deg,
    rgba(12, 28, 48, 0.92),
    rgba(8, 52, 72, 0.88)
  );
  border-top: 1px solid rgba(0, 210, 255, 0.35);
  border-left: 1px solid rgba(0, 210, 255, 0.35);
  box-shadow: -2px -2px 6px rgba(0, 210, 255, 0.08);
}

.hero-header {
  text-align: center;
  position: relative;
  overflow: visible !important;
}

/* 3. 交互樣式 — 僅精準指標裝置 */
@media (hover: hover) and (pointer: fine) {
  .hero-header:has(.kms-brand-hover-wrap:hover) {
    z-index: 10050;
  }

  .kms-brand-hover-trigger {
    cursor: default;
    transition: filter 0.25s ease;
  }

  .kms-brand-hover-wrap:hover .kms-brand-hover-tip,
  .kms-brand-hover-wrap:focus-within .kms-brand-hover-tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  .kms-brand-hover-wrap:hover .kms-brand-hover-trigger,
  .kms-brand-hover-wrap:focus-within .kms-brand-hover-trigger {
    filter:
      drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.7))
      drop-shadow(0 4px 12px rgba(0, 234, 211, 0.65));
  }
}

/* 4. 響應式樣式 — 桌面版啟用；手機/觸控隱藏 */
@media screen and (min-width: 769px) {
  .kms-brand-hover-tip {
    min-width: 280px;
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .kms-brand-hover-tip {
    display: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .kms-brand-hover-tip {
    display: none !important;
  }
}
