/* The guided tour (js/tour/tour.js): a dim, a ring on the part being shown,
 * and one caption bar. Brand cyan on the dark surface; no green. Only the bar
 * takes the pointer, so the page under the tour stays usable. */

.tour { position: fixed; inset: 0; z-index: 900; pointer-events: none; }

.tour-shade {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 9, 0.62);
  transition: opacity 240ms ease;
}
.tour.has-target .tour-shade { opacity: 0; }

.tour-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 16px;
  border: 2px solid var(--cyan, #3cccfc);
  box-shadow:
    0 0 0 200vmax rgba(2, 5, 9, 0.6),
    0 0 0 6px rgba(60, 204, 252, 0.14),
    0 0 36px rgba(60, 204, 252, 0.35);
  opacity: 0;
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1), width 420ms cubic-bezier(.2, .8, .2, 1),
    height 420ms cubic-bezier(.2, .8, .2, 1), opacity 240ms ease;
}
.tour.has-target .tour-ring { opacity: 1; }

.tour-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 32px));
  pointer-events: auto;
  padding: 20px 24px 18px;
  border-radius: 18px;
  border: 1px solid rgba(60, 204, 252, 0.28);
  background: linear-gradient(180deg, rgba(16, 26, 40, 0.97), rgba(8, 13, 21, 0.97));
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  color: var(--text-dim);
  font-family: var(--font-body);
  animation: tour-in 320ms cubic-bezier(.2, .8, .2, 1);
}
@keyframes tour-in { from { opacity: 0; transform: translate(-50%, 14px); } }

.tour-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(150, 190, 255, 0.08);
}
.tour-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan, #3cccfc), var(--azure, #1898fc));
}
.tour-bar.is-paused .tour-progress i { opacity: 0.35; }

.tour-count { margin: 0 0 6px; font-size: 12.5px; color: var(--text-secondary, #8595b2); }
.tour-title {
  margin: 0 36px 6px 0;
  font: 500 20px/1.3 var(--font-heading);
  letter-spacing: -0.005em;
  color: var(--text);
}
.tour-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-dim); min-height: 3.1em; }

.tour-controls, .tour-end { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tour-controls[hidden], .tour-end[hidden] { display: none; }
.tour-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(150, 190, 255, 0.18);
  background: transparent;
  color: var(--text);
  font: 500 14px/1.2 var(--font-body);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.tour-btn:hover { border-color: rgba(60, 204, 252, 0.5); background: rgba(60, 204, 252, 0.08); }
.tour-btn:disabled { opacity: 0.4; cursor: default; }
.tour-btn:focus-visible, .tour-close:focus-visible { outline: 2px solid var(--cyan, #3cccfc); outline-offset: 2px; }
.tour-btn-primary {
  margin-left: auto;
  border-color: transparent;
  background: linear-gradient(90deg, var(--cyan, #3cccfc), var(--azure, #1898fc));
  color: #031019;
}
.tour-btn-primary:hover { background: linear-gradient(90deg, #6bdcff, #3aaaff); }
.tour-end .tour-btn-primary { margin-left: 0; }

.tour-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(150, 190, 255, 0.16);
  background: transparent;
  color: var(--text-secondary, #8595b2);
  font: 400 20px/1 var(--font-body);
  cursor: pointer;
}
.tour-close:hover { color: var(--text); border-color: rgba(60, 204, 252, 0.5); }

/* While touring, the bottom of every screen can scroll clear of the bar. */
body.is-touring #main .stage { padding-bottom: 220px; }

@media (max-width: 600px) {
  .tour-bar { bottom: 12px; padding: 16px 16px 14px; }
  .tour-title { font-size: 17px; }
  .tour-text { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-ring, .tour-shade { transition: none; }
  .tour-bar { animation: none; }
}

/* The header's "How it works" button: a compact "?" where the header is
 * tight (the project line needs the room at laptop widths, the wordmark on
 * a phone). Its title still says what it does. */
@media (max-width: 1320px) {
  .hdr-actions #btn-tour { width: 34px; padding: 0; font-size: 0; justify-content: center; }
  .hdr-actions #btn-tour::before { content: "?"; font: 600 15px/1 var(--font-heading); color: var(--text-dim); }
}
