/* ============================================================
   highlight — the one way a scene says "look here".

   Before this file every scene said it differently: the channel
   window with a 34%-opacity ripple disc, CRM with a 2px outline and
   a 1.018 scale (redefined three more times in its own file, in
   three more blues), Agents with #6366F1, Finance with #377DE5,
   Assistant with #6886F3 and a 1.055 scale, HR with the chapter's
   pink. Six blues, five ring widths, four scales.

   The mark is b2c's, in b2c's blue — which this repo already ships
   as --blue (#1E6BE8), so nothing here is a new colour. Read from
   the element outwards: a white gap, then the ring, then a pale
   plate that settles the mark back into the page.

   The white gap is not decoration. It is what lets ONE mark work on
   a white row, a grey slot and a saturated indigo booking bar alike:
   a ring laid straight onto indigo disappears into it, and a glow
   with no ring disappears with it.

   Contract, same as scene-motion.css: only opacity and transform
   animate. So ring, gap and plate are painted by one overlay
   element and its OPACITY is what moves, never its box-shadow.

   Usage:
     <u class="spot"></u>     inside the positioned target
     .target { --hl-r: 8px }  its own corner radius

   The mark sits BEHIND the target's own content (z-index: -1) so its
   fill can cover the list rules crossing the target without covering
   the text. That only works if the target is its own stacking context,
   which is what the :has() rule below guarantees — no target has to
   remember to do it.

   THE MARK NEEDS ROOM. It reaches --hl-reach outside its target, so
   a target sitting flush against an `overflow: clip` ancestor gets
   the mark sliced off at that edge. Where that happened here the
   container was given those few pixels back (see scene-channels.css)
   — the fix is room, not a smaller mark.
   ============================================================ */

:root {
  /* The colour is a token, and a target may set it. The GEOMETRY never
     changes: that is what makes this one mark rather than six. A
     status pill that already means something in its own colour keeps
     that colour and takes this shape — ringing an amber pill in indigo
     would put two claims on one object. Anything with no meaning of
     its own stays --blue, and a scene may not invent a third blue. */
  --hl-colour: var(--blue);       /* #1E6BE8, = b2c's */

  --hl-gap: 1px;                  /* clear of the element itself */
  --hl-r: 8px;                    /* the element's own radius */
  --hl-w: 2px;                    /* the white gap */
  --hl-ring: #FFFFFF;
  --hl-bleed: 3.2px;              /* the colour, just outside the gap */
  --hl-plate: 7px;                /* the pale plate, outside that */
  /* The fill inside the ring, and it is OFF by default: the mark does
     not repaint what it points at. A target opts in when it sits in a
     divided list and the mark has to lift it out as one clean plate —
     the record rows do. A target that carries its own surface colour,
     a status pill or the indigo booking bar, must not: filling it
     would erase the thing the colour was saying. */
  --hl-fill: transparent;

  /* How far the whole mark reaches past its target: gap + plate.
     Any container that clips has to leave at least this much, and it
     is a multiple of 4 because every gutter it turns into is. */
  --hl-reach: 8px;
}

:where(:has(> .spot)) { isolation: isolate; }

/* This file owns the READING mark only. The press mark (.hl, in
   properties-scene.css) was folded in here once and taken back out:
   a press is a click, and this band — white gap, ring, plate — reads
   as a STATE on a control that already has a border. The pressed tab
   looked selected, and looked deselected again when it faded. */
.spot {
  position: absolute; inset: calc(-1 * var(--hl-gap)); z-index: -1;
  border-radius: calc(var(--hl-r) + var(--hl-gap));
  pointer-events: none; opacity: 0;
  background: var(--hl-fill);
  /* The mark is an element, and scenes style bare <i>/<u> inside the
     very rows it sits in — the cleaning table's avatar disc turned it
     into a 1.5em circle. inset already gives it its size, so these
     say so out loud and refuse a scene's sizing. */
  inline-size: auto; block-size: auto; aspect-ratio: auto;
  /* The colour is mixed HERE, on the element, not in a token up at
     :root. A custom property is substituted where it is DECLARED, so a
     ready-made --hl-halo declared on :root would resolve --hl-colour
     against :root and a target setting its own colour would change
     nothing — which is exactly what happened to the grey "Not
     required" pill, which came out indigo. */
  box-shadow:
    0 0 0 var(--hl-w) var(--hl-ring),
    0 0 0 var(--hl-bleed) color-mix(in oklab, var(--hl-colour) 95%, transparent),
    0 0 0 var(--hl-plate) color-mix(in oklab, var(--hl-colour) 14%, transparent);
}

/* ONE modifier, because there is one thing the mark is ever round: a
   ROW, a chip, a number — something the size of a line of text. There
   used to be a .lift for marking a whole CARD; it was dropped, because
   the band this mark draws is absolute (2px gap, 3px ring, 7px plate)
   and on a 620px card that band is a border, not a highlight. A card
   arrives; the row inside it is what gets marked.

     .tight  the mark is round a DATUM — a number, a date, a time —
             which has no box of its own, so the mark makes its own
             room round the characters. */
.spot.tight { inset: -.2em -.35em; --hl-r: var(--r-chip); }
