/* Intro loader — AI robots at IT work */
html.digitech-loading,
html.digitech-loading body {
  overflow: hidden;
}

#site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(46, 196, 182, 0.16), transparent 55%),
    radial-gradient(700px 420px at 85% 70%, rgba(240, 180, 41, 0.1), transparent 50%),
    #07111f;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#site-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-stage {
  width: min(100%, 920px);
  text-align: center;
}

.loader-logo {
  display: block;
  width: min(280px, 70vw);
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  animation: botBob 1.8s ease-in-out infinite alternate;
}

.loader-stage svg {
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  overflow: visible;
}

.loader-copy {
  margin-top: 1.1rem;
}

.loader-copy strong {
  display: block;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: -0.02em;
  color: #e8f0fa;
  margin-bottom: 0.35rem;
}

.loader-copy span {
  color: #9bb0c7;
  font-size: 0.95rem;
}

.loader-bar {
  width: min(240px, 70%);
  height: 4px;
  margin: 1.15rem auto 0;
  border-radius: 999px;
  background: rgba(232, 242, 255, 0.1);
  overflow: hidden;
}

.loader-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a9e92, #2ec4b6, #f0b429);
  animation: loaderFill 2.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Shared robot motion */
.bot-arm-r {
  transform-origin: 0 0;
  animation: armSwing 1.1s ease-in-out infinite alternate;
}

.bot-arm-l {
  transform-origin: 0 0;
  animation: armSwing 1.1s ease-in-out infinite alternate-reverse;
}

.bot-body {
  animation: botBob 1.6s ease-in-out infinite alternate;
}

.bot-eye {
  animation: eyeBlink 3.2s step-end infinite;
}

.spark {
  animation: sparkPulse 0.7s ease-in-out infinite alternate;
}

.packet {
  animation: packetFlow 1.8s linear infinite;
}

.code-line {
  animation: codeType 1.4s ease-in-out infinite alternate;
}

.screen-glow {
  animation: screenFlicker 2s ease-in-out infinite alternate;
}

.cable-wave {
  animation: cableWiggle 1.5s ease-in-out infinite alternate;
}

.wrench {
  transform-origin: center;
  animation: wrenchTurn 0.9s ease-in-out infinite alternate;
}

.bot-float-1 { animation: botBob 1.5s ease-in-out infinite alternate; }
.bot-float-2 { animation: botBob 1.7s ease-in-out 0.2s infinite alternate; }
.bot-float-3 { animation: botBob 1.4s ease-in-out 0.35s infinite alternate; }
.bot-float-4 { animation: botBob 1.65s ease-in-out 0.15s infinite alternate; }

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

@keyframes botBob {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

@keyframes armSwing {
  from { transform: rotate(-12deg); }
  to { transform: rotate(14deg); }
}

@keyframes wrenchTurn {
  from { transform: rotate(-28deg); }
  to { transform: rotate(32deg); }
}

@keyframes sparkPulse {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

@keyframes packetFlow {
  0% { offset-distance: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

@keyframes codeType {
  from { transform: scaleX(0.35); opacity: 0.45; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes screenFlicker {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes cableWiggle {
  from { transform: translateY(0); }
  to { transform: translateY(3px); }
}

@keyframes eyeBlink {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.15); }
}

@media (prefers-reduced-motion: reduce) {
  #site-loader * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .loader-bar i {
    width: 100%;
  }
}
