/*!
 * hud-boot.css — NIKKENSEI dashboard motion layer · module "hud-boot" (prefix hb-)
 *
 * First-load "system boot" of the dashboard. See company/engineer/tools/dashboard-motion-contract.md.
 *
 * This sheet never selects a base element: every rule below targets nodes that hud-boot.js creates
 * for the ~2 s of the intro and removes again (an overlay layer with the wipe covers, scanning edges
 * and brackets, and the per-character cells of the text decode). The container fades, bar fills and
 * ring draw are Web Animations created in JS with `fill: backwards`, so they pre-hide without a class
 * and release the element by themselves when they end. With the script missing or failing this file
 * does nothing.
 *
 * Colours: theme tokens with the contract fallbacks; white only inside #dash-stage.
 * Translucent tints are derived with color-mix(); a browser without it gets the plain line only.
 */

/* ---------- overlay layer (wipe covers + scanning edges + lock-on brackets) ----------
   Zero-size and left at its static position (the content-box corner of #dash), so it needs no
   positioned ancestor and takes no grid cell. hud-boot.js measures it and places one .hb-box over
   every container (1px larger on each side). */
.hb-layer{position:absolute;width:0;height:0;z-index:3;pointer-events:none}
.hb-box{position:absolute;pointer-events:none;--hb-c:var(--brand,#FF52A2);--hb-r:22px;--hb-bg:transparent;
  --hb-wash:transparent;--hb-halo:transparent;--hb-e1:transparent;--hb-e2:transparent;--hb-e3:transparent;--hb-e4:transparent}
.hb-box.hb-w{--hb-c:#FFFFFF}                     /* inside the stage: white only */
@supports (color:color-mix(in srgb,red 50%,transparent)){
  .hb-box{
    --hb-wash:color-mix(in srgb,var(--hb-c) 12%,transparent);
    --hb-halo:color-mix(in srgb,var(--hb-c) 32%,transparent);
    --hb-e1:color-mix(in srgb,var(--hb-c) 30%,transparent);
    --hb-e2:color-mix(in srgb,var(--hb-c) 21%,transparent);
    --hb-e3:color-mix(in srgb,var(--hb-c) 13%,transparent);
    --hb-e4:color-mix(in srgb,var(--hb-c) 7%,transparent)}
  .hb-box.hb-w{--hb-wash:color-mix(in srgb,var(--hb-c) 17%,transparent);--hb-halo:color-mix(in srgb,var(--hb-c) 40%,transparent)}
}
.hb-clip{position:absolute;inset:0;overflow:hidden;border-radius:calc(var(--hb-r) + 1px)}

/* The cover: a plate in the backdrop colour (--hb-bg, set by JS; transparent when the backdrop is not
   a flat colour). JS slides it off with one transform; its trailing side is the wipe front. */
.hb-cover{position:absolute;inset:0;background:var(--hb-bg);will-change:transform}

/* The scanning edge rides on the cover: ::before trails the front over what is already revealed
   (soft wash, four echo lines, a thin line on the front itself), ::after is a short halo ahead of it.
   --hb-trail / --hb-echo are gradient stop lists along the scan axis: 0 = tail, 110px = the front. */
.hb-box{
  --hb-trail:transparent 0,var(--hb-wash) 94px,var(--hb-halo) 108.5px,var(--hb-c) 108.5px,var(--hb-c) 110px;
  --hb-echo:transparent 43.5px,var(--hb-e4) 43.5px,var(--hb-e4) 44.5px,transparent 44.5px,transparent 65.5px,var(--hb-e3) 65.5px,var(--hb-e3) 66.5px,transparent 66.5px,transparent 82.5px,var(--hb-e2) 82.5px,var(--hb-e2) 83.5px,transparent 83.5px,transparent 95.5px,var(--hb-e1) 95.5px,var(--hb-e1) 96.5px,transparent 96.5px}
.hb-box.hb-w{--hb-trail:transparent 0,var(--hb-wash) 90px,var(--hb-halo) 108px,var(--hb-c) 108px,var(--hb-c) 110px}   /* 2px line on the dark stage */
.hb-fx{position:absolute;inset:0;opacity:0;will-change:opacity}
.hb-fx::before,.hb-fx::after{content:'';position:absolute;pointer-events:none}
.hb-x .hb-fx::before{top:0;bottom:0;right:100%;width:110px;background-image:linear-gradient(90deg,var(--hb-trail)),linear-gradient(90deg,var(--hb-echo))}
.hb-x .hb-fx::after{top:0;bottom:0;left:0;width:20px;background-image:linear-gradient(90deg,var(--hb-halo),transparent)}
.hb-y .hb-fx::before{left:0;right:0;bottom:100%;height:110px;background-image:linear-gradient(180deg,var(--hb-trail)),linear-gradient(180deg,var(--hb-echo))}
.hb-y .hb-fx::after{left:0;right:0;top:0;height:20px;background-image:linear-gradient(180deg,var(--hb-halo),transparent)}

/* lock-on brackets: four rounded corner ticks, concentric with the card corner
   (same language as the stage's own .stage-corner marks) */
.hb-frame{position:absolute;inset:8px;border:1.5px solid var(--hb-c);border-radius:calc(var(--hb-r) - 7px);opacity:0;will-change:transform,opacity;
  -webkit-mask:linear-gradient(#fff,#fff) 0 0/19px 19px no-repeat,linear-gradient(#fff,#fff) 100% 0/19px 19px no-repeat,linear-gradient(#fff,#fff) 0 100%/19px 19px no-repeat,linear-gradient(#fff,#fff) 100% 100%/19px 19px no-repeat;
  mask:linear-gradient(#fff,#fff) 0 0/19px 19px no-repeat,linear-gradient(#fff,#fff) 100% 0/19px 19px no-repeat,linear-gradient(#fff,#fff) 0 100%/19px 19px no-repeat,linear-gradient(#fff,#fff) 100% 100%/19px 19px no-repeat}

/* ---------- text decode ----------
   A label's text node is swapped for <span class="hb-dec"> holding one .hb-c per character and is
   put back (the same node) when the intro ends. The real character stays in the flow but unpainted,
   so the label keeps its exact width; the scramble glyph is a zero-width inline-block in front of it,
   which sits on the same baseline and adds no advance (and has empty alt text: it is never read out). */
.hb-dec{--hb-glow:var(--brand,#FF52A2)}
#dash-stage .hb-dec{--hb-glow:#FFFFFF}
.hb-wd{white-space:nowrap}
.hb-c{white-space:nowrap;-webkit-text-fill-color:transparent}
.hb-c::before{content:attr(data-hb-g);content:attr(data-hb-g) / '';display:inline-block;width:0;white-space:pre;letter-spacing:0;text-indent:0;-webkit-text-fill-color:currentColor;opacity:.5;pointer-events:none}
.hb-c.hb-s{-webkit-text-fill-color:currentColor;opacity:.3}          /* punctuation: waits dimmed, never scrambles */
.hb-c.hb-ok{-webkit-text-fill-color:currentColor;opacity:1;animation:hb-lock .42s cubic-bezier(.2,.7,.2,1) both}
.hb-c.hb-s::before,.hb-c.hb-ok::before{content:none}
@supports (color:color-mix(in srgb,red 50%,transparent)){
  /* dim through the text colour instead of opacity: no extra paint layers for ~150 characters */
  .hb-c::before{opacity:1;-webkit-text-fill-color:color-mix(in srgb,currentColor 50%,transparent)}
  .hb-c.hb-s{opacity:1;-webkit-text-fill-color:color-mix(in srgb,currentColor 30%,transparent)}
  .hb-c.hb-ok{-webkit-text-fill-color:currentColor}
}
@keyframes hb-lock{
  from{text-shadow:0 0 7px var(--hb-glow)}
  to{text-shadow:0 0 0 transparent}
}

/* ---------- reduced motion: the script skips the intro; this is only a belt-and-braces reset ---------- */
@media (prefers-reduced-motion: reduce){
  .hb-layer{display:none!important}
  .hb-c{-webkit-text-fill-color:currentColor!important;opacity:1!important;animation:none!important}
  .hb-c::before{content:none!important}
}
