/* ─── Splash Screen ──────────────────────────────────────────────────────── */

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0a1510;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Safe area for iOS notch */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Geometric pattern tiles ── */
#splash-pattern {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  opacity: 0;
  animation: patternReveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

@keyframes patternReveal {
  0%   { opacity: 0; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── Radial vignette over pattern ── */
#splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    rgba(10, 21, 16, 0.82) 0%,
    rgba(10, 21, 16, 0.60) 50%,
    rgba(10, 21, 16, 0.30) 100%
  );
  z-index: 1;
}

/* ── Center content ── */
#splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── Outer ring ── */
.splash-ring {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.splash-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: ringFadeIn 0.9s ease 0.6s forwards;
}

.splash-ring-track {
  fill: none;
  stroke: rgba(212, 175, 55, 0.15);
  stroke-width: 1;
}

.splash-ring-progress {
  fill: none;
  stroke: var(--gold, #d4af37);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  animation: ringDraw 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

@keyframes ringDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes ringFadeIn {
  to { opacity: 1; }
}

/* ── Star of Islam center medallion ── */
.splash-medallion {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(0.6) rotate(-15deg);
  animation: medallionIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1.0s forwards;
}

@keyframes medallionIn {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── Bismillah ── */
.splash-bismillah {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.6rem;
  color: #d4af37;
  text-align: center;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  animation: textUp 0.6s ease 1.3s forwards;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  margin-bottom: 14px;
}

/* ── App name ── */
.splash-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: #e8ede9;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  animation: textUp 0.6s ease 1.5s forwards;
}

/* ── Subtitle ── */
.splash-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: rgba(154, 184, 159, 0.7);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 6px;
  opacity: 0;
  animation: textUp 0.6s ease 1.7s forwards;
}

@keyframes textUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Loading dots ── */
.splash-loader {
  display: flex;
  gap: 6px;
  margin-top: 40px;
  opacity: 0;
  animation: textUp 0.4s ease 2.0s forwards;
}

.splash-loader span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.5);
  animation: splashDot 1.2s infinite;
}
.splash-loader span:nth-child(2) { animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splashDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* ── Corner ornaments ── */
.splash-corner {
  position: absolute;
  width: 80px;
  height: 80px;
  opacity: 0;
  animation: cornerIn 0.8s ease 0.8s forwards;
}
.splash-corner.tl { top: 20px; left: 20px; transform: rotate(0deg); }
.splash-corner.tr { top: 20px; right: 20px; transform: rotate(90deg); }
.splash-corner.bl { bottom: 20px; left: 20px; transform: rotate(270deg); }
.splash-corner.br { bottom: 20px; right: 20px; transform: rotate(180deg); }

@keyframes cornerIn {
  from { opacity: 0; transform: scale(0.7) rotate(var(--r, 0deg)); }
  to   { opacity: 0.35; transform: scale(1) rotate(var(--r, 0deg)); }
}
.splash-corner.tl { --r: 0deg; }
.splash-corner.tr { --r: 90deg; }
.splash-corner.bl { --r: 270deg; }
.splash-corner.br { --r: 180deg; }

/* ── Exit animation ── */
#splash.hiding {
  animation: splashExit 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes splashExit {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}
