:root {
  --den-primary: #03a303;
  --den-primary-glow: rgba(3, 163, 3, 0.18);
  --den-bg: #ffffff;
  --den-bg-soft: #f7f9f8;
  --den-text: #101613;
  --den-text-muted: #6b7570;
}

/* ===== App visibility ===== */
#app {
  opacity: 1;
}

body.page-loading #app {
  opacity: 0;
}

body.page-revealing #app {
  opacity: 1;
  clip-path: circle(0% at 50% 45%);
  animation: app-reveal 0.85s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  will-change: clip-path;
}

@keyframes app-reveal {
  0% {
    clip-path: circle(0% at 50% 45%);
  }
  100% {
    clip-path: circle(150% at 50% 45%);
  }
}

/* ===== Splash screen container ===== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 50% 45%,
    var(--den-bg-soft) 0%,
    var(--den-bg) 70%
  );
  overflow: hidden;
}

/* ===== Logo + Radar ring (idle loading) ===== */
.splash-logo-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}

.radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--den-primary);
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  animation: radar-ping 2.4s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
  animation-fill-mode: both;
}

.radar-ring.ring-2 {
  animation-delay: 0.8s;
}

.radar-ring.ring-3 {
  animation-delay: 1.6s;
}

@keyframes radar-ping {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.1);
    opacity: 0;
  }
}

.splash-logo {
  position: relative;
  z-index: 2;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logo-breathe 2.4s ease-in-out infinite;
}

.splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px var(--den-primary-glow));
}

@keyframes logo-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* ===== Loading text ===== */
.splash-loading-text {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--den-text-muted);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.splash-loading-text .dot {
  color: var(--den-primary);
  font-weight: 700;
  animation: dot-blink 1.4s ease-in-out infinite;
}

.splash-loading-text .dot:nth-child(3) {
  animation-delay: 0.2s;
}

.splash-loading-text .dot:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes dot-blink {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-screen.is-ready .splash-loading-text {
  opacity: 0;
  pointer-events: none;
}

/* ===== Brand title/subtitle ===== */
.splash-brand {
  margin-top: 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  padding: 0 24px;
  transition: opacity 0.35s ease;
}

.splash-screen.is-ready .splash-brand {
  animation: brand-bounce-in 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes brand-bounce-in {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-title {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--den-text);
  letter-spacing: 0.3px;
}

.splash-title .divider {
  color: var(--den-primary);
  margin: 0 6px;
  font-weight: 400;
}

.splash-subtitle {
  margin: 8px 0 0;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--den-text-muted);
  max-width: 320px;
  line-height: 1.5;
}

/* ===== Reveal ring (final transition, syncs with #app clip-path reveal) ===== */
.reveal-ring {
  position: fixed;
  top: 45%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--den-primary);
  box-shadow: 0 0 24px var(--den-primary-glow);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 100000;
}

.splash-screen.is-expanding .reveal-ring {
  animation: reveal-ring-grow 0.85s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes reveal-ring-grow {
  0% {
    width: 100px;
    height: 100px;
    opacity: 1;
  }
  60% {
    opacity: 0.8;
  }
  100% {
    width: 220vmax;
    height: 220vmax;
    opacity: 0;
  }
}

.splash-screen.is-expanding .splash-logo-wrap .radar-ring {
  opacity: 0;
  display: none;
}
