/* --- Global Animations & Styles --- */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #070913; }
::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, #3b82f6, #a855f7); border-radius: 10px; border: 3px solid #070913; }

html, body {
  background-color: #070913;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
  /* Hardware acceleration for scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  max-width: 100%;
}

@media screen and (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* GPU Hardware Acceleration Keyframes */
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(10px, -20px, 0); }
  66% { transform: translate3d(-10px, 20px, 0); }
}

@keyframes rise {
  0% { transform: translate3d(-50%, 20px, 0) scale(0.5); opacity: 0; }
  20% { opacity: 0.8; }
  100% { transform: translate3d(-50%, -80px, 0) scale(1.2); opacity: 0; }
}

@keyframes flow {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

@keyframes flow-vertical {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

@keyframes beam-drop {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@keyframes beam-slide {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes morph-bubble {
  0% { border-radius: 50%; transform: translate3d(0, 0, 0) scale(1) rotate(0deg); background-color: #3b82f6; opacity: 0; }
  20% { opacity: 1; }
  50% { border-radius: 30%; transform: translate3d(0, -25px, 0) scale(1.2) rotate(45deg); background-color: #8b5cf6; opacity: 0.8; }
  80% { opacity: 0.8; }
  100% { border-radius: 2px; transform: translate3d(0, -50px, 0) scale(0.8) rotate(90deg); background-color: #a855f7; opacity: 0; }
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translate3d(0, 30px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Optimizing animations with will-change to alert browser rendering engine */
.animate-morph { 
  animation: morph-bubble 3s infinite ease-in-out;
  will-change: transform, opacity, border-radius;
}
.animate-float { 
  animation: float 6s infinite ease-in-out;
  will-change: transform;
}
.bubble-rise { 
  animation: rise 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}
.animate-flow { 
  animation: flow 1s linear infinite; 
}
.animate-flow-vertical { 
  animation: flow-vertical 1s linear infinite; 
}
.animate-beam-drop { 
  animation: beam-drop 3s ease-in-out infinite; 
  will-change: top, opacity;
}
.animate-beam-slide { 
  animation: beam-slide 3s ease-in-out infinite; 
  will-change: left, opacity;
}
.animate-fade-in-up { 
  animation: fade-in-up 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
  will-change: transform, opacity;
}

/* Glass panel optimization */
.glass-panel { 
  background: rgba(15, 23, 42, 0.6); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05); 
  /* Prevent layer re-creation lag during transitions */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.text-gradient { 
  background-clip: text; 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent; 
  background-image: linear-gradient(to right, #60a5fa, #c084fc); 
}

/* Hardware accelerated background glow blurs */
.gpu-glow {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
}

/* Custom utility for visibility toggling on HTML element lang attribute */
html[lang="en"] .lang-es { display: none !important; }
html[lang="es"] .lang-en { display: none !important; }
