/* AQUA UI pass 2: the first-visit loading screen (owner, Dec 2026: "designed loading 3D screen using the AQUA logo").
   The official artwork (/assets/aqua-beauty-logo.svg) is cut into two pieces with background/mask positions: the AQUA
   letters, extruded into 3D from 20 stacked masked copies, and the BEAUTY word under them. All CSS 3D, no libraries
   (CSP: style-src 'self', img-src 'self'). 1em = 10 units of the 1000x250 logo, so every crop below is in logo units.
   ui/loader.js runs as a classic script right after the markup: it removes the loader at once on later visits in the
   same session and dismisses it when the catalogue renders (600ms minimum, 2.2s maximum). Without JavaScript the
   loader still steps aside by itself after 3s (ld-failsafe). */
@property --ld-hole{syntax:'<length>';inherits:false;initial-value:0px}

.aqua-loader{
  --ld-ink:#0c0a0d;--ld-aqua:#3fadc6;--ld-rim:#bdf0f8;--ld-deep:#0b4654;
  --ld-logo:url("/assets/aqua-beauty-logo.svg");
  position:fixed;inset:0;z-index:2147483000;display:grid;place-content:center;justify-items:center;gap:2.6em;
  font-size:clamp(5px,min(1.9vw,1.55vh),11px);color:#fff;overflow:hidden;contain:strict;
  animation:ld-failsafe .4s ease 3s forwards;
}
html.aqua-loading,html.aqua-loading body{overflow:hidden}

