/* ==========================================================================
   tour.css — the guided walkthrough chrome.

   Kept out of styles.css on purpose: the tour is scaffolding a visitor may never
   see, and it borrows the page's own tokens (--surface, --line, --accent) rather
   than inventing a second palette.

   z-index budget: the page's own overlays are 100-121, so the walkthrough sits at
   9000+ and always reads as "on top of the app", never mixed into it.
   ========================================================================== */

/* --- synthetic cursor ---------------------------------------------------- */
.tour-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9002;
  width: 24px;
  height: 24px;
  margin: -3px 0 0 -4px;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(20, 18, 15, .35));
  will-change: transform;
  transform: translate(-100px, -100px);
  transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}

.tour-cursor svg {
  display: block;
  width: 24px;
  height: 24px;
}

.tour-ripple {
  position: fixed;
  z-index: 9001;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  animation: tour-ripple .62s ease-out forwards;
}

@keyframes tour-ripple {
  to {
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    opacity: 0;
  }
}

/* --- spotlight ----------------------------------------------------------- */
/* The dimming is one enormous box-shadow: no second backdrop element to keep in
   sync with the hole, and no stacking-context surprises. */
.tour-spot {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow:
    0 0 0 9999px rgba(26, 25, 23, .45),
    0 0 0 1px rgba(31, 122, 140, .55) inset;
  transition:
    top .32s cubic-bezier(.22, .61, .36, 1),
    left .32s cubic-bezier(.22, .61, .36, 1),
    width .32s cubic-bezier(.22, .61, .36, 1),
    height .32s cubic-bezier(.22, .61, .36, 1),
    border-radius .2s;
}

.tour-spot[hidden] {
  display: none;
}

/* --- narration card ------------------------------------------------------ */
.tour-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 9001;
  width: min(660px, calc(100vw - 44px));
  transform: translateX(-50%);
  pointer-events: none;
}

.tour-dock[hidden] {
  display: none;
}

.tour-dock.at-top {
  bottom: auto;
  top: 22px;
}

.tour-card {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px 12px;
  animation: tour-in .34s cubic-bezier(.22, .61, .36, 1);
}

@keyframes tour-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.tour-dock.at-top .tour-card {
  animation-name: tour-in-down;
}

@keyframes tour-in-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.tour-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.tour-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.tour-gap {
  flex: 1;
}

.tour-x {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.tour-x:hover {
  background: var(--ink);
  color: #fff;
}

.tour-card h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -.01em;
  color: var(--ink);
}

.tour-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.tour-card b {
  color: var(--ink);
}

.tour-watch {
  margin: 9px 0 0;
  padding: 0 0 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.tour-watch[hidden] {
  display: none;
}

.tour-watch li::marker {
  color: var(--accent-2);
}

.tour-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.tour-dots {
  display: flex;
  gap: 5px;
  flex: 1;
}

.tour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background .2s, transform .2s;
}

.tour-dots i.done {
  background: #cfd9d6;
}

.tour-dots i.on {
  background: var(--accent);
  transform: scale(1.35);
}

.tour-btns {
  display: flex;
  gap: 7px;
}

.tour-btns button {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}

.tour-btns button:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
}

.tour-btns button:disabled {
  opacity: .4;
  cursor: default;
}

.tour-btns .tour-next {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tour-btns .tour-next:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Exit is the quiet one: it is the escape hatch, not the call to action. */
.tour-btns .tour-exit {
  border-color: transparent;
  color: var(--muted);
}

.tour-btns .tour-exit:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--ink-soft);
}

/* A step that is driving the page says so, rather than looking frozen. */
.tour-card.is-busy {
  opacity: .72;
  transition: opacity .18s;
}

/* --- press feedback ------------------------------------------------------ */
/* A pseudo-element ring rather than an outline: outline would be clipped by the
   overflow:hidden on cards and chips, and would shift layout on some controls. */
.tour-press {
  position: relative;
}

.tour-press::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  pointer-events: none;
  animation: tour-press .3s ease-out forwards;
}

@keyframes tour-press {
  from { opacity: .85; }
  to { opacity: 0; transform: scale(1.04); }
}

/* --- header entry point -------------------------------------------------- */
.nav-tour {
  font: inherit;
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}

.nav-tour::before {
  content: "\25b6";
  font-size: 9px;
  margin-right: 6px;
  vertical-align: 1px;
}

.nav-tour:hover {
  border-color: var(--accent);
  background: rgba(31, 122, 140, .07);
}

/* Footer entry point — the nav is hidden under 720px, so this is the phone's way in. */
.foot-tour {
  font: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.foot-tour::before {
  content: "\25b6";
  font-size: 8px;
  margin-right: 5px;
  vertical-align: 1px;
}

.foot-tour:hover {
  color: var(--accent);
}

/* --- small screens ------------------------------------------------------- */
@media (max-width: 640px) {
  .tour-dock {
    width: calc(100vw - 24px);
    bottom: 12px;
  }

  .tour-dock.at-top {
    top: 12px;
  }

  .tour-card {
    padding: 12px 14px 10px;
  }

  .tour-card h2 {
    font-size: 17.5px;
  }

  .tour-card p {
    font-size: 13px;
  }

  .tour-watch {
    display: none;
  }

  .tour-foot {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tour-dots {
    display: none;
  }

  .tour-btns {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-cursor,
  .tour-spot,
  .tour-card {
    transition: none;
    animation: none;
  }
}
