:root {
  --brand-orange: #ff7a00;
  --brand-gray: #444444;
  --brand-light-gray: #888888;
  --bg-color: #000000;
  --btn-width: 500px;
  --btn-height: 70px;
  --btn-radius: 20px;
}

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

body {
  background-color: var(--bg-color);
  color: #ffffff;
  font-family: "Inter", sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Capa de Ruido y Grid de Laboratorio */
#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#noise-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Capa de Partículas (Canvas) */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* Textos de Consola */
#console-container {
  position: absolute;
  bottom: 40px;
  left: 40px;
  z-index: 4;
  font-family: "Inter", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--brand-light-gray);
  text-transform: uppercase;
  font-weight: 300;
}

.console-line {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  position: absolute;
  bottom: 0;
  white-space: nowrap;
}

.console-line.active {
  opacity: 1;
  transform: translateY(0);
}

.console-line.done {
  opacity: 0;
  transform: translateY(-10px);
}

/* Contenedor Principal del Botón */
#ui-layer {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Botón Glassmorphism */
#contact-btn {
  width: var(--btn-width);
  height: var(--btn-height);
  border-radius: var(--btn-radius);
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 122, 0, 0);
  box-shadow: 0 0 0 rgba(255, 122, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
  pointer-events: none; /* Se activa al final */
}

#contact-btn.visible {
  opacity: 1;
  border: 1px solid rgba(255, 122, 0, 0.3);
  box-shadow: 0 4px 30px rgba(255, 122, 0, 0.1);
}

#contact-btn.interactive {
  pointer-events: auto;
}

#contact-btn.interactive:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 40px rgba(255, 122, 0, 0.25);
  border: 1px solid rgba(255, 122, 0, 0.6);
  background: rgba(30, 30, 30, 0.6);
}

#contact-btn.interactive:active {
  transform: translateY(0) scale(0.98);
}

/* Icono WhatsApp Central -> Botón */
#wa-icon {
  position: absolute;
  width: 34px;
  height: 34px;
  fill: #ffffff;
  opacity: 0;
  z-index: 11;
  transform: translate(0, 0);
  transition:
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    fill 0.5s ease;
}

#wa-icon.pulse {
  animation: elegantPulse 2s infinite alternate ease-in-out;
}

/* Texto del Botón */
#btn-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 6px;
  margin-left: 50px; /* Espacio para el icono */
  color: #ffffff;
  white-space: nowrap;
}

/* Brillo de finalización */
.shimmer {
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  z-index: 20;
  pointer-events: none;
}

.shimmer.animate {
  animation: shimmerEffect 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efecto Ripple al Clic */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 122, 0, 0.5);
  transform: scale(0);
  animation: rippleAnim 0.8s ease-out;
  pointer-events: none;
}

/* BOTÓN RETORNO AL HOME (Estilo HUD / Lab) */
.back-home-btn {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 100; /* Asegura que quede por encima del canvas y ruido */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(10, 10, 10, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.back-home-btn svg {
  transition: transform 0.3s ease, stroke 0.3s ease;
  stroke: var(--brand-orange, #ff7a00);
}

.back-home-btn:hover {
  border-color: var(--brand-orange, #ff7a00);
  background: rgba(255, 122, 0, 0.1);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.25);
  transform: translateX(-3px);
}

.back-home-btn:hover svg {
  transform: translateX(-4px);
}

/* Adaptabilidad en Móviles */
@media (max-width: 768px) {
  .back-home-btn {
    top: 20px;
    left: 20px;
    padding: 8px 14px;
    font-size: 0.7rem;
  }
}

@keyframes elegantPulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(255, 122, 0, 0.2));
  }
  100% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 15px rgba(255, 122, 0, 0.6));
  }
}

@keyframes shimmerEffect {
  0% {
    left: -150%;
  }
  100% {
    left: 200%;
  }
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 600px) {
  :root {
    --btn-width: 90vw;
    --btn-height: 60px;
  }
  #btn-text {
    font-size: 12px;
    letter-spacing: 4px;
    margin-left: 40px;
  }
  #console-container {
    left: 20px;
    bottom: 20px;
    font-size: 9px;
  }
}