/* ============================================
   Canvas: Constelación, Loading, Tooltip
   ============================================ */

/* --- Loading screen --- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  background: #060208;
  overflow: hidden;
  transition: opacity 1.5s ease, visibility 1.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Resplandor ambiental central */
.loading-screen__glow {
  position: absolute;
  top: 35%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(135, 71, 123, 0.12) 0%,
    rgba(135, 71, 123, 0.04) 35%,
    transparent 70%
  );
  animation: glowPulse 6s ease-in-out infinite;
  pointer-events: none;
}

/* Contenido centrado */
.loading-screen__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.loading-screen__logo {
  height: clamp(80px, 16vh, 160px);
  width: auto;
  opacity: 0;
  animation: introReveal 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
  filter: drop-shadow(0 0 60px rgba(135, 71, 123, 0.25));
}

.loading-screen__text {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--texto-marca);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 200;
  opacity: 0;
  animation: introReveal 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s forwards;
  text-shadow: 0 0 60px rgba(226, 176, 33, 0.08);
}

/* Línea decorativa */
.loading-screen__line {
  width: 40px;
  height: 1px;
  background: rgba(226, 176, 33, 0.3);
  opacity: 0;
  animation: introReveal 1.5s ease 1.4s forwards;
}

.loading-screen__bar {
  width: min(200px, 50vw);
  height: 1px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  opacity: 0;
  animation: introReveal 1s ease 1.8s forwards;
}

.loading-screen__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(135, 71, 123, 0.6),
    var(--dorado-acento),
    var(--texto-marca)
  );
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.loading-screen__enter {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: rgba(243, 237, 201, 0.5);
  background: transparent;
  border: 1px solid rgba(226, 176, 33, 0.2);
  padding: 10px 48px;
  border-radius: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 400;
}

.loading-screen__enter.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-screen__enter:hover {
  color: var(--dorado-acento);
  border-color: rgba(226, 176, 33, 0.5);
  padding: 10px 56px;
  box-shadow: 0 0 30px rgba(226, 176, 33, 0.06);
}

@keyframes introReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* --- Tooltip (hover sobre partícula) --- */
.tooltip-card {
  position: fixed;
  z-index: var(--z-tooltip);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 260px;
}

.tooltip-card.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.tooltip-card__photo {
  width: 110px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid rgba(226, 176, 33, 0.6);
  display: block;
  margin: 0 auto var(--space-sm);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(135, 71, 123, 0.15);
}

.tooltip-card__info {
  background: rgba(13, 5, 16, 0.75);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(243, 237, 201, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

.tooltip-card__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--texto-marca);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
}

.tooltip-card__days {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--dorado-acento);
  font-weight: 300;
}

/* --- Onboarding --- */
.onboarding {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(243, 237, 201, 0.4);
  letter-spacing: 0.06em;
  font-weight: 300;
  font-style: italic;
  z-index: var(--z-header);
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

.onboarding.visible {
  opacity: 1;
}

.onboarding.fade-out {
  opacity: 0;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .loading-screen,
  .tooltip-card,
  .loading-screen__enter {
    transition: none;
  }
  .loading-screen__logo,
  .loading-screen__text,
  .loading-screen__line,
  .loading-screen__bar,
  .loading-screen__glow {
    animation: none;
    opacity: 1;
  }
}
