/* ============================================================
   JYOTVIRA — Premium Motion & Visual Rhythm
   motion.css: ambient motion, section decor, card effects
   CSS-only. No external libraries. prefers-reduced-motion safe.
   ============================================================ */

/* ---- Section scaffolding: enable pseudo-element layers ---- */
.section,
.section--alt,
.section--white,
.section--blue,
.section--gold {
  position: relative;
  isolation: isolate; /* new stacking context — pseudo-elements stay behind content */
  overflow-x: hidden; /* contain decorative blobs — prevents section-level h-scroll */
}

/* Container stays above decorative pseudo-elements */
.section > .container,
.section--alt > .container,
.section--white > .container,
.section--blue > .container,
.section--gold > .container {
  position: relative;
  z-index: 1;
}

/* ---- Card base: position + overflow for shine effect ---- */
.product-card,
.service-card {
  overflow: hidden; /* required for shine sweep ::after */
}
.service-card {
  position: relative; /* product-card already has this */
}

/* ============================================================
   HERO
   ============================================================ */

/* Gold accent: breathing glow — makes "runs your business." alive */
@keyframes accent-glow {
  0%, 100% { text-shadow: 0 0 28px rgba(184,134,11,0.20); }
  50%       { text-shadow: 0 0 64px rgba(184,134,11,0.40), 0 0 120px rgba(184,134,11,0.12); }
}
.hero__headline .accent {
  display: inline;
  animation: accent-glow 4s ease-in-out infinite;
}

/* Hero grid: navy dot grid + gold glow bottom-right + blue glow top-right */
.hero__grid {
  background-image:
    linear-gradient(rgba(11,29,58,0.030) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,29,58,0.030) 1px, transparent 1px),
    radial-gradient(ellipse 55% 50% at 88%  8%, rgba(26,98,212,0.10) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 80% 92%, rgba(200,148,10,0.09) 0%, transparent 60%);
  background-size: 72px 72px, 72px 72px, 100% 100%, 100% 100%;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 65%);
}

/* Mobile: expand mask so orb at bottom-right shows */
@media (max-width: 1023px) {
  .hero__grid {
    mask-image: radial-gradient(ellipse at 60% 20%, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 60% 20%, black 0%, transparent 80%);
  }
}

/* ============================================================
   SECTION BACKGROUND LAYERS — ambient, non-interactive
   ============================================================ */

/* Blob drift: used by multiple sections */
@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%       { transform: translate(28px, -18px) scale(1.04); }
  50%       { transform: translate(-16px, 28px) scale(0.97); }
  75%       { transform: translate(12px, 14px) scale(1.02); }
}

/* Convictions (white): gold top glow — brightened to match new gold */
#convictions::before {
  content: '';
  position: absolute;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(200,148,10,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Products (warm ivory): subtle dot matrix */
#products {
  background-image:
    radial-gradient(rgba(11,29,58,0.032) 1px, transparent 1px),
    linear-gradient(var(--color-surface-2), var(--color-surface-2));
  background-size: 26px 26px, 100%;
}

/* Services (soft blue): drifting royal blue orb top-right */
#services::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -8%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(26,98,212,0.10) 0%, transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 20s ease-in-out infinite;
}
/* Second orb bottom-left — counter-drift */
#services::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(26,94,200,0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 26s ease-in-out 6s infinite reverse;
}

/* Industries (white): subtle blue grid, center-faded */
#industries::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,94,200,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,94,200,0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Lab (warm ivory): slow teal orb top-right */
#lab::before {
  content: '';
  position: absolute;
  top: 10%;
  right: 3%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(5,150,105,0.07) 0%, transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 18s ease-in-out 9s infinite;
}

/* Why Jyotvira (gold tint): warm golden orb bottom-left — richer gold */
#why::before {
  content: '';
  position: absolute;
  bottom: -8%;
  left: -6%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(200,148,10,0.12) 0%, transparent 68%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 24s ease-in-out 3s infinite;
}
/* Second smaller orb top-right */
#why::after {
  content: '';
  position: absolute;
  top: -5%;
  right: 10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(184,134,11,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-drift 30s ease-in-out 12s infinite reverse;
}

/* ============================================================
   CARD SHINE SWEEP — left-to-right on hover
   ============================================================ */

@keyframes shine-sweep {
  from { transform: translateX(-100%) skewX(-12deg); }
  to   { transform: translateX(200%) skewX(-12deg); }
}

/* Product cards */
.product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.20) 50%,
    transparent 65%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
  transition: none;
}
.product-card:hover::after {
  animation: shine-sweep 550ms ease forwards;
}

