/* ══════════════════════════════════════════════════════════════
   FIXEO CHAPTER 2 — Ce qui se passe pendant que vous parlez
   Namespace: fc2-*
   Version: fc2-v1b

   DOM position: immediately after #home (hero-post-strip)
   Merges: previous how-it-works + brain engine + why-fixeo
   into ONE coherent narrative chapter.

   Dependencies:
   - css/fixeo-brain-engine-v1.css (fbe-* engine orbital)

   Mobile strategy:
   - .fc2-orbital (fbe-arena-wrap) : desktop only, display:none ≤679px
   - .fc2-mobile-engine            : mobile only, display:none ≥680px
   - .fc2-mob-grid : 2-column CSS Grid, position:static, normal flow
   - All mobile text in normal document flow — no absolute positioning
══════════════════════════════════════════════════════════════ */

/* ── CHAPTER WRAPPER ─────────────────────────────────────────── */
.fc2-chapter {
  padding: clamp(64px, 9vw, 120px) 0 clamp(56px, 7vw, 96px);
  background: var(--fds-surface-bg, #05070f);
  position: relative;
  /* No overflow:hidden at chapter level — fbe-know labels must not clip.
     The orbital glow is contained by fbe-arena-wrap internally. */
}

/* Deep space ambient field behind the orbital — mirrors #fle-section::before */
.fc2-orbital::before {
  content: '';
  position: absolute;
  inset: -60px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 70% at 50% 52%,
      rgba(45, 75, 210, 0.10) 0%, transparent 58%),
    radial-gradient(ellipse 40% 32% at 14% 18%,
      rgba(131, 58, 180, 0.08) 0%, transparent 52%),
    radial-gradient(ellipse 100% 65% at 50% 100%,
      rgba(20, 20, 50, 0.20) 0%, transparent 70%);
  z-index: 0;
  border-radius: 50%;
}

/* Hairline separator from hero */
.fc2-chapter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 80%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(72, 100, 255, 0.15) 50%,
    transparent 100%
  );
  pointer-events: none;
}

/* ── PART 1 — HEADER ─────────────────────────────────────────── */
.fc2-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  padding: 0 16px;
}

.fc2-eyebrow {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(72, 100, 255, 0.72);
  margin-bottom: 16px;
}

.fc2-title {
  font-size: clamp(1.75rem, 3.8vw, 2.8rem);
  font-weight: 700;
  line-height: 1.22;
  color: #f0f4ff;
  letter-spacing: -0.022em;
  margin: 0 0 18px;
}

