/* -----------------------------------------------------------------------------
   Guided demo tour (shared/_demo_tour, demo_tour_controller.js)

   A recorded clip framed as product, not as a video embed: no native chrome,
   annotations pinned to the pixel the cursor acted on, and a small overlay of
   back / restart / next that pops up only while the pointer is over the frame.
   ----------------------------------------------------------------------------- */

.demo-browser {
  margin: 0 auto 2rem;
  border: 1px solid var(--raad-hairline, rgba(255, 255, 255, 0.09));
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.demo-browser__chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--raad-hairline, rgba(255, 255, 255, 0.09));
  background: rgba(255, 255, 255, 0.03);
}

.demo-browser__dots {
  display: flex;
  gap: 6px;
}

.demo-browser__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--raad-hairline-strong, rgba(255, 255, 255, 0.16));
}

.demo-browser__title {
  font-family: var(--raad-font-mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--raad-text-dim, rgba(223, 231, 236, 0.55));
}

.demo-browser__content img {
  display: block;
  width: 100%;
  height: auto;
}

.demo-tour__stage {
  position: relative;
  line-height: 0;
  background: #000;
}

.demo-tour__video {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
}

/* The clip is the interface — never show the browser's own transport. */
.demo-tour__video::-webkit-media-controls,
.demo-tour__video::-webkit-media-controls-enclosure,
.demo-tour__video::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none;
}

/* --- annotations --- */

.demo-tour__note {
  position: absolute;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
}

.demo-tour__pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--raad-orange, #fa4605);
  box-shadow: 0 0 0 3px rgba(250, 70, 5, 0.22), 0 0 12px rgba(250, 70, 5, 0.5);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 140ms ease, transform 180ms cubic-bezier(0.2, 0.9, 0.25, 1.4);
}

.demo-tour__card {
  position: absolute;
  width: max-content;
  max-width: min(20rem, 42vw);
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(6, 18, 16, 0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  line-height: 1.35;
  opacity: 0;
  /* Resting state is 8px UP: the note drops down as it leaves. */
  transform: translateY(-8px) scale(0.97);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.demo-tour__card-title {
  margin: 0;
  font-family: var(--raad-font-display, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
}

.demo-tour__card-body {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--raad-text-dim, rgba(223, 231, 236, 0.55));
}

/* placement: vertical */
.demo-tour__note--above-center .demo-tour__card,
.demo-tour__note--above-start .demo-tour__card,
.demo-tour__note--above-end .demo-tour__card { bottom: 18px; }

.demo-tour__note--below-center .demo-tour__card,
.demo-tour__note--below-start .demo-tour__card,
.demo-tour__note--below-end .demo-tour__card { top: 18px; }

/* placement: horizontal */
.demo-tour__note--above-center .demo-tour__card,
.demo-tour__note--below-center .demo-tour__card { left: 50%; translate: -50% 0; }

.demo-tour__note--above-start .demo-tour__card,
.demo-tour__note--below-start .demo-tour__card { left: -8px; }

.demo-tour__note--above-end .demo-tour__card,
.demo-tour__note--below-end .demo-tour__card { right: -8px; }

.demo-tour__note.is-visible .demo-tour__pin {
  opacity: 1;
  transform: scale(1);
}

.demo-tour__note.is-visible .demo-tour__card {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease-out, transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Crisp exit: fall away and go, faster than it arrived. */
.demo-tour__note.is-leaving .demo-tour__pin {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease-in, transform 160ms ease-in;
}

.demo-tour__note.is-leaving .demo-tour__card {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 150ms ease-in, transform 190ms cubic-bezier(0.4, 0, 1, 1);
}

/* --- controls --- */

.demo-tour__controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(6, 18, 16, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  line-height: 1;
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
  transition: opacity 160ms ease-out, translate 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-tour.is-awake .demo-tour__controls,
.demo-tour__stage:focus-within .demo-tour__controls {
  opacity: 1;
  translate: -50% 0;
  pointer-events: auto;
}

.demo-tour__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--raad-text, #dfe7ec);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.demo-tour__button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.demo-tour__button:disabled {
  opacity: 0.3;
  cursor: default;
}

.demo-tour__button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-tour__counter {
  padding: 0 0.35rem;
  font-family: var(--raad-font-mono, ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 0.68rem;
  color: var(--raad-text-faint, rgba(223, 231, 236, 0.34));
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .demo-tour__card,
  .demo-tour__pin,
  .demo-tour__controls { transition-duration: 1ms; }
}

@media (max-width: 640px) {
  .demo-tour__card { max-width: 60vw; padding: 0.4rem 0.55rem; }
  .demo-tour__card-title { font-size: 0.74rem; }
  .demo-tour__card-body { font-size: 0.68rem; }
  .demo-tour__controls { opacity: 1; translate: -50% 0; pointer-events: auto; }
}
