/* Sampoorna — enhanced background & animation system */

/* ============================================================
   ANIMATED BACKGROUND ORBS
   ============================================================ */
.landing-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.landing-bg .orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px); opacity: 0.12;
}
.landing-bg .orb-1 {
  width: 600px; height: 600px;
  background: var(--brand);
  top: -10%; left: -5%;
  animation: orbDrift1 28s ease-in-out infinite;
}
.landing-bg .orb-2 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: 40%; right: -8%;
  animation: orbDrift2 32s ease-in-out infinite;
}
.landing-bg .orb-3 {
  width: 450px; height: 450px;
  background: var(--brand-pale);
  bottom: -5%; left: 30%;
  animation: orbDrift3 24s ease-in-out infinite;
}
@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.08); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -80px) scale(1.1); }
  66% { transform: translate(50px, 40px) scale(0.92); }
}
@keyframes orbDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, -50px) scale(1.06); }
}

/* ============================================================
   GRID PATTERN OVERLAY
   ============================================================ */
.grid-pattern {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 0%, transparent 70%);
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
.reveal-up {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-up.in-view { opacity: 1; transform: none; }

.reveal-left {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-left.in-view { opacity: 1; transform: none; }

.reveal-right {
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-right.in-view { opacity: 1; transform: none; }

.reveal-scale {
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-scale.in-view { opacity: 1; transform: none; }

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.28s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.36s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.44s; }
.stagger-children > *:nth-child(7) { transition-delay: 0.52s; }
.stagger-children > *:nth-child(8) { transition-delay: 0.6s; }

/* ============================================================
   BRIEF CARD CAROUSEL
   ============================================================ */
.brief-carousel {
  display: flex; gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 20px 4px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-pale) transparent;
  -webkit-overflow-scrolling: touch;
}
.brief-carousel::-webkit-scrollbar { height: 6px; }
.brief-carousel::-webkit-scrollbar-thumb { background: var(--brand-pale); border-radius: 3px; }
.brief-carousel::-webkit-scrollbar-track { background: transparent; }

.brief-slide {
  flex: 0 0 340px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 28px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.3s;
  position: relative; overflow: hidden;
}
.brief-slide::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brief-slide:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -16px color-mix(in srgb, var(--ink) 14%, transparent);
  border-color: var(--brand-pale);
}
.brief-slide:hover::before { transform: scaleX(1); }

/* ============================================================
   FLOATING PARTICLES
   ============================================================ */
.particle {
  position: absolute; width: 4px; height: 4px;
  border-radius: 50%; background: var(--brand-pale);
  opacity: 0.3; pointer-events: none;
}
.particle:nth-child(1) { top: 15%; left: 8%;  animation: particleFloat 12s ease-in-out infinite; }
.particle:nth-child(2) { top: 45%; left: 92%; animation: particleFloat 16s ease-in-out infinite 2s; }
.particle:nth-child(3) { top: 70%; left: 15%; animation: particleFloat 14s ease-in-out infinite 4s; }
.particle:nth-child(4) { top: 25%; left: 85%; animation: particleFloat 18s ease-in-out infinite 1s; width: 6px; height: 6px; }
.particle:nth-child(5) { top: 60%; left: 50%; animation: particleFloat 20s ease-in-out infinite 3s; width: 3px; height: 3px; }

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.3; }
  25% { transform: translate(20px, -30px); opacity: 0.5; }
  50% { transform: translate(-15px, -20px); opacity: 0.2; }
  75% { transform: translate(10px, 10px); opacity: 0.45; }
}

/* ============================================================
   SECTION TRANSITIONS
   ============================================================ */
.section-dark {
  background: var(--ink) !important;
  color: var(--bg);
  position: relative;
}
.section-dark::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--brand) 8%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, color-mix(in srgb, var(--accent) 6%, transparent) 0%, transparent 50%);
  pointer-events: none;
}

/* ============================================================
   HERO ANIMATIONS
   ============================================================ */
@keyframes heroTextReveal {
  from { opacity: 0; transform: translateY(30px); clip-path: inset(100% 0 0 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
@keyframes heroBriefFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(0.5deg); }
}
@keyframes heroFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.hero-text-anim { animation: heroTextReveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-text-anim-d1 { animation-delay: 0.15s; }
.hero-text-anim-d2 { animation-delay: 0.3s; }
.hero-text-anim-d3 { animation-delay: 0.45s; }
.hero-text-anim-d4 { animation-delay: 0.6s; }
.hero-brief-float { animation: heroBriefFloat 7s ease-in-out infinite, heroFadeIn 1.2s 0.5s both; }

/* ============================================================
   NUMBER TICKER
   ============================================================ */
@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.number-highlight {
  display: inline-block;
  animation: numberPulse 3s ease-in-out infinite;
}

/* ============================================================
   PRICING CARD GLOW
   ============================================================ */
.pricing-glow {
  position: relative;
}
.pricing-glow::after {
  content: ''; position: absolute; inset: -2px;
  background: linear-gradient(135deg, var(--brand), var(--accent), var(--brand));
  border-radius: inherit; z-index: -1;
  opacity: 0; transition: opacity 0.5s;
  filter: blur(12px);
}
.pricing-glow:hover::after { opacity: 0.3; }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee-v2 {
  overflow: hidden; white-space: nowrap;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marquee-v2 .track {
  display: inline-flex; gap: 48px;
  animation: marqueeScroll 40s linear infinite;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-v2 .item {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; font-weight: 500;
  color: var(--ink-3);
}
.marquee-v2 .item .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-pale);
}

/* ============================================================
   INTELLIGENCE EXPLORER
   ============================================================ */
.ie-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -32px color-mix(in srgb, var(--ink) 28%, transparent),
              0 2px 8px -2px color-mix(in srgb, var(--ink) 10%, transparent);
}

.ie-topbar {
  background: var(--ink);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.ie-topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 90% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 55%);
  pointer-events: none;
}

