/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ===== Micro-interactions & Animations ===== */

/* Progress bar fill animation */
.animate-progress {
  animation: progress-fill 1s ease-out forwards;
}
@keyframes progress-fill {
  from { width: 0%; }
}

/* Slide-down entrance for flash messages */
.animate-slide-down {
  animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade-in entrance for overlays */
.animate-fade-in {
  animation: fade-in 0.2s ease-out forwards;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade-up entrance for page sections */
.animate-fade-up {
  animation: fade-up 0.5s ease-out forwards;
  opacity: 0;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* Card hover lift (supplement Tailwind's hover:shadow) */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
}

/* Dropdown menu animation */
.dropdown-enter {
  animation: dropdown-open 0.15s ease-out forwards;
}
@keyframes dropdown-open {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Mobile menu slide animation */
.mobile-menu-enter {
  animation: mobile-menu-slide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.mobile-menu-leave {
  animation: mobile-menu-slide 0.2s cubic-bezier(0.16, 1, 0.3, 1) reverse forwards;
}
@keyframes mobile-menu-slide {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
  }
}

/* Notification bell shake animation */
.animate-bell-shake {
  animation: bell-shake 0.6s ease-in-out;
  animation-iteration-count: 1;
}
.bell-ring {
  animation: bell-shake 0.6s ease-in-out infinite;
  animation-delay: 3s;
  animation-iteration-count: 3;
}
@keyframes bell-shake {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(12deg); }
  30%  { transform: rotate(-10deg); }
  45%  { transform: rotate(8deg); }
  60%  { transform: rotate(-6deg); }
  75%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

/* Save button scale pulse */
.animate-save-pulse {
  animation: save-pulse 0.35s cubic-bezier(0.17, 0.67, 0.21, 1.69) forwards;
}
@keyframes save-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Leaderboard podium tinting for top 3 */
.podium-gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
  border-left: 3px solid #f59e0b;
}
.podium-silver {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(107, 114, 128, 0.04) 100%);
  border-left: 3px solid #9ca3af;
}
.podium-bronze {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.06) 0%, rgba(217, 119, 6, 0.03) 100%);
  border-left: 3px solid #b45309;
}

