/* ============================================================================
   Veld — the demonstration chrome
   ----------------------------------------------------------------------------
   The cursor, captions and cards the director draws over the app on
   /demo-player.html. Deliberately not in app.css: none of this is part of the
   product, and the one thing worse than a demo page is a demo page whose styles
   leak into the thing being demonstrated.

   A FILE RATHER THAN A <style> BLOCK

   Not a preference. _headers sets style-src-elem 'self' with no inline escape,
   so a <style> block in the page would be dropped by the browser in production
   and nowhere else — the page would look right locally and arrive with no
   captions, no cards and no cursor. The same goes for the director's own
   bootstrap, which is why showcase-boot.js exists rather than a <script> block.

   What the director sets from JavaScript — the cursor transform, the spotlight
   rectangle, the progress width — are element styles, which style-src-attr
   allows. That is the same allowance the tour spotlight and the portal's
   progress bars already rely on, and the reasoning is next to the policy.
   ========================================================================== */

.sc, .sc * { box-sizing: border-box; }

/* ---------------------------------------------------------------- captions */
/* A lower third. Navy at 95% rather than solid, because a hint of the interface
   through the caption keeps the two reading as one frame. Width is capped near
   the reading measure — a caption the full width of a 1920 window scans badly. */

.sc-cap {
  position: fixed; left: 50%; bottom: 54px; transform: translate(-50%, 14px);
  z-index: 9000; max-width: 1020px; width: calc(100% - 160px);
  background: rgba(10, 37, 64, .95); color: #fff;
  border-radius: 14px; padding: 20px 30px;
  box-shadow: 0 24px 60px rgba(10, 37, 64, .34);
  opacity: 0; transition: opacity .34s ease, transform .34s ease;
  pointer-events: none;
}
.sc-cap.on { opacity: 1; transform: translate(-50%, 0); }
.sc-cap p {
  margin: 0; font: 500 25px/1.42 'Hanken Grotesk', system-ui, sans-serif;
  letter-spacing: -.012em; text-wrap: balance;
}

/* ------------------------------------------------------------------ cursor */
/* A pointer the eye can follow. The real cursor is wherever the operator left
   it and does not move when a reel clicks, so the reel brings its own. */

.sc-cursor {
  position: fixed; left: 0; top: 0; z-index: 9100; width: 0; height: 0;
  pointer-events: none;
  transition: transform .62s cubic-bezier(.22, .61, .36, 1);
}
.sc-cursor::after {
  content: ""; position: absolute; left: -9px; top: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #0a2540; border: 2.5px solid #fff;
  box-shadow: 0 3px 12px rgba(10, 37, 64, .5);
}
.sc-ring {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid #356087; opacity: 0;
}
.sc-cursor.click .sc-ring { animation: sc-ring .55s ease-out; }
@keyframes sc-ring {
  from { opacity: .9; transform: scale(1); }
  to   { opacity: 0;  transform: scale(3.6); }
}

/* The halo on what was just clicked: the difference between a video where
   things change and a video where someone changes them. */
