/* The zero-floor lift waits, responds, then opens. No flying panels or 3D rotation. */
.threshold-scene{position:fixed;inset:0;z-index:40;visibility:hidden;pointer-events:none;opacity:0;background:radial-gradient(ellipse at var(--door-x,70%) var(--door-y,50%),#080a0d11,#080a0d66)}
.key-opening .threshold-scene{visibility:visible;pointer-events:auto;animation:threshold-presence 4.25s ease both}
.threshold-shell{position:absolute;left:var(--door-x,70%);top:var(--door-y,50%);width:min(240px,68vw);height:min(360px,50svh);transform:translate(-50%,-50%);border:1px solid #a8895270;background:#07090c;box-shadow:0 0 30px #080a0d80;isolation:isolate;overflow:hidden;mask-image:linear-gradient(transparent,#000 5%,#000 96%,transparent)}
.threshold-shell:before{content:'';position:absolute;inset:6px;border:1px solid #c4a16a26;z-index:3;pointer-events:none}
.threshold-floor{position:absolute;top:12px;left:50%;transform:translateX(-50%);z-index:4;width:30px;height:30px;display:grid;place-items:center;background:#0b0c0e;color:#d7bd86;font:20px/1 monospace;opacity:0;letter-spacing:0;text-shadow:0 0 13px #d8ae5a33}
.key-opening .threshold-floor{animation:zero-awakes .9s ease .45s both}
.threshold-interior{position:absolute;inset:6px;background:radial-gradient(ellipse at 50% 90%,#a17b3422,transparent 75%),linear-gradient(#050609,#0b0e13)}
.threshold-interior:after{content:'';position:absolute;left:49.8%;top:22%;bottom:0;width:1px;background:linear-gradient(transparent,#cab07b14)}
.threshold-leaf{position:absolute;top:6px;bottom:6px;width:calc(50% - 6px);background:linear-gradient(90deg,#1c1913,#101115 72%,#211c12);border:0;overflow:hidden;will-change:transform}
.threshold-leaf:before{content:'';position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0 5px,#c5a56b04 5px 6px);opacity:.6}
.threshold-left{left:6px;border-right:1px solid #cfb16e44}.threshold-right{right:6px;border-left:1px solid #cfb16e44;background:linear-gradient(90deg,#211c12,#101115 28%,#1c1913)}
.key-opening .threshold-left{animation:lift-left 1.35s cubic-bezier(.35,0,.25,1) 1.15s both}.key-opening .threshold-right{animation:lift-right 1.35s cubic-bezier(.35,0,.25,1) 1.15s both}
.threshold-sill{position:absolute;bottom:6px;left:6px;right:6px;height:1px;background:#b99b5e44}
.key-opening #return-diamond{opacity:.15;transition:opacity .65s}.key-opening #return-diamond .key-seam{display:none}.key-opening .entry-choice:last-child p{opacity:.45;transition:opacity .7s}
#login-view:not([hidden]){animation:threshold-return .65s ease both}
@keyframes threshold-presence{0%{opacity:0}18%,87%{opacity:1}100%{opacity:0}}@keyframes zero-awakes{0%{opacity:0;filter:blur(2px)}100%{opacity:1;filter:blur(0)}}@keyframes lift-left{0%,12%{transform:translateX(0)}100%{transform:translateX(-96%)}}@keyframes lift-right{0%,12%{transform:translateX(0)}100%{transform:translateX(96%)}}@keyframes threshold-return{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.threshold-scene{display:none}#login-view:not([hidden]){animation:none}}

/* The entrance card itself is the lift threshold. */
.panel{position:relative}.threshold-scene{position:absolute;inset:0;border-radius:inherit;overflow:hidden;background:transparent;z-index:5}.threshold-shell{inset:0;left:0;top:0;width:100%;height:100%;transform:none;border:0;box-shadow:none;mask-image:none}.threshold-shell:before{inset:0;border-color:#a8895244}.threshold-leaf{top:0;bottom:0;width:50%}.threshold-left{left:0}.threshold-right{right:0}.threshold-floor{top:16px}.threshold-sill{left:0;right:0;bottom:0}
/* Restrained material and depth, drawn from the novel's aged brass lift. */
.threshold-shell{background:#06080b;box-shadow:inset 0 0 36px #0008}
.threshold-shell:before{border-color:#a88c592e;box-shadow:inset 1px 0 #efd79b11,inset -1px 0 #efd79b11}
.threshold-leaf{background-image:url('./zero-brass-v2-damaged.png');background-size:200% 100%;background-repeat:no-repeat;filter:brightness(.5) saturate(.62);border-color:#d2bc7a33}
.threshold-left{background-position:0 0}.threshold-right{background-position:100% 0}
.threshold-leaf:before{background:linear-gradient(180deg,#0002,transparent 25%,transparent 75%,#0007);opacity:1}
.threshold-floor{top:14px;width:48px;height:32px;font:24px/1 "ZCOOL XiaoWei",serif;border:1px solid #bca16c38;border-radius:2px;background:linear-gradient(135deg,#1b1a16,#0a0b0c 70%);box-shadow:inset 0 1px #e8d6ad0c,0 2px 8px #0006;color:#e4cf9f;text-shadow:0 0 9px #dfbc6644}
.threshold-floor:before,.threshold-floor:after{content:'';position:absolute;top:14px;width:2px;height:2px;border-radius:50%;background:#c4b18766}.threshold-floor:before{left:4px}.threshold-floor:after{right:4px}
.threshold-interior{background:radial-gradient(ellipse at 50% 12%,#ccc0a30c,transparent 50%),linear-gradient(90deg,#080a0d,#0d1014 25%,#050608 50%,#0d1014 75%,#080a0d)}
.threshold-interior:before{content:'';position:absolute;left:10%;right:10%;top:50%;bottom:0;clip-path:polygon(42% 0,58% 0,100% 100%,0 100%);background:linear-gradient(transparent,#7f765a0a 65%,#a69a6b14)}
.threshold-interior:after{left:37%;right:37%;top:25%;bottom:43%;width:auto;border:1px solid #bfb59d0c;border-bottom:0;background:linear-gradient(#bfb59d05,transparent);mask-image:linear-gradient(#000,transparent)}
.threshold-sill{background:linear-gradient(90deg,transparent,#d9c28b44,transparent);height:1px}

/* The cabin remains visible after the lift has opened. */
.threshold-interior{inset:0;background:url('./zero-lift-interior-v1.png') center/cover no-repeat}
.threshold-interior:before{inset:0;clip-path:none;background:linear-gradient(#0001,#0000 40%,#0003)}
.threshold-interior:after{display:none}
/* Six warm segments and an unlit middle bar: an old lift display, not a typeface. */
.threshold-floor{top:12px;width:62px;height:42px;background:linear-gradient(145deg,#191915,#090a09 65%);border-color:#8c784b66;box-shadow:inset 0 1px 3px #000,0 2px 5px #0008}
.threshold-floor:before,.threshold-floor:after{top:19px}
.lift-digit{position:relative;display:block;width:16px;height:26px;transform:skew(-3deg)}
.seg{position:absolute;display:block;background:#edaf50;box-shadow:0 0 4px #eea43a88,0 0 9px #e89a2833}
.seg-a,.seg-d,.seg-g{left:3px;width:10px;height:3px;clip-path:polygon(18% 0,82% 0,100% 50%,82% 100%,18% 100%,0 50%)}
.seg-a{top:0}.seg-d{bottom:0}.seg-g{top:11.5px;opacity:.09;box-shadow:none}
.seg-b,.seg-c,.seg-e,.seg-f{width:3px;height:10px;clip-path:polygon(50% 0,100% 18%,100% 82%,50% 100%,0 82%,0 18%)}
.seg-b{right:0;top:2px}.seg-c{right:0;bottom:2px}.seg-e{left:0;bottom:2px}.seg-f{left:0;top:2px}

.threshold-floor{top:10px;width:42px;height:29px}.threshold-floor:before,.threshold-floor:after{top:13px}.lift-digit{transform:scale(.7) skew(-3deg)}
