/* Brand mark + loading-screen animation.
   Served as a plain public stylesheet (not through Tailwind) because the
   splash in index.html has to animate before the JS bundle has loaded; the
   React <BrandLoader> reuses the exact same classes, so the hand-off from the
   static splash to the in-app loader is seamless. */

:root {
  --mn-red: #e64216;
  --mn-orange: #ec632f;
  --mn-yellow: #f6b724;
  --mn-teal: #12a8c6;
  --mn-splash-bg: #fbf8f4;
  --mn-splash-ink: #1c1917;
  --mn-splash-muted: #7a706a;
}
:root[data-theme="dark"] {
  --mn-splash-bg: #0f0d0d;
  --mn-splash-ink: #f7f3ee;
  --mn-splash-muted: #a9a09a;
}

/* ---- the mark ---------------------------------------------------------- */
.mn-mark {
  display: block;
  overflow: visible;
}
.mn-mark .mn-dot,
.mn-mark .mn-excl {
  transform-box: fill-box;
  transform-origin: center;
}

/* ---- wordmark ---------------------------------------------------------- */
.mn-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--mn-splash-ink);
}
.mn-word {
  display: flex;
  align-items: flex-end;
  gap: 0.06em;
  direction: rtl;
  font-family: "Assistant Variable", "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mn-word .mn-mem {
  height: 0.78em;
  width: auto;
  margin-bottom: 0.08em;
}
.mn-tagline {
  display: flex;
  align-items: center;
  gap: 0.5em;
  direction: rtl;
  margin-top: 0.35em;
  width: 100%;
}
.mn-tagline-line {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--mn-yellow);
  transform-origin: right;
}
.mn-tagline-text {
  font-family: "Amatic SC", "Assistant Variable", cursive;
  font-weight: 700;
  font-size: 0.5em;
  letter-spacing: 0.12em;
  color: var(--mn-yellow);
  white-space: nowrap;
}
:root:not([data-theme="dark"]) .mn-tagline-text {
  /* Yellow on near-white is too faint for text -- the brand's darker orange
     carries it in light mode, the line stays yellow. */
  color: var(--mn-orange);
}

/* ---- full-screen loader / splash --------------------------------------- */
.mn-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--mn-splash-bg);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mn-splash.mn-splash-out {
  opacity: 0;
  visibility: hidden;
}
.mn-splash > .mn-mark {
  width: 112px;
  height: auto;
}
.mn-splash .mn-wordmark {
  font-size: 40px;
}
.mn-splash-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--mn-orange) 22%, transparent), transparent 70%);
  filter: blur(10px);
  animation: mn-breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}

/* ---- intro animation (.mn-intro) -------------------------------------- */
.mn-intro .mn-excl {
  animation: mn-drop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.mn-intro .mn-q {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: mn-draw 0.7s 0.15s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}
.mn-intro .mn-q-line {
  animation: mn-fade 0.25s 0.8s both;
}
.mn-intro .mn-dot-a {
  animation: mn-pop 0.4s 0.62s cubic-bezier(0.3, 1.6, 0.5, 1) both, mn-bob 1.4s 1.3s ease-in-out infinite;
}
.mn-intro .mn-dot-b {
  animation: mn-pop 0.4s 0.76s cubic-bezier(0.3, 1.6, 0.5, 1) both, mn-bob 1.4s 2s ease-in-out infinite;
}
.mn-intro .mn-word {
  animation: mn-rise 0.5s 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.mn-intro .mn-tagline-line {
  animation: mn-grow 0.55s 1s cubic-bezier(0.6, 0, 0.3, 1) both;
}
.mn-intro .mn-tagline-text {
  animation: mn-fade 0.4s 1.2s both;
}

/* ---- loop-only animation (.mn-loop): in-app loader after the splash --- */
.mn-loop .mn-dot-a {
  animation: mn-bob 1.4s ease-in-out infinite;
}
.mn-loop .mn-dot-b {
  animation: mn-bob 1.4s 0.7s ease-in-out infinite;
}

@keyframes mn-drop {
  from { transform: translateY(-45%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes mn-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes mn-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes mn-bob {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14%); }
}
@keyframes mn-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mn-rise {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes mn-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes mn-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.75; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mn-intro *,
  .mn-loop *,
  .mn-splash-glow {
    animation: none !important;
  }
  .mn-intro .mn-q {
    stroke-dashoffset: 0;
  }
}
