/* ---------- XELLUM brand intro ----------
   A visual layer only: it sits above the page while the page loads and
   initialises normally underneath (see assets/xellum-intro.js for the
   gate, input hold and failsafe). Everything is built from the official
   logo artwork, assets/xellum-logo.png — no font, no redrawn glyphs. The
   pieces below are windows onto that one image, tiling it pixel-for-pixel:
   X, the three bars of the custom E, L, L, U, M. At the lock they hand
   over to .xi-full, the untouched logo image itself.

   Timeline (ms):  trace 40 · X strokes 110/180 · intersection 230 ·
   X lock 260–350 · E bars 260/300/340 · L 380 · L 430 · U 480 · M 530 ·
   logo lock 770 · sweep 800–1000 · exit: logo forward + fade 960–1200,
   curtain lift 960–1320 · gone 1340.
   Only transform and opacity animate, so the whole sequence runs on the
   compositor: the homepage boots (React + in-browser compile) on the main
   thread at the same time, and nothing here waits for it. */

/* Near-black from the very first paint — before the intro layer itself can
   be parsed behind the page's synchronous <head> scripts — so a cold,
   slow load never flashes white. Same colour as the site's own body. */
html{background-color:#08090B}

[data-xellum-intro]{
  --xi-bg:#08090B;--xi-ease:cubic-bezier(.2,.7,.2,1);
  position:fixed;inset:0;z-index:2147483000;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;pointer-events:auto;contain:strict;
  animation:xi-gone 1ms linear 1340ms both;
}
.xi-off [data-xellum-intro],.xi-done [data-xellum-intro]{display:none}
/* Held at frame 0 (for ≤300ms) while the logo artwork decodes — see
   assets/xellum-intro.js. */
.xi-wait [data-xellum-intro],.xi-wait [data-xellum-intro] *,
.xi-wait [data-xellum-intro] ::before,.xi-wait [data-xellum-intro] ::after{animation-play-state:paused!important}
.xi-fade{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}

/* Curtain: the near-black field that lifts away to open the page. Its
   soft lower edge and one fine violet/blue line are the site's own
   wipe-line language (data-wipeline in index.html). */
.xi-bg{
  position:absolute;inset:0;will-change:transform;
  /* Opaque stops only (no alpha falloff to band): the faintest violet
     light behind the mark, fading into the site's own near-black. */
  background:radial-gradient(ellipse 62% 48% at 50% 50%,#0E0C18,#0B0A12 45%,var(--xi-bg));
  animation:xi-lift 360ms cubic-bezier(.76,0,.24,1) 960ms both;
}
.xi-bg::after{
  content:"";position:absolute;left:0;right:0;top:100%;height:16vh;
  background:linear-gradient(180deg,var(--xi-bg),rgba(8,9,11,0));
}
.xi-bg::before{
  content:"";position:absolute;left:0;right:0;bottom:0;height:1px;z-index:1;opacity:0;
  background:linear-gradient(90deg,transparent,#6D3FA0 30%,#405DE6 70%,transparent);
  animation:xi-edge 360ms linear 960ms both;
}
.xi-stage{
  position:relative;will-change:transform,opacity;
  animation:xi-forward 240ms cubic-bezier(.4,0,.6,1) 960ms both;
}
.xi-logo{
  position:relative;
  width:min(680px,84vw);aspect-ratio:1334/285;
}
.xi-parts,.xi-full,.xi-sweep{position:absolute;inset:0}
.xi-parts{will-change:opacity;animation:xi-off 1ms linear 770ms both}
.xi-full{
  background:url(xellum-logo.webp) 0 0/100% 100% no-repeat;opacity:0;will-change:opacity;
  animation:xi-on 1ms linear 770ms both;
}
/* A piece is a window (.xi-w: position/size in the logo) onto the logo
   image (.xi-p: background mapped back to the full logo). Reveals that
   need a moving edge counter-translate the window and its content, so the
   edge travels while the artwork stays put — transform only, so it keeps
   running on the compositor even while the page underneath is busy
   booting on the main thread. */
.xi-w{position:absolute;display:block;overflow:hidden;will-change:transform,opacity}
.xi-p{
  position:absolute;inset:0;display:block;
  background:url(xellum-logo.webp) no-repeat;
  background-size:var(--bs);background-position:var(--bp);
}

/* X — two strokes drawn, then the whole mark locks. */
.xi-x{left:0%;top:0%;width:28.8606%;height:100%;--bs:346.4935% 100%;--bp:0% 0%}
/* "\" stroke drawn downward, "/" stroke drawn upward; each clipped to its
   own band so the other stroke doesn't appear with it. */
.xi-x1{animation:xi-down 230ms var(--xi-ease) 110ms both}
.xi-x1 .xi-p{clip-path:polygon(23.8961% 17.5439%,44.1558% 17.5439%,89.0909% 81.4035%,68.5714% 81.4035%);animation:xi-down-in 230ms var(--xi-ease) 110ms both}
.xi-x2{animation:xi-up 170ms var(--xi-ease) 180ms both}
.xi-x2 .xi-p{clip-path:polygon(22.3377% 81.4035%,42.0779% 81.4035%,89.6104% 14.0351%,72.7273% 14.0351%);animation:xi-up-in 170ms var(--xi-ease) 180ms both}
.xi-xl{opacity:0;animation:xi-on 90ms linear 260ms both}
@keyframes xi-down{0%{opacity:0;transform:translate3d(0,-100%,0)}12%{opacity:1}99%{opacity:1;transform:translate3d(0,0,0)}100%{opacity:0;transform:translate3d(0,0,0)}}
@keyframes xi-down-in{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}
@keyframes xi-up{0%{opacity:0;transform:translate3d(0,100%,0)}12%{opacity:1}99%{opacity:1;transform:translate3d(0,0,0)}100%{opacity:0;transform:translate3d(0,0,0)}}
@keyframes xi-up-in{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}

/* The energy trace that precedes the first stroke, on the stroke's axis. */
.xi-trace{
  position:absolute;left:4.5%;top:-4.9%;width:33.06%;height:1px;
  transform-origin:0 50%;transform:rotate(44.7deg) scaleX(0);opacity:0;
  background:linear-gradient(90deg,transparent,#B08FE0 35%,#8FA6FF 70%,transparent);
  box-shadow:0 0 6px rgba(109,63,160,.8);
  animation:xi-trace 280ms cubic-bezier(.3,0,.2,1) 40ms both;
}
@keyframes xi-trace{
  0%{opacity:0;transform:rotate(44.7deg) scaleX(0)}
  25%{opacity:.9}
  55%{opacity:.8;transform:rotate(44.7deg) scaleX(1)}
  100%{opacity:0;transform:rotate(44.7deg) scaleX(1)}
}
/* Where the second stroke crosses the first: a faint, cool bloom. */
.xi-flash{
  position:absolute;left:11.24%;top:27.02%;width:9.745%;aspect-ratio:1;
  border-radius:50%;opacity:0;mix-blend-mode:screen;pointer-events:none;
  background:radial-gradient(closest-side,rgba(226,214,255,.5),rgba(143,120,240,.22) 45%,transparent);
  animation:xi-flash 220ms ease-out 230ms both;
}
@keyframes xi-flash{
  0%{opacity:0;transform:scale(.5)}
  35%{opacity:.75;transform:scale(1)}
  100%{opacity:0;transform:scale(1.15)}
}

/* Custom E — its three bars wipe in and slide into alignment,
   top → middle → bottom. */
.xi-e1{left:28.8606%;top:14.0351%;width:14.2429%;height:22.4561%;--bs:702.1053% 445.3125%;--bp:33.6538% 18.0995%}
.xi-e2{left:28.8606%;top:36.4912%;width:14.2429%;height:22.4561%;--bs:702.1053% 445.3125%;--bp:33.6538% 47.0588%}
.xi-e3{left:28.8606%;top:58.9474%;width:14.2429%;height:25.2632%;--bs:702.1053% 395.8333%;--bp:33.6538% 78.8732%}
.xi-e1,.xi-e1 .xi-p{animation-delay:260ms}
.xi-e2,.xi-e2 .xi-p{animation-delay:300ms}
.xi-e3,.xi-e3 .xi-p{animation-delay:340ms}
.xi-e1,.xi-e2,.xi-e3{animation-name:xi-bar;animation-duration:200ms;animation-timing-function:var(--xi-ease);animation-fill-mode:both}
.xi-e1 .xi-p,.xi-e2 .xi-p,.xi-e3 .xi-p{animation-name:xi-bar-in;animation-duration:200ms;animation-timing-function:var(--xi-ease);animation-fill-mode:both}
@keyframes xi-bar{from{opacity:0;transform:translate3d(-100%,0,0)}40%{opacity:1}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes xi-bar-in{from{transform:translate3d(96%,0,0)}to{transform:translate3d(0,0,0)}}

/* L L U M — one continuous left-to-right resolve. */
.xi-l1{left:43.1034%;top:14.0351%;width:12.8936%;height:70.1754%;--bs:775.5814% 142.5%;--bp:49.4836% 47.0588%;animation:xi-letter 230ms var(--xi-ease) 380ms both}
.xi-l2{left:55.997%;top:14.0351%;width:11.994%;height:70.1754%;--bs:833.75% 142.5%;--bp:63.6286% 47.0588%;animation:xi-letter 230ms var(--xi-ease) 430ms both}
.xi-u{left:67.991%;top:14.0351%;width:14.9925%;height:70.1754%;--bs:667% 142.5%;--bp:79.9824% 47.0588%;animation:xi-letter 230ms var(--xi-ease) 480ms both}
.xi-m{left:82.9835%;top:14.0351%;width:17.0165%;height:70.1754%;--bs:587.6652% 142.5%;--bp:100% 47.0588%;animation:xi-letter 230ms var(--xi-ease) 530ms both}
@keyframes xi-letter{
  from{opacity:0;transform:translate3d(0,6%,0)}
  to{opacity:1;transform:translate3d(0,0,0)}
}

/* One reflection across the locked logo, masked to the logo's own lit
   surfaces (luminance: the dark halo in the artwork catches nothing). */
.xi-sweep{
  overflow:hidden;pointer-events:none;
  -webkit-mask:url(xellum-logo.webp) 0 0/100% 100% no-repeat;
  -webkit-mask-source-type:luminance; /* older Safari's spelling of mask-mode */
  mask:url(xellum-logo.webp) 0 0/100% 100% no-repeat luminance;
}
.xi-sweep::before{
  content:"";position:absolute;top:0;bottom:0;left:0;width:22%;
  background:linear-gradient(100deg,transparent,rgba(240,236,255,.75) 50%,transparent);
  transform:translate3d(-110%,0,0);
  animation:xi-sweep 200ms cubic-bezier(.45,0,.3,1) 800ms both;
}
@keyframes xi-sweep{to{transform:translate3d(460%,0,0)}}

@keyframes xi-on{to{opacity:1}}
@keyframes xi-off{to{opacity:0}}
@keyframes xi-forward{
  0%{transform:scale(1);opacity:1}
  30%{opacity:1}
  100%{transform:scale(1.05);opacity:0}
}
@keyframes xi-lift{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(0,calc(-100% - 17vh),0)}
}
@keyframes xi-edge{0%{opacity:0}20%,70%{opacity:.7}100%{opacity:0}}
@keyframes xi-gone{to{visibility:hidden;pointer-events:none}}

/* Reduced motion: no assembly, no travel — the logo simply appears, holds
   and the layer fades away. */
@media (prefers-reduced-motion:reduce){
  [data-xellum-intro]{animation-delay:720ms}
  .xi-parts,.xi-trace,.xi-flash,.xi-sweep{display:none}
  .xi-full{animation:xi-on 160ms linear both}
  .xi-stage{animation:none}
  .xi-bg{animation:none}
  [data-xellum-intro] .xi-fade{animation:xi-off 200ms linear 500ms both}
}