.ie-body {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 540px;
}

/* Section index */
.ie-index {
  border-right: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ie-index-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
  position: relative;
}
.ie-index-item:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.ie-index-item.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ie-index-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.ie-index-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-3);
  flex-shrink: 0;
}
.ie-index-item.active .ie-index-num { color: var(--brand); }
.ie-index-title {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.25;
}
.ie-index-item.active .ie-index-title { color: var(--ink); font-weight: 500; }

/* Content panel */
.ie-content {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  animation: ieFadeIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes ieFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.ie-content-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ie-content-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--brand);
}
.ie-content-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
}
.ie-content-body { flex: 1; }

/* Reusable bits */
.ie-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.ie-tile {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.ie-callout {
  background: color-mix(in srgb, var(--brand) 5%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 10px;
  padding: 16px 18px;
}
.ie-chip {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--ink-2);
  letter-spacing: .02em;
}
.ie-chip-brand {
  background: color-mix(in srgb, var(--brand) 10%, var(--bg));
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  color: var(--brand);
  font-weight: 600;
}
.ie-chip-gold {
  background: color-mix(in srgb, var(--gold, #c9a227) 14%, var(--bg));
  border-color: color-mix(in srgb, var(--gold, #c9a227) 35%, var(--line));
  color: var(--gold, #a8851f);
  font-weight: 700;
  letter-spacing: .08em;
}
.ie-gap {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}
.ie-gap-high {
  background: color-mix(in srgb, var(--c-emerald) 14%, var(--bg));
  color: var(--c-emerald);
}
.ie-gap-medium {
  background: color-mix(in srgb, var(--c-amber) 16%, var(--bg));
  color: color-mix(in srgb, var(--c-amber) 80%, black);
}

/* Mobile: stack index as horizontal scroll */
@media (max-width: 860px) {
  .ie-body { grid-template-columns: 1fr; }
  .ie-index {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    gap: 6px;
    scrollbar-width: thin;
  }
  .ie-index-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 130px;
    padding: 8px 12px;
  }
  .ie-index-item.active::before { top: auto; bottom: 0; left: 8px; right: 8px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .ie-content { padding: 24px 20px; }
  .ie-content-title { font-size: 21px; }
}

/* ============================================================
   REVEAL KEYFRAMES (JS-gated — applied when in view)
   ============================================================ */
@keyframes revealUpAnim {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes revealRightAnim {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes revealLeftAnim {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: none; }
}
@keyframes revealScaleAnim {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}
.anim-reveal-up    { animation: revealUpAnim    .9s cubic-bezier(.2,.8,.2,1) both; }
.anim-reveal-right { animation: revealRightAnim .9s cubic-bezier(.2,.8,.2,1) both; }
.anim-reveal-left  { animation: revealLeftAnim  .9s cubic-bezier(.2,.8,.2,1) both; }
.anim-reveal-scale { animation: revealScaleAnim .8s cubic-bezier(.2,.8,.2,1) both; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  z-index: 100; width: 0%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 40%, transparent);
}

/* Hover lift for cards */
.hover-lift {
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s cubic-bezier(.2,.8,.2,1), border-color .3s;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px -18px color-mix(in srgb, var(--ink) 16%, transparent);
  border-color: var(--brand-pale) !important;
}

/* Brand-tinted hover for index/buttons already covered. Heading accent draw */
@keyframes underlineDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.accent-underline { position: relative; display: inline-block; }
.accent-underline::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px;
  background: var(--brand-pale); border-radius: 2px;
  transform-origin: left; animation: underlineDraw 1s .4s cubic-bezier(.2,.8,.2,1) both;
}

/* Gentle float for hero brief card */
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.gentle-float { animation: gentleFloat 7s ease-in-out infinite; }

/* Button shine sweep on hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -80%;
  width: 50%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transition: left .6s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .landing-bg .orb,
  .particle,
  .hero-brief-float,
  .number-highlight,
  .marquee-v2 .track,
  .gentle-float,
  .anim-reveal-up, .anim-reveal-right, .anim-reveal-left, .anim-reveal-scale,
  .accent-underline::after {
    animation: none !important;
  }
  .reveal-up, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1 !important; transform: none !important;
  }
}

/* ============================================================
   MOBILE RESPONSIVE — override inline styles
   ============================================================ */
@media (max-width: 900px) {
  /* Hero grid → single col */
  .hero-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  
  /* All 2-col section grids */
  .landing-grid-2col { grid-template-columns: 1fr !important; gap: 36px !important; }
  
  /* Problem stats grid */
  .problem-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  
  /* Approach 3-col cards */
  .approach-cards { grid-template-columns: 1fr !important; gap: 20px !important; }
  
  /* Footer grid */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  
  /* Hero stats row */
  .hero-stats { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }
  
  /* Section padding */
  .section-inner { padding: 0 24px !important; }
  .section-label { left: 24px !important; }
  
  /* Nav */
  .landing-nav-links { display: none !important; }
  .landing-header { padding: 0 24px !important; }
  
  /* Brief carousel cards */
  .brief-slide { flex: 0 0 280px !important; }
  
  /* Pricing table */
  .pricing-table { font-size: 11px !important; }
  .pricing-table th, .pricing-table td { padding: 8px 10px !important; }
}

@media (max-width: 480px) {
  .section-inner { padding: 0 16px !important; }
  .section-label { left: 16px !important; }
  .landing-header { padding: 0 16px !important; }
  .hero-stats { grid-template-columns: 1fr !important; }
  .brief-slide { flex: 0 0 260px !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .quote-block { padding: 24px 20px !important; }
}
