* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6c63ff;
  --primary2: #6b63ff;
  --secondary: #00d9ff;
  --accent: #ff6584;
  --dark: #0a0e27;
  --darker: #050816;
  --light: #e8e9f3;
  --card-bg: rgba(255, 255, 255, 0.03);

  /* Responsive spacing */
  --section-padding: clamp(3rem, 8vw, 6rem);
  --container-padding: clamp(1rem, 5vw, 2rem);
  --card-gap: clamp(1rem, 3vw, 2rem);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: sans-serif;
  background: var(--darker);
  color: var(--light);
  overflow-x: hidden;
  line-height: 1.6;
  /* Prevent horizontal scroll */
  max-width: 100vw;
  position: relative;
}

/* Animated Mesh Background - RESPONSIVE */
/* .mesh-background {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  background: radial-gradient(
      ellipse at 20% 30%,
      rgba(108, 99, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(0, 217, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(255, 101, 132, 0.1) 0%,
      transparent 50%
    );
  animation: meshMove 20s ease-in-out infinite;
  will-change: transform;
} */

@keyframes meshMove {
  0%,
  100% {
    transform: scale(1) translate(0, 0);
  }
  33% {
    transform: scale(1.1) translate(5%, 5%);
  }
  66% {
    transform: scale(0.9) translate(-5%, -5%);
  }
}

/* Floating Orbs - RESPONSIVE */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(min(80px, 15vw)); /* Responsive blur */
  opacity: 0.6;
  z-index: -1;
  animation: floatOrb 20s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}

.orb-1 {
  width: min(500px, 80vw); /* Responsive size */
  height: min(500px, 80vw);
  background: radial-gradient(circle, rgba(108, 99, 255, 0.4), transparent);
  top: -25vw;
  left: -25vw;
  animation-delay: 0s;
}

.orb-2 {
  width: min(400px, 70vw);
  height: min(400px, 70vw);
  background: radial-gradient(circle, rgba(0, 217, 255, 0.3), transparent);
  bottom: -20vw;
  right: -20vw;
  animation-delay: 5s;
}

.orb-3 {
  width: min(350px, 60vw);
  height: min(350px, 60vw);
  background: radial-gradient(circle, rgba(255, 101, 132, 0.3), transparent);
  top: 50%;
  left: 50%;
  animation-delay: 10s;
}

/* RESPONSIVE ANIMATIONS - Use viewport units instead of fixed pixels */
@keyframes floatOrb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(10vw, -10vh) scale(1.1);
  }
  50% {
    transform: translate(-5vw, 10vh) scale(0.9);
  }
  75% {
    transform: translate(15vw, 5vh) scale(1.05);
  }
}

/* Grid Pattern Overlay - RESPONSIVE */
.grid-overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  background-image: linear-gradient(
      rgba(108, 99, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
  background-size: clamp(30px, 8vw, 50px) clamp(30px, 8vw, 50px);
  animation: gridScroll 20s linear infinite;
  will-change: transform;
}

@keyframes gridScroll {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(clamp(30px, 8vw, 50px), clamp(30px, 8vw, 50px));
  }
}

/* ===== NEW PREMIUM FLOATING ELEMENTS ===== */

/* Floating Particles - RESPONSIVE */
.floating-particles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: clamp(2px, 0.5vw, 4px);
  height: clamp(2px, 0.5vw, 4px);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  opacity: 0.4;
  box-shadow: 0 0 clamp(5px, 2vw, 10px) rgba(108, 99, 255, 0.5);
}

/* Floating Geometric Shapes - RESPONSIVE */
.geometric-shapes {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  opacity: 0.15;
}

@keyframes rotateShape {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(180deg) translateY(clamp(-30px, -8vw, -50px));
  }
  100% {
    transform: rotate(360deg) translateY(0);
  }
}

@keyframes floatShape {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(clamp(15px, 4vw, 30px), clamp(-20px, -5vw, -40px))
      rotate(90deg);
  }
  50% {
    transform: translate(0, clamp(-40px, -10vw, -80px)) rotate(180deg);
  }
  75% {
    transform: translate(clamp(-15px, -4vw, -30px), clamp(-20px, -5vw, -40px))
      rotate(270deg);
  }
}

/* Premium Light Rays - RESPONSIVE */
.light-rays {
  position: fixed;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.1;
  animation: rotateLights 60s linear infinite;
  will-change: transform;
}

.ray {
  position: absolute;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--primary2),
    transparent
  );
  transform-origin: center;
}

@keyframes rotateLights {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Glowing Cursor Trail - DESKTOP ONLY */
.cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.6), transparent);
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease-out;
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.5);
}

/* Section Transition Effect */
section {
  position: relative;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary),
    var(--secondary),
    transparent
  );
  opacity: 0;
  transition: opacity 0.6s ease;
}

section.in-view::before {
  opacity: 0.5;
  animation: sectionSlide 1.5s ease-out;
}

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

