/* ============================================================
   Nahj Al-Injaz — Enhanced Animations CSS v2
   Bold & Immersive: Cursor · Particles · 3D · Shimmer · Orbs
   ============================================================ */

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */

/* ============================================================
   SCROLL-DRIVEN PROCESS TIMELINE
   ============================================================ */

/* Container */
.process-timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 2rem;
}

/* Vertical spine */
/* Vertical spine — drawn via ::after on each badge so it is ALWAYS
   perfectly centered on the badge circle, regardless of grid math. */
/* Dim track: from badge center downward to next badge */
.timeline-step:not(:last-child) .timeline-badge::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: var(--spine-seg-h, 130px);
  background: rgba(201,162,75,0.18);
  border-radius: 0 0 2px 2px;
  z-index: -1;
  pointer-events: none;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
/* Lit segment: full gold once badge is active */
.timeline-step:not(:last-child) .timeline-badge.active::after {
  background: linear-gradient(180deg, #DDBB66 0%, #C9A24B 70%, rgba(201,162,75,0.3) 100%);
  box-shadow: 0 0 10px rgba(221,187,102,0.5);
}
/* Partial fill while line is travelling (JS adds .spine-filling + --spine-fill-pct) */
.timeline-step:not(:last-child) .timeline-badge.spine-filling::after {
  background: linear-gradient(
    180deg,
    #DDBB66 0%,
    #C9A24B var(--spine-fill-pct, 0%),
    rgba(201,162,75,0.18) var(--spine-fill-pct, 0%),
    rgba(201,162,75,0.18) 100%
  );
  box-shadow: 0 0 8px rgba(221,187,102,0.35);
}

/* Each step row */
.timeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: 120px;
  margin-bottom: 2.5rem;
  z-index: 1;
}

/* Badge (center column) */
.timeline-badge {
  grid-column: 2;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,22,40,0.9);
  border: 2px solid rgba(201,162,75,0.35);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.4s ease;
  z-index: 2;
}

.timeline-badge.active {
  background: linear-gradient(135deg, #C9A24B 0%, #DDBB66 100%);
  border-color: #DDBB66;
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(221,187,102,0.15), 0 0 28px rgba(221,187,102,0.5);
}

.badge-num {
  font-family: var(--font-head, 'Tajawal', sans-serif);
  font-weight: 800;
  font-size: 1.4rem;
  color: rgba(221,187,102,0.7);
  transition: color 0.4s ease;
  line-height: 1;
}

.timeline-badge.active .badge-num {
  color: #0a1628;
}

/* Glow ring that pulses on activation */
.badge-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(221,187,102,0);
  transition: border-color 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.timeline-badge.active .badge-glow {
  border-color: rgba(221,187,102,0.5);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.4; }
}

/* Content cards */
.timeline-content {
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.23,1,0.32,1);
}
/* JS adds .timeline-ready to the container once initialized;
   only then do we hide cards so they can animate in */
.process-timeline.timeline-ready .timeline-content {
  opacity: 0;
}
.process-timeline.timeline-ready .timeline-content.active {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.timeline-content--right {
  grid-column: 3;
  transform: translateX(40px);
}

.timeline-content--left {
  grid-column: 1;
  transform: translateX(-40px);
}

/* RTL: flip directions for AR pages */
[dir="rtl"] .timeline-content--right {
  grid-column: 1;
  transform: translateX(-40px);
}

[dir="rtl"] .timeline-content--left {
  grid-column: 3;
  transform: translateX(40px);
}

.timeline-content.active {
  opacity: 1;
  transform: translateX(0) !important;
}

.timeline-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,162,75,0.2);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.4s ease, background 0.4s ease;
}

.timeline-content.active .timeline-card {
  background: rgba(255,255,255,0.08);
  border-color: rgba(201,162,75,0.4);
}

