body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-bg, rgba(124, 58, 237, 0.3));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--glass-border, rgba(124, 58, 237, 0.5));
}

/* Selection */
::selection {
  background: rgba(124, 58, 237, 0.4);
  color: var(--purple-50);
}

/* Particle Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Loading Screen */
/* ═══════════════════════════════════════════════════════
   Loading Screen — Apple-style cinematic reveal
   ═══════════════════════════════════════════════════════ */

.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary, #0A0A0F);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow: hidden;
  /* NO opacity transition on the container — background stays solid to prevent bleed-through */
}

.loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 55%, rgba(139, 92, 246, 0.04) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.loading-screen.hide {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reveal container ── */
.loading-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ── Logo ── */
.loading-reveal__logo {
  width: 72px;
  height: 72px;
  margin-bottom: 28px;
  opacity: 0;
  transform: scale(0.6) translateY(10px);
  filter: blur(12px);
  animation: revealUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.loading-reveal__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.5))
          drop-shadow(0 0 40px rgba(167, 139, 250, 0.2));
}

/* ── Title: ACCIOS CORE ── */
.loading-reveal__title {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin: 0 0 12px;
  display: flex;
  gap: 0.35em;
}

.loading-reveal__word {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(10px);
  display: inline-block;
  background: linear-gradient(135deg, #e2d6ff 0%, #a78bfa 40%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-reveal__word:nth-child(1) {
  animation: revealWord 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.loading-reveal__word:nth-child(2) {
  animation: revealWord 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.loading-reveal__word--light {
  font-weight: 300;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Subtitle: Digital Ecosystem ── */
.loading-reveal__sub {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.6);
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  animation: revealWord 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

/* ── Accent line ── */
.loading-reveal__line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), rgba(167, 139, 250, 0.3), transparent);
  margin-bottom: 18px;
  animation: revealLine 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

/* ── Status text: "Inicializando" ── */
.loading-reveal__status {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  filter: blur(6px);
  animation: revealWord 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards,
             statusPulse 2s ease-in-out 1.4s infinite;
}

/* ═══ Keyframes ═══ */

@keyframes revealUp {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes revealWord {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes revealLine {
  to {
    width: min(220px, 60vw);
  }
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--purple-300) 0%, var(--purple-400) 50%, var(--purple-200) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: rgba(18, 18, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--text-sm);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--error); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info    { border-left: 3px solid var(--info); }

/* Modal Root */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.modal-root.active {
  display: block;
  pointer-events: auto;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #particle-canvas {
    display: none;
  }
}

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

@keyframes blink {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  80%, 100% { opacity: 0; }
}

/* ── Mobile fixes ── */
@media (max-width: 480px) {
  .toast-container {
    right: var(--space-3);
    left: var(--space-3);
    max-width: none;
  }
}
