/* Front page upgrade (2026-12-02, preview): visual + motion add-on over the Lotus Gate.
   SWITCH: the <link> to this file and the <script src="/portal/upgrade.js"> line in portal/page.html.
   Each feature also has its own switch in FX at the top of upgrade.js. */

/* 1. title letters lock into place one by one (replaces the wipe) */
.head h1.up-split{animation:none}
.head h1.up-split .ch{display:inline-block;animation:up-ch .8s cubic-bezier(.16,1,.3,1) both;animation-delay:calc(var(--i) * 55ms + .1s)}
@keyframes up-ch{0%{opacity:0;transform:translateY(var(--y)) scaleY(1.6);clip-path:inset(0 0 100% 0)}
  60%{opacity:1}100%{opacity:1;transform:none;clip-path:inset(0 0 0 0)}}
html.intro .head h1.up-split .ch{animation-play-state:paused}

/* 2. frame: chamfered corner brackets + edge scales; markers follow the pointer */
.up-frame{position:fixed;inset:0;z-index:4;pointer-events:none;opacity:0;transition:opacity .9s .2s}
.up-frame.on{opacity:1}
.up-frame svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.up-frame .br{fill:none;stroke:#5fe9f5;stroke-width:2;stroke-linejoin:miter}
.up-frame .tk{stroke:#1f4870;stroke-width:1}
.up-frame .tk.l{stroke:#3b74a6}
.up-frame .mk{fill:var(--cyan);transition:transform .12s linear}
.up-frame .mk.p{fill:var(--pink)}
.up-frame .draw{stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset 1.1s cubic-bezier(.7,0,.2,1)}
.up-frame.on .draw{stroke-dashoffset:0}

/* 3. ring doors: segments split apart on hover, digit gets an extruded side face */
.disc .seg{transition:transform .45s cubic-bezier(.16,1,.3,1)}
.door:hover .disc .seg,.door:focus-within .disc .seg{transform:translate(var(--dx),var(--dy))}
.disc .ext path{fill:color-mix(in srgb,var(--ac) 32%,#04122a);animation:none!important;filter:none!important}
.disc .ext path.front{fill:var(--ac)}
.disc svg.num{transition:transform .45s cubic-bezier(.16,1,.3,1)}
.door:hover .disc svg.num,.door:focus-within .disc svg.num{transform:translate(-50%,-50%) scale(1.08)}
/* leaving: the ring opens outwards before the next page */
.up-leave .disc .seg{transition:transform .5s cubic-bezier(.7,0,.2,1),opacity .5s;transform:translate(calc(var(--dx) * 6),calc(var(--dy) * 6));opacity:0}
.up-leave .stage{transition:transform .55s cubic-bezier(.7,0,.2,1),opacity .55s;transform:scale(1.06);opacity:.2}
.up-leave .page{transition:opacity .4s;opacity:0}

/* 9-10. glows + micro particles canvas (upgrade.js embers) */
.stage .up-embers{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;mix-blend-mode:screen;
  -webkit-mask-image:radial-gradient(ellipse 60% 64% at 50% 50%,#000 60%,transparent 100%);mask-image:radial-gradient(ellipse 60% 64% at 50% 50%,#000 60%,transparent 100%)}

/* 4. trace: a line from the hovered door's ring to the orb */
.up-trace{position:fixed;inset:0;z-index:1;pointer-events:none;width:100%;height:100%}
.up-trace path{fill:none;stroke-width:1.6;stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset .6s cubic-bezier(.7,0,.2,1)}
.up-trace rect{opacity:0;transition:opacity .2s}
.up-trace.on path{stroke-dashoffset:0}
.up-trace.on rect{opacity:1}

/* 5. bottom links: numbered, one marker slides to the hovered link */
.links{counter-reset:up}
.links a{counter-increment:up}
.links a::before{content:counter(up,decimal-leading-zero);margin-right:10px;font:500 11px var(--data);letter-spacing:.1em;color:#5f8fbf;vertical-align:1px}
.links a:hover::before,.links a:focus-visible::before{color:var(--pink)}
.links .up-mk{position:absolute;bottom:2px;height:2px;left:0;width:0;background:var(--cyan);opacity:0;
  transition:transform .3s cubic-bezier(.2,.9,.1,1),width .3s cubic-bezier(.2,.9,.1,1),opacity .2s;pointer-events:none}

@media (max-width:760px){
  .up-frame,.up-trace,.links .up-mk{display:none}
  .links a::before{display:none}
}
@media (prefers-reduced-motion:reduce){
  .head h1.up-split .ch{animation:none}
  .disc .seg,.disc svg.num,.up-frame,.up-frame .draw,.up-trace path,.links .up-mk{transition:none}
}
