/* Internal terminal only. The controller keeps the existing 1.3 s preparation
   and supplies the real Start button rectangle through --psi-gate-* values. */
.stage{--psi-door-width:min(78vw,1040px)}
/* Stationary PSI-angle details live at the edges, behind the original mark
   and every interactive screen. No additional animation loop is introduced. */
.stage{
  background:
    linear-gradient(105deg,transparent 0 12%,#ffffff03 12.04% 30%,transparent 30.04%),
    linear-gradient(105deg,transparent 0 75%,#ffffff05 75.04% 92%,transparent 92.04%),
    #030303;
}
.stage::before,.stage::after{
  content:'';position:absolute;width:69px;height:18px;z-index:-2;
  pointer-events:none;transform:skewX(-15deg);
  background:
    linear-gradient(#e8153dba,#e8153dba) left center/3px 100% no-repeat,
    repeating-linear-gradient(90deg,#ffffff3d 0 3px,transparent 3px 22px);
}
.stage::before{top:103px;right:5vw;background-position:right center,0 0}
.stage::after{bottom:48px;left:5vw}
.assemble{overflow:hidden}
.stage[data-scene="assemble"] #start{visibility:hidden}
.assemble::before,.assemble::after{content:'';position:absolute;left:var(--psi-gate-x,50%);top:var(--psi-gate-y,80%);pointer-events:none;transform:translate(-50%,-50%);opacity:0}
.assemble::before{width:var(--psi-gate-width,200px);height:var(--psi-gate-height,48px);background:#eeeee9}
.assemble::after{width:var(--psi-door-width);height:1px;border-block:1px solid #e8153d70}
.assemble.active::before{animation:psi-gate-open 1300ms cubic-bezier(.25,.72,.2,1) both}
.assemble.active::after{animation:psi-door-aperture 1300ms cubic-bezier(.2,.75,.25,1) both}
.assemble.active .assemble-copy h2{animation:psi-protocol-in 400ms 170ms ease-out both}
.assemble.active .assemble-copy p{animation:psi-protocol-in 400ms 270ms ease-out both}
@keyframes psi-gate-open{
  0%{width:var(--psi-gate-width,200px);height:var(--psi-gate-height,48px);background:#eeeee9;opacity:1}
  18%{width:var(--psi-gate-width,200px);height:1px;background:#eeeee9;opacity:1}
  34%{width:28px;height:1px;background:#e8153d;opacity:1}
  72%{width:var(--psi-door-width);height:1px;background:#e8153d;opacity:.9}
  88%{width:var(--psi-door-width);height:1px;background:#e8153d;opacity:.65}
  100%{width:var(--psi-door-width);height:1px;background:#e8153d;opacity:0}
}
@keyframes psi-door-aperture{
  0%,46%{height:1px;opacity:0}
  66%{height:1px;opacity:.5}
  88%{height:130px;opacity:.18}
  100%{height:174px;opacity:0}
}
@keyframes psi-protocol-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}

/* A visible hollow contact becomes solid only as its own row settles. Its
   final frame shares the controller's row duration and per-row start delay. */
.permission-list b{--psi-lock-color:#e8153d;--psi-lock-pulse:#e8153d35}
.permission-list b[data-edit="false"]{--psi-lock-color:#8a8a87;--psi-lock-pulse:#8a8a8730}
.permission-list b::before{width:6px;height:6px;border:1px solid var(--psi-lock-color);background:transparent;box-shadow:0 0 0 0 transparent}
.permission-list b[data-edit="false"]::before{background:transparent}
.identity.active .permission-list li{animation-timing-function:cubic-bezier(.19,.75,.27,1)}
.identity.active .permission-list b::before{animation:psi-permission-lock var(--permission-row-duration,620ms) linear both;animation-delay:var(--row-delay,0ms)}
@keyframes psi-permission-lock{
  0%,40%{background:transparent;box-shadow:0 0 0 0 transparent;opacity:.65}
  68%{background:var(--psi-lock-color);box-shadow:0 0 0 0 var(--psi-lock-pulse);opacity:1}
  84%{background:var(--psi-lock-color);box-shadow:0 0 0 4px var(--psi-lock-pulse);opacity:1}
  100%{background:var(--psi-lock-color);box-shadow:0 0 0 7px transparent;opacity:1}
}
/* Four compact registration corners frame the identity card. Only the upper
   right contact responds once, when the sixth row and solid mark settle. */
.identity-card::before{
  content:'';position:absolute;inset:-1px;width:auto;height:auto;pointer-events:none;
  background:
    linear-gradient(#cbcbc77a,#cbcbc77a) left top/12px 1px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) left top/1px 12px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) right top/12px 1px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) right top/1px 12px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) left bottom/12px 1px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) left bottom/1px 12px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) right bottom/12px 1px no-repeat,
    linear-gradient(#cbcbc77a,#cbcbc77a) right bottom/1px 12px no-repeat;
}
.identity-card::after{
  content:'';position:absolute;right:-1px;top:-1px;width:12px;height:12px;
  pointer-events:none;opacity:0;
  background:linear-gradient(#e8153d,#e8153d) right top/12px 1px no-repeat,
    linear-gradient(#e8153d,#e8153d) right top/1px 12px no-repeat;
}
.identity.active .identity-card::after{animation:psi-card-confirm 280ms 2826.086952ms ease-out both}
@keyframes psi-card-confirm{0%{opacity:0}24%{opacity:1}100%{opacity:.42}}
/* A single, restrained title settle keeps the original centered greeting.
   The header brand and terminal labels remain stationary throughout access. */
.welcome-copy h2{--psi-welcome-spacing-start:.035em;--psi-welcome-spacing-end:-.035em}
.welcome.active h2{animation:psi-welcome-settle 600ms cubic-bezier(.16,1,.3,1) both}
@keyframes psi-welcome-settle{
  from{opacity:0;letter-spacing:var(--psi-welcome-spacing-start);transform:scale(1.015)}
  to{opacity:1;letter-spacing:var(--psi-welcome-spacing-end);transform:scale(1)}
}
.page-paused .assemble::before,.page-paused .assemble::after,
.page-paused .assemble-copy h2,.page-paused .assemble-copy p,
.page-paused .permission-list li,.page-paused .permission-list b::before,
.page-paused .identity-card::after,
.page-paused .welcome-copy,.page-paused .welcome-copy h2,
.page-paused .psi-line-svg *{animation-play-state:paused!important}
@media(max-width:700px){
  .stage{
    --psi-door-width:calc(100% - 44px);
    background:
      linear-gradient(105deg,transparent 0 2%,#ffffff02 2.06% 13%,transparent 13.06%),
      linear-gradient(105deg,transparent 0 88%,#ffffff03 88.06% 100%),
      #030303;
  }
  .stage::before,.stage::after{width:25px;height:12px}
  .stage::before{top:73px;right:25px}
  .stage::after{bottom:16px;left:25px}
  .welcome-copy h2{--psi-welcome-spacing-start:.015em;--psi-welcome-spacing-end:-.04em}
  @keyframes psi-door-aperture{
    0%,46%{height:1px;opacity:0}
    66%{height:1px;opacity:.5}
    88%{height:72px;opacity:.18}
    100%{height:96px;opacity:0}
  }
}
@media(prefers-reduced-motion:reduce){
  .assemble::before,.assemble::after{display:none!important;animation:none!important}
  .assemble-copy h2,.assemble-copy p,.welcome.active .welcome-copy,.welcome.active h2{animation:none!important}
  .permission-list b::before,.permission-list b[data-edit="false"]::before{animation:none!important;background:var(--psi-lock-color);box-shadow:none;opacity:1}
  .identity.active .identity-card::after{animation:none!important;opacity:.42}
}
