/* Splash — preparação premium da experiência */

body.is-splash-active {
  overflow: hidden;
}

body.is-splash-active .skip-link {
  visibility: hidden;
}

body.is-splash-active .site-brand__logo img {
  opacity: 0;
  visibility: hidden;
}

.splash__logo.is-flying {
  position: fixed !important;
  z-index: 10001;
  margin: 0 !important;
  pointer-events: none;
  object-fit: contain;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.splash--experience {
  --splash-bg: #080809;
  --splash-accent: #7dd3fc;

  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--splash-bg);
  overflow: hidden;
  isolation: isolate;
  contain: layout paint style;
  will-change: opacity;
}

.splash--experience.is-done {
  pointer-events: none;
}

/* Luz ambiente suave */
.splash__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(125, 211, 252, 0.09), transparent 68%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(56, 189, 248, 0.05), transparent 70%),
    radial-gradient(ellipse 45% 35% at 15% 75%, rgba(14, 165, 233, 0.04), transparent 72%);
  opacity: 0.6;
}

@media (prefers-reduced-motion: no-preference) {
  .splash__ambient {
    animation: splash-ambient-pulse 5s ease-in-out infinite;
  }
}

@keyframes splash-ambient-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.75;
  }
}

.splash__veil {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background: rgba(8, 8, 9, 0.45);
  will-change: opacity;
}

.splash__stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: clamp(1.5rem, 5vw, 3rem);
  pointer-events: none;
}

.splash__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 420px);
  gap: clamp(1.5rem, 4vh, 2.25rem);
  text-align: center;
}

/* Logo */
.splash__logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(75vw, 380px);
  height: min(75vw, 380px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(125, 211, 252, 0.18) 0%,
    rgba(125, 211, 252, 0.06) 45%,
    transparent 70%
  );
  opacity: 0;
  pointer-events: none;
}

.splash__logo {
  position: relative;
  z-index: 1;
  display: block;
  width: min(58vw, 280px);
  height: auto;
  opacity: 0;
  transform: scale(0.92);
  filter: drop-shadow(0 0 40px rgba(125, 211, 252, 0.12));
  will-change: transform, opacity;
}

/* Mensagens */
.splash__message {
  margin: 0;
  min-height: 1.5em;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2.8vw, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

/* Loader — anel + porcentagem */
.splash__loader {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  opacity: 0;
  transform: translateY(8px);
}

.splash__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.splash__ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2;
}

.splash__ring-fill {
  fill: none;
  stroke: url(#splash-ring-gradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.15s ease-out;
}

/* Gradiente inline via CSS stroke — fallback cor sólida */
.splash__ring-fill {
  stroke: var(--splash-accent);
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.35));
}

.splash__pct {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.splash__pct [data-splash-progress] {
  color: var(--splash-accent);
  font-weight: 600;
}

.splash__pct-suffix {
  margin-left: 0.05em;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85em;
}

/* Barra inferior suave */
.splash__bar {
  width: min(280px, 72vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  opacity: 0;
}

.splash__bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), var(--splash-accent));
  box-shadow: 0 0 16px rgba(125, 211, 252, 0.25);
  transition: width 0.12s ease-out;
}

.splash__ready {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 2.4vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--splash-accent);
  opacity: 0;
  transform: translateY(6px);
}

@media (max-width: 767px) {
  .splash__logo {
    width: min(78vw, 340px);
  }

  .splash__glow {
    width: min(85vw, 400px);
    height: min(85vw, 400px);
  }
}

@media (min-width: 768px) {
  .splash__logo {
    width: min(24vw, 300px);
  }

  .splash__content {
    width: min(100%, 480px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__ambient {
    animation: none;
  }
}
