/* ============================================================
   Cortex Laboratory — entrance transition layer
   Nothing in this file renders while the page is at rest.
   ============================================================ */

/* ---------- full-viewport render surface ---------- */
.wormhole-canvas{
  display:none;
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  pointer-events:none;
  z-index:24;
  background:transparent;
}
.wormhole-canvas.active{display:block}
/* During the hold the canvas is moved inside the hero: above the picture and
   its shade, below the text (see wormhole.js, "layering"). */
.wormhole-canvas.under-content{z-index:5}

/* Visible only in the local inspection mode, for identifying recordings. */
.preview-status{
  position:fixed;left:10px;bottom:10px;z-index:40;pointer-events:none;
  padding:7px 10px;border-left:2px solid #ff149f;background:rgba(0,0,0,.82);
  color:#ffdf61;font:11px/1.4 ui-monospace,Consolas,monospace;
}
.preview-status[hidden]{display:none}

/* ---------- hold reaction ----------
   wormhole.js moves the header and hero text toward the hole with the
   individual translate/scale/opacity properties, so their own transforms and
   hover styles are untouched. They only need a compositing hint here. */
body.warping .site-header,
body.warping .hero-copy,
body.warping .hero-right,
body.warping .portal-stage,
body.warping .scroll-cue{will-change:translate,scale,opacity}

/* Once the hole covers every corner the page no longer needs painting. */
body.wormhole-occluded .site-header,
body.wormhole-occluded main,
body.wormhole-occluded .footer{visibility:hidden}
body.wormhole-occluded .portal-aura{animation-play-state:paused}

/* The old tunnel's darkening layer is unused; the hole draws its own shadow. */
#wormholeVignette{display:none}

/* ---------- destination surface (revealed through the exit aperture) ---------- */
#destinationLayer{
  position:fixed;
  inset:0;
  z-index:22;
  display:block;
  visibility:hidden;
  overflow:hidden;
  background:#04030a;
  contain:strict;
  pointer-events:none;
}
#destinationLayer.on{visibility:visible}
#destinationFrame{
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#04030a;
}
#destinationFallback{
  position:absolute;
  inset:0;
  display:none;
  place-content:center;
  text-align:center;
  color:#f5eef4;
  font:400 clamp(18px,3vw,30px)/1.5 Inter,ui-sans-serif,system-ui,sans-serif;
  background:radial-gradient(ellipse at 50% 45%,#150a1c,#04030a 70%);
}
#destinationFallback.on{display:grid}
#destinationFallback b{display:block;font-weight:500;letter-spacing:.02em}
#destinationFallback span{display:block;margin-top:10px;font-size:.55em;letter-spacing:.3em;color:#b9a6b8}

#destinationFlash{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(circle at 50% 52%,
      rgba(255,244,252,.90) 0%,
      rgba(255,183,225,.62) 16%,
      rgba(255,64,173,.34) 34%,
      rgba(180,20,110,.14) 54%,
      rgba(60,4,40,0) 74%);
}

/* A sharp arrival impulse, then a quick physical settle. */
#destinationLayer.impact{
  animation:dest-impact var(--arrival-settle,.48s) cubic-bezier(.14,.92,.28,1) both;
}
#destinationLayer.impact #destinationFlash{
  animation:dest-flash .30s cubic-bezier(.1,.8,.3,1) both;
}
@keyframes dest-impact{
  0%   {transform:translate3d(0,0,0) scale(1.10)}
  14%  {transform:translate3d(-9px,6px,0) scale(1.055)}
  30%  {transform:translate3d(7px,-4px,0) scale(1.026)}
  48%  {transform:translate3d(-4px,3px,0) scale(1.012)}
  68%  {transform:translate3d(2px,-1px,0) scale(1.004)}
  100% {transform:translate3d(0,0,0) scale(1)}
}
@keyframes dest-flash{
  0%  {opacity:.92}
  38% {opacity:.24}
  100%{opacity:0}
}

/* Letting go early plays the same hold backwards in site.js; nothing here
   adds a separate transition that could lag behind it. */
