/*  walkthrough.css — "Explain this Page" live-tour chrome.
    Injected by static/js/walkthrough.js. The page itself stays untouched;
    everything here is overlay: dim layer, spotlight ring, synthetic cursor,
    caption HUD with transport controls.  */

#wt-root { display: none; }
body.wt-active #wt-root { display: block; }

/* Auto-mounted "Explain this Page" launcher — injected by walkthrough.js on
   pages that have a minted script but no hand-wired in-context button. Sits
   bottom-right, out of the way; hidden while a show is running. */
#wt-launch {
  position: fixed; z-index: 8000;
  right: 20px; bottom: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600;
  color: #e8ecf6;
  background: rgba(12, 16, 28, .92);
  border: 1px solid rgba(99, 132, 255, .45);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
#wt-launch:hover {
  background: rgba(99, 132, 255, .25);
  border-color: rgba(99, 132, 255, .8);
}
#wt-launch:active { transform: translateY(1px); }
body.wt-active #wt-launch { display: none; }

/* Dim layer — sits over the page but under the spotlight ring + HUD.
   pointer-events on so the operator can't click through mid-show
   (transport buttons remain clickable above it). */
#wt-dim {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(5, 8, 16, 0);
  transition: background .5s ease;
  pointer-events: auto;
}
body.wt-active #wt-dim { background: rgba(5, 8, 16, .38); }
/* While spotlighting, the ring's 100vmax box-shadow IS the dim — the flat
   dim layer goes transparent so the punched-out element shows through. */
body.wt-active.wt-spotting #wt-dim { background: transparent; }

/* Spotlight ring — positioned over the live element every frame.
   The huge box-shadow punches a visual "hole" through the dim. */
#wt-spot {
  position: fixed; z-index: 9001;
  border: 2px solid rgba(99, 132, 255, .95);
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(5, 8, 16, .55), 0 0 28px rgba(99, 132, 255, .55);
  opacity: 0;
  transition: left .35s cubic-bezier(.2,.7,.2,1), top .35s cubic-bezier(.2,.7,.2,1),
              width .35s cubic-bezier(.2,.7,.2,1), height .35s cubic-bezier(.2,.7,.2,1),
              opacity .3s ease;
  pointer-events: none;
}
#wt-spot.on { opacity: 1; }

/* Synthetic cursor */
#wt-cursor {
  position: fixed; z-index: 9005;
  width: 18px; height: 18px;
  margin: -3px 0 0 -3px;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  background:
    linear-gradient(135deg, #fff 0%, #fff 45%, transparent 46%) no-repeat,
    rgba(99, 132, 255, .9);
  clip-path: polygon(0 0, 100% 38%, 55% 55%, 38% 100%);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
#wt-cursor.on { opacity: 1; }

.wt-click-ring {
  position: fixed; z-index: 9004;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(99, 132, 255, .9);
  border-radius: 50%;
  opacity: .9;
  pointer-events: none;
  transition: transform .6s ease, opacity .6s ease;
}
.wt-click-ring.on { transform: scale(4.2); opacity: 0; }

/* HUD — caption + transport, bottom-center */
#wt-hud {
  position: fixed; z-index: 9010;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 40px));
  background: rgba(12, 16, 28, .92);
  border: 1px solid rgba(99, 132, 255, .35);
  border-radius: 14px;
  padding: 12px 16px 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  font-family: 'Inter', system-ui, sans-serif;
  color: #e8ecf6;
}
#wt-hud-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #9aa7c7; margin-bottom: 6px;
}
#wt-hud-act { font-family: 'JetBrains Mono', monospace; }
#wt-caption {
  font-size: 14px; line-height: 1.55;
  min-height: 22px; max-height: 110px; overflow-y: auto;
  opacity: 0; transition: opacity .35s ease;
}
#wt-caption.on { opacity: 1; }

#wt-hud-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
#wt-segments { display: flex; gap: 4px; flex: 1; height: 6px; }
.wt-seg {
  position: relative; border: none; padding: 0; height: 6px;
  background: rgba(255,255,255,.14); border-radius: 3px;
  cursor: pointer; overflow: hidden;
}
.wt-seg span {
  display: block; height: 100%; width: 0%;
  background: rgba(99, 132, 255, .95); border-radius: 3px;
}
.wt-seg.active { outline: 1px solid rgba(99, 132, 255, .5); }

#wt-buttons { display: flex; gap: 6px; }
#wt-buttons button {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #e8ecf6; border-radius: 8px;
  font-size: 12px; padding: 4px 10px; cursor: pointer;
  transition: background .15s ease;
}
#wt-buttons button:hover { background: rgba(99, 132, 255, .25); }
#wt-exit { font-weight: 600; }
