/* ===========================================
   FLOWBRAIN — Sections
   Image-rich, split layouts, visual-first
   =========================================== */

/* ============================================
   SECTION: POURQUOI FLOWBRAIN (image + stats)
   ============================================ */
.why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

.why__card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 36px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

/* Why card mouse-tracking glow */
.why__card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 200, 150, 0.06) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.why__card:hover::before {
  opacity: 1;
}

.why__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 200, 150, 0.08);
  border-color: var(--glass-border-hover);
}

.why__card-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 16px;
}

.why__card h3 {
  margin-bottom: 12px;
  color: var(--color-text-primary);
}

.why__card p {
  font-size: var(--small-size);
  color: var(--color-text-secondary);
}


/* ---- Services: Horizontal Scroll ---- */
.services__scroll-container {
  position: relative;
  height: 300vh;
}

.services__scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.services__scroll-track {
  display: flex;
  gap: 32px;
  padding: 0 40px;
  will-change: transform;
}

.services__hcard {
  flex-shrink: 0;
  width: clamp(320px, 30vw, 420px);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateX(60px) scale(0.96);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out),
              border-color var(--duration-fast) ease;
}

.services__hcard.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.services__hcard:hover {
  border-color: var(--glass-border-hover);
}

.services__hcard-img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.services__hcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.services__hcard:hover .services__hcard-img img {
  transform: scale(1.06);
}

.services__hcard-img::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(5,5,16,0.9), transparent);
}

.services__hcard-body {
  padding: 28px;
}

.services__hcard-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-accent);
  opacity: 0.25;
  line-height: 1;
}

.services__hcard-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-light);
  margin-top: 8px;
  margin-bottom: 12px;
}

.services__hcard-body h3 {
  color: var(--color-white);
  margin-bottom: 10px;
}

.services__hcard-body p {
  font-size: var(--small-size);
  color: var(--color-gray);
  line-height: 1.6;
}

.services__hcard-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: var(--small-size);
  font-weight: 600;
  color: var(--color-accent-light);
  transition: gap var(--duration-fast) ease;
}

.services__hcard-link:hover {
  gap: 14px;
}

.services__hcard-link svg {
  width: 16px;
  height: 16px;
}


/* ---- Timeline (scroll-driven) ---- */
.timeline {
  position: relative;
  padding-left: 48px;
  margin-top: 64px;
}

.timeline__track {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.timeline__fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-accent) 0%, var(--color-indigo) 50%, var(--color-purple) 100%);
  border-radius: 2px;
  transform-origin: top center;
  transform: scaleY(0);
  will-change: transform;
}

.timeline__dot {
  position: absolute;
  left: -48px;
  top: 32px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg-3);
  border: 3px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  transform: translateX(-6.5px);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.timeline__step.is-active .timeline__dot {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 200, 150, 0.5), 0 0 30px rgba(0, 200, 150, 0.2);
}

.timeline__step {
  position: relative;
  padding-bottom: 100px;
  opacity: 0.3;
  transition: opacity 0.6s var(--ease-out);
}

.timeline__step:last-child {
  padding-bottom: 0;
}

.timeline__step.is-active {
  opacity: 1;
}

.timeline__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.timeline__content--reverse {
  direction: rtl;
}

.timeline__content--reverse > * {
  direction: ltr;
}

.timeline__num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.25;
}

.timeline__title {
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.timeline__desc {
  font-size: var(--small-size);
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

.timeline__image {
  border-radius: var(--card-radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.timeline__step.is-active .timeline__image {
  opacity: 1;
  transform: translateY(0);
}

.timeline__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ============================================
   SECTION: STATS (numbers on dark bg)
   ============================================ */
.stats {
  position: relative;
}

.stats__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.stats__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

.stats__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 16, 0.75);
}

.stats__content {
  position: relative;
  z-index: 2;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: center;
}

.stats__item {}

.stats__value {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stats__label {
  margin-top: 16px;
  font-size: var(--small-size);
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

.stats__source {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: rgba(255,255,255,0.3);
}

/* Stats floating blobs */
.stats__blobs {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.stats__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
}

.stats__blob--1 {
  width: 300px;
  height: 300px;
  background: var(--color-accent);
  top: 20%;
  left: 10%;
  animation: statsFloat1 10s ease-in-out infinite;
}

.stats__blob--2 {
  width: 250px;
  height: 250px;
  background: var(--color-indigo);
  bottom: 15%;
  right: 15%;
  animation: statsFloat2 12s ease-in-out infinite;
}

@keyframes statsFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(1.1); }
}

@keyframes statsFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15px, 10px) scale(1.08); }
}


/* ============================================
   SECTION: CTA IMAGE (split image + text)
   ============================================ */
.cta-split__img {
  border-radius: var(--card-radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.cta-split__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta-split__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.cta-split__content p {
  font-size: 1.0625rem;
  line-height: 1.65;
}


/* ============================================
   SECTION: FAQ
   ============================================ */
.faq__list {
  max-width: 800px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid var(--glass-border);
}

.faq__item:first-child {
  border-top: 1px solid var(--glass-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 28px 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--duration-fast) ease;
  letter-spacing: -0.01em;
}

.faq__question:hover {
  color: var(--color-accent);
}

.faq__icon {
  width: 24px;
  height: 24px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--color-accent);
  flex-shrink: 0;
}

.faq__item.is-open .faq__icon {
  transform: rotate(45deg);
}

.faq__item.is-open .faq__question {
  color: var(--color-accent);
}

.faq__answer {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              padding-bottom 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  padding-bottom: 0;
}

.faq__answer > div {
  overflow: hidden;
}

.faq__item.is-open .faq__answer {
  grid-template-rows: 1fr;
  padding-bottom: 24px;
}

.faq__answer p {
  font-size: var(--small-size);
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.section--dark .faq__item {
  border-color: var(--glass-border);
}

.section--dark .faq__question {
  color: var(--color-text-primary);
}

.section--dark .faq__answer p {
  color: var(--color-text-secondary);
}


/* ============================================
   SECTION: FINAL CTA (full-width image bg)
   ============================================ */
.final-cta {
  position: relative;
  text-align: center;
  padding: var(--section-py) 0;
  overflow: hidden;
}

.final-cta__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.final-cta__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.final-cta__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 16, 0.7);
}

.final-cta__content {
  position: relative;
  z-index: var(--z-content);
  max-width: 640px;
  margin: 0 auto;
}

.final-cta__content h2 {
  color: var(--color-white);
}

.final-cta__content p {
  color: rgba(255,255,255,0.6);
  font-size: 1.0625rem;
  margin-top: 20px;
  line-height: 1.65;
}

.final-cta__actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}