/* Quiz option interactive hover */
.quiz-option {
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.quiz-option:hover {
  background-color: rgb(238 242 255); /* indigo-50 */
  border-color: rgb(165 180 252);     /* indigo-300 */
  box-shadow: 0 1px 3px 0 rgb(99 102 241 / 0.08);
}

/* Tab transition for leaderboard and similar components */
.tab-link {
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.tab-link:hover {
  background-color: rgb(238 242 255); /* indigo-50 */
}

/* ===== Pass 4: Learning Momentum Micro-interactions ===== */

/* Lesson completion celebration — checkmark draws in + ring expands */
.lesson-complete-celebrate {
  animation: celebrate-pop 0.5s cubic-bezier(0.17, 0.67, 0.21, 1.69) forwards;
}
@keyframes celebrate-pop {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* XP counter count-up glow effect */
.xp-toast-enter {
  animation: xp-float-up 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes xp-float-up {
  0%   { opacity: 0; transform: translateY(12px) scale(0.8); }
  15%  { opacity: 1; transform: translateY(0) scale(1.1); }
  25%  { transform: translateY(0) scale(1); }
  75%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-24px); }
}

/* Badge unlock reveal — spins in from nothing */
.badge-unlock {
  animation: badge-reveal 0.8s cubic-bezier(0.17, 0.67, 0.21, 1.25) forwards;
}
@keyframes badge-reveal {
  0%   { opacity: 0; transform: scale(0) rotate(-180deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(10deg); }
  80%  { transform: scale(0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Quiz answer reveal — staggered fade with color */
.quiz-answer-correct {
  animation: answer-correct 0.4s ease-out forwards;
}
@keyframes answer-correct {
  0%   { background-color: transparent; border-color: #e5e7eb; }
  40%  { background-color: #dcfce7; border-color: #86efac; transform: scale(1.02); }
  100% { background-color: #f0fdf4; border-color: #bbf7d0; transform: scale(1); }
}
.quiz-answer-incorrect {
  animation: answer-incorrect 0.4s ease-out forwards;
}
@keyframes answer-incorrect {
  0%   { background-color: transparent; }
  30%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  70%  { transform: translateX(-2px); }
  100% { background-color: #fef2f2; border-color: #fecaca; transform: translateX(0); }
}

/* Score percentage count-up container */
.score-reveal {
  animation: score-grow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes score-grow {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Streak flame pulse — gentle throb for active streaks */
.streak-flame-pulse {
  animation: flame-pulse 2s ease-in-out infinite;
}
@keyframes flame-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* Level up shimmer effect */
.level-up-shimmer {
  position: relative;
  overflow: hidden;
}
.level-up-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer-sweep 1.5s ease-in-out;
  pointer-events: none;
}
@keyframes shimmer-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Progress ring draw animation (SVG) */
.progress-ring-animate {
  animation: ring-draw 1.2s ease-out forwards;
  stroke-dashoffset: 100;
}
@keyframes ring-draw {
  from { stroke-dashoffset: 100; }
}

/* Scroll-triggered reveal — elements below the fold */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Course completion banner celebration */
.course-complete-banner {
  animation: banner-celebrate 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #f0fdf4 100%);
  background-size: 200% 200%;
}
@keyframes banner-celebrate {
  0%   { opacity: 0; transform: translateY(-10px); background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { opacity: 1; transform: translateY(0); background-position: 0% 50%; }
}

/* Enrollment button success morph */
.enroll-success {
  animation: enroll-morph 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes enroll-morph {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.95); }
  60%  { transform: scale(1.05); background-color: #16a34a; }
  100% { transform: scale(1); background-color: #16a34a; }
}

/* Onboarding step slide transition */
.onboarding-step-enter {
  animation: step-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.onboarding-step-exit {
  animation: step-slide-out 0.25s ease-in forwards;
}
@keyframes step-slide-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes step-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}

/* Skeleton loading shimmer for lazy-loaded content */
.skeleton-shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Number counter animation (for stats on profile/dashboard) */
.counter-animate {
  display: inline-block;
  animation: counter-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes counter-pop {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Smooth check mark draw for lesson nav */
.check-draw svg {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw-check 0.4s ease-out 0.1s forwards;
}
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

/* Nav active indicator underline transition */
.nav-link-active-indicator {
  position: relative;
}
.nav-link-active-indicator::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #6366f1;
  transition: width 0.25s ease, left 0.25s ease;
}
.nav-link-active-indicator:hover::after,
.nav-link-active-indicator.active::after {
  width: 100%;
  left: 0;
}


/* ===== Dark Mode Overrides ===== */

/* Skeleton shimmer — dark variant */
.dark .skeleton-shimmer {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
}

/* Quiz answer colors in dark mode */
.dark .quiz-answer-correct {
  animation-name: answer-correct-dark;
}
@keyframes answer-correct-dark {
  0%   { background-color: transparent; border-color: #374151; }
  40%  { background-color: rgba(34, 197, 94, 0.2); border-color: #22c55e; transform: scale(1.02); }
  100% { background-color: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.4); transform: scale(1); }
}
.dark .quiz-answer-incorrect {
  animation-name: answer-incorrect-dark;
}
@keyframes answer-incorrect-dark {
  0%   { background-color: transparent; }
  30%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  70%  { transform: translateX(-2px); }
  100% { background-color: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); transform: translateX(0); }
}

/* Podium tinting — dark */
.dark .podium-gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-left-color: #f59e0b;
}
.dark .podium-silver {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.15) 0%, rgba(107, 114, 128, 0.08) 100%);
  border-left-color: #9ca3af;
}
.dark .podium-bronze {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
  border-left-color: #b45309;
}

/* Course complete banner — dark */
.dark .course-complete-banner {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.2) 50%, rgba(34, 197, 94, 0.1) 100%);
  background-size: 200% 200%;
}

/* Quiz option hover — dark */
.dark .quiz-option:hover {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 1px 3px 0 rgb(99 102 241 / 0.15);
}

/* Tab link hover — dark */
.dark .tab-link:hover {
  background-color: rgba(99, 102, 241, 0.15);
}

/* Level up shimmer — dark */
.dark .level-up-shimmer::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
}

/* Nav active indicator — dark */
.dark .nav-link-active-indicator::after {
  background-color: #818cf8;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .animate-progress,
  .animate-slide-down,
  .animate-fade-up,
  .card-hover,
  .dropdown-enter,
  .mobile-menu-enter,
  .mobile-menu-leave,
  .animate-bell-shake,
  .bell-ring,
  .animate-save-pulse,
  .quiz-option,
  .tab-link,
  .lesson-complete-celebrate,
  .xp-toast-enter,
  .badge-unlock,
  .quiz-answer-correct,
  .quiz-answer-incorrect,
  .score-reveal,
  .streak-flame-pulse,
  .level-up-shimmer::after,
  .progress-ring-animate,
  .scroll-reveal,
  .course-complete-banner,
  .enroll-success,
  .onboarding-step-enter,
  .onboarding-step-exit,
  .skeleton-shimmer,
  .counter-animate,
  .check-draw svg,
  .cmi-rise-1,
  .cmi-rise-2,
  .cmi-rise-3,
  .cmi-rise-4,
  .cmi-rise-5,
  .cmi-float-a,
  .cmi-float-b,
  .cmi-float-c,
  .cmi-feat-card,
  .cmi-cta-breathe,
  .cmi-pulse-dot {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
  .scroll-reveal,
  .scroll-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ===== Focus Mode / Zen Mode ===== */
/* Strips visual noise for distraction-free learning.
   Activated by toggling .zen-mode on <body>. */

/* Hide gamification elements */
.zen-mode .streak-flame-pulse,
.zen-mode [data-gamification],
.zen-mode #xp_display,
.zen-mode #xp_display_mobile {
  display: none !important;
}

/* Hide notification badge */
.zen-mode #notification_badge {
  display: none !important;
}

/* Hide activity feed links and social elements */
.zen-mode [data-social],
.zen-mode [data-feed-link] {
  display: none !important;
}

/* Maximize content area */
.zen-mode main {
  max-width: 100% !important;
}

/* Subdued color palette */
.zen-mode {
  --zen-bg: #fafafa;
  --zen-text: #374151;
}

.zen-mode.dark {
  --zen-bg: #0f0f0f;
  --zen-text: #d1d5db;
}

/* Kill all animations */
.zen-mode,
.zen-mode *,
.zen-mode *::before,
.zen-mode *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
}

/* Simplify nav - keep functional links, reduce visual weight */
.zen-mode nav {
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

/* Hide leaderboard and feed nav links */
.zen-mode a[href="/leaderboard"],
.zen-mode a[href="/feed"] {
  display: none !important;
}

/* Reduce footer visual noise */
.zen-mode footer {
  opacity: 0.5;
}

/* Focus indicator for the toggle button */
.focus-toggle-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: white;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.focus-toggle-btn:hover {
  background: #f3f4f6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dark .focus-toggle-btn {
  background: #1f2937;
  color: #d1d5db;
  border-color: #374151;
}

.dark .focus-toggle-btn:hover {
  background: #374151;
}

/* Active zen mode toggle style */
.zen-mode .focus-toggle-btn {
  background: #4f46e5;
  color: white;
  border-color: #4338ca;
}

.zen-mode .focus-toggle-btn:hover {
  background: #4338ca;
}

.zen-mode.dark .focus-toggle-btn {
  background: #6366f1;
  border-color: #818cf8;
}

.zen-mode.dark .focus-toggle-btn:hover {
  background: #4f46e5;
}

/* ===== Advanced Animations — Floating Elements ===== */

@keyframes cmi-float-a {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%      { transform: translateY(-9px) rotate(0.5deg); }
  66%      { transform: translateY(-4px) rotate(-0.5deg); }
}
@keyframes cmi-float-b {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  40%      { transform: translateY(-7px) rotate(-0.4deg); }
  70%      { transform: translateY(-3px) rotate(0.4deg); }
}
@keyframes cmi-float-c {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-11px) rotate(0.3deg); }
}
.cmi-float-a { animation: cmi-float-a 3.8s ease-in-out infinite; }
.cmi-float-b { animation: cmi-float-b 4.4s ease-in-out infinite; animation-delay: 0.9s; }
.cmi-float-c { animation: cmi-float-c 3.2s ease-in-out infinite; animation-delay: 1.7s; }

/* ===== Staggered Rise Entrance ===== */

@keyframes cmi-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cmi-rise-1 { animation: cmi-rise 0.7s ease-out both; }
.cmi-rise-2 { animation: cmi-rise 0.7s ease-out 0.12s both; }
.cmi-rise-3 { animation: cmi-rise 0.7s ease-out 0.24s both; }
.cmi-rise-4 { animation: cmi-rise 0.7s ease-out 0.36s both; }
.cmi-rise-5 { animation: cmi-rise 0.7s ease-out 0.48s both; }
.cmi-rise-card { animation: cmi-rise 0.8s cubic-bezier(0.22,1,0.36,1) 0.2s both; }

/* ===== CTA Breathing Pulse ===== */

@keyframes cmi-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 28px rgba(99,102,241,0.32), 0 2px 8px rgba(0,0,0,0.06); }
  50%      { transform: scale(1.03); box-shadow: 0 12px 36px rgba(99,102,241,0.42), 0 4px 12px rgba(0,0,0,0.08); }
}
.cmi-cta-breathe {
  animation: cmi-breathe 3s ease-in-out infinite;
}
.cmi-cta-breathe:hover {
  animation: none;
}

/* ===== CTA Shine Sweep ===== */

@keyframes cmi-shine {
  0%   { left: -100%; }
  100% { left: 150%; }
}
.cmi-cta-shine { position: relative; overflow: hidden; }
.cmi-cta-shine::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: skewX(-20deg);
  left: -100%;
  pointer-events: none;
}
.cmi-cta-shine:hover::after {
  animation: cmi-shine 0.6s ease-out;
}

/* ===== Hero Gradient Shift ===== */

@keyframes cmi-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.cmi-gradient-bg {
  background-size: 200% 200%;
  animation: cmi-gradient-shift 12s ease-in-out infinite;
}

/* ===== Noise Texture Overlay ===== */

.cmi-noise-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
}

/* ===== Gradient Text ===== */

.cmi-gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Stat Number Glow ===== */

.cmi-stat-glow {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.3));
}

