/* ==========================================================================
   CRAACT TECHNOLOGIES — CINEMATIC INTERACTION & TRANSITIONS SYSTEM
   Ultra-luxury scroll physics, ambient spotlight lighting, 3D perspective depth,
   and fluid page transitions.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LENIS SMOOTH SCROLL INTEGRATION
   -------------------------------------------------------------------------- */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   2. VIEWPORT SCROLL PROGRESS INDICATOR
   -------------------------------------------------------------------------- */
#cinematic-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2.5px;
  background: linear-gradient(90deg, #0052ff 0%, #00d2ff 50%, #0052ff 100%);
  background-size: 200% 100%;
  animation: progressShimmer 3s linear infinite;
  box-shadow: 0 0 12px rgba(0, 82, 255, 0.6), 0 0 4px rgba(0, 210, 255, 0.4);
  z-index: 10000;
  pointer-events: none;
  transition: width 0.08s ease-out;
}

@keyframes progressShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* --------------------------------------------------------------------------
   3. AMBIENT CONSTELLATION / NEURAL CANVAS (Hero Background)
   -------------------------------------------------------------------------- */
.cinematic-canvas-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

#cinematic-ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
}

/* --------------------------------------------------------------------------
   4. CURSOR SPOTLIGHT TRACKING & 3D TILT PHYSICS
   -------------------------------------------------------------------------- */
.cinematic-tilt-card {
  perspective: 1200px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
}

/* Ambient spotlight overlay inside cards */
.cinematic-spotlight {
  position: relative;
  overflow: hidden;
}

.cinematic-spotlight::before {
  content: '';
  position: absolute;
  top: var(--spotlight-y, -1000px);
  left: var(--spotlight-x, -1000px);
  width: 480px;
  height: 480px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 82, 255, 0.08) 0%, rgba(0, 210, 255, 0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cinematic-spotlight:hover::before {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   5. MAGNETIC BUTTON PHYSICS
   -------------------------------------------------------------------------- */
.cinematic-magnetic {
  display: inline-flex;
  position: relative;
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
}

/* --------------------------------------------------------------------------
   6. CINEMATIC SCROLL REVEALS & STAGGER SEQUENCING
   -------------------------------------------------------------------------- */
.cinematic-fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.cinematic-fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.cinematic-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-stagger.in-view > *:nth-child(1) { transition-delay: 0.04s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(3) { transition-delay: 0.20s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(4) { transition-delay: 0.28s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(5) { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(6) { transition-delay: 0.44s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(7) { transition-delay: 0.52s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(8) { transition-delay: 0.60s; opacity: 1; transform: translateY(0); }
.cinematic-stagger.in-view > *:nth-child(9) { transition-delay: 0.68s; opacity: 1; transform: translateY(0); }

/* --------------------------------------------------------------------------
   7. PAGE TRANSITIONS (View Transitions API & CSS Fallbacks)
   -------------------------------------------------------------------------- */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: cinematicPageExit 0.3s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: cinematicPageEnter 0.35s cubic-bezier(0, 0, 0.2, 1) both;
}

@keyframes cinematicPageExit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.995); }
}

@keyframes cinematicPageEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fallback page transition */
.page-fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary, #ffffff);
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease-in-out;
}

body.is-transitioning .page-fade-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   8. AEO & GEO EXECUTIVE ANSWER MODULES (Direct Answer Extraction)
   -------------------------------------------------------------------------- */
.aeo-executive-box {
  background: linear-gradient(135deg, rgba(0, 82, 255, 0.02) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1px solid rgba(0, 82, 255, 0.12);
  border-left: 3px solid var(--accent, #0052ff);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 82, 255, 0.04);
}

.aeo-box-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent, #0052ff);
  margin-bottom: 0.6rem;
}

.aeo-box-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #0052ff);
  box-shadow: 0 0 6px rgba(0, 82, 255, 0.6);
}

.aeo-box-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #090d16);
  margin-bottom: 0.5rem;
}

.aeo-box-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary, #3f4a56);
  margin-bottom: 1rem;
}

.aeo-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.08);
}

.aeo-metric-item {
  display: flex;
  flex-direction: column;
}

.aeo-metric-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent, #0052ff);
}

.aeo-metric-lbl {
  font-size: 0.78rem;
  color: var(--text-muted, #71717a);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. CINEMATIC PILL BADGES & PULSE
   -------------------------------------------------------------------------- */
.cinematic-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 82, 255, 0.06);
  border: 1px solid rgba(0, 82, 255, 0.15);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #0052ff);
}

.cinematic-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
}

.cinematic-pulse-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: pulseDot 2s infinite ease-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* --------------------------------------------------------------------------
   10. BULLETPROOF CINEMATIC REVEAL VISIBILITY GUARANTEE
   -------------------------------------------------------------------------- */
.reveal.active,
.reveal.in-view,
.reveal.revealed,
.cinematic-fade-up.in-view,
.cinematic-fade-up.active {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
  visibility: visible !important;
}
