/* ============================================================================
   INTERACTION CUES

   The owner, 2026-10-05: "it's very hard to understand that you're supposed to
   click on things to use them. I want to make sure there's a nice, in-your-face
   'Hey, interact with this.'"

   One cue component, three tracks, each sitting ON the control it talks about
   rather than in a paragraph above it. The page's own tokens throughout: its
   type scale, its corner token, its ease, and the route's own accent through
   --ea, which each route already sets.

   A cue says what to do, shows the gesture once when its track arrives, and
   then retires for good on the visitor's first real interaction in that track.
   It never comes back and it never loops. Under reduced motion the cue is
   still there and still legible; only the movement goes.
   ========================================================================= */

.cue {
  --cue-ink: #060815;
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--corner-control);
  /* FILLED IN SW BLUE, the locked brand blue, with the page's own near-black
     as the ink. The owner, 2026-10-05: "we need to make sure we're sticking
     with the SW-approved blue and not the super neon blue."

     The colour is the brand's, and the direction of the pair is a measurement:
     WHITE on this blue is 3.14:1 and fails AA, while near-black on it is
     5.41:1 and passes. So the brand blue can carry this pill, but only with
     dark ink on it. Do not "fix" this later by switching the text to white. */
  background: var(--sw-blue);
  border: 0;
  box-shadow: 0 6px 24px rgba(6, 8, 15, 0.72), 0 0 30px rgba(var(--blue-rgb), 0.34);
  color: var(--cue-ink);
  font-weight: 650;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.004em;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}

/* THE ATTENTION RING. A soft ring breathing out of the pill while the cue is
   live, on a pseudo-element so the `animation` property on .cue itself stays
   free for the one-pass nudge. It stops the moment the cue retires, because
   the selector stops matching, and it never runs under reduced motion. */
.cue::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(var(--blue-rgb), 0.85);
  opacity: 0;
  pointer-events: none;
}
@keyframes cueRing {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}
.cue[data-cue="live"]::after { animation: cueRing 3.2s var(--ease-out) infinite; }

/* The glyph carries the verb, so it differs per track. */
.cue::before {
  content: '';
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  background: var(--cue-ink);
  -webkit-mask: var(--cue-glyph) center / contain no-repeat;
  mask: var(--cue-glyph) center / contain no-repeat;
}

/* Drag: a hand with a horizontal arrow under it. */
.cue[data-verb="drag"] {
  --cue-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M2 12h4l-2-2.5L2 12zm20 0h-4l2-2.5 2 2.5zM4.6 11.2h14.8v1.6H4.6z'/%3E%3Cpath fill='%23fff' d='M9 4.2a1.3 1.3 0 0 1 2.6 0v3h.6a1.3 1.3 0 0 1 2.6 0v.5h.5a1.3 1.3 0 0 1 2.6 0V11a5.4 5.4 0 0 1-5.4 5.4h-.8A5 5 0 0 1 7 13.1l-.9-2a1.2 1.2 0 0 1 2-1.3l.9 1V4.2z'/%3E%3C/svg%3E");
}
/* Pick: a pointing cursor on a target. */
.cue[data-verb="pick"] {
  --cue-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 2.4a9.6 9.6 0 1 0 4.2 18.2l-1-1.8A7.6 7.6 0 1 1 19.6 12h2A9.6 9.6 0 0 0 12 2.4z'/%3E%3Ccircle cx='12' cy='12' r='3.4' fill='%23fff'/%3E%3Cpath fill='%23fff' d='M15.6 13.2 22 20l-2.2.5L21 23l-1.9.9-1.2-2.6-1.6 1.6z'/%3E%3C/svg%3E");
}
/* Add: a plus in a rounded square. */
.cue[data-verb="add"] {
  --cue-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M6 2.6h12A3.4 3.4 0 0 1 21.4 6v12a3.4 3.4 0 0 1-3.4 3.4H6A3.4 3.4 0 0 1 2.6 18V6A3.4 3.4 0 0 1 6 2.6zm0 1.8A1.6 1.6 0 0 0 4.4 6v12A1.6 1.6 0 0 0 6 19.6h12a1.6 1.6 0 0 0 1.6-1.6V6A1.6 1.6 0 0 0 18 4.4z'/%3E%3Cpath fill='%23fff' d='M11.1 7.4h1.8v9.2h-1.8z'/%3E%3Cpath fill='%23fff' d='M7.4 11.1h9.2v1.8H7.4z'/%3E%3C/svg%3E");
}

/* RETIRED. The visitor has done the thing; the cue goes and does not return. */
.cue[data-cue="retired"] {
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out),
              visibility 0s linear 0.35s;
}

