/* Custom Styles for Morphosis888 - Dark Theme */

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

:root {
  --brandPurple: #3D3D6B;
  --brandRed: #8B2252;
  --brandYellow: #C78C06;
  --brandCyan: #0D7377;
  --darkBg: #0D0D0D;
  --brandGray: #1A1A1A;
  --brandLight: #2A2A2A;
}

body {
  background-color: var(--darkBg);
  color: #FFFFFF;
  overflow-x: hidden;
}

/* Particle Canvas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Skew Sections */
.skew-section {
  transform: skewY(-2deg);
}

.unskew {
  transform: skewY(2deg);
}

/* Text Outline Effect */
.text-outline {
  -webkit-text-stroke: 2px #FFFFFF;
  color: transparent;
}

/* Grid Background */
.grid-bg {
  background-image: radial-gradient(rgba(199, 140, 6, 0.5) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--darkBg);
}

::-webkit-scrollbar-thumb {
  background: var(--brandPurple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brandCyan);
}

/* Bouncy Button */
.bouncy-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bouncy-btn:hover {
  animation: buttonBounce 0.5s ease;
}

@keyframes buttonBounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(2deg); }
  50% { transform: scale(0.95) rotate(-2deg); }
  75% { transform: scale(1.05) rotate(1deg); }
}

/* Bouncy Card Animation */
.bouncy-card {
  animation: cardBounce 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.bouncy-card:nth-child(1) { animation-delay: 0s; }
.bouncy-card:nth-child(2) { animation-delay: 0.3s; }
.bouncy-card:nth-child(3) { animation-delay: 0.6s; }

@keyframes cardBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Service Card Hover Effect */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--brandPurple), transparent, var(--brandCyan), transparent, var(--brandYellow), transparent);
  animation: rotate 4s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover::before {
  opacity: 0.2;
}

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

/* Client Card */
.client-card img {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.client-card:hover img {
  filter: grayscale(0%);
}


.client-card:hover {
  animation: wiggleOnce 0.5s ease;
  filter: grayscale(0%);
}

@keyframes wiggleOnce {
  0%, 100% { transform: rotate(0deg) scale(1.05); }
  25% { transform: rotate(2deg) scale(1.05); }
  75% { transform: rotate(-2deg) scale(1.05); }
}

/* Testimonial Card Float */
.testimonial-card {
  animation: floatTestimonial 4s ease-in-out infinite;
}

.testimonial-card:nth-child(1) { animation-delay: 0s; }
.testimonial-card:nth-child(2) { animation-delay: 1.3s; }
.testimonial-card:nth-child(3) { animation-delay: 2.6s; }

@keyframes floatTestimonial {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Strategy Card Pop */
.strategy-card {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.strategy-card:hover {
  transform: translateY(-10px) scale(1.02);
}

/* Automation Card */
.automation-card {
  transition: all 0.3s ease;
}

.automation-card:hover {
  transform: translateY(-5px);
}

/* Form Input Focus Animation */
.form-group input:focus,
.form-group textarea:focus {
  animation: inputPulse 0.5s ease;
}

@keyframes inputPulse {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.02); }
}

/* Nav Link Hover */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brandCyan), var(--brandYellow));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Social Link Bounce */
.social-link {
  display: inline-block;
  transition: all 0.3s ease;
}

.social-link:hover {
  animation: socialBounce 0.5s ease;
}

@keyframes socialBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Tech Badge */
.tech-badge {
  cursor: default;
  transition: all 0.3s ease;
}

/* Logo Bounce on Load */
.animate-bounce-on-load {
  animation: logoBounce 1s ease-out;
}

@keyframes logoBounce {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(10deg); }
  70% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

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

/* Color Shift Animation for Elements */
.color-shift {
  animation: colorShift 5s ease-in-out infinite;
}

@keyframes colorShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(20deg); }
}

/* Pulse Glow Effect */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(61, 61, 107, 0.5); }
  50% { box-shadow: 0 0 40px rgba(199, 140, 6, 0.6); }
}

/* Floating Animation Variations */
.float-1 { animation: float 3s ease-in-out infinite; }
.float-2 { animation: float 4s ease-in-out infinite; animation-delay: 1s; }
.float-3 { animation: float 5s ease-in-out infinite; animation-delay: 2s; }

/* Shake Animation on Error */
.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success Animation */
.success-bounce {
  animation: successBounce 0.6s ease;
}

@keyframes successBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.1); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Glowing Text */
.glow-text {
  text-shadow: 0 0 10px rgba(199, 140, 6, 0.5), 0 0 20px rgba(199, 140, 6, 0.3);
}

/* Selection Color */
::selection {
  background-color: var(--brandCyan);
  color: white;
}

/* Focus Outline */
*:focus-visible {
  outline: 2px solid var(--brandYellow);
  outline-offset: 2px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .text-outline {
    -webkit-text-stroke: 1px #FFFFFF;
  }
  
  .testimonial-card,
  .bouncy-card {
    animation: none;
  }
  
  .service-card::before {
    display: none;
  }
}

/* Print Styles */
@media print {
  #particles-canvas,
  .fixed,
  nav {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Loading State */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

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