/* ARC — Splash Screen Styles */
/* Solomon pattern adapted for iPhone (portrait, edge-to-edge) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background-color: #080C14;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

/* ── Splash root ── */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  transition: opacity 0.9s ease-out;
}

#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Animated gradient background ── */
.background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(59, 130, 246, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 20%, rgba(99, 102, 241, 0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15, 32, 68, 0.5) 0%, transparent 70%),
    #080C14;
  animation: pulseBackground 8s ease-in-out infinite;
}

@keyframes pulseBackground {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.8; }
}

/* ── Layout container ── */
.container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 11;
  padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 0);
}

/* ── Floating logo mark (above card) ── */
.logo-icon {
  width: 72px;
  height: auto;
  margin-bottom: -20px;
  position: relative;
  z-index: 20;
  filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.5));
  animation: logoFloat 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* ── Card ── */
.card {
  position: relative;
  z-index: 10;
  width: 88%;
  max-width: 380px;
  padding: 40px 32px 36px;
  background: rgba(13, 21, 38, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow:
    0 4px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(59, 130, 246, 0.06);
  animation: cardEntrance 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}

/* Top highlight edge */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(96, 165, 250, 0.4) 35%,
    rgba(96, 165, 250, 0.4) 65%,
    transparent 100%);
  border-radius: 8px 8px 0 0;
}

@keyframes cardEntrance {
  0% {
    transform: translateY(32px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

#splash.hidden .card {
  animation: cardExit 0.9s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes cardExit {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(100%) scale(0.85); opacity: 0; }
}

/* ── Logo inside card ── */
.logo-main {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto 24px;
  opacity: 0.9;
}

/* ── Card content ── */
.content-box {
  text-align: center;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 6px;
  color: #ffffff;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.8);
  margin-bottom: 0;
}

.line {
  width: 40px;
  height: 1px;
  background: rgba(59, 130, 246, 0.3);
  margin: 28px auto 0;
}

/* ── Loading indicator ── */
.loading-section {
  margin-top: 20px;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(59, 130, 246, 0.15);
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4));
}

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

.loading-text {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: rgba(148, 163, 184, 0.45);
}

/* ── iPhone notch / Dynamic Island safe area ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .container {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* ── Compact height (iPhone SE etc.) ── */
@media (max-height: 680px) {
  .logo-icon { width: 56px; margin-bottom: -14px; }
  .card      { padding: 32px 24px 28px; }
  .logo-main { width: 90px; margin-bottom: 16px; }
  .title     { font-size: 1.6rem; }
}
