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

body {
  background: #1a1a1a;
  font-family: 'poppins', sans-serif;
  overflow: hidden;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeOutSplash 1.2s ease-in-out 6s forwards;
  padding: 0 20px;
}

#logo-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 300px;
}

/* Optimizaciones adicionales de rendimiento */
#splash svg {
  width: clamp(80px, 30vw, 120px);
  height: auto;
  opacity: 0;
  transform: scale(0.8);
  animation: logoEntrance 1s ease-out 0.2s forwards;
  filter: drop-shadow(0 4px 15px rgba(123, 97, 255, 0.2));
  will-change: transform, opacity;
}

/* Animación optimizada de los paths del SVG */
#splash svg path {
  fill: transparent;
  stroke: #7B61FF;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  will-change: stroke-dashoffset, fill;
}

/* Optimización de animaciones más largas */
#splash svg .path-1 {
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  animation: drawAndFill1 3s ease-out 1s forwards;
}

#splash svg .path-2 {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: drawAndFill2 2.8s ease-out 1.5s forwards;
}

#splash svg .path-3 {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: drawAndFill3 1.5s ease-out 2.5s forwards;
}

#splash svg .path-4 {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawAndFill4 2.2s ease-out 2s forwards;
}

/* Efecto de resplandor responsive */
.glow-effect {
  position: absolute;
  width: clamp(150px, 40vw, 200px);
  height: clamp(150px, 40vw, 200px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 97, 255, 0.1), transparent 70%);
  opacity: 0;
  animation: pulseGlow 2s ease-in-out 1.5s infinite alternate;
}

@keyframes logoEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animaciones combinadas más fluidas */
@keyframes drawAndFill1 {
  0% {
    stroke-dashoffset: 1800;
    fill: transparent;
  }

  70% {
    stroke-dashoffset: 0;
    fill: transparent;
  }

  100% {
    stroke-dashoffset: 0;
    fill: #7B61FF;
  }
}

@keyframes drawAndFill2 {
  0% {
    stroke-dashoffset: 1600;
    fill: transparent;
  }

  70% {
    stroke-dashoffset: 0;
    fill: transparent;
  }

  100% {
    stroke-dashoffset: 0;
    fill: #7B61FF;
  }
}

@keyframes drawAndFill3 {
  0% {
    stroke-dashoffset: 500;
    fill: transparent;
  }

  70% {
    stroke-dashoffset: 0;
    fill: transparent;
  }

  100% {
    stroke-dashoffset: 0;
    fill: #7B61FF;
  }
}

@keyframes drawAndFill4 {
  0% {
    stroke-dashoffset: 1400;
    fill: transparent;
  }

  70% {
    stroke-dashoffset: 0;
    fill: transparent;
  }

  100% {
    stroke-dashoffset: 0;
    fill: #7B61FF;
  }
}

@keyframes pulseGlow {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes fadeOutSplash {
  0% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

#landing {
  opacity: 0;
  text-align: center;
  color: #fff;
  animation: showLanding 1.5s ease-out 6.5s forwards;
  transform: translateY(20px);
  padding: 0 20px;
  width: 100%;
}

#landing h1 {
  font-size: clamp(1.5rem, 8vw, 3.5rem);
  font-weight: 700;
  margin-bottom: clamp(0.5rem, 3vw, 1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#landing .brand {
  color: #7B61FF;
  background: linear-gradient(135deg, #7B61FF, #9D7BFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

#landing p {
  font-size: clamp(0.9rem, 4vw, 1.25rem);
  font-weight: 300;
  opacity: 0.8;
  animation: slideUpText 1.2s ease-out 7.5s forwards;
  transform: translateY(10px);
  line-height: 1.4;
}

@keyframes showLanding {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpText {
  0% {
    opacity: 0.8;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading indicator con timing extendido - responsive */
.loading-bar {
  position: fixed;
  bottom: clamp(20px, 5dvh, 30px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(200px, 80vw, 250px);
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: showLoadingBar 0.8s ease-out 2s forwards, hideLoadingBar 0.8s ease-out 5.5s forwards;
}

.loading-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7B61FF, #9D7BFF);
  border-radius: 2px;
  animation: loadingProgress 3.5s ease-in-out 2s forwards;
}

@keyframes showLoadingBar {
  to {
    opacity: 1;
  }
}

@keyframes hideLoadingBar {
  to {
    opacity: 0;
  }
}

@keyframes loadingProgress {
  to {
    width: 100%;
  }
}

/* Botón flotante de home - responsive */
.home-button {
  position: fixed;
  top: clamp(15px, 4vw, 20px);
  left: clamp(15px, 4vw, 20px);
  width: clamp(40px, 12vw, 50px);
  height: clamp(40px, 12vw, 50px);
  background: rgba(123, 97, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: clamp(8px, 3vw, 12px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
  border: 1px solid rgba(123, 97, 255, 0.2);
  animation: showHomeButton 0.8s ease-out 7s forwards;
}

.home-button:hover {
  background: rgba(123, 97, 255, 0.2);
  transform: scale(0.9);
  box-shadow: 0 8px 25px rgba(123, 97, 255, 0.3);
}

.home-button:active {
  transform: scale(0.85);
}

.home-button svg {
  width: clamp(20px, 6vw, 28px);
  height: clamp(20px, 6vw, 28px);
  opacity: 0.9;
}

.home-button svg path {
  fill: #7B61FF !important;
  stroke: none !important;
  animation: none !important;
}

@keyframes showHomeButton {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Optimizaciones críticas de rendimiento */
* {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

#splash,
#landing,
svg,
.glow-effect {
  transform-style: preserve-3d;
}

/* Media queries para dispositivos muy pequeños */
@media screen and (max-width: 320px) {
  #landing h1 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }

  #landing p {
    font-size: 0.85rem;
  }

  #splash svg {
    width: 70px;
  }

  .glow-effect {
    width: 120px;
    height: 120px;
  }

  .loading-bar {
    width: 180px;
    bottom: 15px;
  }
}

/* Orientación landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
  #landing h1 {
    font-size: clamp(1.2rem, 6vw, 2rem);
    margin-bottom: 0.3rem;
  }

  #landing p {
    font-size: clamp(0.8rem, 3vw, 1rem);
  }

  #splash svg {
    width: clamp(60px, 20vw, 80px);
  }

  .loading-bar {
    bottom: 15px;
  }

  .home-button {
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
  }

  .home-button svg {
    width: 18px;
    height: 18px;
  }
}

/* Mejoras para pantallas táctiles */
@media (pointer: coarse) {
  .home-button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Reducir animaciones para dispositivos con poca potencia */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}