/* Figma loading screen (1:2674).
   Keep this in sync with src/components/branding/arca-app-splash.css. */

.arca-app-splash {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  background: #f4f4f4;
  font-family: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.arca-app-splash::before,
.arca-app-splash::after {
  content: "";
  display: none;
}

.arca-app-splash::before {
  left: -825px;
}

.arca-app-splash::after {
  left: calc(83.33% + 59px);
}

.arca-app-splash__stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.arca-app-splash__stack {
  width: 188.427px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.arca-app-splash__mark-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arca-app-splash__mark {
  width: 54px;
  height: 54px;
  display: block;
}

/*
  Boot-splash dot matrix — pure CSS mirror of the React DotmCircular10
  component used while the JS bundle is still loading. 13 dots positioned in a
  circular pattern inside a 54×54 box (dotSize=6, cellSpacing=12). Opacity
  animates in a ring-based wave so the spinner reads as "loading" with no
  framework dependency.
*/
.arca-app-splash__dotm {
  position: relative;
  width: 54px;
  height: 54px;
  pointer-events: none;
}

.arca-app-splash__dotm-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0e121b;
  opacity: 0.06;
  animation: arca-dotm-pulse 1.6s ease-in-out infinite;
}

/* Center cell — leads the wave. */
.arca-app-splash__dotm-dot--r0 {
  animation-delay: 0ms;
}

/* Inner ring — follows the center by a beat. */
.arca-app-splash__dotm-dot--r1 {
  animation-delay: 200ms;
}

/* Outer ring — closes the wave. */
.arca-app-splash__dotm-dot--r2 {
  animation-delay: 400ms;
}

@keyframes arca-dotm-pulse {
  0%, 100% {
    opacity: 0.06;
  }
  50% {
    opacity: 0.94;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arca-app-splash__dotm-dot {
    animation: none;
    opacity: 0.48;
  }
}

.arca-app-splash__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.arca-app-splash__title {
  margin: 0;
  color: #0e121b;
  font-size: 24px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.144px;
  white-space: nowrap;
}

.arca-app-splash__title-dots {
  display: inline;
}

.arca-app-splash__title-dots span {
  opacity: 0.15;
  animation: arca-title-dot-blink 1.4s ease-in-out infinite;
}

.arca-app-splash__title-dots span:nth-child(1) {
  animation-delay: 0ms;
}

.arca-app-splash__title-dots span:nth-child(2) {
  animation-delay: 200ms;
}

.arca-app-splash__title-dots span:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes arca-title-dot-blink {
  0%, 100% {
    opacity: 0.15;
  }
  40% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arca-app-splash__title-dots span {
    animation: none;
    opacity: 0.6;
  }
}

.arca-app-splash__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: #0e121b;
}

#boot-splash.arca-app-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
}

/*
  Dot-matrix scatter exit — the 13 dots of the spinner break formation and
  fly outward radially (each dot's --sx/--sy vector points away from the
  center, set inline on each .arca-app-splash__dotm-dot in index.html).
  The title drifts up and fades; the backdrop fades last so the app appears
  through a softly clearing burst. This ties the exit to the brand's
  dot-matrix identity rather than a generic dissolve.

  Timing (within the 0.72s window):
    0–55%  pause then begin scatter (dots hold formation, title starts fading)
    55–100% dots accelerate outward, shrink to 0.2, fade to 0
    0–80%  backdrop holds opaque (so dots stay visible against the splash bg)
    80–100% backdrop fades, revealing the app underneath
*/
#boot-splash.arca-app-splash--exit {
  pointer-events: none;
  animation: arca-boot-backdrop-out 0.72s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: opacity;
}

/* Pause the idle pulse so each dot exits from a known state. */
#boot-splash.arca-app-splash--exit .arca-app-splash__dotm-dot {
  animation: arca-boot-dot-scatter 0.72s cubic-bezier(0.34, 0.04, 0.4, 1.2) forwards;
  will-change: transform, opacity;
}

#boot-splash.arca-app-splash--exit .arca-app-splash__title {
  animation: arca-boot-title-out 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

@keyframes arca-boot-dot-scatter {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.94;
  }
  15% {
    /* Tiny inward "wind-up" — like an arrow being drawn before release. */
    transform: translate(calc(var(--sx, 0px) * -0.04), calc(var(--sy, 0px) * -0.04)) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(0.2);
    opacity: 0;
  }
}

@keyframes arca-boot-title-out {
  0% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: -0.144px;
  }
  100% {
    opacity: 0;
    /* Title drifts up + slightly expands its tracking, like it's being
       "blown away" by the dot burst. */
    transform: translateY(-10px);
    letter-spacing: 0.5px;
  }
}

@keyframes arca-boot-backdrop-out {
  0%, 80% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot-splash.arca-app-splash--exit {
    animation: arca-boot-fade-reduced 0.4s ease forwards;
  }
  #boot-splash.arca-app-splash--exit .arca-app-splash__dotm-dot,
  #boot-splash.arca-app-splash--exit .arca-app-splash__title {
    animation: none;
  }
  @keyframes arca-boot-fade-reduced {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      visibility: hidden;
    }
  }
}

