/* ============================================================
   CCAI - Shared Styles
   Extracted from inline <style> blocks for maintainability.
   Includes: design tokens, layout primitives, animation keyframes,
   component styles (glass, service cards, nav, etc.)
   ============================================================ */

/* --- Base --- */
* { font-family: 'Space Grotesk', sans-serif; }
body { box-sizing: border-box; }

/* --- Background & Gradient --- */
.gradient-bg {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0d0d1f 100%);
  position: relative;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: opacity 8s ease-in-out;
}

/* --- Tech Grid Pattern Overlay --- */
.tech-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(0deg, transparent 24%, rgba(59, 130, 246, 0.05) 25%, rgba(59, 130, 246, 0.05) 26%, transparent 27%, transparent 74%, rgba(59, 130, 246, 0.05) 75%, rgba(59, 130, 246, 0.05) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, rgba(59, 130, 246, 0.05) 25%, rgba(59, 130, 246, 0.05) 26%, transparent 27%, transparent 74%, rgba(59, 130, 246, 0.05) 75%, rgba(59, 130, 246, 0.05) 76%, transparent 77%, transparent);
  background-size: 50px 50px;
  z-index: 2;
}

/* --- Glow Text --- */
.glow-text {
  text-shadow: 0 0 80px rgba(59, 130, 246, 0.6);
}

/* --- Hero Title Rotator --- */
.hero-title-rotator {
  position: relative;
  display: block;
}

.hero-title-phrase {
  display: none;
}

.hero-title-phrase.is-visible {
  display: block;
}

.hero-title-rotator.hero-title-animated .hero-title-phrase {
  display: block;
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.hero-title-rotator.hero-title-animated .hero-title-phrase.is-visible {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* --- Buttons --- */
.btn-glow {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-glow:hover {
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* --- Glass Morphism --- */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Floating Orbs --- */
.orb {
  position: absolute;
  border-radius: 5%;
  filter: blur(0px);
  opacity: 0.05;
  z-index: 3;
}

/* --- Content Wrapper --- */
.content-wrapper {
  position: relative;
  z-index: 10;
}

/* --- Scroll Animations --- */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-animate-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-animate-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* --- Navigation --- */
.nav-link {
  position: relative;
}

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

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

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

/* --- Service Cards --- */
.service-card {
  transition: all 0.4s ease;
  border: 2px solid transparent;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: #3b82f6;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

/* --- Case Study Cards --- */
.case-study-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  text-decoration: none;
}

.case-study-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(59, 130, 246, 0.3);
}

.case-study-card:focus-visible {
  outline: none;
  transform: translateY(-8px);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.5), 0 20px 50px rgba(59, 130, 246, 0.3);
}

.case-study-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 39, 0.9) 100%);
}

/* --- Counter --- */
.counter {
  font-size: 2.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Insight Cards --- */
.insight-card {
  transition: all 0.4s ease;
  border-left: 4px solid #3b82f6;
}

.insight-card:hover {
  border-left-color: #8b5cf6;
  transform: translateX(8px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

/* --- Testimonials --- */
.testimonial-card {
  position: relative;
}

.testimonial-quote {
  font-size: 1.1rem;
  line-height: 1.8;
  font-style: italic;
}

.star-rating {
  color: #fbbf24;
  font-size: 1.2rem;
  letter-spacing: 2px;
}

/* --- Carousel --- */
@keyframes slideInCarousel {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.carousel-item {
  animation: slideInCarousel 0.6s ease-out;
}

/* --- Differentiator --- */
.differentiator-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.differentiator-block:hover .differentiator-icon {
  transform: scale(1.1) rotate(5deg);
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, rgba(10, 14, 39, 0.8), rgba(30, 20, 60, 0.8));
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --- Float Animations --- */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, -40px); }
  50% { transform: translate(-20px, -60px); }
  75% { transform: translate(40px, -30px); }
}

@keyframes floatReverse {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-35px, 45px); }
  50% { transform: translate(25px, 55px); }
  75% { transform: translate(-40px, 35px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(50px, -50px); }
  66% { transform: translate(-40px, 40px); }
}

@keyframes floatFast {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-30px, -35px); }
  40% { transform: translate(35px, -25px); }
  60% { transform: translate(-35px, 30px); }
  80% { transform: translate(30px, 35px); }
}

/* --- Fade & Slide Animations --- */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes slideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Animation Delays --- */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

@keyframes bgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