/* Service cards (non-featured) */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.16) 50%,
    transparent 65%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
  transition: none;
}
.service-card:hover::after {
  animation: shine-sweep 550ms ease forwards;
}

/* Why cards (::before taken by gold top bar, ::after free) */
.why-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255,255,255,0.14) 50%,
    transparent 65%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
  transition: none;
}
.why-card:hover::after {
  animation: shine-sweep 550ms ease forwards;
}

/* ============================================================
   STAGGERED GRID REVEAL — automatic by child position
   ============================================================ */

/* Grids: override generic reveal-delay with position-based delays */
.grid-3 .reveal:nth-child(1),
.grid-3 .reveal:nth-child(4),
.grid-3 .reveal:nth-child(7) { transition-delay: 60ms; }
.grid-3 .reveal:nth-child(2),
.grid-3 .reveal:nth-child(5),
.grid-3 .reveal:nth-child(8) { transition-delay: 150ms; }
.grid-3 .reveal:nth-child(3),
.grid-3 .reveal:nth-child(6),
.grid-3 .reveal:nth-child(9) { transition-delay: 240ms; }

.grid-4 .reveal:nth-child(odd)  { transition-delay: 60ms; }
.grid-4 .reveal:nth-child(even) { transition-delay: 140ms; }

.grid-2 .reveal:nth-child(odd)  { transition-delay: 80ms; }
.grid-2 .reveal:nth-child(even) { transition-delay: 180ms; }

/* Convictions grid stagger */
.convictions-grid .reveal:nth-child(1) { transition-delay: 80ms; }
.convictions-grid .reveal:nth-child(2) { transition-delay: 180ms; }
.convictions-grid .reveal:nth-child(3) { transition-delay: 100ms; }
.convictions-grid .reveal:nth-child(4) { transition-delay: 200ms; }

/* ============================================================
   INDUSTRY ITEMS — icon lift + glow
   ============================================================ */

.industry-item__icon {
  transition: transform 240ms ease, background 240ms ease, box-shadow 240ms ease;
}
.industry-item:hover .industry-item__icon {
  transform: scale(1.10) translateY(-2px);
  background: linear-gradient(135deg, rgba(184,134,11,0.14), rgba(26,94,200,0.08));
  box-shadow: 0 4px 20px rgba(184,134,11,0.18);
}

/* ============================================================
   PRODUCT CARDS — tier-specific glow
   ============================================================ */

/* LIVE: green inner glow */
.product-card[data-tier="primary"] {
  box-shadow:
    0 1px 4px rgba(11,29,58,0.04),
    0 2px 12px rgba(11,29,58,0.04),
    inset 0 -1px 0 rgba(16,185,129,0.10);
}
.product-card[data-tier="primary"]:hover {
  box-shadow:
    0 10px 40px rgba(11,29,58,0.13),
    0 0 0 1px rgba(16,185,129,0.22),
    inset 0 -2px 0 rgba(16,185,129,0.35);
}

/* ============================================================
   CONTACT PAGE — form + sidebar
   ============================================================ */

/* Sidebar info cards: hover lift */
.contact-info-block {
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.contact-info-block:hover {
  border-color: var(--color-border-glow);
  box-shadow: 0 6px 24px rgba(11,29,58,0.08);
  transform: translateY(-2px);
}

/* Form: focus glow ring */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(26,94,200,0.13), 0 2px 10px rgba(26,94,200,0.09);
}

/* Textarea: left accent line on focus */
.form-textarea:focus { border-left-width: 2px; border-left-color: var(--color-cta); }

/* Submit button: active press feel */
#form-submit-btn:active { transform: translateY(1px) scale(0.99); }

/* ============================================================
   CTA BANNER — animated radial glow
   ============================================================ */

@keyframes cta-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50%       { opacity: 0.9; transform: translateX(-50%) scale(1.18); }
}
.cta-banner::before {
  animation: cta-pulse 7s ease-in-out infinite;
}

/* ============================================================
   FOUNDER BLOCK — border glow pulse
   ============================================================ */

@keyframes founder-border {
  0%, 100% { border-left-color: var(--color-gold); }
  50%       { border-left-color: var(--color-gold-bright); box-shadow: -3px 0 12px rgba(184,134,11,0.18); }
}
.founder-block { animation: founder-border 5s ease-in-out infinite; }

/* ============================================================
   NAV
   ============================================================ */

/* Scrolled: stronger glow shadow */
.nav.scrolled {
  box-shadow:
    0 1px 0 rgba(226,221,212,0.7),
    0 4px 28px rgba(11,29,58,0.07);
}

