/**
 * Sheba site-wide motion + micro-craft (non-AI pages only)
 * Scoped: body:not(.sheba-ai-page)
 * Does NOT touch #mainHeader, .font-footer / footer chrome, or AI landing.
 * Complements sheba-site-v2.css (load after it).
 */

/* ---------------------------------------------------------------------------
   SCROLL REVEAL — AI .reveal craft, milder travel (18px)
   Classes: .reveal (manual) and .sheba-reveal (auto-tagged by JS)
--------------------------------------------------------------------------- */
body:not(.sheba-ai-page) .reveal,
body:not(.sheba-ai-page) .sheba-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.7s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  will-change: opacity, transform;
}

body:not(.sheba-ai-page) .reveal.is-visible,
body:not(.sheba-ai-page) .sheba-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Stagger — siblings in flex/grid parents */
body:not(.sheba-ai-page) .reveal:nth-child(1),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(1) { transition-delay: 0ms; }
body:not(.sheba-ai-page) .reveal:nth-child(2),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(2) { transition-delay: 60ms; }
body:not(.sheba-ai-page) .reveal:nth-child(3),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(3) { transition-delay: 120ms; }
body:not(.sheba-ai-page) .reveal:nth-child(4),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(4) { transition-delay: 180ms; }
body:not(.sheba-ai-page) .reveal:nth-child(5),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(5) { transition-delay: 240ms; }
body:not(.sheba-ai-page) .reveal:nth-child(6),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(6) { transition-delay: 300ms; }
body:not(.sheba-ai-page) .reveal:nth-child(7),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(7) { transition-delay: 360ms; }
body:not(.sheba-ai-page) .reveal:nth-child(8),
body:not(.sheba-ai-page) .sheba-reveal:nth-child(8) { transition-delay: 420ms; }

/* Tighter stagger inside common grids / row containers */
body:not(.sheba-ai-page) .grid > .reveal:nth-child(1),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(1),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(1),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(1) { transition-delay: 0ms; }
body:not(.sheba-ai-page) .grid > .reveal:nth-child(2),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(2),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(2),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(2) { transition-delay: 80ms; }
body:not(.sheba-ai-page) .grid > .reveal:nth-child(3),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(3),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(3),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(3) { transition-delay: 160ms; }
body:not(.sheba-ai-page) .grid > .reveal:nth-child(4),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(4),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(4),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(4) { transition-delay: 240ms; }
body:not(.sheba-ai-page) .grid > .reveal:nth-child(5),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(5),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(5),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(5) { transition-delay: 320ms; }
body:not(.sheba-ai-page) .grid > .reveal:nth-child(6),
body:not(.sheba-ai-page) .grid > .sheba-reveal:nth-child(6),
body:not(.sheba-ai-page) [class*="grid-cols"] > .reveal:nth-child(6),
body:not(.sheba-ai-page) [class*="grid-cols"] > .sheba-reveal:nth-child(6) { transition-delay: 400ms; }

/* Explicit stagger via data-sheba-delay (set by JS for flex rows like services) */
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="0"] { transition-delay: 0ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="1"] { transition-delay: 70ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="2"] { transition-delay: 140ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="3"] { transition-delay: 210ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="4"] { transition-delay: 280ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="5"] { transition-delay: 350ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="6"] { transition-delay: 420ms; }
body:not(.sheba-ai-page) .sheba-reveal[data-sheba-delay="7"] { transition-delay: 490ms; }

/* CRITICAL: never hide existing Tailwind scroll-anim (opacity-0 + animate-*) */
body:not(.sheba-ai-page) .scroll-anim.sheba-reveal,
body:not(.sheba-ai-page) .scroll-anim.reveal {
  opacity: unset;
  transform: none;
  transition: none;
  will-change: auto;
}

/* ---------------------------------------------------------------------------
   STRONGER CARD HOVER — match AI process-card / .card lift
   (site-v2 already lifts; this nudges shadow + border for polish)
--------------------------------------------------------------------------- */
body:not(.sheba-ai-page) .services-block {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    background-color 0.22s ease;
}

body:not(.sheba-ai-page) .services-block:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift, 0 16px 40px rgba(31, 40, 60, 0.16));
  border-color: rgba(2, 148, 223, 0.35) !important;
}