/* Parallax Layers */
.parallax-layer {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.parallax-layer-1 {
  z-index: 1;
}
.parallax-layer-2 {
  z-index: 2;
}
.parallax-layer-3 {
  z-index: 3;
}

/* Floating Code Symbols - RESPONSIVE */
.code-symbol {
  position: absolute;
  font-family: "Courier New", monospace;
  font-size: clamp(16px, 3vw, 24px);
  color: var(--primary);
  opacity: 0.2;
  font-weight: bold;
  animation: floatCode 20s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes floatCode {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.2;
  }
  50% {
    transform: translateY(clamp(-50px, -12vw, -100px)) rotate(360deg);
    opacity: 0.4;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(135deg, #6365f149, #8a5cf698, #743cf6cd);
  z-index: 10000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.8);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(clamp(40px, 10vw, 80px));
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Extra Small Devices (Portrait Phones, 320px - 480px) */
@media (max-width: 480px) {
  :root {
    --section-padding: 2rem;
    --container-padding: 1rem;
    --card-gap: 1rem;
  }

  /* Reduce animation intensity on small screens */
  .orb {
    filter: blur(40px);
    opacity: 0.4;
  }

  /* Disable heavy animations on small devices */
  @media (prefers-reduced-motion: no-preference) {
    .mesh-background {
      animation: none;
      transform: scale(1);
    }

    .grid-overlay {
      animation: none;
    }
  }

  /* Hide cursor trail on touch devices */
  .cursor-trail {
    display: none;
  }

  /* Simplify geometric shapes */
  .geometric-shapes {
    opacity: 0.5;
  }

  /* Reduce particle count effect */
  .particle:nth-child(n + 11) {
    display: none;
  }
}

/* Small Devices (Landscape Phones, 481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  :root {
    --section-padding: 2.5rem;
    --container-padding: 1.5rem;
  }

  .orb {
    filter: blur(50px);
    opacity: 0.5;
  }

  .cursor-trail {
    display: none;
  }
}

/* Medium Devices (Tablets, 768px - 1023px) */
@media (max-width: 1023px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 8rem 5% 4rem;
    min-height: auto;
  }

  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    flex-direction: column !important;
    padding-left: 0;
  }

  .timeline-content {
    width: 100%;
    margin-left: 70px;
    margin-right: 0;
  }

  .timeline-content::before {
    display: none;
  }

  .timeline-dot {
    left: 30px;
  }

  .services-container,
  .pricing-grid,
  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--card-gap);
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .contact-container {
    padding: 2.5rem 1.5rem;
  }

  /* Optimize orbs for tablet */
  .orb {
    filter: blur(60px);
  }

  /* Reduce light rays */
  .light-rays {
    opacity: 0.05;
  }
}

/* Large Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .services-container,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* Large Devices (Desktops, 1024px+) */
@media (min-width: 1024px) {
  :root {
    --section-padding: 5rem;
    --container-padding: 2rem;
  }

  .services-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Extra Large Devices (Large Desktops, 1440px+) */
@media (min-width: 1440px) {
  :root {
    --section-padding: 6rem;
  }

  .container {
    max-width: 1400px;
    margin: 0 auto;
  }

  /* Enhanced effects for large screens */
  .orb {
    filter: blur(100px);
    opacity: 0.7;
  }

  .particle {
    width: 5px;
    height: 5px;
  }
}

/* Ultra Wide Screens (1920px+) */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  .services-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .cursor-trail {
    display: none !important;
  }

  /* Optimize animations for touch */
  .orb {
    animation-duration: 30s; /* Slower animation */
  }

  /* Simplify parallax on touch */
  .parallax-layer {
    transform: none !important;
  }

  /* Remove hover-dependent animations */
  .feature-card:hover,
  .service-box:hover,
  .pricing-card:hover {
    transform: none;
  }
}

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

  .mesh-background,
  .orb,
  .grid-overlay,
  .floating-particles,
  .geometric-shapes,
  .light-rays {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --primary: #7d73ff;
    --secondary: #00e5ff;
    --accent: #ff758c;
  }

  .orb,
  .particle,
  .mesh-background {
    opacity: 0.3;
  }
}

/* Dark Mode Adjustments (if system prefers dark) */
@media (prefers-color-scheme: dark) {
  /* Already dark by default, but can add adjustments */
  .orb {
    opacity: 0.7;
  }
}

/* Landscape Orientation on Mobile */
@media (max-width: 1023px) and (orientation: landscape) {
  .hero {
    padding: 4rem 5% 2rem;
    min-height: 100vh;
  }

  .orb {
    opacity: 0.3;
    filter: blur(40px);
  }

  /* Reduce vertical spacing */
  section {
    padding: 3rem 0;
  }
}

/* Print Styles */
@media print {
  .mesh-background,
  .orb,
  .grid-overlay,
  .floating-particles,
  .geometric-shapes,
  .light-rays,
  .cursor-trail,
  .scroll-progress {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* Performance Optimizations */
@media (max-width: 768px) {
  /* Use hardware acceleration wisely */
  .reveal,
  .timeline-item,
  .feature-card,
  .service-box,
  .pricing-card {
    will-change: auto; /* Don't force GPU acceleration on all elements */
  }

  /* Simplify shadows on mobile */
  .feature-card,
  .service-box,
  .pricing-card {
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.15);
  }
}

/* Ensure all containers are responsive */
.container,
.hero-content,
.features-grid,
.services-container,
.pricing-grid,
.timeline,
.contact-container {
  max-width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Prevent text overflow */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
li {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Images responsive by default */
img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
