/* =============================================================================
   SCROLL PROGRESS BAR
   ============================================================================= */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9999;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #14b8a6, #06b6d4, #14b8a6);
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

@keyframes progress-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =============================================================================
   SCROLL REVEAL (reemplaza AOS en elementos clave)
   ============================================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal="left"]  { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="scale"] { transform: scale(0.92) translateY(16px); }
[data-reveal="fade"]  { transform: none; }

[data-reveal].is-revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Delays escalonados para grupos de elementos */
[data-reveal-delay="100"] { transition-delay: 0.1s; }
[data-reveal-delay="150"] { transition-delay: 0.15s; }
[data-reveal-delay="200"] { transition-delay: 0.2s; }
[data-reveal-delay="300"] { transition-delay: 0.3s; }
[data-reveal-delay="400"] { transition-delay: 0.4s; }
[data-reveal-delay="500"] { transition-delay: 0.5s; }
[data-reveal-delay="600"] { transition-delay: 0.6s; }

/* =============================================================================
   PARALLAX BASE (gestionado por JS con CSS custom properties)
   ============================================================================= */
.parallax-layer {
  will-change: transform;
  transform: translateZ(0);
}

/* =============================================================================
   CURSOR PERSONALIZADO
   ============================================================================= */
.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #14b8a6;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.3s ease;
  mix-blend-mode: screen;
}

.cursor-ring {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(20, 184, 166, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition:
    left 0.12s cubic-bezier(0.17, 0.67, 0.83, 0.67),
    top 0.12s cubic-bezier(0.17, 0.67, 0.83, 0.67),
    width 0.25s ease,
    height 0.25s ease,
    opacity 0.3s ease;
}

.cursor-ring.hovering {
  width: 48px;
  height: 48px;
  border-color: rgba(20, 184, 166, 0.25);
  background: rgba(20, 184, 166, 0.05);
}

/* Solo en desktop */
@media (hover: none) {
  .cursor-dot,
  .cursor-ring { display: none; }
}

/* =============================================================================
   HOVER LIFT (tarjetas y botones)
   ============================================================================= */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35),
              0 0 24px rgba(20, 184, 166, 0.06);
}

/* =============================================================================
   GRADIENT BORDER ANIMADO (optimizado, sin repaints)
   ============================================================================= */
@keyframes gradient-spin {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

.animate-gradient-border {
  animation: gradient-spin 5s ease infinite;
  background-size: 200% 200%;
}

/* =============================================================================
   FLOATING (reemplaza el float animado con GPU-friendly transform)
   ============================================================================= */
@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.animate-float {
  animation: float-y 6s ease-in-out infinite;
  will-change: transform;
}

.animate-float-delay {
  animation: float-y 8s ease-in-out 1s infinite;
  will-change: transform;
}

/* =============================================================================
   SECCIÓN — DIVIDER LINE
   ============================================================================= */
.section-label {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #14b8a6;
  font-weight: 600;
  position: relative;
  padding-left: 1.25rem;
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.75rem;
  height: 1.5px;
  background: #14b8a6;
  border-radius: 1px;
}

/* =============================================================================
   HERO — INDICATOR DE SCROLL
   ============================================================================= */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
}

.scroll-indicator-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #14b8a6;
  animation: scroll-bounce 1.6s ease-in-out infinite;
}

.scroll-indicator-dot:nth-child(2) { animation-delay: 0.2s; }
.scroll-indicator-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes scroll-bounce {
  0%, 100% { opacity: 0.2; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.5); }
}

/* =============================================================================
   BACKEND TERMINAL BUTTON (versión mejorada sin scan loop)
   ============================================================================= */
.backend-terminal-v2 {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(5, 15, 25, 0.92);
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 10px;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #cbd5e1;
  text-decoration: none;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.backend-terminal-v2:hover {
  border-color: rgba(20, 184, 166, 0.6);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.12),
              0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
  color: #e2e8f0;
}

.backend-terminal-v2 .prompt {
  color: #14b8a6;
  font-weight: bold;
}

.backend-terminal-v2 .bt-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: #14b8a6;
  vertical-align: middle;
  animation: blink-cursor 1.1s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@media (max-width: 640px) {
  .backend-terminal-v2 {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.72rem;
  }
}

/* =============================================================================
   REDUCED MOTION — respeta preferencias del usuario
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