.timeline-card h3 {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.timeline-card p {
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

/* Mobile: stack vertically */
@media (max-width: 767px) {

  .timeline-step {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto;
    gap: 0 1rem;
    min-height: auto;
    margin-bottom: 2rem;
  }

  .timeline-badge {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
  }

  .timeline-content--right,
  .timeline-content--left,
  [dir="rtl"] .timeline-content--right,
  [dir="rtl"] .timeline-content--left {
    grid-column: 2;
    grid-row: 1;
    transform: translateX(20px);
  }

  .timeline-content.active {
    transform: translateX(0) !important;
  }
}

/* Reduced motion: show all immediately */
@media (prefers-reduced-motion: reduce) {
  .timeline-content { opacity: 1 !important; transform: none !important; }
  .timeline-badge { transition: none; }
  .badge-glow { animation: none !important; }
}
/* CSS custom cursor — works on all browsers without JS, unaffected by z-index or stacking */
@media (pointer: fine) {
  *, *::before, *::after {
    cursor: url('/manus-storage/cursor_7d2dfb8b.svg') 16 16, crosshair !important;
  }
}

/* JS-driven cursor ring overlay (enhancement on top of CSS cursor) */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(221,187,102,0.7);
  box-shadow: 0 0 12px rgba(221,187,102,0.5);
  pointer-events: none;
  z-index: 99999;
  transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  will-change: transform;
}

.cursor-glow--expand {
  width: 64px;
  height: 64px;
  border-color: rgba(221,187,102,0.9);
  box-shadow: 0 0 22px rgba(221,187,102,0.8);
}

/* Hide JS cursor elements — CSS cursor handles the primary pointer */
.cursor-dot {
  display: none !important;
}

/* ============================================================
   HERO PARTICLE CANVAS
   ============================================================ */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   GRADIENT MESH ORBS (Hero Background)
   ============================================================ */
.hero-gradient-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.mesh-orb--1 {
  width: 600px; height: 600px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(201,162,75,0.12) 0%, transparent 70%);
  animation: orb-drift-1 18s ease-in-out infinite alternate;
}

.mesh-orb--2 {
  width: 500px; height: 500px;
  bottom: -150px; left: -100px;
  background: radial-gradient(circle, rgba(26,53,96,0.5) 0%, transparent 70%);
  animation: orb-drift-2 22s ease-in-out infinite alternate;
}

.mesh-orb--3 {
  width: 400px; height: 400px;
  top: 30%; left: 30%;
  background: radial-gradient(circle, rgba(201,162,75,0.07) 0%, transparent 70%);
  animation: orb-drift-3 28s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-60px, 40px) scale(1.1); }
  100% { transform: translate(40px, -30px) scale(0.95); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(50px, -40px) scale(1.08); }
  100% { transform: translate(-30px, 30px) scale(1.05); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50%  { transform: translate(40px, 50px) scale(1.2); opacity: 1; }
  100% { transform: translate(-50px, -20px) scale(0.9); opacity: 0.4; }
}

/* ============================================================
   HERO CONTENT — z-index layering
   ============================================================ */
.hero-grid {
  position: relative;
  z-index: 2;
}

/* ============================================================
   CHARACTER REVEAL SPANS
   ============================================================ */
.char-reveal {
  display: inline-block;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
}

/* ============================================================
   EMBLEM LIGHT BURST
   ============================================================ */
.emblem-burst {
  position: absolute;
  width: min(340px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,75,0.5) 0%, rgba(201,162,75,0.15) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   ENHANCED ORBITAL RINGS
   ============================================================ */
.hero-ring-enhanced {
  pointer-events: none;
  will-change: transform;
}

.orbit-dot {
  will-change: transform;
}

/* ============================================================
   CARD GLARE OVERLAY
   ============================================================ */
.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.split-card,
.card {
  position: relative;
  overflow: hidden;
  will-change: transform;
}

/* Ensure card content is above glare */
.split-card > *:not(.card-glare),
.card > *:not(.card-glare) {
  position: relative;
  z-index: 2;
}

/* ============================================================
   SPLIT CARD — Enhanced hover shimmer
   ============================================================ */
.split-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(201,162,75,0.12) 50%,
    transparent 70%
  );
  transform: translateX(-130%);
  transition: transform 0.7s ease;
  pointer-events: none;
  z-index: 1;
}

