/* ==========================================================================
   Gurevs Devs — custom.css
   Supplementary styles not provided by Tailwind CDN
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scroll-reveal animations
   -------------------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings inside a grid so they cascade in */
.fade-up:nth-child(2) { transition-delay: 0.08s; }
.fade-up:nth-child(3) { transition-delay: 0.16s; }
.fade-up:nth-child(4) { transition-delay: 0.24s; }
.fade-up:nth-child(5) { transition-delay: 0.32s; }
.fade-up:nth-child(6) { transition-delay: 0.40s; }

/* Respect users' reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   3D Tilt Card Effect
   -------------------------------------------------------------------------- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
}

.tilt-card-inner {
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

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

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

/* --------------------------------------------------------------------------
   Cursor Glow Effect on Cards
   -------------------------------------------------------------------------- */
.glow-card {
  position: relative;
  overflow: hidden;
}

.glow-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    400px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(124, 58, 237, 0.08),
    transparent 40%
  );
}

.glow-card:hover::before {
  opacity: 1;
}

/* Glowing border effect on hover */
.glow-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    300px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(59, 130, 246, 0.25),
    transparent 40%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
}

.glow-card:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Floating 3D Geometry
   -------------------------------------------------------------------------- */
.geo-scene {
  perspective: 800px;
  perspective-origin: 50% 50%;
}

.geo-float {
  animation: geo-float 8s ease-in-out infinite;
  will-change: transform;
}

.geo-float-delay { animation-delay: -2.5s; }
.geo-float-delay-2 { animation-delay: -5s; }

@keyframes geo-float {
  0%, 100% { transform: translateY(0) rotateX(0) rotateY(0); }
  25% { transform: translateY(-20px) rotateX(8deg) rotateY(12deg); }
  50% { transform: translateY(-10px) rotateX(-4deg) rotateY(-8deg); }
  75% { transform: translateY(-25px) rotateX(6deg) rotateY(-6deg); }
}

.geo-cube {
  width: 60px;
  height: 60px;
  transform-style: preserve-3d;
  animation: geo-spin 16s linear infinite;
}

.geo-cube-face {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.04);
  backdrop-filter: blur(2px);
}

.geo-cube-face:nth-child(1) { transform: rotateY(0deg) translateZ(30px); }
.geo-cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(30px); }
.geo-cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(30px); }
.geo-cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(30px); }
.geo-cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(30px); }
.geo-cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(30px); }

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

.geo-octahedron {
  width: 50px;
  height: 50px;
  transform-style: preserve-3d;
  animation: geo-spin-reverse 20s linear infinite;
}

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

.geo-ring {
  width: 120px;
  height: 120px;
  border: 2px solid rgba(124, 58, 237, 0.15);
  border-radius: 50%;
  animation: geo-ring-spin 12s linear infinite;
}

@keyframes geo-ring-spin {
  0% { transform: rotateX(70deg) rotateY(0) rotateZ(0); }
  100% { transform: rotateX(70deg) rotateY(0) rotateZ(360deg); }
}

.geo-ring-2 {
  width: 80px;
  height: 80px;
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 50%;
  animation: geo-ring-spin-2 10s linear infinite;
}

@keyframes geo-ring-spin-2 {
  0% { transform: rotateX(50deg) rotateY(30deg) rotateZ(0); }
  100% { transform: rotateX(50deg) rotateY(30deg) rotateZ(-360deg); }
}

/* --------------------------------------------------------------------------
   Aurora / Gradient Mesh Animation
   -------------------------------------------------------------------------- */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  will-change: transform;
  animation: aurora-drift 10s ease-in-out infinite alternate;
}

.aurora-blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35), transparent 70%);
  top: -10%; left: 10%;
  animation-duration: 12s;
}

.aurora-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent 70%);
  top: 20%; right: 5%;
  animation-duration: 15s;
  animation-delay: -3s;
}

.aurora-blob-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2), transparent 70%);
  bottom: 10%; left: 30%;
  animation-duration: 18s;
  animation-delay: -7s;
}

.aurora-blob-4 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.2), transparent 70%);
  top: 50%; right: 20%;
  animation-duration: 14s;
  animation-delay: -5s;
}

/* Mobile: scale down aurora */
@media (max-width: 639px) {
  .aurora-blob-1 { width: 280px; height: 280px; }
  .aurora-blob-2 { width: 220px; height: 220px; }
  .aurora-blob-3 { width: 200px; height: 200px; }
  .aurora-blob-4 { width: 180px; height: 180px; }
}

@keyframes aurora-drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.15); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
  100% { transform: translate(40px, -20px) scale(1.05); }
}

/* --------------------------------------------------------------------------
   Noise Texture Overlay
   -------------------------------------------------------------------------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --------------------------------------------------------------------------
   Magnetic Button
   -------------------------------------------------------------------------- */
