/**
 * Section headers - compact, animated, GPU-friendly (not the main hero).
 */

html:has(body.page-landing) {
  --landing-section-head-max: min(40rem, 100%);
  --landing-section-head-title: clamp(1.35rem, 2.65vw, 1.875rem);
  --landing-section-head-lede: clamp(0.8125rem, 1.15vw, 0.875rem);
  --landing-section-head-gap: clamp(1.1rem, 2.2vw, 1.65rem);
}

/* ----- Base block ----- */
.landing-section-head {
  position: relative;
  isolation: isolate;
  text-align: center;
  max-width: var(--landing-section-head-max);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--landing-section-head-gap);
  padding-top: 0.15rem;
  contain: layout style;
}

.landing-section-head::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(26rem, 88%);
  height: 5rem;
  background: radial-gradient(ellipse 70% 75% at 50% 0%, rgba(59, 130, 246, 0.11) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

.landing-section-head.is-section-head-visible::before {
  animation: landing-head-glow 5s ease-in-out infinite;
}

.landing-section-head::after {
  content: '';
  display: block;
  width: 2.75rem;
  height: 2px;
  margin: 0.65rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.85), rgba(96, 165, 250, 0.95), transparent);
  background-size: 200% 100%;
  opacity: 0.75;
  transform: scaleX(0.35);
  transform-origin: center;
}

.landing-section-head.is-section-head-visible::after {
  animation: landing-head-rule-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards,
    landing-head-shimmer 4.5s ease-in-out 0.9s infinite;
}

.landing-section-head--left {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.landing-section-head--left::before {
  left: 0;
  transform: none;
  width: min(18rem, 100%);
}

.landing-section-head--left.is-section-head-visible::before {
  animation: landing-head-glow-left 5s ease-in-out infinite;
}

@keyframes landing-head-glow-left {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.landing-section-head--left::after {
  margin-left: 0;
  margin-right: auto;
  transform-origin: left center;
}

.landing-section-head--no-rule::after {
  display: none;
}

/* ----- Scroll reveal (JS adds .is-section-head-visible) ----- */
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-section-head__row,
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) h2,
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__title"]:not([class*="__card"]):not([class*="__group"]):not([class*="__cell"]),
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-partners-marquee__h,
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__desc"],
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__description"],
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__lede"],
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-bento__desc,
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-partners-marquee__lead,
html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-pricing__desc {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}

html.landing-section-heads-js .landing-section-head.is-section-head-visible .landing-section-head__row {
  animation: landing-head-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

html.landing-section-heads-js .landing-section-head.is-section-head-visible h2,
html.landing-section-heads-js .landing-section-head.is-section-head-visible [class*="__title"]:not([class*="__card"]):not([class*="__group"]):not([class*="__cell"]),
html.landing-section-heads-js .landing-section-head.is-section-head-visible .landing-partners-marquee__h {
  animation: landing-head-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.07s forwards;
}

html.landing-section-heads-js .landing-section-head.is-section-head-visible [class*="__desc"],
html.landing-section-heads-js .landing-section-head.is-section-head-visible [class*="__description"],
html.landing-section-heads-js .landing-section-head.is-section-head-visible [class*="__lede"],
html.landing-section-heads-js .landing-section-head.is-section-head-visible .landing-bento__desc,
html.landing-section-heads-js .landing-section-head.is-section-head-visible .landing-partners-marquee__lead,
html.landing-section-heads-js .landing-section-head.is-section-head-visible .landing-pricing__desc {
  animation: landing-head-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.14s forwards;
}

.landing-section-head.is-section-head-visible:not(.is-section-head-done) {
  will-change: transform, opacity;
}

.landing-section-head.is-section-head-done {
  will-change: auto;
}

@keyframes landing-head-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes landing-head-rule-in {
  to {
    opacity: 0.85;
    transform: scaleX(1);
  }
}

@keyframes landing-head-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes landing-head-glow {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

/* ----- Eyebrow row ----- */
.landing-section-head__row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 0.85rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 6px 22px -16px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.landing-section-head--left .landing-section-head__row {
  justify-content: flex-start;
  margin-left: 0;
  margin-right: auto;
}

[data-mantine-color-scheme="light"] .landing-section-head__row {
  border-color: rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 18px -12px rgba(15, 23, 42, 0.1);
}

.landing-section-head__row [class*="__badge"] {
  margin-bottom: 0 !important;
}

/* ----- Badges ----- */
.landing-section-head [class*="__badge"] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.58rem;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #93c5fd;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.landing-section-head [class*="__badge"]::before {
  content: '';
  flex-shrink: 0;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.landing-section-head.is-section-head-visible [class*="__badge"]::before {
  animation: landing-head-dot 2.4s ease-in-out infinite;
}

[data-mantine-color-scheme="light"] .landing-section-head [class*="__badge"] {
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-color: rgba(37, 99, 235, 0.22);
}

[data-mantine-color-scheme="light"] .landing-section-head [class*="__badge"]::before {
  background: #2563eb;
}

@keyframes landing-head-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.88); }
}