/* Logo pill: authoritative in layout.css */

/* ============================================================
   SECTION LABEL — entrance animation (once)
   ============================================================ */

@keyframes label-enter {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.section-header.visible .section-label {
  animation: label-enter 350ms ease forwards;
}

/* ============================================================
   PAGE HERO INNER PAGES — accent glow
   ============================================================ */

.page-hero__heading .accent {
  animation: accent-glow 4s ease-in-out infinite;
}

/* ============================================================
   LAB ITEMS — hover lift (complementary to existing)
   ============================================================ */

.lab-item {
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.lab-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(11,29,58,0.10);
  border-color: var(--color-border-glow);
}

/* ============================================================
   METRIC NUMBERS — subtle glow on reveal
   ============================================================ */

@keyframes metric-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.metrics-bar.visible .metric-item__number {
  animation: metric-pop 400ms ease forwards;
}
.metrics-bar.visible .metric-item:nth-child(2) .metric-item__number { animation-delay: 80ms; }
.metrics-bar.visible .metric-item:nth-child(3) .metric-item__number { animation-delay: 160ms; }
.metrics-bar.visible .metric-item:nth-child(4) .metric-item__number { animation-delay: 240ms; }

/* ============================================================
   PREFERS-REDUCED-MOTION — kill all ambient animation
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  /* Kill ambient blob drift */
  #services::before,
  #services::after,
  #why::before,
  #why::after,
  #lab::before { animation: none !important; }

  /* Kill glow animations */
  .hero__headline .accent,
  .page-hero__heading .accent,
  .cta-banner::before,
  .founder-block { animation: none !important; }

  /* Kill metric pop */
  .metrics-bar.visible .metric-item__number { animation: none !important; }

  /* Kill label entrance */
  .section-header.visible .section-label { animation: none !important; }

  /* Kill shine sweep */
  .product-card::after,
  .service-card::after,
  .why-card::after { display: none !important; }

  /* Kill icon/card transforms */
  .industry-item__icon { transition: none !important; }
  .contact-info-block  { transition: none !important; }
  .lab-item            { transition: none !important; }
}

/* ============================================================
   BUILD PIPELINE — connector pulse animation
   ============================================================ */

/* Stagger the pulse dots across all 4 connectors */
.hero__pipeline .pipeline-connector:nth-child(2) .pipeline-connector__pulse { animation-delay: 0s; }
.hero__pipeline .pipeline-connector:nth-child(4) .pipeline-connector__pulse { animation-delay: 0.56s; }
.hero__pipeline .pipeline-connector:nth-child(6) .pipeline-connector__pulse { animation-delay: 1.12s; }
.hero__pipeline .pipeline-connector:nth-child(8) .pipeline-connector__pulse { animation-delay: 1.68s; }

/* Pipeline step nodes: subtle entrance */
.hero__pipeline .pipeline-step {
  opacity: 0;
  transform: translateX(16px);
  animation: pipeline-step-in 0.4s ease forwards;
}
.hero__pipeline .pipeline-step:nth-child(1)  { animation-delay: 0.3s; }
.hero__pipeline .pipeline-step:nth-child(3)  { animation-delay: 0.5s; }
.hero__pipeline .pipeline-step:nth-child(5)  { animation-delay: 0.7s; }
.hero__pipeline .pipeline-step:nth-child(7)  { animation-delay: 0.9s; }
.hero__pipeline .pipeline-step:nth-child(9)  { animation-delay: 1.1s; }

@keyframes pipeline-step-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.hero__pipeline .pipeline-footer {
  opacity: 0;
  animation: pipeline-step-in 0.4s ease forwards 1.4s;
}

