/* ── Scroll progress (hero landing) ── */
.hero-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.04);
  z-index: 10001;
  pointer-events: none;
}

.hero-scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--teal), var(--green));
  border-radius: 0 2px 2px 0;
  transition: width 0.08s linear;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.35);
}

/* ── Scroll reveal animations ── */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal-fade-left {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-fade-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-fade-right {
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-fade-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Parallax layers — driven by JS inline transform */
.hero-parallax-layer {
  transition: transform 0.12s linear;
  will-change: transform;
}

/* 3D avatar hint */
.avatar-3d-hint {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  animation: hintPulse 3s ease-in-out infinite;
}

.avatar-3d-ring-label {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(79, 70, 229, 0.15);
  padding: 4px 8px;
  border-radius: 99px;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

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

/* Empty-state mini 3D orb */
.empty-orb-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-2);
}

#empty-state-orb {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#empty-state-orb:active {
  cursor: grabbing;
}

.empty-orb-glow {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: orbGlow 4s ease-in-out infinite;
}

@keyframes orbGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.empty-pipeline-step {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.empty-pipeline-step.is-lit {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.1);
  color: var(--accent);
}

/* Tab content entrance */
.tab-content.tab-enter {
  animation: tabSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ambient floating orbs in app shell */
.app-visible .orb {
  animation: orbFloat 18s ease-in-out infinite;
}

.app-visible .orb2 {
  animation-delay: -6s;
}

.app-visible .orb3 {
  animation: orbFloatCentered 18s ease-in-out infinite;
  animation-delay: -12s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(12px, -18px); }
  66% { transform: translate(-8px, 10px); }
}

@keyframes orbFloatCentered {
  0%, 100% { transform: translate(-50%, -50%); }
  33% { transform: translate(calc(-50% + 12px), calc(-50% - 18px)); }
  66% { transform: translate(calc(-50% - 8px), calc(-50% + 10px)); }
}

/* Loading 3D viewport scan-line atmosphere */
.loading-3d-viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(79, 70, 229, 0.025) 2px,
    rgba(79, 70, 229, 0.025) 4px
  );
  mix-blend-mode: multiply;
  animation: scanDrift 12s linear infinite;
}

@keyframes scanDrift {
  from { transform: translateY(0); }
  to { transform: translateY(8px); }
}

.loading-3d-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(79, 70, 229, 0.04) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-fade-left,
  .reveal-fade-right,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-parallax-layer {
    transform: none !important;
  }

  .orb,
  .avatar-3d-hint,
  .empty-orb-glow {
    animation: none !important;
  }
}
