/* Site loader: the whole UNEX TRADING logo assembles piece by piece (L, the X, the letters,
   the TRADING line), a shipment travels EG -> WORLD, then the screen splits along the brand's
   diagonal and slides away. The logo is the original artwork, cut into pieces with clip paths. */
html.is-loading { overflow: hidden; }
.site-loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; pointer-events: none; }
.loader-panel { position: absolute; inset: 0; background: #fbfcff; transition: transform 1s cubic-bezier(.7,0,.2,1); }
/* the two halves meet on a slanted line, like the cuts in the mark */
.loader-panel--start { clip-path: polygon(0 0, 58% 0, 42% 100%, 0 100%); }
.loader-panel--end { clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%); background: #f4f7fd; }
.loader-panel--start::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgb(7 84 255 / 7%), transparent 55%); }

.loader-core { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 28px; transition: opacity .35s, transform .5s cubic-bezier(.7,0,.2,1); }
.loader-logo { width: min(340px, 74vw); height: auto; overflow: visible; }

/* assembly: each piece arrives from its own side */
.lg-piece { opacity: 0; animation: lg-in .7s cubic-bezier(.2,.8,.2,1) forwards; }
.lg-l    { --from: translateY(160px);            animation-delay: .1s; }
.lg-chev { --from: translateX(-260px);           animation-delay: .3s; }
.lg-st   { --from: translate(180px, -180px);     animation-delay: .45s; }
.lg-sl   { --from: translate(180px, 180px);      animation-delay: .55s; }
.lg-u    { --from: translateY(90px);             animation-delay: .7s; }
.lg-n    { --from: translateY(90px);             animation-delay: .78s; }
.lg-e    { --from: translateY(90px);             animation-delay: .86s; }
.lg-x    { --from: translateY(90px);             animation-delay: .94s; }
.lg-word { --from: translateY(40px);             animation-delay: 1.15s; }
@keyframes lg-in { from { opacity: 0; transform: var(--from); } to { opacity: 1; transform: none; } }

/* the side lines of TRADING grow outward from the word */
.lg-line { transform-box: fill-box; transform: scaleX(0); animation: lg-line .6s cubic-bezier(.2,.8,.2,1) 1.05s forwards; }
.lg-line--start { transform-origin: right center; }
.lg-line--end { transform-origin: left center; }
@keyframes lg-line { to { transform: scaleX(1); } }

/* a glint runs across the finished logo */
.lg-glint { animation: lg-glint 1.5s ease-in-out 1.45s infinite; }
@keyframes lg-glint { 0% { transform: translateX(0); } 70%, 100% { transform: translateX(2100px); } }

/* EG ---•--- WORLD: the dot is a shipment on its way */
.loader-route { display: flex; align-items: center; gap: 12px; color: #8390a5; font: 700 10px/1 Arial, sans-serif; letter-spacing: .2em; opacity: 0; animation: lr-show .4s ease-out .9s forwards; }
.loader-route-line { position: relative; width: min(180px, 40vw); height: 2px; background: rgb(7 21 46 / 10%); overflow: visible; }
.loader-route-line::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, #9aa3b2, #0754ff); transform-origin: left; transform: scaleX(0); animation: lr-fill 1.1s cubic-bezier(.4,0,.2,1) 1s forwards; }
.loader-route-line i { position: absolute; top: 50%; left: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #0754ff; box-shadow: 0 0 0 4px rgb(7 84 255 / 18%); animation: lr-dot 1.1s cubic-bezier(.4,0,.2,1) 1s forwards; }
@keyframes lr-show { to { opacity: 1; } }
@keyframes lr-fill { to { transform: scaleX(1); } }
@keyframes lr-dot { to { left: 100%; } }

/* Exit: the content lifts away, then the two halves slide out along the diagonal. */
html.is-loaded .loader-core { opacity: 0; transform: translateY(-14px) scale(.96); }
html.is-loaded .loader-panel--start { transform: translateX(-102%); transition-delay: .2s; }
html.is-loaded .loader-panel--end { transform: translateX(102%); transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  .lg-piece, .loader-route { opacity: 1; transform: none; animation: none; }
  .lg-line { transform: none; animation: none; }
  .lg-glint, .loader-route-line::before, .loader-route-line i { animation: none; }
  .loader-route-line::before { transform: scaleX(1); }
  .loader-panel { transition: opacity .4s; }
  html.is-loaded .loader-panel--start, html.is-loaded .loader-panel--end { transform: none; opacity: 0; }
}
