/* =============================================================================
   CASTFLOW — Custom styles
   -----------------------------------------------------------------------------
   Complement to Tailwind CDN. Organized in 6 layers:

     1. Base           — Typography, scroll behavior
     2. Animations     — @keyframes definitions
     3. Components     — Reusable visual blocks (marquee, icons, feature cards)
     4. Utilities      — Single-purpose helpers (reveal, hero-rise, card-lift)
     5. Layout         — Header / navigation behavior
     6. Accessibility  — prefers-reduced-motion fallback
   ============================================================================= */


/* -----------------------------------------------------------------------------
   1. BASE
   -------------------------------------------------------------------------- */
*,
body {
  font-family: 'Geist', sans-serif;
}

html {
  scroll-behavior: smooth;
}


/* -----------------------------------------------------------------------------
   2. ANIMATIONS — Keyframes
   -------------------------------------------------------------------------- */

/* Marquee horizontal infini (bandeau noir “Structurer l’agence…”) */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Flottement aléatoire des icônes décoratives */
@keyframes float {
  0%, 100% { transform: translateY(0)    rotate(0); }
  25%      { transform: translateY(-10px) rotate(2deg); }
  50%      { transform: translateY(5px)   rotate(-1.5deg); }
  75%      { transform: translateY(-5px)  rotate(1.5deg); }
}

/* Apparition fade + slide-up (reveal au scroll, entrée hero) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* -----------------------------------------------------------------------------
   3. COMPONENTS
   -------------------------------------------------------------------------- */

/* — Marquee track (rangée animée infinie) */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 50s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* — Blog slider : carrousel horizontal plein écran — auto-défilement + glisser-déposer (JS).
     initBlogSlider clone le groupe pour une boucle infinie sur n'importe quel viewport. */
.blog-slider {
  overflow-x: auto;
  scroll-behavior: auto;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* anciens Edge/IE */
  cursor: grab;
}
.blog-slider::-webkit-scrollbar { display: none; }
.blog-slider.is-dragging { cursor: grabbing; }
.blog-track { user-select: none; }
.blog-slider img { -webkit-user-drag: none; user-select: none; }

/* — Icônes flottantes décoratives
     Variables CSS personnalisées : --duration et --delay (override inline) */
