/**
 * TechStart — Animations & 3D Effects
 */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scan-line, #hero-particles, .flow-particle {
    display: none !important;
  }

  .pipeline-scene {
    animation: none !important;
  }
}

/* Cursor glow (desktop) */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

body.cursor-active .cursor-glow {
  opacity: 1;
}

.hero {
  position: relative;
}

.hero-scan {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.4), transparent);
  animation: scan 8s linear infinite;
  opacity: 0.6;
}

@keyframes scan {
  0% { top: -2px; }
  100% { top: 100%; }
}

#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.7;
}

.hero-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1rem;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  opacity: 0.85;
}

.hero-domain i {
  font-size: 0.75rem;
  animation: blink 2s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* 3D scene */
.hero-3d-scene {
  perspective: 1600px;
  perspective-origin: 50% 45%;
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.scene-wrapper {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* 3D delivery pipeline: Plan → Execute → Deliver */
.pipeline-scene {
  --pipeline-scale: 1.55;
  position: relative;
  width: 400px;
  height: 360px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transform: rotateX(14deg) rotateY(-22deg) scale(var(--pipeline-scale));
  animation: pipeline-float 7s ease-in-out infinite;
}

@keyframes pipeline-float {
  0%, 100% { transform: rotateX(14deg) rotateY(-22deg) scale(var(--pipeline-scale)) translateY(0); }
  50% { transform: rotateX(16deg) rotateY(-18deg) scale(var(--pipeline-scale)) translateY(-14px); }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .pipeline-scene {
    --pipeline-scale: 1.3;
  }
}

.pipeline-floor {
  position: absolute;
  width: 340px;
  height: 340px;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%) rotateX(90deg) translateZ(-40px);
  background:
    linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 50%;
  opacity: 0.6;
  mask-image: radial-gradient(circle, black 30%, transparent 70%);
}

.pipeline-connector {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.6), rgba(167, 139, 250, 0.2));
  transform-style: preserve-3d;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}

.connector-a {
  width: 120px;
  left: 78px;
  top: 168px;
  transform: rotateZ(-8deg) rotateX(55deg) translateZ(30px);
}

.connector-b {
  width: 120px;
  right: 78px;
  top: 168px;
  transform: rotateZ(8deg) rotateX(55deg) translateZ(30px);
}

.flow-particle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan), 0 0 40px rgba(34, 211, 238, 0.4);
  left: 50%;
  top: 50%;
  margin: -6px 0 0 -6px;
  transform-style: preserve-3d;
  animation: flow-journey 6s ease-in-out infinite;
  z-index: 10;
}

@keyframes flow-journey {
  0%, 100% { transform: translate3d(-130px, 40px, 25px); }
  33% { transform: translate3d(0, -30px, 90px); }
  66% { transform: translate3d(130px, 40px, 25px); }
}

.pipeline-stages {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.pipeline-stage {
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.pipeline-stage:nth-child(1) {
  left: 0;
  top: 90px;
  transform: translate3d(0, 0, 20px) rotateY(28deg);
}

.pipeline-stage:nth-child(2) {
  left: 50%;
  top: 40px;
  transform: translate3d(-50%, 0, 85px);
}

.pipeline-stage:nth-child(3) {
  right: 0;
  top: 90px;
  transform: translate3d(0, 0, 20px) rotateY(-28deg);
}

.stage-card {
  width: 118px;
  padding: 18px 14px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
}

.pipeline-stage.is-active .stage-card {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.35), 0 20px 40px rgba(0, 0, 0, 0.35);
  transform: translateZ(12px) scale(1.06);
}

.stage-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.stage-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  transition: all 0.4s ease;
}

.pipeline-stage.is-active .stage-icon {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
}

.stage-icon i {
  font-size: 1.25rem;
  color: var(--accent-light);
}

.pipeline-stage.is-active .stage-icon i {
  color: var(--accent-cyan);
}

.stage-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 4px;
}

.stage-card span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.pipeline-caption {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(10px);
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.pipeline-caption::before {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  margin: 0 auto 10px;
  background: var(--gradient);
  border-radius: 2px;
}

/* 3D Cube — unused legacy */
.cube-scene {
  position: absolute;
  right: -20px;
  bottom: 20px;
  width: 80px;
  height: 80px;
  perspective: 400px;
  transform-style: preserve-3d;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 20s linear infinite;
}

@keyframes cube-spin {
  0% { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}

.cube-face {
  position: absolute;
  width: 60px;
  height: 60px;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent-cyan);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  backdrop-filter: blur(4px);
}

.cube-face.front  { transform: rotateY(0deg) translateZ(30px); }
.cube-face.back   { transform: rotateY(180deg) translateZ(30px); }
.cube-face.right  { transform: rotateY(90deg) translateZ(30px); }
.cube-face.left   { transform: rotateY(-90deg) translateZ(30px); }
.cube-face.top    { transform: rotateX(90deg) translateZ(30px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(30px); }

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  animation: orbit-spin 15s linear infinite;
}

.orbit-ring-1 {
  width: 360px;
  height: 360px;
  top: -20px;
  left: -20px;
  border-style: dashed;
}

.orbit-ring-2 {
  width: 400px;
  height: 400px;
  top: -40px;
  left: -40px;
  animation-direction: reverse;
  animation-duration: 25s;
  opacity: 0.5;
}

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-cyan);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