[dir="rtl"] .split-card::after {
  transform: translateX(130%);
}

.split-card:hover::after {
  transform: translateX(130%);
}

[dir="rtl"] .split-card:hover::after {
  transform: translateX(-130%);
}

/* ============================================================
   CARD — Enhanced hover glow border
   ============================================================ */
.card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(201,162,75,0) 0%,
    rgba(201,162,75,0.4) 50%,
    rgba(201,162,75,0) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.card:hover::after {
  opacity: 1;
}

/* ============================================================
   ICON BADGE — Glow on hover
   ============================================================ */
.icon-badge {
  transition: box-shadow 0.3s ease, background 0.3s ease;
  will-change: transform;
}

.split-card:hover .icon-badge,
.card:hover .icon-badge {
  box-shadow: 0 0 20px rgba(201,162,75,0.35), 0 0 40px rgba(201,162,75,0.15);
  background: linear-gradient(140deg, rgba(201,162,75,0.25), rgba(201,162,75,0.1));
}

/* ============================================================
   HERO CHIPS — Enhanced styling
   ============================================================ */
.hero-chip {
  will-change: transform;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-chip:hover {
  border-color: rgba(201,162,75,0.65);
  box-shadow: 0 8px 24px -8px rgba(201,162,75,0.4), 0 0 0 1px rgba(201,162,75,0.2);
}

/* ============================================================
   STAT NUMBERS — Glow on reveal
   ============================================================ */
.stat-num {
  will-change: filter;
  transition: filter 0.3s ease;
}

/* ============================================================
   SECTION HEAD EYEBROW — Animated underline
   ============================================================ */
.eyebrow {
  position: relative;
}

/* ============================================================
   MARQUEE BAND — Enhanced
   ============================================================ */
.marquee-band {
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.marquee-band:hover {
  box-shadow: 0 0 30px -10px rgba(201,162,75,0.2);
}

/* ============================================================
   HERO VISUAL — Perspective container
   ============================================================ */
.hero-visual {
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* ============================================================
   FLOATING GEOMETRIC SHAPES (Hero ambient)
   ============================================================ */
.hero::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  top: 15%;
  left: 5%;
  border: 1px solid rgba(201,162,75,0.06);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morph-shape 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes morph-shape {
  0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(0deg) scale(1); }
  25%  { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; transform: rotate(45deg) scale(1.05); }
  50%  { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; transform: rotate(90deg) scale(0.95); }
  75%  { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; transform: rotate(135deg) scale(1.02); }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(180deg) scale(1); }
}

/* ============================================================
   SCROLL PROGRESS INDICATOR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-gold, linear-gradient(90deg, #A67F2F, #C9A24B, #E9D08C));
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9998;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(201,162,75,0.6);
}

/* ============================================================
   HERO BADGE — Pulse ring enhancement
   ============================================================ */
.hero-badge {
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-badge:hover {
  border-color: rgba(201,162,75,0.6);
  box-shadow: 0 0 20px rgba(201,162,75,0.2);
  transform: translateY(-2px);
}

/* ============================================================
   SPLIT CARD — Enhanced border glow on hover
   ============================================================ */
.split-card:hover {
  box-shadow:
    0 24px 50px -20px rgba(6, 15, 31, 0.8),
    0 0 0 1px rgba(201,162,75,0.4),
    0 0 40px -20px rgba(201,162,75,0.3);
}

/* ============================================================
   REDUCED MOTION OVERRIDES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .cursor-glow,
  .cursor-dot,
  .hero-particles,
  .hero-gradient-mesh,
  .mesh-orb,
  .hero-ring-enhanced,
  .emblem-burst,
  .hero::after,
  .scroll-progress {
    display: none !important;
    animation: none !important;
  }

  .split-card::after,
  .card::after,
  .card-glare {
    display: none !important;
  }

  * { cursor: auto !important; }
}

/* ============================================================
   MOBILE OVERRIDES
   ============================================================ */
@media (max-width: 768px) {
  .cursor-glow,
  .cursor-dot {
    display: none !important;
  }

  .hero::after {
    display: none;
  }

  .mesh-orb--1 { width: 300px; height: 300px; }
  .mesh-orb--2 { width: 250px; height: 250px; }
  .mesh-orb--3 { display: none; }
}

/* ============================================================
   SCROLL PROGRESS BAR (JS-driven)
   ============================================================ */
@keyframes progress-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(201,162,75,0.6); }
  50% { box-shadow: 0 0 16px rgba(201,162,75,0.9); }
}