.icon-float {
  animation: float var(--duration, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* — Feature cards : conteneur d’icônes parallaxé au mousemove (JS) */
.feature-icons {
  transition: transform 0.15s ease-out;
}

/* — Icônes fonctionnelles du Design System ─────────────────────────────────
     Système unique pour garantir taille, alignement et espacements cohérents.

     .cf-chip  : puce carrée arrondie (dégradé teal) contenant une icône
                 line-art. Utilisée dans les headers de sections et les
                 en-têtes de cards. L'icône reste noire (style sticker) :
                 lisible et nette sur le dégradé teal de la marque.
     .cf-ico   : icône inline alignée au texte (listes, statuts, étapes,
                 lignes de tableau). --invert : variante blanche sur fond sombre. */
.cf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #09aaaa, #007692);
}
.cf-chip img { object-fit: contain; }

.cf-chip--sm { width: 36px; height: 36px; border-radius: 9px; }
.cf-chip--sm img { width: 18px; height: 18px; }

.cf-chip--md { width: 44px; height: 44px; border-radius: 12px; }
.cf-chip--md img { width: 22px; height: 22px; }

.cf-ico {
  flex-shrink: 0;
  display: inline-block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}
.cf-ico--sm { width: 15px; height: 15px; }
.cf-ico--invert { filter: invert(1); }

/* — Feature cards : zone image, gradient teal au survol du parent .group */
.feature-card-image {
  background: #e8e6e3;
  transition: background 0.5s;
}
.group:hover .feature-card-image {
  background: linear-gradient(90deg, #007692 0%, #09a9aa 100%);
}


/* -----------------------------------------------------------------------------
   4. UTILITIES — Animations contrôlées par JS / au scroll
   -------------------------------------------------------------------------- */

/* — Reveal au scroll : élément masqué, révélé via .visible (IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity   0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger : délais cumulatifs pour grilles révélées simultanément */
.reveal-1 { transition-delay: 0.08s; }
.reveal-2 { transition-delay: 0.16s; }
.reveal-3 { transition-delay: 0.24s; }
.reveal-4 { transition-delay: 0.32s; }

/* — Entrée Hero au chargement (cascade au boot, sans observer) */
.hero-rise {
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-rise-1 { animation-delay: 0.05s; }
.hero-rise-2 { animation-delay: 0.18s; }
.hero-rise-3 { animation-delay: 0.31s; }
.hero-rise-4 { animation-delay: 0.44s; }
.hero-rise-5 { animation-delay: 0.57s; }
.hero-rise-6 { animation-delay: 0.70s; }

/* — Lift au survol (cards blog / FAQ) */
.card-lift {
  transition: transform  0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-lift:hover {
  transform: translateY(-6px);
}

/* — Blog : puces de filtre par catégorie (état actif piloté par JS initBlogFilter) */
.cat-chip {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cat-chip:hover {
  border-color: rgba(0, 0, 0, 0.25);
}
.cat-chip.is-active {
  background-color: #007692;
  border-color: #007692;
  color: #ffffff;
}

/* — Blog : tag (petite étiquette de catégorie sur les cards / articles) */
.tag-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(0, 118, 146, 0.10);
  color: #007692;
}

/* — Article : typographie éditoriale (corps d'article long-form) */
.article-body {
  color: rgba(0, 0, 0, 0.70);
  font-size: 17px;
  line-height: 1.75;
}
.article-body p { margin: 0 0 1.5rem; }
.article-body h2 {
  font-size: 24px;
  font-weight: 500;
  color: #0a0a0a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.75rem 0 1rem;
}
.article-body h3 {
  font-size: 19px;
  font-weight: 500;
  color: #0a0a0a;
  margin: 2rem 0 0.75rem;
}
.article-body ul {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.article-body li {
  position: relative;
  padding-left: 1.65rem;
}
.article-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #007692;
}
.article-body strong { color: #0a0a0a; font-weight: 600; }
.article-body a { color: #007692; text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid #007692;
  background: #f6f4f1;
  border-radius: 0 6px 6px 0;
  font-size: 19px;
  line-height: 1.5;
  font-style: italic;
  color: #111;
}
.article-body figure { margin: 2.5rem 0; }
.article-body figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.45);
}

/* — Workflow timeline : points activés au passage de la ligne de progression (JS)
     La ligne teal #workflow-progress voit sa hauteur pilotée au scroll. */
.wf-dot {
  transition: background-color 0.45s ease,
              transform        0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow        0.45s ease;
}
.wf-dot--active {
  background-color: #007692 !important;
  transform: scale(1.18);
  box-shadow: 0 0 0 5px rgba(0, 118, 146, 0.12);
}

/* — Workflow timeline : texte de chaque étape, révélé quand la ligne atteint
     son point (.is-shown ajouté par JS) → apparition séquentielle. */
.wf-step-body {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity   0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.wf-step-body.is-shown {
  opacity: 1;
  transform: none;
}
.wf-step-body h3 {
  transition: color 0.45s ease;
}
/* Étape courante (dernier point atteint) : mise en avant, plus grande. */
.wf-step-body.is-current {
  transform: scale(1.06);
  transform-origin: left center;
}
.wf-step-body.is-current h3 {
  color: #007692;
}

/* — Bento : barres de progression qui se remplissent au scroll (JS : initBentoStats).
     La largeur cible est passée via --w (inline). */
.bento-bar {
  width: 0;
  transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.bento-bar.is-filled {
  width: var(--w, 0);
}


/* -----------------------------------------------------------------------------
   5. LAYOUT — Header (ombre légère au scroll, ajoutée par JS)
   -------------------------------------------------------------------------- */
header {
  transition: box-shadow 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}
header.scrolled {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Page application : pas de strip flou derrière la navbar, même au scroll
   (le pill blanc garde sa propre ombre). */
header.no-frost.scrolled {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* Pill nav : plat en haut de page (aucune ombre), l'ombre portée
   n'apparaît qu'au scroll (header.scrolled, ajouté par JS). */
.nav-pill {
  transition: box-shadow 0.3s ease;
}
header.scrolled .nav-pill {
  box-shadow: 2px 10px 50px rgba(0, 0, 0, 0.18);
}


/* -----------------------------------------------------------------------------
   6. ACCESSIBILITY — prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-rise,
  .icon-float,
  .marquee-track,
  .blog-track,
  .wf-dot,
  .wf-step-body,
  .bento-bar {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  /* Barres affichées pleines d'emblée, sans animation. */
  .bento-bar {
    width: var(--w) !important;
  }
}


/* -----------------------------------------------------------------------------
   MAILTO FORMS — état de confirmation après envoi
   -------------------------------------------------------------------------- */
.cf-form-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  animation: fadeUp 0.5s ease both;
}

.cf-form-sent__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #007692;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-form-sent__title {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
}

.cf-form-sent__sub {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 3px;
}

.cf-form-sent--on-dark  { color: #fff; }
.cf-form-sent--on-dark  .cf-form-sent__sub { color: rgba(255, 255, 255, 0.7); }
.cf-form-sent--on-light { color: #0f0f0f; }
.cf-form-sent--on-light .cf-form-sent__sub { color: rgba(0, 0, 0, 0.5); }
