/* ===================================================
   MIG LOADER ANIMATION
   =================================================== */

#loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

/* Exit: wipe upward */
#loader.ll-exit {
  animation: loaderWipeUp 0.7s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes loaderWipeUp {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 1; }
}
#loader.done { display: none; }

/* ── Scan line ─────────────────────────────────────── */
.ll-scan {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(41,141,255,0.6), rgba(255,255,255,0.8), rgba(41,141,255,0.6), transparent);
  pointer-events: none;
  opacity: 0;
}
.ll-scan.ll-scan-run {
  opacity: 1;
  animation: scanSweep 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes scanSweep {
  0%   { left: -100%; top: 30%; }
  100% { left: 100%;  top: 70%; }
}

/* ── Glitch overlay ────────────────────────────────── */
.ll-glitch {
  position: absolute;
  inset: 0;
  background: rgba(41,141,255,0.06);
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}
.ll-glitch.ll-glitch-run {
  animation: glitchFlash 0.18s steps(3) forwards;
}
@keyframes glitchFlash {
  0%   { opacity: 0; transform: translateX(0); }
  20%  { opacity: 1; transform: translateX(-4px); background: rgba(255,0,80,0.07); }
  40%  { opacity: 0.5; transform: translateX(4px); background: rgba(41,141,255,0.1); }
  60%  { opacity: 1; transform: translateX(-2px); background: rgba(0,255,180,0.05); }
  80%  { opacity: 0.3; transform: translateX(0); }
  100% { opacity: 0; }
}

/* ── Logo wrapper ──────────────────────────────────── */
.ll-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* ── Blue box ──────────────────────────────────────── */
.ll-box {
  position: relative;
  width: 120px;
  height: 120px;
  opacity: 0;
  transform: scale(0.4) rotate(-8deg);
  transition: none;
}
.ll-box.ll-show {
  animation: boxReveal 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes boxReveal {
  0%   { opacity: 0; transform: scale(0.4) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(1.06) rotate(1deg); }
  80%  { transform: scale(0.97) rotate(-0.5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.ll-box-bg {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: linear-gradient(135deg, #5bbef5 0%, #1a6bb3 100%);
  box-shadow: 0 0 60px rgba(41,141,255,0.4), 0 0 120px rgba(41,141,255,0.15);
}
.ll-box-shine {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
}
.ll-box-border {
  position: absolute;
  inset: 3px;
  border-radius: 23px;
  border: 1.5px solid rgba(255,255,255,0.3);
}

/* ── SVG inside box ────────────────────────────────── */
.ll-box svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* M letter — stroke draw */
.ll-m {
  fill: none;
  stroke: white;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: none;
}
.ll-m.ll-draw {
  animation: strokeDraw 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* G letter — stroke draw */
.ll-g {
  fill: none;
  stroke: #4ade80;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: none;
}
.ll-g.ll-draw {
  animation: strokeDraw 0.45s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes strokeDraw {
  0%   { stroke-dashoffset: 200; opacity: 0.3; }
  20%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* Power button circle */
.ll-power circle {
  fill: none;
  stroke: #4ade80;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  transform-origin: center;
  transform-box: fill-box;
}
.ll-power circle.ll-draw {
  animation: strokeDraw 0.4s cubic-bezier(0.4,0,0.2,1) forwards,
             powerGlow 1s ease 0.4s infinite alternate;
}
.ll-power line {
  stroke: #4ade80;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.ll-power line.ll-draw {
  animation: strokeDraw 0.3s cubic-bezier(0.4,0,0.2,1) 0.1s forwards;
}
@keyframes powerGlow {
  from { filter: drop-shadow(0 0 3px #4ade80); }
  to   { filter: drop-shadow(0 0 10px #4ade80) drop-shadow(0 0 20px rgba(74,222,128,0.4)); }
}

/* ── Subtitle letter-by-letter ─────────────────────── */
.ll-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  overflow: hidden;
  white-space: nowrap;
}
.ll-sub .ll-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  transition: none;
}
.ll-sub.ll-sub-show .ll-char {
  animation: charReveal 0.4s cubic-bezier(0.34,1.4,0.64,1) forwards;
}
@keyframes charReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Progress bar ──────────────────────────────────── */
.ll-progress {
  width: 160px;
  height: 1px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 8px;
}
.ll-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #298DFF, #4ade80);
  border-radius: 1px;
  transition: none;
}
.ll-bar.ll-bar-fill {
  animation: barFill 1.1s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes barFill {
  0%   { width: 0; }
  60%  { width: 85%; }
  100% { width: 100%; }
}