.scroll-progress {
  animation: progress-glow 2s ease-in-out infinite;
}

/* ============================================================
   HERO EMBLEM — Enhanced drop shadow transition
   ============================================================ */
.hero-emblem {
  transition: filter 0.4s ease;
  will-change: filter, transform;
}

/* ============================================================
   NAV — Enhanced glass effect on scroll
   ============================================================ */
.nav.scrolled {
  box-shadow: 0 4px 30px -10px rgba(6,15,31,0.5), 0 0 0 1px rgba(201,162,75,0.12);
}

/* ============================================================
   SPLIT CARD ICON BADGE — 3D lift
   ============================================================ */
.split-card:hover .icon-badge {
  transform: translateZ(20px);
}

/* ============================================================
   HERO CTA BUTTONS — Enhanced glow on hover
   ============================================================ */
.btn-gold:hover {
  box-shadow:
    0 14px 34px -10px rgba(201, 162, 75, 0.6),
    0 0 0 1px rgba(201,162,75,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* ============================================================
   STEP NUMBERS — Animated on scroll
   ============================================================ */
.step-num {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.step:hover .step-num {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(201,162,75,0.3);
  border-color: rgba(201,162,75,0.7);
}

/* ============================================================
   TESTIMONIAL CARDS — Subtle lift
   ============================================================ */
.quote-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quote-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(16,24,40,0.15);
}

/* ============================================================
   PROCESS SECTION — dark-bg contrast + scroll-driven steps
   ============================================================ */

/* Contrast: force light text on the dark navy process section */
.process-section .section-head h2,
.process-section .section-head p { color: #fff !important; }
.process-section .section-head .eyebrow { color: var(--gold-300, #c9a24b) !important; }
.process-section .section-head .eyebrow::before,
.process-section .section-head .eyebrow::after { background: var(--gold-300, #c9a24b) !important; }
.process-section .step h3 { color: #fff !important; }
.process-section .step p { color: rgba(210,220,235,0.85) !important; }
.process-section .step-num {
  background: transparent !important;
  border: 2px solid rgba(201,162,75,0.7) !important;
  color: var(--gold-300, #c9a24b) !important;
  box-shadow: 0 0 18px rgba(201,162,75,0.25) !important;
}

/* Scroll-driven: steps start hidden, JS reveals them */
@media (prefers-reduced-motion: no-preference) {
  .process-section .step[data-step] {
    opacity: 0;
    transform: translateY(44px);
  }
  .process-section .step[data-step].step--visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.65s cubic-bezier(0.23,1,0.32,1), transform 0.65s cubic-bezier(0.23,1,0.32,1);
  }
  /* Connector line animates from 0 width */
  .process-section .steps::before {
    transform-origin: right;
    transform: scaleX(0);
    transition: transform 1.4s cubic-bezier(0.23,1,0.32,1) 0.2s;
  }
  .process-section .steps.steps--line-visible::before {
    transform: scaleX(1);
  }
}
