/* Math LLC logo loader — from src/assets/LOGO/math-logo-loader.html.
   Loaded by index.html (first-load splash) and used by the React
   <MathLogoLoader /> component, so the styles live in one place. */

.ml-loader {
  --ml-navy: #143d6b;
  --ml-sky: #3bb5e5;
  --ml-red: #ae211d;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #fff;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
/* White-logo version: explicit .dark, or the app's dark theme (<html class="dark">) */
.ml-loader.dark,
.dark .ml-loader {
  background: #0f2d50;
}
.ml-loader.done {
  opacity: 0;
  visibility: hidden;
}

/* Inside a layout (page switches): no overlay, sits in the content area */
.ml-loader.ml-loader--inline,
.dark .ml-loader.ml-loader--inline {
  position: static;
  z-index: auto;
  min-height: 60vh;
  background: transparent;
}
.ml-loader--inline .ml-logo {
  width: min(150px, 42vw);
}

.ml-logo {
  width: min(220px, 56vw);
  height: auto;
  overflow: visible;
}

/* letter colour per theme */
.ml-letter {
  --ink: var(--ml-navy);
}
.ml-loader.dark .ml-letter,
.dark .ml-loader .ml-letter {
  --ink: #fff;
}

/* 1) outline draws itself, 2) fill floods in */
.ml-letter path {
  fill: var(--ink);
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ml-draw 1s cubic-bezier(0.65, 0, 0.35, 1) forwards, ml-fill 0.5s ease forwards;
  animation-delay: calc(var(--i) * 0.12s), calc(0.7s + var(--i) * 0.12s);
}
@keyframes ml-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes ml-fill {
  to {
    fill-opacity: 1;
    stroke-width: 0;
  }
}

/* 3) blue plus drops in and spins */
.ml-plus {
  fill: var(--ml-sky);
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: translateY(-140px) rotate(-180deg) scale(0.4);
  animation: ml-plus 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.15s forwards,
    ml-pulse 1.6s ease-in-out 2.4s infinite;
}
@keyframes ml-plus {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ml-pulse {
  50% {
    transform: scale(1.12);
  }
}

/* 4) LLC badge wipes in, text rises */
.ml-badge {
  fill: var(--ml-red);
  clip-path: inset(0 100% 0 0);
  animation: ml-wipe 0.55s cubic-bezier(0.65, 0, 0.35, 1) 1.6s forwards;
}
@keyframes ml-wipe {
  to {
    clip-path: inset(0 0 0 0);
  }
}
.ml-llc {
  opacity: 0;
  transform: translateY(30px);
  animation: ml-rise 0.45s ease-out 2s forwards;
}
@keyframes ml-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* 5) light shine sweeps across */
.ml-shine {
  transform: translateX(-600px);
  animation: ml-shine 1s ease-in-out 2.3s forwards;
}
@keyframes ml-shine {
  to {
    transform: translateX(2200px);
  }
}

/* thin progress bar under logo */
.ml-bar {
  width: min(120px, 32vw);
  height: 3px;
  margin: 16px auto 0;
  border-radius: 3px;
  background: rgba(20, 61, 107, 0.12);
  overflow: hidden;
}
.ml-loader.dark .ml-bar,
.dark .ml-loader .ml-bar {
  background: rgba(255, 255, 255, 0.15);
}
.ml-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: var(--ml-sky);
  animation: ml-bar 1.1s ease-in-out infinite;
}
@keyframes ml-bar {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-loader * {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
