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

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&family=Roboto:wght@300;400;500&display=swap");

* {
  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;
}

/* Flutter's rendering surface — locked to ARC background so it never bleeds through */
/* Scoped to flt-* elements only — must NOT catch #halo-ring-canvas */
flt-glass-pane,
flt-scene-host,
flt-glass-pane canvas {
  background: #080c14 !important;
}

/* ── Splash root ── */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  z-index: 9999;
  background-color: #080c14;
  /* No transition here by default — only activated when dismissing begins */
}

#splash.dismissing {
  transition: opacity 0.85s 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;
  }
}

/* ── Three.js HALO ring wrap ── */
#halo-ring-wrap {
  position: fixed;
  pointer-events: none;
  z-index: 9;
  overflow: visible;
  background: transparent;
}

#halo-ring-canvas {
  display: block;
  background: transparent;
  width: 0;
  height: 0;
}

/* ── 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, -40px) env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 0);
  will-change: transform, opacity;
  transform-origin: center center;
}

/* ── Floating logo mark — 40% bigger (72 × 1.4 = ~101px) ── */
.logo-icon {
  width: 101px;
  height: auto;
  margin-bottom: -28px;
  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 — fully transparent, no bg / border / shadow ── */
.card {
  position: relative;
  z-index: 10;
  width: 88%;
  max-width: 380px;
  padding: 20px 32px 36px;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  text-align: center;
}

/* Remove top highlight bar */
.card::before {
  display: none;
}

/* ── Phase 1: firesite.ai brand intro ── */
.brand-intro {
  opacity: 1;
  transition: opacity 0.8s ease-out;
}

.brand-intro.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Typography from firesite.io .content-box h1 / p */
.brand-intro h1 {
  font-family: "Open Sans", sans-serif;
  font-size: 3rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  margin-bottom: 8px;
  margin-top: 20px;
  line-height: 1.1;
  letter-spacing: -0.25px;
}

.brand-intro p {
  font-family: "Roboto", sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.5;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* ── Phase 2: ARC identity ── */
.arc-identity {
  opacity: 0;
  transition: opacity 1.2s ease-in;
  position: absolute;
  width: 100%;
  left: 0;
  top: 55px;
  pointer-events: none;
}

.arc-identity.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Relative wrapper so absolute arc-identity is positioned inside card */
.card {
  position: relative;
  min-height: 120px;
}

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

.subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  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: 205px 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: 78px;
    margin-bottom: -14px;
  }
  .card {
    padding: 32px 24px 28px;
  }
  .brand-intro h1 {
    font-size: 2.5rem;
  }
  .brand-intro p {
    font-size: 1rem;
  }
  .title {
    font-size: 2.5rem;
  }
}
