/* ══════════════════════════════════════════════════════════════════════
   SITE TOUR — guided walkthrough of the homepage (tour.js, data/tour.json)
   Patterns: corner invite (beehiiv), spotlight + step popover (Deel, beehiiv),
   tagged tip card with arrow (Front), progress dots (HoneyBook), help button (Canva)
   ══════════════════════════════════════════════════════════════════════ */

.tour-launch {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 10000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--c-blue);
  color: #fff;
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(37, 99, 235, 0.6);
  transition: transform 0.3s var(--ease-spring), background 0.2s ease, opacity 0.3s ease;
}
.tour-launch:hover { transform: translateY(-2px) scale(1.05); background: var(--c-blue-dark); }
.tour-launch:focus-visible { outline: 2px solid var(--c-blue-light); outline-offset: 3px; }
.tour-launch[hidden] { display: none; }
.tour-active .tour-launch { opacity: 0; pointer-events: none; }

/* ── Invite (non-blocking, bottom corner) ─────────────────────────── */
.tour-invite {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: calc(clamp(1rem, 3vw, 1.75rem) + 60px);
  z-index: 10001;
  width: min(340px, calc(100vw - 2rem));
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 14px;
  background: var(--c-off-white);
  color: var(--c-black);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease-smooth), transform 0.35s var(--ease-smooth);
}
.tour-invite.is-open { opacity: 1; transform: none; }
.tour-invite-title {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  padding-right: 1.5rem;
}
.tour-invite-body { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.5; color: #444; }
.tour-invite-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

/* ── Spotlight ────────────────────────────────────────────────────── */
.tour-blocker {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: transparent;
}
.tour-spot {
  position: fixed;
  z-index: 10003;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(6, 8, 14, 0.72), 0 0 0 2px var(--c-blue-light);
  pointer-events: none;
}
/* Glide between steps only; while the visitor scrolls, the spotlight tracks the page exactly */
.tour-spot.is-moving {
  transition: top 0.45s var(--ease-smooth), left 0.45s var(--ease-smooth),
              width 0.45s var(--ease-smooth), height 0.45s var(--ease-smooth);
}

/* ── Step popover ─────────────────────────────────────────────────── */
.tour-pop {
  position: fixed;
  z-index: 10004;
  width: min(360px, calc(100vw - 2rem));
  padding: 1.25rem 1.25rem 1rem;
  border-radius: 14px;
  background: var(--c-off-white);
  color: var(--c-black);
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tour-pop.is-open { opacity: 1; }
.tour-pop:focus { outline: none; }
.tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--c-off-white);
  transform: rotate(45deg);
}
.tour-pop[data-side="bottom"] .tour-arrow { top: -7px; }
.tour-pop[data-side="top"] .tour-arrow { bottom: -7px; }
.tour-pop[data-side="none"] .tour-arrow { display: none; }

.tour-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--c-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tour-title {
  margin-top: 0.75rem;
  font-family: var(--f-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
}
.tour-body { margin-top: 0.5rem; font-size: 0.98rem; line-height: 1.55; color: #3a3a3a; }

.tour-foot { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.1rem; }
.tour-dots { display: flex; gap: 5px; flex: 1; align-items: center; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, 0.15); transition: width 0.3s var(--ease-smooth), background 0.3s ease; }
.tour-dot.is-on { width: 18px; border-radius: 3px; background: var(--c-blue); }
.tour-count { font-size: 0.8rem; color: #777; white-space: nowrap; }
.tour-btns { display: flex; gap: 0.4rem; }

.tour-btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--c-black);
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.tour-btn:hover { background: rgba(0, 0, 0, 0.05); }
.tour-btn--primary { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }
.tour-btn--primary:hover { background: var(--c-blue-dark); border-color: var(--c-blue-dark); }
.tour-btn:focus-visible, .tour-x:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

.tour-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #666;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.tour-x:hover { background: rgba(0, 0, 0, 0.06); color: var(--c-black); }

.tour-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: the popover docks to the bottom as a sheet so it never covers the highlighted part */
@media (max-width: 640px) {
  .tour-pop {
    left: 0.75rem !important;
    right: 0.75rem;
    top: auto !important;
    bottom: 0.75rem;
    width: auto;
  }
  .tour-arrow { display: none; }
  .tour-title { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-pop, .tour-invite, .tour-launch, .tour-dot { transition: none; }
}