.fc2-title em {
  font-style: normal;
  background: linear-gradient(135deg, rgba(72,100,255,1) 0%, rgba(130,160,255,1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.fc2-subtitle {
  font-size: clamp(0.92rem, 1.5vw, 1.04rem);
  color: rgba(200, 212, 255, 0.55);
  line-height: 1.65;
  margin: 0;
}

/* ── PART 2 — ENGINE BLOCK ───────────────────────────────────── */
.fc2-engine-block {
  margin: 0 auto clamp(40px, 6vw, 72px);
  /* Orbital is 620px wide — on smaller desktop this needs to be scrollable.
     No explicit width limit; fbe-arena centers itself with margin:auto. */
}

/* ── Desktop orbital (hidden on mobile) ── */
.fc2-orbital {
  display: block; /* shown ≥680px */
}

/* Override fbe-core center to show engine label (no image) */
.fc2-core {
  flex-direction: column;
  gap: 0;
  position: absolute;        /* inherits from fbe-core positioning */
}

.fc2-core-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(72, 100, 255, 0.28) 0%,
    rgba(72, 100, 255, 0.06) 55%,
    transparent 72%
  );
  animation: fc2-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.fc2-core-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(72, 100, 255, 0.85);
  position: relative;
  z-index: 2;
  user-select: none;
}

/* ── Mobile engine (shown ≤679px) ── */
.fc2-mobile-engine {
  display: none; /* shown via media query below */
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 0 0 8px;
  /* mb set in context (fc2-engine-block margin handles spacing to consequences) */
}

/* Mobile core indicator */
.fc2-mob-core {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(72, 100, 255, 0.08);
  border: 1.5px solid rgba(72, 100, 255, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 2-column grid — pure normal flow, no absolute positioning */
.fc2-mob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  width: 100%;
  max-width: 380px;
}

.fc2-mob-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: rgba(72, 100, 255, 0.05);
  border: 1px solid rgba(72, 100, 255, 0.10);
  border-radius: 12px;
  text-align: center;
  min-width: 0; /* prevent grid blowout */
}

.fc2-mob-icon {
  font-size: 1.35rem;
  line-height: 1;
  display: block;
}

.fc2-mob-label {
  font-size: 0.77rem;
  font-weight: 500;
  color: rgba(200, 212, 255, 0.75);
  line-height: 1.4;
  display: block;
  word-break: break-word;
  hyphens: auto;
}

/* ── PART 3 — CONSEQUENCES ───────────────────────────────────── */
.fc2-consequences {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.fc2-because {
  font-size: clamp(1.00rem, 1.8vw, 1.18rem);
  font-weight: 600;
  color: #f0f4ff;
  text-align: center;
  margin: 0 0 clamp(28px, 4vw, 44px);
  letter-spacing: -0.010em;
  line-height: 1.45;
}

/* Hide <br> inside fc2-because on desktop */
.fc2-br-mobile { display: none; }

.fc2-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.fc2-result {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(72, 100, 255, 0.09);
}

.fc2-result:first-child {
  border-top: 1px solid rgba(72, 100, 255, 0.09);
}

.fc2-result-mark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: rgba(32, 201, 151, 0.82);
}

.fc2-result-mark svg {
  width: 100%;
  height: 100%;
}

.fc2-result-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fc2-result-text strong {
  font-size: 0.94rem;
  font-weight: 600;
  color: #f0f4ff;
  line-height: 1.4;
  display: block;
}

.fc2-result-text span {
  font-size: 0.85rem;
  color: rgba(200, 212, 255, 0.52);
  line-height: 1.55;
  display: block;
}

/* Transition — whispered question leading into Services */
.fc2-transition {
  font-size: clamp(1.02rem, 1.8vw, 1.20rem);
  font-weight: 500;
  color: rgba(200, 212, 255, 0.50);
  text-align: center;
  margin: 0;
  font-style: italic;
  letter-spacing: -0.008em;
  line-height: 1.45;
}

/* ── KEYFRAMES ───────────────────────────────────────────────── */
@keyframes fc2-pulse {
  0%, 100% { opacity: 0.65; transform: scale(1.00); }
  50%       { opacity: 1.00; transform: scale(1.12); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */

/* Tablet: 680px–1023px — orbital scales, no mobile grid */
@media (min-width: 680px) and (max-width: 1023px) {
  .fc2-orbital {
    display: block;
  }
  .fc2-mobile-engine {
    display: none;
  }
  .fc2-title {
    font-size: clamp(1.60rem, 4.2vw, 2.2rem);
  }
}

/* Mobile: ≤679px — hide orbital, show clean grid */
@media (max-width: 679px) {

  .fc2-chapter {
    padding: 52px 0 48px;
    overflow: visible; /* allow natural height growth */
  }

  .fc2-header {
    padding: 0 20px;
    margin-bottom: 36px;
  }

  .fc2-title {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
    line-height: 1.24;
  }

  .fc2-subtitle {
    font-size: 0.90rem;
  }

  /* Desktop orbital: completely hidden */
  .fc2-orbital {
    display: none !important;
  }

  /* Mobile engine: flex column */
  .fc2-mobile-engine {
    display: flex;
    padding: 0 20px 0;
  }

  .fc2-mob-grid {
    gap: 10px 12px;
  }

  .fc2-mob-node {
    padding: 12px 8px;
    border-radius: 10px;
  }

  .fc2-mob-icon {
    font-size: 1.20rem;
  }

  .fc2-mob-label {
    font-size: 0.73rem;
  }

  /* Consequences */
  .fc2-consequences {
    padding: 0 20px;
  }

  .fc2-because {
    font-size: 0.98rem;
    margin-bottom: 24px;
  }

  .fc2-br-mobile {
    display: inline; /* show line break in fc2-because on mobile */
  }

  .fc2-result {
    gap: 12px;
    padding: 16px 0;
  }

  .fc2-result-text strong {
    font-size: 0.90rem;
  }

  .fc2-result-text span {
    font-size: 0.82rem;
  }

  .fc2-transition {
    font-size: 0.95rem;
    padding: 0 4px;
  }
}

/* Very small: ≤374px */
@media (max-width: 374px) {
  .fc2-chapter {
    padding: 44px 0 40px;
  }

  .fc2-title {
    font-size: 1.35rem;
  }

  .fc2-mob-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }

  .fc2-mob-node {
    padding: 10px 6px;
  }

  .fc2-mob-icon {
    font-size: 1.10rem;
  }

  .fc2-mob-label {
    font-size: 0.70rem;
  }
}

/* ≤319px — single column fallback */
@media (max-width: 319px) {
  .fc2-mob-grid {
    grid-template-columns: 1fr;
  }

  .fc2-mob-node {
    flex-direction: row;
    text-align: left;
    gap: 10px;
    padding: 10px 12px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fc2-core-pulse {
    animation: none;
    opacity: 0.45;
  }
}

/* ── BRAIN ENGINE: extend field animation scope to chapter 2 ── */
/* The fbe-brain CSS scopes #fle-section::after for the ambient field.
   Extend the same effect to #fixeo-chapter-2. */
#fixeo-chapter-2 .fc2-orbital::after {
  content: '';
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(72, 100, 255, 0.06) 0%,
    transparent 65%
  );
  pointer-events: none;
  animation: fbe-field-breathe 16s ease-in-out infinite;
  z-index: 0;
}
