/* tour.css - "How DecompilerAI works" screenshot gallery on the homepage (#demo).
   Loaded after style.css; colours are design tokens from style.css only.
   Without JS the slides render as a plain vertical list of screenshots; tour.js
   adds .is-js and turns it into an auto-advancing, crossfading gallery. */

/* the hero "See how it works" CTA jumps here; clear the fixed top nav */
#demo { scroll-margin-top: 84px; }

.tour { position: relative; max-width: 1040px; margin: 0 auto; text-align: left; outline: 0; }
.tour_frame { position: relative; }
.tour_track { list-style: none; margin: 0; padding: 0; }
.tour_slide { margin: 0 0 18px; }

.tour_fig {
  position: relative; margin: 0;
  aspect-ratio: 2 / 1;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.tour_media { position: absolute; inset: 0; }
.tour_media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* white caption laid over the screenshot: bold step, then the title */
.tour_cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 64px clamp(18px, 3vw, 28px) 20px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .5) 45%, rgba(0, 0, 0, .85));
}
.tour_step {
  display: block; margin-bottom: 4px;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  letter-spacing: 1.6px; text-transform: uppercase; color: #fff;
}
.tour_h { margin: 0; font-size: clamp(18px, 2.2vw, 23px); line-height: 1.2; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .55); }

/* the progress bar + play button stay in the DOM for tour.js, but this gallery hides them
   (.tour_btn.tour_play beats the .tour_btn base rule on specificity) */
.tour_progress { display: none; }
.tour_btn.tour_play { display: none; }
.tour_bar { display: block; height: 0; width: 0; }

/* nav: prev / next overlaid on the frame, dots below */
.tour_btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  transition: border-color .12s ease, transform .08s ease, background .12s ease;
}
.tour_btn svg { width: 20px; height: 20px; }
.tour_btn:hover { border-color: var(--accent); }
.tour_btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tour_arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .22);
}
.tour_arrow:hover { background: var(--accent); border-color: var(--accent-soft); transform: translateY(-50%) scale(1.05); }
.tour_prev { left: 14px; }
.tour_next { right: 14px; }

.tour_nav { display: flex; justify-content: center; margin-top: 14px; }
.tour_dots { display: flex; gap: 8px; align-items: center; }
.tour_dot {
  width: 10px; height: 10px; padding: 0; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-elevated); cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.tour_dot:hover { border-color: var(--accent); }
.tour_dot.is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.25); }
.tour_dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* drag-a-file animation on the upload slide */
.tour_drag { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tour_dz {
  position: absolute; left: 12.8%; top: 27.2%; width: 73.2%; height: 22.5%;
  border: 2px dashed var(--accent-soft); border-radius: 10px; background: rgba(27, 117, 189, .08);
  animation: tour_dz 3s ease-in-out infinite;
}
@keyframes tour_dz { 0%, 100% { background: rgba(27, 117, 189, .05); } 60% { background: rgba(27, 117, 189, .16); } }
.tour_ghost {
  position: absolute; left: 72%; top: 4%; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--accent-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .5); font-size: 13px; color: var(--text); white-space: nowrap;
  animation: tour_ghost 3s ease-in-out infinite;
}
.tour_ghost svg { width: 16px; height: 16px; stroke: var(--accent-soft); fill: none; stroke-width: 1.7; }
@keyframes tour_ghost {
  0% { left: 72%; top: 4%; opacity: 0; transform: scale(.9); }
  12% { opacity: 1; }
  58% { left: 41%; top: 32%; opacity: 1; transform: scale(1); }
  70% { left: 41%; top: 35%; opacity: .85; transform: scale(.82); }
  80% { opacity: 0; }
  100% { left: 72%; top: 4%; opacity: 0; }
}
.tour_cursor { position: absolute; left: 74%; top: 9%; width: 16px; height: 16px; z-index: 3; animation: tour_cursor 3s ease-in-out infinite; }
.tour_cursor svg { width: 16px; height: 16px; fill: #fff; stroke: var(--bg-inset); stroke-width: 1; }
@keyframes tour_cursor { 0% { left: 74%; top: 9%; } 58% { left: 43%; top: 37%; } 70% { left: 43%; top: 40%; } 100% { left: 74%; top: 9%; } }

/* ---------- JS enhanced: crossfade ---------- */
.tour.is-js .tour_track { display: grid; overflow: hidden; border-radius: 12px; touch-action: pan-y; }
.tour.is-js .tour_slide {
  grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transform: translateX(24px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; pointer-events: none;
}
.tour.is-js .tour_slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .45s ease, transform .45s ease, visibility 0s; pointer-events: auto;
}
.tour.is-js .tour_media { cursor: grab; user-select: none; -webkit-user-select: none; }
.tour.is-js .tour_media img { -webkit-user-drag: none; }
.tour.is-js .tour_media.is-dragging { cursor: grabbing; }
.tour:focus-visible .tour_fig { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .tour_h { font-size: 18px; }
  .tour_cap { padding: 46px 16px 16px; }
  .tour_arrow { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour.is-js .tour_slide, .tour.is-js .tour_slide.is-active { transition: none; transform: none; }
  .tour_dz, .tour_cursor { animation: none; }
  .tour_ghost { animation: none; left: 41%; top: 32%; opacity: 1; }
  .tour_btn, .tour_dot { transition: none; }
}