/* ----- Titles ----- */
.landing-section-head h2,
.landing-section-head [class*="__title"]:not([class*="__card"]):not([class*="__group"]):not([class*="__cell"]),
.landing-section-head .landing-partners-marquee__h {
  font-family: 'Outfit', 'DM Sans', system-ui, sans-serif;
  font-size: var(--landing-section-head-title);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.12;
  margin: 0.15rem 0 0.45rem;
  color: var(--landing-text);
  background: linear-gradient(165deg, #ffffff 0%, #e2e8f0 38%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-section-head .landing-globe__title-muted {
  -webkit-text-fill-color: rgba(148, 163, 184, 0.85);
  color: rgba(148, 163, 184, 0.85);
}

[data-mantine-color-scheme="light"] .landing-section-head h2,
[data-mantine-color-scheme="light"] .landing-section-head [class*="__title"]:not([class*="__card"]):not([class*="__group"]):not([class*="__cell"]),
[data-mantine-color-scheme="light"] .landing-section-head .landing-partners-marquee__h {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 48%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ----- Ledes ----- */
.landing-section-head [class*="__desc"],
.landing-section-head [class*="__description"],
.landing-section-head [class*="__lede"],
.landing-section-head .landing-bento__desc,
.landing-section-head .landing-partners-marquee__lead,
.landing-section-head .landing-pricing__desc {
  font-size: var(--landing-section-head-lede);
  line-height: 1.55;
  color: var(--landing-text-muted);
  max-width: 36rem;
  margin: 0 auto;
}

.landing-section-head--left [class*="__desc"],
.landing-section-head--left [class*="__description"],
.landing-section-head--left [class*="__lede"],
.landing-section-head--left .landing-bento__desc {
  margin-left: 0;
  margin-right: 0;
}

.landing-section-head [class*="__desc"] strong,
.landing-section-head [class*="__description"] strong,
.landing-section-head .landing-bento__desc strong {
  color: var(--landing-text);
  font-weight: 600;
}

.landing-section-head .landing-features__description::after {
  display: none;
}

/* ----- Live pulse in header row ----- */
.landing-section-head .landing-live-pulse {
  padding: 0.16rem 0.42rem;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  border-color: rgba(74, 222, 128, 0.22);
  background: rgba(74, 222, 128, 0.07);
}

.landing-section-head.is-section-head-visible .landing-live-pulse span {
  animation: landing-head-dot 2s ease-in-out infinite;
}

/* ----- Section-specific overrides ----- */
.landing-bento__header.landing-section-head,
.landing-features__header.landing-section-head,
.landing-showcase__header.landing-section-head,
.landing-paths__header.landing-section-head,
.landing-how__header.landing-section-head {
  margin-bottom: var(--landing-section-head-gap);
}

.landing-pricing__intro.landing-section-head {
  max-width: var(--landing-section-head-max);
}

.landing-compare__copy.landing-section-head {
  max-width: 24rem;
}

.landing-free-spotlight__copy.landing-section-head {
  max-width: none;
  margin-bottom: 0;
}

.landing-globe__copy.landing-section-head {
  max-width: 22rem;
  margin-bottom: 0;
}

.landing-globe__copy.landing-section-head::after {
  margin-top: 0.55rem;
}

.landing-partners-marquee__header.landing-section-head {
  max-width: 38rem;
}

@media (max-width: 40em) {
  html:has(body.page-landing) {
    --landing-section-head-title: clamp(1.25rem, 5.5vw, 1.625rem);
    --landing-section-head-gap: 1rem;
  }

  .landing-section-head__row {
    border-radius: 12px;
    padding: 0.28rem 0.38rem;
  }

  .landing-section-head::after {
    width: 2.25rem;
    margin-top: 0.55rem;
  }

  .landing-section-head::before {
    height: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-section-head__row,
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) h2,
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__title"],
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__desc"],
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__description"],
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) [class*="__lede"],
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-bento__desc,
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-partners-marquee__lead,
  html.landing-section-heads-js .landing-section-head:not(.is-section-head-visible) .landing-pricing__desc {
    opacity: 1;
    transform: none;
  }

  .landing-section-head.is-section-head-visible::before,
  .landing-section-head.is-section-head-visible::after,
  .landing-section-head.is-section-head-visible [class*="__badge"]::before,
  .landing-section-head.is-section-head-visible .landing-live-pulse span {
    animation: none !important;
  }

  .landing-section-head::after {
    transform: scaleX(1);
    opacity: 0.75;
  }

  .landing-section-head [class*="__badge"]::before {
    box-shadow: none;
  }

  .landing-section-head__row {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) {
    .landing-section-head__row {
      transition: border-color 0.25s ease, box-shadow 0.25s ease;
    }

    .landing-section-head__row:hover {
      border-color: rgba(96, 165, 250, 0.18);
      box-shadow: 0 8px 26px -14px rgba(59, 130, 246, 0.22);
    }
  }
}