/* THE NUDGE. One pass when the track arrives, then still. Movement is the
   cue drawing the eye to itself, not the control moving under the pointer. */
@keyframes cueNudge {
  0%, 12%   { transform: translateX(0); }
  34%       { transform: translateX(7px); }
  56%       { transform: translateX(0); }
  78%       { transform: translateX(4px); }
  100%      { transform: translateX(0); }
}
.cue[data-nudge="1"] { animation: cueNudge 1.9s var(--ease-out) 1 both; }

/* The control the cue points at lifts once, in the same beat. */
@keyframes cueLift {
  0%, 10%  { transform: translateY(0); }
  40%      { transform: translateY(-6px); }
  70%      { transform: translateY(0); }
  100%     { transform: translateY(0); }
}
[data-cue-lift="1"] { animation: cueLift 1.9s var(--ease-out) 1 both; }

/* ---- PLACEMENT, per track ------------------------------------------- */

/* Route one. The frame is the control, so the cue sits on it, low left, clear
   of the existing "Generated concept image" credit at the foot. */
.act .cue { left: 14px; bottom: 56px; }

/* Routes two and three. These controls are button groups, not images, so the
   cue sits IN FLOW as the group's own first line rather than floating over it.
   It still reads as part of the control rather than as body copy, and nothing
   can clip it: an absolutely placed pill above a group that sits at the top of
   a panel lands outside any ancestor with overflow hidden, which is a defect
   you only see on one breakpoint. */
.cue--inline {
  /* ABSOLUTE, INSIDE the group it belongs to, sitting just above its top edge.
     It was briefly a previous sibling instead, which broke route three: .ctrl
     is a two column grid, so a sibling takes a grid cell and the nine layers
     were pushed out of the left column into the right one. A cue must not be
     able to move the thing it points at, so it is taken out of flow entirely
     and the group is the positioning context. */
  position: absolute;
  left: 0;
  top: 6px;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
}
.cue-host {
  position: relative;
  /* The group RESERVES the cue's row rather than the cue hanging above it on a
     negative offset. Hanging it cost the route two stage its heading, which the
     pill sat straight on top of. Padding keeps the cue out of flow, so it still
     cannot move a sibling, while guaranteeing it never covers anything. */
  padding-top: 60px;
}

@media (max-width: 1000px) {
  .cue { font-size: 14px; padding: 10px 14px; gap: 8px; }
  .cue::before { width: 18px; height: 18px; }
  .act .cue { bottom: 48px; }
  .cue--inline { top: 5px; }
  .cue-host { padding-top: 52px; }
}

/* ---- MAKE THE CONTROLS LOOK LIKE CONTROLS ----------------------------- */

.act [data-view] { cursor: grab; }
.act [data-view]:active { cursor: grabbing; }
.layer, .chip, .vw-tab { cursor: pointer; }

/* A visible focus ring in the route's own accent, for every control a cue
   points at. The page had focus-visible on some of these and not others. */
.act [data-view]:focus-visible,
.layer:focus-visible,
.chip:focus-visible,
.vw-tab:focus-visible,
.act-scrub:focus-visible {
  outline: 2px solid rgb(var(--ea, var(--sky-rgb)));
  outline-offset: 3px;
}

/* Hover and active, so a pointer user gets the same answer the cue gives. */
.layer:hover, .chip:hover, .vw-tab:hover {
  border-color: rgba(var(--ea, var(--sky-rgb)), 0.5);
}
.layer:active, .chip:active, .vw-tab:active { transform: translateY(1px); }

/* ---- REDUCED MOTION --------------------------------------------------- */
/* The cue stays and stays readable. Only the movement goes. Every track is
   still usable: route one has its slider, routes two and three are buttons. */
@media (prefers-reduced-motion: reduce) {
  .cue[data-nudge="1"], [data-cue-lift="1"] { animation: none; }
  .cue[data-cue="live"]::after { animation: none; opacity: 0; }
  .cue { transition: opacity 0.001s linear; }
}
body.reduced .cue[data-nudge="1"],
body.reduced [data-cue-lift="1"] { animation: none; }
body.reduced .cue[data-cue="live"]::after { animation: none; opacity: 0; }
body.reduced .cue { transition: opacity 0.001s linear; }

/* The page hid route one's own hint entirely under reduced motion, which left
   that track with no instruction at all for exactly the visitors most likely
   to need one. The cue replaces it, so it must not inherit that. */
body.reduced .cue { display: inline-flex; }

/* The card carrying the cue already had a quiet "Drag across" chip in its top
   corner. Two messages saying the same thing on one card is noise, so the
   chip stands down where the cue stands up. The other five cards keep theirs:
   every frame is draggable and the chip is the per-card reminder. */
.act.has-cue .act-hint { display: none; }