/* ===== Pulse Dot (eyebrow badges) ===== */

@keyframes cmi-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}
.cmi-pulse-dot { animation: cmi-pulse-dot 2s ease-in-out infinite; }

/* ===== Animated Bar Growth ===== */

@keyframes cmi-bar-grow {
  from { height: 0%; }
}
.cmi-bar-grow {
  animation: cmi-bar-grow 1.5s ease-out both;
}

/* ===== Logo / Feature Carousel ===== */

.cmi-logo-carousel {
  overflow: hidden;
  width: 100%;
  padding: 0.5rem 0;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.cmi-logo-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  will-change: transform;
}
.is-visible .cmi-logo-track {
  animation: cmi-scroll 35s linear infinite;
}
.cmi-logo-slide {
  flex-shrink: 0;
}
@keyframes cmi-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.is-visible .cmi-logo-track:hover {
  animation-play-state: paused;
}

/* ===== Step Connectors (How It Works) ===== */

.cmi-step-connector {
  position: absolute;
  top: 2rem;
  left: calc(50% + 2rem);
  width: calc(100% - 4rem);
  height: 2px;
  background: linear-gradient(90deg, #818cf8, #a78bfa);
  z-index: 0;
}

.cmi-step-num {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  color: white;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  position: relative;
  z-index: 1;
}

/* ===== Feature Card Hover (elevated shadow) ===== */

.cmi-feat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cmi-feat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99,102,241,0.12);
}