.sc-spot {
  position: fixed; z-index: 8900; border-radius: 10px;
  border: 2px solid #356087; background: rgba(53, 96, 135, .10);
  pointer-events: none; opacity: 0;
}
.sc-spot.on { animation: sc-spot 1.1s ease-out forwards; }
@keyframes sc-spot {
  0%   { opacity: 0; transform: scale(1.06); }
  18%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ------------------------------------------------------------------- cards */

.sc-card {
  position: fixed; inset: 0; z-index: 9500;
  background: linear-gradient(160deg, #0a2540 0%, #0e3155 58%, #123a63 100%);
  display: grid; place-items: center; text-align: center;
  opacity: 0; transition: opacity .55s ease;
}
.sc-card.on { opacity: 1; }
.sc-card-in { max-width: 920px; padding: 0 48px; }
.sc-mark { width: 62px; height: 63px; margin-bottom: 26px; }
.sc-card h1 {
  margin: 0 0 14px; color: #fff;
  font: 700 clamp(40px, 5vw, 62px)/1.06 'Hanken Grotesk', system-ui, sans-serif;
  letter-spacing: -.03em;
}
.sc-card p {
  margin: 0; color: #cfe0ef;
  font: 400 clamp(19px, 2vw, 25px)/1.42 'Hanken Grotesk', system-ui, sans-serif;
  letter-spacing: -.01em; text-wrap: balance;
}
.sc-card-note {
  margin-top: 34px; color: rgba(207, 224, 239, .62);
  font: 400 15px/1.5 'Hanken Grotesk', system-ui, sans-serif;
}
/* The ready card has to be obviously a ready card, so a take never starts with
   a title slide that was actually the operator waiting. */
.sc-card.ready .sc-card-note {
  color: #8fbae3; border: 1px solid rgba(143, 186, 227, .3);
  border-radius: 999px; padding: 10px 20px; display: inline-block;
}

/* ---------------------------------------------------------------- progress */
/* Three pixels at the top edge. Enough to see the reel is running, small
   enough that it reads as part of the frame rather than as a control. */

.sc-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9600;
  background: transparent; pointer-events: none;
}
.sc-progress i {
  display: block; height: 100%; width: 0; background: #8fbae3;
  transition: width .6s ease;
}

/* --------------------------------------------------------------- operator */
/* Off camera. H toggles it. The warning line is the point of it: a step whose
   target has gone says so here instead of filming a stall. */

.sc-hud {
  position: fixed; right: 14px; bottom: 14px; z-index: 9700; width: 400px;
  max-height: 58vh; overflow: auto; background: rgba(10, 20, 32, .95);
  color: #cbd5e1; border-radius: 10px; padding: 12px 14px;
  font: 400 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.sc-hud b { color: #8fbae3; display: block; margin-bottom: 8px; }
.sc-hud ol { margin: 0; padding-left: 22px; }
.sc-hud li { color: #64748b; }
.sc-hud li.done { color: #475569; }
.sc-hud li.on { color: #fff; font-weight: 600; }
.sc-warn:not(:empty) {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(203, 213, 225, .2);
  color: #fca5a5;
}
.sc.paused .sc-hud b::after { content: "  ·  PAUSED"; color: #fbbf24; }

/* 16:9 safe area, for a window that is not exactly 1920x1080. */
.sc-guide {
  position: fixed; inset: 0; z-index: 8800; pointer-events: none;
  outline: 1px dashed rgba(10, 37, 64, .35); outline-offset: -4px;
}

/* ------------------------------------------------------------------- exit */
/* The way back to the site, for a visitor who has just watched a reel. It is
   on the ready card and after the end card, and gone while a reel is running —
   a page that is both the public demonstration and the thing a screen recorder
   is pointed at cannot carry site chrome through the middle of a take. */

.sc-exit {
  position: fixed; left: 22px; top: 18px; z-index: 9800;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(143, 186, 227, .34);
  color: #cfe0ef; text-decoration: none;
  font: 500 14.5px/1 'Hanken Grotesk', system-ui, sans-serif;
  transition: opacity .3s ease, background .18s ease, border-color .18s ease;
}
.sc-exit:hover { background: rgba(255, 255, 255, .17); border-color: rgba(143, 186, 227, .6); }
.sc-exit svg { width: 15px; height: 15px; }
body.sc-playing .sc-exit { opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------------- menu */

.sc-menu {
  position: fixed; inset: 0; z-index: 9400; overflow: auto;
  background: linear-gradient(160deg, #0a2540 0%, #0e3155 60%, #123a63 100%);
  color: #fff; padding: 64px 32px;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
}
.sc-menu-in { max-width: 980px; margin: 0 auto; }
.sc-menu h1 { font: 700 46px/1.1 inherit; letter-spacing: -.03em; margin: 0 0 10px; }
.sc-menu > .sc-menu-in > p { color: #cfe0ef; font-size: 19px; margin: 0 0 40px; max-width: 70ch; }
.sc-menu a {
  display: block; text-decoration: none; color: inherit;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(143, 186, 227, .22);
  border-radius: 14px; padding: 20px 24px; margin-bottom: 12px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.sc-menu a:hover {
  background: rgba(255, 255, 255, .1); border-color: rgba(143, 186, 227, .5);
  transform: translateY(-1px);
}
.sc-menu a b { font-size: 21px; letter-spacing: -.015em; }
.sc-menu a .len { float: right; color: #8fbae3; font-size: 15px; padding-top: 4px; }
.sc-menu a span { display: block; color: #cfe0ef; font-size: 16px; margin-top: 5px; }
.sc-menu .sc-keys {
  margin-top: 36px; color: rgba(207, 224, 239, .62); font-size: 14.5px; line-height: 1.7;
}
.sc-menu code {
  background: rgba(255, 255, 255, .09); border-radius: 5px; padding: 2px 6px;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  /* The reels are recordings — motion is the deliverable, so only the parts
     that are decoration are dropped. */
  .sc-spot.on { animation-duration: .01s; }
  .sc-cursor.click .sc-ring { animation-duration: .01s; }
}