/* Transform section: pair slide in from sides */
.transform-pair .transform-before {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.transform-pair .transform-after {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.transform-pair.visible .transform-before,
.transform-pair.visible .transform-after {
  opacity: 1;
  transform: translateX(0);
}
.transform-pair.visible .transform-after {
  transition-delay: 0.12s;
}

/* Why asymmetric: number reveal */
.why-statement .why-statement__number {
  transition: -webkit-text-stroke-color 400ms ease;
}

/* Promise block entrance */
.promise-block.reveal {
  transform: translateY(20px);
}
.promise-block.reveal.visible {
  transform: translateY(0);
}

/* ============================================================
   PREFERS-REDUCED-MOTION additions
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .hero__pipeline .pipeline-step,
  .hero__pipeline .pipeline-footer { animation: none !important; opacity: 1 !important; transform: none !important; }
  .transform-pair .transform-before,
  .transform-pair .transform-after  { opacity: 1 !important; transform: none !important; transition: none !important; }
  .pipeline-connector__pulse { animation: none !important; }
}

/* ============================================================
   STRATEGIC MOTION PASS — Intelligence, Systems, Depth
   ============================================================ */

/* ---- Hero grid: ultra-slow background drift (ambient depth) ---- */
@keyframes grid-drift {
  0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0; }
  33%       { background-position: 3px 2px, 3px 2px, 0 0, 0 0; }
  66%       { background-position: -2px 4px, -2px 4px, 0 0, 0 0; }
}
.hero__grid {
  animation: grid-drift 60s ease-in-out infinite;
}

/* ---- Process connector: draw-in from top on scroll reveal ---- */
.process-steps::before {
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.process-steps.visible::before {
  transform: scaleY(1);
}

/* ---- LIVE product cards: ambient production pulse ---- */
@keyframes live-pulse {
  0%, 100% {
    box-shadow:
      0 1px 4px rgba(11,29,58,0.04),
      0 2px 12px rgba(11,29,58,0.04),
      inset 0 -1px 0 rgba(16,185,129,0.10);
  }
  50% {
    box-shadow:
      0 2px 8px rgba(11,29,58,0.06),
      0 4px 20px rgba(11,29,58,0.06),
      inset 0 -1px 0 rgba(16,185,129,0.22),
      0 0 0 1px rgba(16,185,129,0.08);
  }
}
.product-card[data-tier="primary"] {
  animation: live-pulse 5s ease-in-out infinite;
}
/* Override with stronger hover state */
.product-card[data-tier="primary"]:hover {
  animation: none;
}

/* ---- PILOT cards: subtle emerging amber warmth ---- */
@keyframes pilot-emerge {
  0%, 100% { border-color: var(--color-border); }
  50%       { border-color: rgba(200,148,10,0.22); }
}
.product-card[data-tier="tertiary"] {
  animation: pilot-emerge 6s ease-in-out infinite;
}
.product-card[data-tier="tertiary"]:hover {
  animation: none;
}

/* ---- CTA link arrows: directional intent on hover ---- */
.strip-card__cta span[aria-hidden="true"],
.flagship-card__cta span[aria-hidden="true"],
.pilot-card__cta span[aria-hidden="true"],
.product-card__cta span[aria-hidden="true"] {
  display: inline-block;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.strip-card__cta:hover span[aria-hidden="true"],
.flagship-card__cta:hover span[aria-hidden="true"],
.pilot-card__cta:hover span[aria-hidden="true"],
.product-card__cta:hover span[aria-hidden="true"] {
  transform: translateX(5px);
}

/* ---- Primary button: momentum hover ---- */
.btn--primary {
  transition:
    background 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26,94,200,0.22);
}
.btn--primary:active {
  transform: translateY(0px);
  box-shadow: none;
}

/* ---- Section header: tighter reveal for headings ---- */
.section-header .reveal {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Story facts sidebar: staggered reveal ---- */
.story-facts .story-fact:nth-child(1) { transition-delay: 80ms; }
.story-facts .story-fact:nth-child(2) { transition-delay: 180ms; }
.story-facts .story-fact:nth-child(3) { transition-delay: 280ms; }
.story-facts .story-fact:nth-child(4) { transition-delay: 380ms; }

/* ---- Hero stat grid: staggered pop ---- */
.hero-stat-grid .hero-stat:nth-child(1) { transition-delay: 100ms; }
.hero-stat-grid .hero-stat:nth-child(2) { transition-delay: 200ms; }
.hero-stat-grid .hero-stat:nth-child(3) { transition-delay: 300ms; }
.hero-stat-grid .hero-stat:nth-child(4) { transition-delay: 400ms; }

/* ---- Prefers-reduced-motion: kill new animations ---- */
@media (prefers-reduced-motion: reduce) {
  .hero__grid { animation: none !important; }
  .process-steps::before { transform: scaleY(1) !important; transition: none !important; }
  .process-steps.visible::before { transform: scaleY(1) !important; }
  .product-card[data-tier="primary"],
  .product-card[data-tier="tertiary"] { animation: none !important; }
  .strip-card__cta span[aria-hidden="true"],
  .flagship-card__cta span[aria-hidden="true"],
  .pilot-card__cta span[aria-hidden="true"],
  .product-card__cta span[aria-hidden="true"] { transition: none !important; }
  .btn--primary { transition: background 200ms ease, border-color 200ms ease !important; transform: none !important; }
  .story-facts .story-fact { transition-delay: 0ms !important; }
  .hero-stat-grid .hero-stat { transition-delay: 0ms !important; }
}