/* ===== Tilt Card (3D hover) ===== */

.cmi-tilt-card {
  transition: transform 0.15s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ===== Testimonial Quote Mark ===== */

.cmi-quote::before {
  content: '\201C';
  font-family: 'Bricolage Grotesque', serif;
  font-size: 4rem;
  line-height: 1;
  color: #c7d2fe;
  position: absolute;
  top: -0.5rem;
  left: 1rem;
}

/* ===== Typewriter Cursor ===== */

@keyframes cmi-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.cmi-typewriter-cursor::after {
  content: '|';
  animation: cmi-blink 1s step-end infinite;
  color: #6366f1;
  font-weight: 300;
}

/* ===== Sticky Mobile CTA ===== */

.cmi-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  transform: translateY(100%);
  animation: cmi-slide-up 0.5s ease-out 2s both;
}
@keyframes cmi-slide-up {
  to { transform: translateY(0); }
}
@media (min-width: 768px) {
  .cmi-sticky-cta { display: none !important; }
}

/* ===== Enhanced Scroll Reveal Variants ===== */

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== Dark Mode — Advanced Animations ===== */

.dark .cmi-gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark .cmi-stat-glow {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(129,140,248,0.4));
}

.dark .cmi-quote::before {
  color: #4338ca;
}

.dark .cmi-step-connector {
  background: linear-gradient(90deg, #6366f1, #7c3aed);
}

.dark .cmi-cta-breathe {
  box-shadow: 0 8px 28px rgba(129,140,248,0.25), 0 2px 8px rgba(0,0,0,0.2);
}

/* ===== Reduced Motion — Advanced Animations ===== */

@media (prefers-reduced-motion: reduce) {
  .cmi-float-a,
  .cmi-float-b,
  .cmi-float-c,
  .cmi-rise-1,
  .cmi-rise-2,
  .cmi-rise-3,
  .cmi-rise-4,
  .cmi-rise-5,
  .cmi-rise-card,
  .cmi-cta-breathe,
  .cmi-cta-shine::after,
  .cmi-gradient-bg,
  .cmi-pulse-dot,
  .cmi-bar-grow,
  .is-visible .cmi-logo-track,
  .cmi-sticky-cta,
  .cmi-typewriter-cursor::after,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