/* Backdrop: near-black with slow aqua / pink / lilac light. The exit punches a growing hole through it. */
.ld-bg{position:absolute;inset:0;background:radial-gradient(120% 90% at 50% 42%,#1d1820 0%,var(--ld-ink) 62%);
  -webkit-mask:radial-gradient(circle at 50% 46%,transparent var(--ld-hole),#000 calc(var(--ld-hole) + 1px));
          mask:radial-gradient(circle at 50% 46%,transparent var(--ld-hole),#000 calc(var(--ld-hole) + 1px))}
.ld-bg::before,.ld-bg::after{content:"";position:absolute;left:50%;top:46%;width:150vmax;height:150vmax;margin:-75vmax 0 0 -75vmax;border-radius:50%;pointer-events:none}
.ld-bg::before{background:radial-gradient(circle at 36% 40%,rgb(63 173 198/.34),transparent 26%),radial-gradient(circle at 66% 62%,rgb(166 0 84/.30),transparent 24%);animation:ld-drift 9s linear infinite}
.ld-bg::after{background:radial-gradient(circle at 60% 34%,rgb(200 181 250/.20),transparent 22%),radial-gradient(circle at 40% 66%,rgb(255 79 170/.12),transparent 18%);animation:ld-drift 13s linear infinite reverse}

/* 3D stage */
.ld-stage{position:relative;width:45em;height:20em;perspective:90em;perspective-origin:50% 40%}
.ld-spin,.ld-mark,.ld-orbit,.ld-orbit b{position:absolute;transform-style:preserve-3d}
.ld-spin{inset:0;animation:ld-in .85s cubic-bezier(.16,1,.3,1) both}
.ld-mark{inset:0;animation:ld-sway 3.2s ease-in-out .7s infinite alternate;transform:rotateY(-26deg) rotateX(8deg)}
.ld-mark span{position:absolute;inset:0;backface-visibility:visible}

/* Extrusion: masked copies of the letters stepping back 0.16em each, rim-lit at the front, deep aqua behind. */
.ld-x{background:#1f7f94;-webkit-mask:var(--ld-logo) -2em -2.6em/100em 25em no-repeat;mask:var(--ld-logo) -2em -2.6em/100em 25em no-repeat;
  transform:translateZ(calc(var(--i) * -.16em));background:color-mix(in oklab,var(--ld-rim),var(--ld-deep) calc(var(--i) * 5%))}
.ld-x:nth-child(1){--i:1}.ld-x:nth-child(2){--i:2}.ld-x:nth-child(3){--i:3}.ld-x:nth-child(4){--i:4}
.ld-x:nth-child(5){--i:5}.ld-x:nth-child(6){--i:6}.ld-x:nth-child(7){--i:7}.ld-x:nth-child(8){--i:8}
.ld-x:nth-child(9){--i:9}.ld-x:nth-child(10){--i:10}.ld-x:nth-child(11){--i:11}.ld-x:nth-child(12){--i:12}
.ld-x:nth-child(13){--i:13}.ld-x:nth-child(14){--i:14}.ld-x:nth-child(15){--i:15}.ld-x:nth-child(16){--i:16}
.ld-x:nth-child(17){--i:17}.ld-x:nth-child(18){--i:18}.ld-x:nth-child(19){--i:19}.ld-x:nth-child(20){--i:20}
/* Front face: the real artwork, then a light sweep clipped to the letters. */
.ld-face{background:var(--ld-logo) -2em -2.6em/100em 25em no-repeat;filter:drop-shadow(0 0 .25em rgb(63 173 198/.35))}
.ld-sheen{transform:translateZ(.02em);-webkit-mask:var(--ld-logo) -2em -2.6em/100em 25em no-repeat;mask:var(--ld-logo) -2em -2.6em/100em 25em no-repeat;
  background:linear-gradient(105deg,transparent 38%,rgb(255 255 255/.85) 50%,transparent 62%) 160% 0/300% 100% no-repeat;animation:ld-sheen 2.4s cubic-bezier(.45,0,.2,1) .5s infinite}

/* Orbit: three brand-colour sparks on a tilted ring that pass in front of and behind the letters. */
.ld-orbit{left:50%;top:50%;width:0;height:0;transform:rotateX(76deg) rotateZ(-8deg)}
.ld-orbit::before{content:"";position:absolute;width:60em;height:60em;margin:-30em;border-radius:50%;border:.12em solid rgb(255 255 255/.14);box-shadow:0 0 1.2em rgb(63 173 198/.25)}
.ld-orbit i{position:absolute;inset:0;transform-style:preserve-3d;animation:ld-orbit 3.6s linear infinite}
.ld-orbit i:nth-child(2){animation-delay:-1.2s}.ld-orbit i:nth-child(3){animation-delay:-2.4s}
.ld-orbit b{width:2.6em;height:2.6em;margin:-1.3em;border-radius:50%;animation:ld-billboard 3.6s linear infinite;animation-delay:inherit}
.ld-orbit i:nth-child(1) b{background:radial-gradient(circle,#fff 0 18%,#ffb7da 34%,rgb(255 183 218/0) 70%)}
.ld-orbit i:nth-child(2) b{background:radial-gradient(circle,#fff 0 18%,#c8b5fa 34%,rgb(200 181 250/0) 70%)}
.ld-orbit i:nth-child(3) b{background:radial-gradient(circle,#fff 0 18%,#dfff70 34%,rgb(223 255 112/0) 70%)}

/* Light pad under the letters, breathing with the sway. */
.ld-floor{position:absolute;left:8%;right:8%;bottom:-4.2em;height:3.4em;border-radius:50%;
  background:radial-gradient(closest-side,rgb(63 173 198/.55),rgb(63 173 198/.12) 60%,transparent);animation:ld-floor 3.2s ease-in-out .7s infinite alternate}

/* BEAUTY, cut from the same artwork, wipes in; a thin progress line fills under it. */
.ld-word{position:relative;width:29em;height:5.6em;background:var(--ld-logo) -59em -10.8em/100em 25em no-repeat;margin-top:1.6em;
  animation:ld-wipe .6s cubic-bezier(.65,0,.35,1) .2s both}
.ld-bar{position:relative;width:18em;height:.45em;border-radius:999px;background:rgb(255 255 255/.10);overflow:hidden}
.ld-bar span{display:block;height:100%;border-radius:inherit;transform-origin:0 50%;background:linear-gradient(90deg,#ffb7da,#c8b5fa 55%,#dfff70);
  animation:ld-fill 2.2s cubic-bezier(.3,.6,.2,1) both;transition:transform .25s var(--ease-out,ease-out)}
.aqua-loader.is-ready .ld-bar span{animation:none;transform:none}

/* Exit: the letters fly at the viewer and fade while a hole opens through the backdrop onto the shop. */
.aqua-loader.is-leaving{pointer-events:none}
.aqua-loader.is-leaving .ld-bg{transition:--ld-hole .75s cubic-bezier(.7,0,.2,1) .1s,opacity .5s ease .35s;--ld-hole:110vmax;opacity:0}
.aqua-loader.is-leaving .ld-stage{transition:transform .55s cubic-bezier(.5,0,.75,0),opacity .4s ease .1s;transform:scale(1.5);opacity:0}
.aqua-loader.is-leaving .ld-word,.aqua-loader.is-leaving .ld-bar{transition:opacity .25s ease,transform .4s ease;opacity:0;transform:translateY(1.5em)}

@keyframes ld-in{from{opacity:0;transform:translateY(3em) rotateX(28deg) rotateY(-70deg)}40%{opacity:1}to{opacity:1;transform:none}}
@keyframes ld-sway{from{transform:rotateY(-26deg) rotateX(8deg)}to{transform:rotateY(26deg) rotateX(-5deg)}}
@keyframes ld-sheen{from{background-position:160% 0}60%,to{background-position:-60% 0}}
@keyframes ld-orbit{from{transform:rotateZ(0)}to{transform:rotateZ(360deg)}}
@keyframes ld-billboard{from{transform:translateX(30em) rotateZ(0) rotateZ(8deg) rotateX(-76deg)}to{transform:translateX(30em) rotateZ(-360deg) rotateZ(8deg) rotateX(-76deg)}}
@keyframes ld-floor{0%,100%{transform:scaleX(.84);opacity:.75}50%{transform:scaleX(1);opacity:1}}
@keyframes ld-drift{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@keyframes ld-wipe{from{opacity:0;clip-path:inset(0 100% 0 0);transform:translateY(.8em)}to{opacity:1;clip-path:inset(0 0 0 0);transform:none}}
@keyframes ld-fill{from{transform:scaleX(0)}to{transform:scaleX(.92)}}
@keyframes ld-failsafe{to{opacity:0;visibility:hidden}}

@media(prefers-reduced-motion:reduce){
  .aqua-loader *,.aqua-loader *::before,.aqua-loader *::after{animation:none!important}
  .ld-mark{transform:rotateY(-16deg) rotateX(6deg)}
  .ld-orbit,.ld-sheen{display:none}
  .ld-bar span{transform:scaleX(.6)}
  .aqua-loader.is-leaving{transition:opacity .18s ease;opacity:0}
  .aqua-loader.is-leaving .ld-bg,.aqua-loader.is-leaving .ld-stage,.aqua-loader.is-leaving .ld-word,.aqua-loader.is-leaving .ld-bar{transition:none;transform:none;opacity:1;--ld-hole:0px}
}