body:not(.sheba-ai-page) .service-card {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

body:not(.sheba-ai-page) .service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift, 0 16px 40px rgba(31, 40, 60, 0.16));
  border-color: rgba(2, 148, 223, 0.35);
}

/* Testimonial / bordered cards */
body:not(.sheba-ai-page) .border.rounded-2xl.border-secondary,
body:not(.sheba-ai-page) .border.rounded-xl.border-secondary {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  box-shadow: var(--shadow-1, 0 4px 16px rgba(35, 31, 32, 0.06));
}

body:not(.sheba-ai-page) .border.rounded-2xl.border-secondary:hover,
body:not(.sheba-ai-page) .border.rounded-xl.border-secondary:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift, 0 16px 40px rgba(31, 40, 60, 0.16));
  border-color: rgba(2, 148, 223, 0.35);
}

/* how-we-work items — light lift if not already scroll-anim only */
body:not(.sheba-ai-page) .how-we-work-item {
  transition:
    box-shadow 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 0.22s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.22s ease;
}

body:not(.sheba-ai-page) .how-we-work-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2, 0 12px 30px rgba(31, 40, 60, 0.12));
}

/* Contrast safety (reinforce site-v2): dark bands white; light cards dark */
body:not(.sheba-ai-page) .bg-footer:not(.font-footer),
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) p,
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) h1,
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) h2,
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) h3,
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) span,
body:not(.sheba-ai-page) .bg-footer:not(.font-footer) li {
  color: #fff;
}

body:not(.sheba-ai-page) .border.rounded-2xl.border-secondary,
body:not(.sheba-ai-page) .border.rounded-xl.border-secondary,
body:not(.sheba-ai-page) .service-card,
body:not(.sheba-ai-page) .services-block {
  color: var(--sheba-near-black, #231F20);
}

/* ---------------------------------------------------------------------------
   YELLOW TRIANGLE polish + optional section-headliner corner accent
--------------------------------------------------------------------------- */
body:not(.sheba-ai-page) li.yellow-triangle-bullet::before {
  border-left-color: var(--sheba-yellow, #FFD400) !important;
}

/* Tasteful corner accent on secondary section headliners (not hero CTA) */
body:not(.sheba-ai-page) main h2.font-pageHeadliner,
body:not(.sheba-ai-page) main h2.text-pageHeadlinerSecondaryMobile,
body:not(.sheba-ai-page) main .sheba-section-headliner {
  position: relative;
}

body:not(.sheba-ai-page) main h2.font-pageHeadliner.sheba-tri-accent::before,
body:not(.sheba-ai-page) main h2.text-pageHeadlinerSecondaryMobile.sheba-tri-accent::before,
body:not(.sheba-ai-page) main .sheba-section-headliner.sheba-tri-accent::before {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  top: -10px;
  width: 0;
  height: 0;
  margin-left: -6px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--sheba-yellow, #FFD400);
  opacity: 0.95;
  pointer-events: none;
}

/* Left-aligned headliners: place accent left */
body:not(.sheba-ai-page) main h2.font-pageHeadliner.text-left.sheba-tri-accent::before,
body:not(.sheba-ai-page) main h2.md\:text-left.sheba-tri-accent::before {
  left: 0;
  margin-left: 0;
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION — instant visible, no lift transforms on hover either
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body:not(.sheba-ai-page) .reveal,
  body:not(.sheba-ai-page) .sheba-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  body:not(.sheba-ai-page) .services-block:hover,
  body:not(.sheba-ai-page) .service-card:hover,
  body:not(.sheba-ai-page) .border.rounded-2xl.border-secondary:hover,
  body:not(.sheba-ai-page) .border.rounded-xl.border-secondary:hover,
  body:not(.sheba-ai-page) .how-we-work-item:hover {
    transform: none;
  }
}

/* Hard locks: never animate header / site footer chrome */
body:not(.sheba-ai-page) #mainHeader .reveal,
body:not(.sheba-ai-page) #mainHeader .sheba-reveal,
body:not(.sheba-ai-page) .font-footer .reveal,
body:not(.sheba-ai-page) .font-footer .sheba-reveal,
body:not(.sheba-ai-page) footer .reveal,
body:not(.sheba-ai-page) footer .sheba-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