.hero-float-3d {
  animation: float3d 5s ease-in-out infinite;
}

@keyframes float3d {
  0%, 100% { transform: translateZ(20px) translateY(0); }
  50% { transform: translateZ(30px) translateY(-8px); }
}

/* Tilt cards */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}

.tilt-card .tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.tilt-card:hover .tilt-shine {
  opacity: 1;
}

.tilt-card .tilt-content {
  transform: translateZ(20px);
  position: relative;
  z-index: 1;
}

/* Animated gradient border */
.glow-border {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.glow-border::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: conic-gradient(from var(--border-angle, 0deg), #6366f1, #22d3ee, #a78bfa, #6366f1);
  border-radius: calc(var(--radius) + 2px);
  z-index: 0;
  animation: border-rotate 4s linear infinite;
}

.glow-border::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: inherit;
  border-radius: calc(var(--radius) - 2px);
  z-index: 0;
}

@keyframes border-rotate {
  to { --border-angle: 360deg; }
}

@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glow-border > * {
  position: relative;
  z-index: 1;
}

/* Section ambient glow */
.section-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.section-glow-left {
  top: 10%;
  left: -10%;
  background: #6366f1;
}

.section-glow-right {
  bottom: 10%;
  right: -10%;
  background: #22d3ee;
}

.section-dark {
  position: relative;
  overflow: hidden;
}

.section-dark > .container {
  position: relative;
  z-index: 1;
}

/* Reveal animations (GSAP handles, fallback) */
.reveal-item {
  opacity: 0;
  transform: translateY(40px);
}

.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Process step pulse */
.process-step .step-num {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.process-step.active .step-num {
  transform: scale(1.1);
  box-shadow: 0 0 0 5px var(--bg-dark), 0 0 30px rgba(99, 102, 241, 0.5);
}

.process-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--gradient);
  transition: width 1.2s ease;
}

/* Tech orbit */
.tech-orbit-wrap {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
  z-index: 2;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 60px rgba(34, 211, 238, 0.6); }
}

.tech-orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbit-spin 30s linear infinite;
}

.tech-orbit-ring span {
  position: absolute;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.tech-orbit-ring span:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.08);
}

.orbit-inner {
  width: 320px;
  height: 320px;
}

.orbit-outer {
  width: 480px;
  height: 480px;
  animation-direction: reverse;
  animation-duration: 45s;
}

/* Magnetic button */
.btn-magnetic {
  position: relative;
  transition: transform 0.2s ease;
}

/* Client tile 3D flip hint */
.client-tile {
  transform-style: preserve-3d;
  position: relative;
}

.client-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.client-tile:hover::after {
  opacity: 1;
}

/* Contact card glow — background set above in .contact-card.glow-border */

/* Stats counter pop */
.hero-stats strong {
  transition: transform 0.3s ease;
}

.hero-stats .stat-pop {
  animation: stat-pop 0.5s ease;
}

@keyframes stat-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* FAQ slide */
.faq-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--accent);
}

/* Platform strip */
.platform-strip {
  background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(5, 8, 16, 0.95) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  position: relative;
  overflow: hidden;
}

.platform-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.platform-metric {
  text-align: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all 0.35s ease;
  transform-style: preserve-3d;
}

.platform-metric:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-6px) rotateX(4deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.platform-metric i {
  font-size: 1.75rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  display: block;
}

.platform-metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 4px;
}

.platform-metric span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.platform-code .code-kw { color: #c084fc; }
.platform-code .code-str { color: #34d399; }
.platform-code .code-num { color: #fbbf24; }

.contact-card.glow-border {
  background: var(--bg-dark);
}

.contact-card.glow-border::after {
  background: var(--bg-dark);
}

@media (max-width: 991px) {
  .platform-strip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-orbit-wrap {
    min-height: 280px;
  }

  .tech-orbit-ring.orbit-outer {
    display: none;
  }

  .hero-3d-scene {
    min-height: 480px;
    margin-top: 2rem;
  }

  .pipeline-scene {
    --pipeline-scale: 1.15;
    transform: rotateX(10deg) rotateY(-12deg) scale(var(--pipeline-scale));
    animation: none;
  }

  .orbit-ring, .cube-scene {
    display: none;
  }

  .cursor-glow {
    display: none;
  }
}

@media (max-width: 575px) {
  .platform-strip-grid {
    grid-template-columns: 1fr;
  }
}
