/* The entrance: a short brand reveal over the home page, once per session.
   entrance.js decides whether it plays and adds html.wge-on before first paint; the page renders underneath the whole time.
   Failsafe: if the script never builds the overlay, the cover lifts by itself after 3.4 s. */
html.wge-on body::after{content:"";position:fixed;inset:0;z-index:2147483646;background:#010c06;pointer-events:none;animation:wge-lift .45s ease 3.4s forwards}
html.wge-built body::after{display:none}
@keyframes wge-lift{to{opacity:0;visibility:hidden}}

.wge{position:fixed;inset:0;z-index:2147483647;color:#eef4f0;display:grid;place-items:center;overflow:hidden;
  cursor:pointer;-webkit-tap-highlight-color:transparent;font-family:"Instrument Sans",system-ui,sans-serif}
/* the gate: the dark field is two leaves that part from the middle when it opens (transforms only: an animated
   full-screen mask crashed WebKit) */
.wge__leaf{position:absolute;top:0;bottom:0;width:50.5%;background:#010c06}
.wge__leaf--l{left:0}.wge__leaf--r{right:0}
.wge canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.wge__glow{position:absolute;inset:0;background:radial-gradient(60% 50% at 50% 46%,rgba(18,216,132,.16),transparent 70%);opacity:0}
.wge__seam{position:absolute;top:0;bottom:0;left:50%;width:2px;margin-left:-1px;background:linear-gradient(180deg,transparent,#A8F5D6 30%,#12D884 50%,#A8F5D6 70%,transparent);
  box-shadow:0 0 24px 4px rgba(18,216,132,.55);opacity:0;transform:scaleY(0)}
.wge__set{position:relative;display:flex;flex-direction:column;align-items:center;gap:18px;pointer-events:none}
.wge__mk{width:clamp(76px,11vw,128px);height:auto;overflow:visible}
.wge__mk .m1{fill:#12D884}.wge__mk .m2{fill:#A8F5D6}
.wge__word{font-weight:600;font-size:clamp(28px,4.4vw,48px);letter-spacing:-.02em;line-height:1;white-space:nowrap}
.wge__word span{display:inline-block;opacity:0}
.wge__rule{width:clamp(80px,12vw,140px);height:2px;background:linear-gradient(90deg,transparent,#12D884,transparent);transform:scaleX(0)}
.wge__skip{position:absolute;right:18px;bottom:18px;font:500 12px/1 "Instrument Sans",system-ui,sans-serif;
  letter-spacing:.14em;text-transform:uppercase;color:rgba(204,251,234,.55);background:none;border:0;padding:14px 12px;cursor:pointer;opacity:0;animation:wge-in .4s ease .5s forwards}
.wge__skip:focus-visible{outline:2px solid #12D884;outline-offset:2px;color:#eef4f0}

/* variant: logo set. The mark's outer leaves close in from the sides, the inner pair rises, the name is set letter by letter */
.wge--logo .m1a{animation:wge-from-l .9s cubic-bezier(.2,.8,.2,1) .15s both}
.wge--logo .m1b{animation:wge-from-r .9s cubic-bezier(.2,.8,.2,1) .15s both}
.wge--logo .m2{animation:wge-rise .8s cubic-bezier(.2,.8,.2,1) .45s both}
.wge--logo .wge__glow{animation:wge-in 1.2s ease .2s forwards}
.wge--logo .wge__word span{animation:wge-letter .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(.6s + var(--i) * 40ms)}
.wge--logo .wge__rule{animation:wge-rule .6s cubic-bezier(.2,.8,.2,1) .95s forwards}

/* variant: canary moment. The canvas carries the glass canary and the snow; the name arrives under it */
.wge--canary .wge__set{position:absolute;left:0;right:0;bottom:clamp(64px,13vh,140px);gap:12px}
.wge--canary .wge__mk{width:clamp(44px,5vw,60px)}
.wge--canary .wge__mk,.wge--canary .wge__rule{opacity:0}
.wge--canary .wge__mk{animation:wge-up .7s cubic-bezier(.2,.8,.2,1) .85s forwards}
.wge--canary .wge__word{font-size:clamp(24px,3.4vw,38px)}
.wge--canary .wge__word span{animation:wge-letter .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(.95s + var(--i) * 40ms)}
.wge--canary .wge__rule{animation:wge-rule .6s cubic-bezier(.2,.8,.2,1) 1.1s forwards}

.wge__pic{position:absolute;left:50%;top:41%;width:max(80vw,160vh);aspect-ratio:16/9;opacity:0;transform:translate(-53%,-47%) scale(1.08);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent),linear-gradient(180deg,transparent,#000 22%,#000 72%,transparent);
  -webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,transparent,#000 14%,#000 86%,transparent),linear-gradient(180deg,transparent,#000 22%,#000 72%,transparent);mask-composite:intersect}
.wge__pic img{display:block;width:100%;height:100%}
.wge__glint{position:absolute;left:30%;top:20%;width:28%;aspect-ratio:1;border-radius:50%;background:radial-gradient(closest-side,rgba(200,255,232,.9),rgba(200,255,232,0));mix-blend-mode:overlay;opacity:0}
.wge__pic.is-in{animation:wge-in .9s ease-out forwards,wge-push 2.4s cubic-bezier(.2,.7,.2,1) forwards}
.wge__pic.is-in .wge__glint{animation:wge-glint .8s ease-in-out .75s forwards}
@media (max-aspect-ratio:1/1){.wge__pic{width:145vw}}

/* leaving: the seam lights, what is on screen dims, then the leaves part onto the page */
.wge.is-open .wge__seam{animation:wge-seam .3s ease-out forwards,wge-out .35s ease .45s forwards}
.wge.is-open:not(.wge--gate):not(.wge--vault)>:not(.wge__leaf):not(.wge__seam){transition:opacity .3s ease;opacity:0}
.wge.is-open .wge__pic.is-in{animation:wge-pic-out .3s ease forwards}   /* its own animations would hold it lit */
.wge.is-open .wge__glow{animation:wge-glow-out .3s ease forwards}
.wge.is-open .wge__leaf--l{animation:wge-leaf-l .75s cubic-bezier(.7,0,.25,1) .25s forwards}
.wge.is-open .wge__leaf--r{animation:wge-leaf-r .75s cubic-bezier(.7,0,.25,1) .25s forwards}
.wge.is-skip{transition:opacity .25s ease;opacity:0}
.wge.is-skip *{animation-play-state:paused}

@keyframes wge-in{to{opacity:1}}
@keyframes wge-up{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes wge-from-l{from{opacity:0;transform:translateX(-60px)}to{opacity:1;transform:none}}
@keyframes wge-from-r{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:none}}
@keyframes wge-rise{from{opacity:0;transform:translateY(40px)}to{opacity:1;transform:none}}
@keyframes wge-letter{from{opacity:0;transform:translateY(.35em);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
@keyframes wge-rule{to{transform:scaleX(1);opacity:1}}
@keyframes wge-seam{to{opacity:1;transform:scaleY(1)}}
@keyframes wge-out{to{opacity:0}}
@keyframes wge-pic-out{from{opacity:1;transform:translate(-53%,calc(-47% - 6px)) scale(1)}to{opacity:0;transform:translate(-53%,calc(-47% - 6px)) scale(1)}}
@keyframes wge-glow-out{from{opacity:1}to{opacity:0}}
@keyframes wge-leaf-l{to{transform:translateX(-101%)}}
@keyframes wge-leaf-r{to{transform:translateX(101%)}}
@keyframes wge-push{to{transform:translate(-53%,calc(-47% - 6px)) scale(1)}}
@keyframes wge-glint{0%{opacity:0;transform:translateX(0)}50%{opacity:1}100%{opacity:0;transform:translateX(130%)}}

/* variant: the gate. Two tall leaves of slender bars, each carrying half of the mark; the seam lights, the leaves swing in
   on their outer hinges, cold light spills through and the whole mark and name resolve in the opening, over the page */
.wgg__light{position:absolute;inset:0;opacity:0;background:radial-gradient(ellipse 60% 70% at 50% 52%,rgba(226,255,243,.5),rgba(18,216,132,.14) 45%,transparent 78%)}
.wge--gate{--cw:clamp(96px,13vw,164px)}
.wgg__gate{position:absolute;inset:0;perspective:1300px}
@media (max-width:700px){.wgg__gate{perspective:520px}}
.wgg__leaf{--p:clamp(34px,4.6vw,64px);position:absolute;top:0;bottom:0;width:calc(50% + 1px);overflow:hidden;background:#010c06;backface-visibility:hidden}
.wgg__leaf--l{left:0;transform-origin:0 50%;box-shadow:inset -1px 0 0 rgba(168,245,214,.2)}
.wgg__leaf--r{right:0;transform-origin:100% 50%;box-shadow:inset 1px 0 0 rgba(168,245,214,.2)}
/* the bars and the two rails, mirrored from the seam so the gate is symmetric */
.wgg__leaf::before{content:"";position:absolute;inset:0;opacity:0;animation:wge-in .8s ease .1s forwards;
  background:linear-gradient(180deg,transparent 0 calc(30% - 2px),rgba(168,245,214,.13) calc(30% - 2px) 30%,transparent 30% calc(86% - 2px),rgba(168,245,214,.13) calc(86% - 2px) 86%,transparent 86%),
  repeating-linear-gradient(var(--dir),transparent 0 calc(var(--p) - 3px),rgba(168,245,214,.13) calc(var(--p) - 3px) var(--p))}
.wgg__leaf--l::before{--dir:270deg}.wgg__leaf--r::before{--dir:90deg}
.wgg__arch{position:absolute;top:9%;width:200%;height:42%;border:2px solid rgba(168,245,214,.16);border-radius:50%;opacity:0;animation:wge-in .8s ease .25s forwards}
.wgg__leaf--l .wgg__arch{left:0}.wgg__leaf--r .wgg__arch{right:0}
/* frost: a pale drift at the foot of the gate, the top lost in the dark */
.wgg__frost{position:absolute;inset:0;background:linear-gradient(180deg,rgba(1,12,6,.92),rgba(1,12,6,0) 26%),linear-gradient(0deg,rgba(226,245,237,.13),rgba(226,245,237,0) 20%)}
.wgg__crest{position:absolute;top:50%;width:var(--cw);opacity:0;animation:wgg-crest .7s cubic-bezier(.2,.8,.2,1) .35s forwards}
.wgg__leaf--l .wgg__crest{right:0;--x:50%}.wgg__leaf--r .wgg__crest{left:0;--x:-50%}
.wgg__crest .wge__mk{display:block;width:100%}
.wgg__seam{position:absolute;top:0;bottom:0;left:50%;width:2px;margin-left:-1px;opacity:0;transform:scaleY(0);
  background:linear-gradient(180deg,transparent,#A8F5D6 30%,#12D884 50%,#A8F5D6 70%,transparent);box-shadow:0 0 26px 5px rgba(18,216,132,.5);
  animation:wge-seam .4s ease-out .85s forwards}
.wgg__halo{position:absolute;left:50%;top:50%;width:min(92vw,620px);aspect-ratio:1.6;transform:translate(-50%,-50%);opacity:0;
  background:radial-gradient(closest-side,rgba(1,12,6,.82),rgba(1,12,6,.5) 55%,rgba(1,12,6,0))}
/* the name sets on the closed gate; the set's own mark sits exactly where the two crest halves meet and takes over at the opening */
.wge--gate .wge__set{position:absolute;left:0;right:0;top:calc(50% - var(--cw) * .444)}
.wge--gate .wge__set .wge__mk{width:var(--cw);opacity:0}
.wge--gate .wge__word span{animation:wge-letter .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(.55s + var(--i) * 38ms)}
.wge--gate .wge__rule{animation:wge-rule .6s cubic-bezier(.2,.8,.2,1) .95s forwards}
.wge--gate.is-open .wgg__leaf--l{animation:wgg-swing-l 1.05s cubic-bezier(.6,0,.25,1) forwards}
.wge--gate.is-open .wgg__leaf--r{animation:wgg-swing-r 1.05s cubic-bezier(.6,0,.25,1) forwards}
.wge--gate.is-open .wgg__seam{animation:wge-out .3s ease forwards}
.wge--gate.is-open .wgg__light{animation:wgg-light 1.4s ease-out forwards}
.wge--gate.is-open .wge__set .wge__mk{opacity:1}
.wge--gate.is-open .wgg__crest{visibility:hidden}
.wge--gate.is-open .wgg__halo{animation:wgg-resolve 1.35s ease forwards}
.wge--gate.is-open .wge__set{animation:wgg-hold 1.35s ease forwards}

/* variant: the vault. A round door in a dark wall; the dial turns, twelve bolts draw back, light leaks round the rim,
   the door swings toward you and we pass through the opening onto the page */
.wge--vault{--D:min(72vmin,540px);perspective:1100px}
.wgv__wall,.wgv__rim{transform-origin:50% 46%}
.wgv__wall{position:absolute;inset:-1px;background:radial-gradient(circle at 50% 46%,transparent 0 calc(var(--D) * .422),#03120b calc(var(--D) * .422 + 1px),#010c06 calc(var(--D) * 1.2))}
.wgv__rim{position:absolute;inset:0;opacity:0}
.wgv__rim::before{content:"";position:absolute;left:50%;top:46%;width:calc(var(--D) * .856);aspect-ratio:1;border-radius:50%;transform:translate(-50%,-50%);
  box-shadow:0 0 0 2px rgba(168,245,214,.55),0 0 36px 8px rgba(18,216,132,.38),inset 0 0 30px 4px rgba(18,216,132,.3)}
.wgv__door{position:absolute;left:50%;top:46%;width:var(--D);aspect-ratio:1;margin:calc(var(--D) * -.5) 0 0 calc(var(--D) * -.5);
  transform-origin:7.2% 50%;backface-visibility:hidden}   /* opaque from the first frame: the wall's opening is behind it */
.wgv__rings{opacity:0;animation:wge-in .5s ease .05s forwards}
.wgv__door svg{display:block;width:100%;height:100%;overflow:visible}
.wgv__face{fill:#06170f;stroke:rgba(168,245,214,.24);stroke-width:1.5}
.wgv__ring{fill:none;stroke:rgba(168,245,214,.13);stroke-width:1.5}
.wgv__ring--in{stroke:rgba(18,216,132,.36)}
.wgv__bolts .b{fill:#0b2419;stroke:rgba(168,245,214,.32);stroke-width:1.2;animation:wgv-bolt .4s cubic-bezier(.6,0,.3,1) both;animation-delay:calc(.72s + var(--i) * 22ms)}
.wgv__dial{fill:rgba(168,245,214,.4);transform-box:view-box;transform-origin:250px 250px;animation:wgv-dial .85s cubic-bezier(.45,0,.2,1) .2s both}
.wgv__hub .m1{fill:#12D884}.wgv__hub .m2{fill:#A8F5D6}
.wgv__hub{opacity:0;animation:wge-in .5s ease .2s forwards}
.wge--vault .wge__set{position:absolute;left:0;right:0;top:calc(46% + var(--D) * .5 + 6px);gap:12px}
.wge--vault .wge__set .wge__mk{display:none}
.wge--vault .wge__word{font-size:clamp(24px,3.6vw,40px)}
.wge--vault .wge__word span{animation:wge-letter .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(.5s + var(--i) * 38ms)}
.wge--vault .wge__rule{animation:wge-rule .6s cubic-bezier(.2,.8,.2,1) .8s forwards}
.wge--vault .wgv__rim{animation:wgv-rim .3s ease-out 1.05s forwards}
.wge--vault.is-open .wgv__door{animation:wgv-swing .8s cubic-bezier(.55,0,.3,1) forwards}
.wge--vault.is-open .wgv__wall,.wge--vault.is-open .wgv__rim{animation:wgv-through .95s cubic-bezier(.5,0,.6,1) .4s both}
.wge--vault.is-open .wge__set,.wge--gate.is-open .wge__skip,.wge--vault.is-open .wge__skip{animation:wge-out .3s ease forwards}

/* snow for both: two tiled layers of flakes on a tall strip that slides down (a transform, nothing repainted) */
.wgg__snow,.wgv__snow{position:absolute;left:0;top:-100%;width:100%;height:200%;pointer-events:none;opacity:.7;animation:wg-snow 7s linear forwards;
  background:radial-gradient(1.5px 1.5px at 22px 38px,#eaf7f1 50%,transparent),radial-gradient(1px 1px at 120px 90px,#eaf7f1 50%,transparent),
  radial-gradient(2px 2px at 70px 150px,rgba(234,247,241,.8) 50%,transparent),radial-gradient(1.2px 1.2px at 200px 20px,#eaf7f1 50%,transparent);
  background-size:180px 180px,240px 240px,310px 310px,260px 260px}
.wge.is-open .wgg__snow,.wge.is-open .wgv__snow{transition:opacity .5s ease;opacity:0}

@keyframes wgg-crest{from{opacity:0;transform:translate(var(--x),-42%)}to{opacity:1;transform:translate(var(--x),-50%)}}
@keyframes wgg-hold{0%,55%{opacity:1}92%,100%{opacity:0}}
@keyframes wgg-swing-l{0%{transform:none}60%{opacity:1}88%{opacity:0}100%{transform:rotateY(84deg) scale(1.04);opacity:0}}
@keyframes wgg-swing-r{0%{transform:none}60%{opacity:1}88%{opacity:0}100%{transform:rotateY(-84deg) scale(1.04);opacity:0}}
@keyframes wgg-light{0%{opacity:0}30%{opacity:1}100%{opacity:0}}
@keyframes wgg-resolve{0%{opacity:0;transform:translate(var(--hx,0),var(--hy,0)) scale(.95)}20%,55%{opacity:1;transform:translate(var(--hx,0),var(--hy,0)) scale(1)}100%{opacity:0;transform:translate(var(--hx,0),var(--hy,0)) scale(1.03)}}
.wgg__halo{--hx:-50%;--hy:-50%}
@keyframes wgv-dial{from{transform:rotate(0)}to{transform:rotate(-120deg)}}
@keyframes wgv-bolt{from{transform:none}to{transform:translateY(40px)}}
@keyframes wgv-rim{to{opacity:1}}
@keyframes wgv-swing{0%{transform:none;opacity:1}75%{opacity:1}100%{transform:rotateY(-92deg);opacity:0}}
@keyframes wgv-through{0%{transform:none;opacity:1}60%{opacity:1}100%{transform:scale(5);opacity:0}}
@keyframes wg-snow{to{transform:translateY(50%)}}


/* reduced motion: the name, held, then a simple fade. Nothing travels */
@media (prefers-reduced-motion:reduce){
  .wge *,.wge{animation:none!important}
  .wge__word span,.wge__mk,.wge__rule,.wge__skip{opacity:1!important;transform:none!important;filter:none!important}
  .wge__seam,.wge__glint,.wgg__seam,.wgg__light,.wgg__snow,.wgv__snow{display:none}
  .wge--gate .wgg__halo,.wgg__leaf::before,.wgg__arch,.wgg__crest,.wgv__rings,.wgv__hub{opacity:1!important}
  .wgg__crest{transform:translate(var(--x),-50%)!important}
  .wge__pic.is-in{opacity:1!important;transform:translate(-53%,-47%)!important}
  .wge.is-open{transition:opacity .45s ease;opacity:0}
}
