/* ============================================================
   GHOSTHUNTER — fx-descent
   The Descent: canvas veil, page-over-map overlap, HUD close-out,
   the "Assessment complete" note, and the grid that continues off
   the plan onto the ticker and #services.
   Tokens come from index.html's :root; --ease-out-expo is declared
   by fx-grammar.css (loaded first) and falls back to --ease-out,
   which is the same curve.
   ============================================================ */

/* ---------- canvas veil: compositor-only fade of the GL layer ----------
   --veil is written on .cinema-sticky by fx-descent.js (0 as the ticker
   enters the pinned canvas, 1 once the ticker/#services cover it — real
   scroll, not p); #gl inherits it. No extra fullscreen element. */
#gl{opacity:calc(1 - var(--veil,0))}

/* ---------- overlap: the page slides over the plan for the last 30vh ----------
   offsetHeight (and therefore cinemaRange / p) is unchanged by a negative
   margin; the ticker enters the viewport at p≈.942 while the canvas is
   still pinned. Disabled under html.no-gl (fx-print collapses the cinema
   there). The fixed .vignette at z-index 2 still sits above both. */
html:not(.no-gl) .cinema{position:relative;z-index:0;margin-bottom:-30vh}
.ticker,.section,.manifesto,.reserve,footer{position:relative;z-index:1}

/* ---------- HUD close-out ---------- */
.hud .corner{
  transition:transform .8s var(--ease-out-expo, var(--ease-out)),opacity .8s;
}
.hud.release .corner{opacity:0}
.hud.release .c-tl{transform:translate(-22px,-22px)}
.hud.release .c-tr{transform:translate(22px,-22px)}
.hud.release .c-bl{transform:translate(-22px,22px)}
.hud.release .c-br{transform:translate(22px,22px)}
.hud.release .ro-br{visibility:hidden}

/* "Assessment complete" — inserted by fx-descent.js, styled like .ro-br.
   The red rule beneath it is the one permitted accent in the close-out. */
.hud .ro-done{bottom:38px;right:62px;visibility:hidden}
.hud .ro-done::after{
  content:"";position:absolute;left:0;right:0;bottom:-6px;height:1px;
  background:var(--threat);
  transform:scaleX(0);transform-origin:right;
  transition:transform .5s var(--ease-out-expo, var(--ease-out)) .15s;
}
.hud.release .ro-done{visibility:visible}
.hud.release .ro-done::after{transform:scaleX(1)}
@media (min-width: 761px) and (max-width: 1020px) and (orientation: portrait){
  .hud .ro-done{right:26px;bottom:60px}
}
@media (max-width: 760px){
  .hud .ro-done{right:26px;bottom:60px}
}

/* ---------- grid continuation ----------
   .75-unit gridMat cells are ≈17.5vh at the plan camera; this is a rhyme
   with the perspective grid, not a registration. Fades out over 60vh. */
.ticker::before,#services::before{
  content:"";position:absolute;left:0;right:0;top:0;height:60vh;
  pointer-events:none;z-index:0;
  --cell:clamp(110px,17.5vh,190px);
  background:
    linear-gradient(var(--border) 1px,transparent 1px) 0 0/var(--cell) var(--cell),
    linear-gradient(90deg,var(--border) 1px,transparent 1px) 0 0/var(--cell) var(--cell);
  opacity:.35;
  -webkit-mask-image:linear-gradient(#000,transparent);
  mask-image:linear-gradient(#000,transparent);
}
.ticker-track,#services .shell{position:relative;z-index:1}
