/* loader.css — Aarav & Riya Wedding */

/* ===================== LOADER ===================== */
#loader {
  position: fixed;
  inset: 0;
  background: var(--royal);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  overflow: hidden;
}

.loader__mandala {
  position: absolute;
  width: 320px;
  height: 320px;
  animation: mandala-spin 12s linear infinite;
  opacity: 0.15;
}

@keyframes mandala-spin { to { transform: rotate(360deg); } }

.loader__monogram {
  position: relative;
  z-index: 2;
  width: 140px;
  height: 140px;
  padding: 0.85rem;
  border: 2px solid rgba(212, 160, 23, 0.7);
  border-radius: 2rem;
  background: rgba(255, 249, 232, 0.96);
  box-shadow: 0 0 0 0.45rem rgba(212, 160, 23, 0.12), 0 1.25rem 3rem rgba(0, 0, 0, 0.22);
}

.loader__logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loader__monogram svg path {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: draw-path 2.2s ease forwards 0.3s;
}

@keyframes draw-path { to { stroke-dashoffset: 0; } }

.loader__text {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  margin: 2.25rem 0 0;
  padding: 0 1rem;
  text-align: center;
  opacity: 0;
  animation: fade-in 1s ease forwards 2s;
  position: relative;
  z-index: 2;
}

@keyframes fade-in { to { opacity: 1; } }

.loader__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  width: 0%;
  animation: bar-fill 2.8s ease forwards 0.2s;
}

@keyframes bar-fill { to { width: 100%; } }

.loader__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Iris wipe */
#loader.exit {
  animation: iris-out 0.9s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes iris-out {
  from { clip-path: circle(150% at 50% 50%); }
  to { clip-path: circle(0% at 50% 50%); }
}
