/* ==========================================================================
   XYPHLA PREMIUM ANIMATIONS & DESIGN SYSTEM STYLES
   ========================================================================== */

:root {
  /* Geometric Radius System */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Layered Premium Shadows (Smooth Umbra & Penumbra) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);

  /* Animation Easing Curve (Stripe/Apple standard: cubic-bezier Ease Out Expo) */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.5s var(--ease-expo);
  --transition-fast: all 0.2s var(--ease-expo);
}

/* ==========================================================================
   1. GLOBAL BACKGROUND VISUAL EFFECTS (Noise & Aurora Grid)
   ========================================================================== */

/* Grain Noise Overlay */
.bg-grid::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: 1;
}

/* Moving Aurora Orb animation */
.orb {
  animation: aurora-move 20s infinite alternate ease-in-out;
  will-change: transform;
}
.orb:nth-child(2) {
  animation-duration: 25s;
  animation-delay: -5s;
}

@keyframes aurora-move {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(10%, 8%) scale(1.1);
  }
  100% {
    transform: translate(-5%, -5%) scale(0.9);
  }
}

/* (Custom Cursor Disabled for Maximum Performance) */

@media (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}

/* ==========================================================================
   3. STICKY & GLASSMORPHIC NAVIGATION
   ========================================================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: padding 0.3s var(--ease-expo), background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  padding: 24px 8%;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  padding: 12px 8%;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dim);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Nav Link Underline Hover */
.nav-menu ul li a {
  position: relative;
}
.nav-menu ul li a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--text-accent, #3b82f6);
  transition: width 0.3s var(--ease-expo);
}
.nav-menu ul li a:hover::after,
.nav-menu ul li.current-menu-item a::after {
  width: 100%;
}

/* ==========================================================================
   4. BUTTON MICRO-INTERACTIONS
   ========================================================================== */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-expo), background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Mechanical click press feedback */
.btn:active {
  transform: scale(0.96) translateY(0);
}

/* Focus outline accessibility indicator */
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--text-accent, #3b82f6);
  outline-offset: 4px;
}

/* Primary Button Glow */
.btn-primary {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4), var(--shadow-glow);
}

/* Outline Button Lift */
.btn-outline {
  background: rgba(255, 255, 255, 0.03);
}
.btn-outline:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

/* Pulse animation on Call To Action button */
.hp-cta .btn-primary {
  animation: btn-pulse 3s infinite;
}

@keyframes btn-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* ==========================================================================
   5. PREMIUM CARD INTERACTIONS (Spotlight & Tilt)
   ========================================================================== */
.testimonial-card,
.product-card,
.hp-project-card,
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition: transform 0.5s var(--ease-expo), border-color 0.4s ease, box-shadow 0.4s ease;
  will-change: transform;
}

/* Spotlight Hover Effect Wrapper */
.testimonial-card::before,
.product-card::before,
.hp-project-card::before,
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.06), transparent 40%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease-expo);
}

.testimonial-card:hover::before,
.product-card:hover::before,
.hp-project-card:hover::before,
.card:hover::before {
  opacity: 1;
}

/* Card Hover translation scale */
.testimonial-card:hover,
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(59, 130, 246, 0.3);
}

.hp-project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), var(--shadow-glow-cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

/* ==========================================================================
   6. SCROLL TIMELINE SVG PROGRESS PATH
   ========================================================================== */
.timeline-scroll-container {
  position: relative;
  width: 100%;
  padding-bottom: 20px;
}

.timeline-svg-line-horizontal {
  position: absolute;
  top: 30px;
  left: 0;
  width: 100%;
  height: 6px;
  z-index: 0;
  pointer-events: none;
}

.timeline-svg-line-horizontal path {
  transition: stroke-dashoffset 0.1s linear;
}

.process-step-horizontal {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   7. INPUTS & FORMS MICRO-INTERACTIONS
   ========================================================================== */
.newsletter-form input[type="email"] {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border: 1px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s var(--ease-expo), background-color 0.3s;
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--text-accent, #3b82f6);
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   8. MOBILE VIEWPORTS & ACCESSIBILITY FALLBACKS
   ========================================================================== */

/* Reduced Motion Fallbacks */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: scroll !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    transform: none !important;
    backdrop-filter: none !important;
  }
  
  .orb {
    animation: none !important;
  }
  
  .testimonials-marquee-group {
    animation: none !important;
    flex-wrap: wrap !important;
    overflow-x: auto !important;
  }
}

/* Mobile responsive padding & scaling adjustments */
@media (max-width: 768px) {
  nav {
    padding: 16px 6%;
  }
  nav.scrolled {
    padding: 10px 6%;
  }
  .testimonials-marquee-group .testimonial-card {
    width: 300px;
  }
  .timeline-svg-line {
    display: none;
  }
}