.magnetic-btn {
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Hero Text Reveal
   -------------------------------------------------------------------------- */
.text-reveal {
  overflow: hidden;
  display: inline-block;
}

.text-reveal-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-reveal.is-visible .text-reveal-inner {
  transform: translateY(0);
}

.text-reveal:nth-child(2) .text-reveal-inner { transition-delay: 0.1s; }
.text-reveal:nth-child(3) .text-reveal-inner { transition-delay: 0.2s; }

/* --------------------------------------------------------------------------
   Particle Canvas
   -------------------------------------------------------------------------- */
#particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Scroll-driven parallax helper
   -------------------------------------------------------------------------- */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* --------------------------------------------------------------------------
   Tech stack badge
   -------------------------------------------------------------------------- */
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(100, 116, 139, 0.3);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Marquee / infinite scroll
   -------------------------------------------------------------------------- */
.marquee-wrapper {
  --marquee-width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 20px;
  margin: 0 6px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.2);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.marquee-item:hover {
  color: #e2e8f0;
  border-color: rgba(59, 130, 246, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Reviews carousel
   -------------------------------------------------------------------------- */
.carousel-slide {
  width: 100%;
}

@media (min-width: 640px) {
  .carousel-slide {
    width: calc(50% - 12px);
  }
}

@media (min-width: 1024px) {
  .carousel-slide {
    width: calc(33.333% - 16px);
  }
}

/* --------------------------------------------------------------------------
   Select element arrow colour fix for dark backgrounds
   -------------------------------------------------------------------------- */
select option {
  background-color: #1e293b;
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Smooth focus ring offset for dark bg inputs
   -------------------------------------------------------------------------- */
input:focus,
select:focus,
textarea:focus {
  --tw-ring-offset-color: #1e293b;
}

/* --------------------------------------------------------------------------
   Scroll Progress Bar
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
  background-size: 300% 100%;
  animation: scroll-gradient 4s linear infinite;
  z-index: 9999;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

@keyframes scroll-gradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* --------------------------------------------------------------------------
   Rotating Conic Gradient Border (Pricing "Most Popular")
   -------------------------------------------------------------------------- */
.conic-border {
  position: relative;
  border: none !important;
}

.conic-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 1rem;
  padding: 2px;
  background: conic-gradient(
    from var(--conic-angle, 0deg),
    #3b82f6,
    #8b5cf6,
    #ec4899,
    #f97316,
    #3b82f6
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: conic-rotate 4s linear infinite;
}

@keyframes conic-rotate {
  0% { --conic-angle: 0deg; }
  100% { --conic-angle: 360deg; }
}

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

/* --------------------------------------------------------------------------
   Hero Word Reveal Animation
   -------------------------------------------------------------------------- */
.word-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.word-reveal-inner {
  display: inline-block;
  transform: translateY(110%) rotateX(-80deg);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom center;
}

@media (max-width: 639px) {
  .word-reveal-inner {
    transform: translateY(100%);
  }
  .hero-grid-interactive {
    background-size: 30px 30px;
  }
}

.word-reveal.is-visible .word-reveal-inner {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Section Wavy Dividers
   -------------------------------------------------------------------------- */
.section-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.section-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

/* --------------------------------------------------------------------------
   Glowing Section Separators
   -------------------------------------------------------------------------- */
.glow-separator {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.3) 20%,
    rgba(139, 92, 246, 0.5) 50%,
    rgba(59, 130, 246, 0.3) 80%,
    transparent 100%
  );
  margin: 0 auto;
  max-width: 80%;
}

.glow-separator::after {
  content: '';
  position: absolute;
  inset: -4px 10% -4px 10%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.1) 20%,
    rgba(139, 92, 246, 0.15) 50%,
    rgba(59, 130, 246, 0.1) 80%,
    transparent 100%
  );
  filter: blur(6px);
}

/* --------------------------------------------------------------------------
   Interactive Hero Grid Glow
   -------------------------------------------------------------------------- */
.hero-grid-interactive {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  --grid-glow-x: 50%;
  --grid-glow-y: 50%;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(
    600px circle at var(--grid-glow-x) var(--grid-glow-y),
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.04) 100%
  );
  mask-image: radial-gradient(
    600px circle at var(--grid-glow-x) var(--grid-glow-y),
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.04) 100%
  );
}

/* --------------------------------------------------------------------------
   Case Study Card Inner Parallax
   -------------------------------------------------------------------------- */
.case-parallax {
  transition: transform 0.3s ease-out;
}

.case-card:hover .case-parallax {
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   Enhanced Fade-Up with Blur & Scale
   -------------------------------------------------------------------------- */
.fade-up-pro {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  filter: blur(6px);
  transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease;
}

.fade-up-pro.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.fade-up-pro:nth-child(2) { transition-delay: 0.1s; }
.fade-up-pro:nth-child(3) { transition-delay: 0.2s; }
.fade-up-pro:nth-child(4) { transition-delay: 0.3s; }
.fade-up-pro:nth-child(5) { transition-delay: 0.4s; }
.fade-up-pro:nth-child(6) { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   Section Heading Gradient Shimmer
   -------------------------------------------------------------------------- */
.heading-shimmer {
  background: linear-gradient(
    110deg,
    #fff 0%,
    #fff 40%,
    rgba(59, 130, 246, 0.8) 50%,
    #fff 60%,
    #fff 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heading-shimmer 6s ease-in-out infinite;
}

@keyframes heading-shimmer {
  0%, 100% { background-position: 150% center; }
  50% { background-position: -50% center; }
}

/* --------------------------------------------------------------------------
   Reduced motion: disable all heavy animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .geo-float,
  .geo-cube,
  .geo-octahedron,
  .geo-ring,
  .geo-ring-2,
  .aurora-blob,
  .noise-overlay,
  .text-reveal-inner,
  .word-reveal-inner {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .tilt-card-inner {
    transition: none !important;
  }
  #particle-canvas {
    display: none;
  }
  .scroll-progress {
    animation: none;
  }
  .conic-border::before {
    animation: none;
  }
  .heading-shimmer {
    animation: none;
    -webkit-text-fill-color: #fff;
  }
  .fade-up-pro {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}
