/* ═════════ LOADER — the studio's light tunnel, the neon logo powering on, an LED strip filling up ═════════ */
#loader { position: fixed; inset: 0; z-index: 100; overflow: hidden; display: grid; place-items: center; perspective: 900px;
  background: radial-gradient(70% 55% at 50% 48%, #121a2e 0%, #070a12 55%, #030408 100%);
  clip-path: inset(0 0 0 0); transition: clip-path 1.05s cubic-bezier(.77, 0, .18, 1) .25s, visibility 0s 1.4s; }
#loader.done { clip-path: inset(0 0 100% 0); visibility: hidden; }

/* tunnel of LED arches flying toward the camera (like the light tunnel in the studio) */
.ld-tunnel { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; opacity: .6; }
.ld-arch { position: absolute; left: 50%; top: 50%; width: 92vmin; height: 55vmin; margin: -30vmin 0 0 -46vmin; overflow: visible;
  animation: ldFly 4.5s linear infinite; animation-delay: calc(var(--i) * -0.5s); opacity: 0; }
.ld-arch path { fill: none; stroke: #f4f7ff; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px rgba(200, 220, 255, .9)) drop-shadow(0 0 16px rgba(91, 134, 255, .8)); }
.ld-arch:nth-child(3n) path { stroke: #ffe39a; filter: drop-shadow(0 0 5px rgba(255, 210, 110, .9)) drop-shadow(0 0 16px rgba(244, 193, 74, .75)); }
.ld-arch:nth-child(3n+1) path { stroke: #b9ccff; }
@keyframes ldFly { 0% { transform: translateZ(-1800px); opacity: 0; } 12% { opacity: .9; } 82% { opacity: .9; } 100% { transform: translateZ(820px); opacity: 0; } }
#loader.go .ld-arch { animation-duration: 1.1s; }
.ld-floor { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 52%; pointer-events: none; transform: perspective(500px) rotateX(64deg); transform-origin: 50% 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 7vw), repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 7vw);
  -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); animation: ldFloor 1.2s linear infinite; }
@keyframes ldFloor { to { background-position: 0 0, 0 7vw; } }
#loader::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(42% 36% at 50% 48%, rgba(5, 7, 12, .92), rgba(5, 7, 12, .55) 60%, transparent 100%); z-index: 1; }

/* core: logo, tagline, LED strip */
.ld-core { position: relative; z-index: 2; display: grid; justify-items: center; gap: clamp(12px, 2vh, 22px); width: min(780px, 92vw); }
.ld-logo { width: min(520px, 84vw) !important; }
.ld-logo { position: relative; width: 100%; animation: ldOn 1.6s steps(1, end) both, ldFloat 5s ease-in-out 1.6s infinite; }
.ld-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 10px rgba(255, 246, 214, .55)) drop-shadow(0 0 34px rgba(30, 99, 255, .7)) drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); animation: ldGlow 2.6s ease-in-out 1.6s infinite; }
/* neon strike: stutters on like a tube */
@keyframes ldOn { 0% { opacity: 0; } 8% { opacity: .9; } 11% { opacity: .1; } 16% { opacity: 1; } 21% { opacity: .25; } 24% { opacity: .95; } 36% { opacity: .5; } 40%, 100% { opacity: 1; } }
@keyframes ldFloat { 50% { transform: translateY(-6px) rotateX(4deg); } }
@keyframes ldGlow { 50% { filter: drop-shadow(0 0 14px rgba(255, 246, 214, .7)) drop-shadow(0 0 48px rgba(30, 99, 255, .9)) drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); } }
/* light sweep across the logo, masked to its shape */
.ld-shine { position: absolute; inset: 0; pointer-events: none; -webkit-mask: url(../assets/logo.webp) center / 100% 100% no-repeat; mask: url(../assets/logo.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 48%, rgba(255, 255, 255, 0) 60%) no-repeat; background-size: 250% 100%; mix-blend-mode: screen; animation: ldShine 2.8s ease-in-out 1.4s infinite; }
@keyframes ldShine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }

.ld-tag { font: 700 clamp(9px, 1.3vw, 12.5px)/1 Orbitron, var(--fh); letter-spacing: .5em; color: #c9d4ea; white-space: nowrap; padding-left: .5em; }
.ld-tag span { display: inline-block; opacity: 0; transform: translateY(10px); filter: blur(6px); animation: ldChar .6s cubic-bezier(.2, .9, .2, 1) forwards; animation-delay: calc(1.1s + var(--k) * 32ms); }
.ld-tag span.dot { color: var(--gold); }
@keyframes ldChar { to { opacity: 1; transform: none; filter: none; } }

.ld-strip { display: grid; grid-template-columns: repeat(var(--n, 28), 1fr); gap: 5px; width: min(420px, 78vw); padding: 7px; border-radius: 9px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.ld-strip i { height: 9px; border-radius: 2px; background: rgba(255, 255, 255, .07); transition: background .25s, box-shadow .25s; }
.ld-strip i.on { background: linear-gradient(180deg, #ffe7a6, #f4c14a); box-shadow: 0 0 10px rgba(244, 193, 74, .85); }
.ld-strip i.on.b { background: linear-gradient(180deg, #c9d6ff, #3a6bff); box-shadow: 0 0 10px rgba(58, 107, 255, .9); }
.ld-strip i.head { background: #fff; box-shadow: 0 0 14px #fff, 0 0 28px rgba(244, 193, 74, .9); }

.ld-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; width: min(420px, 78vw); }
.ld-msg { font: 600 12.5px/1 var(--fb); letter-spacing: .03em; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-msg.in { animation: ldMsg .45s cubic-bezier(.2, .9, .2, 1); }
@keyframes ldMsg { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
#ldPct { font: 800 clamp(22px, 2.6vw, 30px)/1 Orbitron, var(--fh); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 18px rgba(244, 193, 74, .45); }

/* the graffiti tag sprays across the bottom right when the studio is ready */
.ld-graf.graf { position: absolute; right: 7vw; bottom: 9vh; top: auto; z-index: 3; font-size: clamp(38px, 5vw, 76px); rotate: -7deg; transition: --sp .9s linear;
  --c1: #ffe0f0; --c2: #ff5fae; --c3: #c2187a; --ex: #1c3cb4; }

/* exit: logo punches toward the viewer, tunnel accelerates, then the screen rolls up like the shop shutter */
#loader.go .ld-core { animation: ldOut .8s cubic-bezier(.6, 0, .3, 1) .15s forwards; }
@keyframes ldOut { to { transform: scale(1.5) translateZ(200px); opacity: 0; filter: blur(8px); } }
#loader.go::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle at 50% 46%, rgba(255, 255, 255, .6), rgba(255, 240, 200, .18) 24%, transparent 48%); animation: ldFlash .4s ease-out forwards; }
@keyframes ldFlash { from { opacity: 1; } to { opacity: 0; } }
#loader.done { background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 22px), radial-gradient(70% 55% at 50% 48%, #121a2e 0%, #070a12 55%, #030408 100%); }

@media (max-width: 760px) {
  .ld-arch { width: 130vmin; height: 78vmin; margin: -42vmin 0 0 -65vmin; }
  .ld-graf.graf { right: 50%; translate: 50% 0; bottom: 8vh; }
  .ld-tag { font-size: 8.5px; letter-spacing: .24em; padding-left: .24em; }
}
@media (prefers-reduced-motion: reduce) {
  .ld-arch, .ld-floor, .ld-logo, .ld-logo img, .ld-shine { animation: none !important; } .ld-arch { opacity: .5; transform: translateZ(calc(var(--i) * -180px)); }
  .ld-tag span { animation-duration: .01s; }
}

/* ═════════ the polishing scene: a DA works across a blue panel, turning swirled paint into a mirror ═════════ */
#loader { --pp: 6%; }
.ld-scene { position: relative; width: min(820px, 94vw); height: clamp(200px, 30vh, 280px); margin: 0; }
.ld-panel { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; border-radius: 26px 26px 18px 18px / 46px 46px 18px 18px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08), 0 -1px 0 rgba(255, 255, 255, .35) inset; transform: perspective(520px) rotateX(32deg); transform-origin: 50% 100%; }
.pn-gloss, .pn-dull { position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 30% -10%, #3d84ff 0%, #1453e0 32%, #0a2f8f 70%, #061a52 100%); }
/* LED-arch reflections sliding along the paint */
.pn-refl { position: absolute; inset: -20% -10%; background:
  linear-gradient(104deg, transparent 0 18%, rgba(255, 255, 255, .5) 18.4% 19%, transparent 19.6% 58%, rgba(255, 255, 255, .42) 58.4% 59.6%, transparent 60.2%),
  linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 22%, transparent 70%, rgba(0, 0, 0, .35)); background-size: 160% 100%, 100% 100%;
  animation: pnRefl 6s linear infinite; mix-blend-mode: screen; }
@keyframes pnRefl { to { background-position: -160% 0, 0 0; } }
.pn-crease { position: absolute; left: 0; right: 0; top: 30%; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75) 20%, rgba(255, 255, 255, .9) 50%, rgba(255, 255, 255, .6) 80%, transparent); box-shadow: 0 6px 10px rgba(0, 0, 0, .35); }
.pn-vent { position: absolute; top: 44%; width: 15%; height: 28%; border-radius: 40% 40% 24% 24% / 50% 50% 30% 30%; background: linear-gradient(180deg, #02040a, #0a0f1d 70%, #1a2f6a);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, .55), inset 0 6px 10px rgba(0, 0, 0, .9); }
.pn-vent.v1 { left: 24%; } .pn-vent.v2 { left: 61%; }
.pn-stars b { position: absolute; left: var(--x); top: var(--y); width: 18px; height: 18px; margin: -9px; opacity: 0; animation: pnStar 2.2s ease-in-out infinite; animation-delay: var(--t); }
.pn-stars b::before, .pn-stars b::after { content: ''; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff; }
.pn-stars b::before { width: 100%; height: 2px; margin: -1px 0 0 -50%; } .pn-stars b::after { width: 2px; height: 100%; margin: -50% 0 0 -1px; }
@keyframes pnStar { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* the unpolished side: hazy, flat, swirled — masked away as the pad passes */
.pn-dull { filter: saturate(.55) brightness(.78) contrast(.85);
  -webkit-mask-image: linear-gradient(90deg, transparent calc(var(--pp) - 1%), #000 calc(var(--pp) + 3.5%)); mask-image: linear-gradient(90deg, transparent calc(var(--pp) - 1%), #000 calc(var(--pp) + 3.5%)); }
.pn-dull .pn-refl { filter: blur(7px); opacity: .55; }
.pn-dull .pn-crease { filter: blur(2px); opacity: .5; }
.pn-swirl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .28; mix-blend-mode: screen; }
.pn-haze { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(220, 230, 255, .16), rgba(220, 230, 255, .05)); }
/* wet compound trail right behind the pad */
.pn-trail { position: absolute; top: 8%; bottom: 8%; left: calc(var(--pp) - 14%); width: 14%; background: radial-gradient(60% 50% at 100% 50%, rgba(255, 255, 255, .28), transparent 70%); filter: blur(4px); }

/* the machine — rides the progress line, with arm sweeps, vibration and a spinning pad */
.ld-pol { position: absolute; left: var(--pp); bottom: 18%; width: clamp(210px, 34%, 290px); translate: -46% 0; animation: polSweep 3.2s ease-in-out infinite; z-index: 2; }
@keyframes polSweep { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-9%) rotate(-1.5deg); } 50% { transform: translateY(5%) rotate(1deg); } 75% { transform: translateY(-4%) rotate(-.6deg); } }
.ld-tool { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .65)); animation: polBuzz .07s steps(2) infinite; }
@keyframes polBuzz { 50% { transform: translate(.6px, -.5px); } }
.t-cable { fill: none; stroke: #0b0b0d; stroke-width: 9; stroke-linecap: round; }
.t-ribs { animation: padSpin .18s linear infinite; }
@keyframes padSpin { to { stroke-dashoffset: -23; } }
.t-spin { animation: padOrbit .12s linear infinite; transform-box: fill-box; }
@keyframes padOrbit { 0% { transform: translate(1.2px, 0); } 25% { transform: translate(0, .8px); } 50% { transform: translate(-1.2px, 0); } 75% { transform: translate(0, -.8px); } }
/* compound flecks slung off the pad rim */
.ld-sling { position: absolute; left: 50%; bottom: 6%; width: 0; height: 0; }
.ld-sling i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff6dc; box-shadow: 0 0 6px rgba(255, 246, 220, .9); opacity: 0;
  animation: sling var(--d) cubic-bezier(.2, .7, .4, 1) var(--l) infinite; }
@keyframes sling { 0% { opacity: 1; transform: rotate(var(--a)) translateX(34px) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)) translateY(26px) scale(.4); } }
/* live gloss meter riding above the machine */
.ld-gu { position: absolute; left: 88%; top: 26%; display: flex; align-items: baseline; gap: 5px; padding: 7px 10px 9px; border-radius: 10px; white-space: nowrap;
  background: rgba(6, 9, 16, .82); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .8); font: 700 9px/1 Orbitron, var(--fh); letter-spacing: .16em; color: #9fb4e8; }
.ld-gu b { font: 800 19px/1 Orbitron, var(--fh); letter-spacing: 0; color: #fff; font-variant-numeric: tabular-nums; }
.ld-gu em { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ld-gu em i { display: block; height: 100%; width: var(--pp); background: linear-gradient(90deg, #f4c14a, #4ff0d8); }
#loader.go .ld-pol { transition: transform .5s cubic-bezier(.6, 0, .4, 1); transform: translate(60vw, -30vh) rotate(25deg); }
@media (max-width: 760px) {
  .ld-scene { height: 190px; } .ld-pol { width: 170px; bottom: 20%; } .ld-gu { left: 72%; top: 6%; } .ld-gu b { font-size: 15px; }
  .ld-panel { border-radius: 18px 18px 12px 12px / 30px 30px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) { .ld-pol, .ld-tool, .t-ribs, .t-spin, .ld-sling i, .pn-refl, .pn-stars b { animation: none !important; } }
/* detail pass: curved arch reflections, hood lip, spray bottle misting the panel, bigger compound flecks */
.pn-gloss::after, .pn-dull::after { content: ''; position: absolute; left: -10%; right: -10%; top: -60%; height: 150%; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, .55); border-bottom-color: transparent; border-left-color: transparent; transform: rotate(-8deg); filter: drop-shadow(0 0 6px rgba(160, 190, 255, .8)); }
.pn-dull::after { filter: blur(5px); opacity: .5; }
.pn-lip { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; background: linear-gradient(180deg, rgba(255, 255, 255, .55), #0a1c55 18%, #040b22); box-shadow: 0 -1px 0 rgba(0, 0, 0, .5); }
.ld-sling i { width: 5px; height: 5px; }
.ld-bottle { position: absolute; right: 1%; bottom: 36%; width: clamp(38px, 6vw, 58px); z-index: 1; animation: bottleBob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.ld-bottle svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 12px rgba(0, 0, 0, .6)); }
@keyframes bottleBob { 0%, 70%, 100% { transform: rotate(-4deg); } 78% { transform: rotate(-10deg) translateY(-3px); } 86% { transform: rotate(-6deg); } }
.b-trig { transform-box: fill-box; transform-origin: 50% 0; animation: trig 2.6s ease-in-out infinite; }
@keyframes trig { 0%, 72%, 100% { transform: none; } 78% { transform: rotate(-18deg); } }
.ld-mist { position: absolute; left: 2%; top: 18%; width: 0; height: 0; }
.ld-mist i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(230, 240, 255, .9); box-shadow: 0 0 6px rgba(200, 220, 255, .9); opacity: 0; animation: mist 2.6s ease-out infinite; animation-delay: var(--l); }
@keyframes mist { 0%, 74% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.6); } 78% { opacity: 1; } 96%, 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)) scale(1.8); } }
@media (max-width: 760px) { .ld-bottle { width: 34px; bottom: 40%; } }
#loader.ld-flip .ld-gu { left: auto; right: 86%; }
.ld-bottle { transition: transform .8s cubic-bezier(.6, 0, .3, 1), opacity .8s; }
#loader.ld-late .ld-bottle { transform: translate(140%, 30%) rotate(18deg); opacity: 0; animation: none; }
