/* ================================================================
   ARROW — CHAPTER.CSS
   Socle partagé de la direction « Cinéma continu » pour les pages
   intérieures refondues (produit.html, tarifs.html, qualiopi.html).
   Contient les motifs communs extraits des maquettes validées :
   - chapter hero plein écran (mot géant + numéro de fond + méta HUD)
   - kickers de section
   - index / casting cliquable
   - scene-rows alternées avec cadres de capture façon viseur
   - interludes chiffrés
   - rail scroll-spy latéral
   - carton final
   - mécanique de reveal orchestrée (gérée par assets/main.js)

   Charge après tokens.css et base.css, avant la CSS propre à la page.
   Réutilise les custom properties de tokens.css ; les deux seules
   valeurs spécifiques (numéros de fond) sont définies ici.

   Robustesse sans JS : les états initiaux d'animation (opacity 0,
   jauges à 0) ne s'appliquent que sous html.js-anim, classe posée
   par main.js. Sans JS, tout le contenu est visible d'emblée.
   ================================================================ */

:root {
  --num-fill: rgba(232, 236, 244, 0.035);
  --num-stroke: rgba(232, 236, 244, 0.07);
}

/* ================================================================
   1) CHAPTER HERO — le hero plein écran des pages intérieures
   ================================================================ */
.ch-hero {
  position: relative;
  min-height: 96vh;
  min-height: 96svh;
  display: flex; align-items: center; overflow: hidden;
  padding: clamp(110px, 15vh, 180px) clamp(24px, 6vw, 96px) clamp(90px, 12vh, 140px);
}
.ch-hero--compact {
  min-height: 78vh;
  padding: clamp(120px, 16vh, 190px) clamp(24px, 6vw, 96px) clamp(70px, 9vh, 110px);
}
.ch-hero__glow {
  position: absolute; z-index: 0;
  width: 72vw; height: 72vw; max-width: 940px; max-height: 940px;
  left: 62%; top: 46%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(61, 155, 255, 0.1) 0%, transparent 62%);
  pointer-events: none;
}
.ch-hero__num {
  position: absolute; z-index: 1; right: -0.06em; top: 2%;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(14rem, 46vw, 34rem); line-height: 0.8; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1.5px var(--num-stroke);
  user-select: none; pointer-events: none; white-space: nowrap;
}
.ch-hero__num--fill { color: var(--num-fill); -webkit-text-stroke: 0; }
.ch-hero__inner { position: relative; z-index: 3; width: 100%; max-width: 1180px; margin: 0 auto; }

.ch-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--primary);
  margin-bottom: clamp(20px, 3vh, 34px);
}
.ch-kicker::before { content: ""; width: 34px; height: 1px; background: var(--primary-line); }

.ch-word {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3rem, 10.5vw, 8.6rem); line-height: 0.92; letter-spacing: -0.03em;
  text-transform: uppercase; margin-bottom: clamp(24px, 4vh, 44px); max-width: 14ch;
}
.ch-word--solo { font-size: clamp(3.4rem, 12vw, 10rem); max-width: none; }
.ch-word--compact { font-size: clamp(2.7rem, 8.6vw, 7rem); line-height: 0.94; max-width: 16ch; margin-bottom: 26px; }
.ch-word em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary), #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ch-sub {
  max-width: 580px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.65;
  color: var(--ink-dim); margin-bottom: clamp(30px, 5vh, 48px);
}
.ch-sub strong { color: var(--ink); font-weight: 500; }
.ch-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.ch-cta-row--center { justify-content: center; }

.link-quiet {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--hairline); padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.link-quiet:hover { color: var(--ink); border-color: var(--primary-line); }

/* Bande méta HUD au pied du hero : le « générique technique » de la page */
.ch-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 10px clamp(22px, 4vw, 56px);
  padding: 16px clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
  background: linear-gradient(to top, rgba(13, 13, 21, 0.85), rgba(13, 13, 21, 0));
}
.ch-meta b { font-weight: 400; color: var(--primary); }

/* ================================================================
   2) KICKER DE SECTION (repris sur toutes les sections chapitre)
   ================================================================ */
.sec-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: clamp(22px, 3vh, 34px);
}
.sec-kicker::before { content: ""; width: 34px; height: 1px; background: var(--primary-line); }

/* ================================================================
   3) INDEX / CASTING — le sommaire cliquable
   ================================================================ */
.index-section { padding: clamp(70px, 10vh, 120px) clamp(24px, 6vw, 96px); }
.index-inner { max-width: 1000px; margin: 0 auto; }
.index-head {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1;
  letter-spacing: -0.02em; text-transform: uppercase;
  margin-bottom: clamp(30px, 5vh, 52px);
}
.index-head em { font-style: normal; color: var(--primary); }
.index-list { border-top: 1px solid var(--hairline); }
.index-row {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: baseline;
  gap: clamp(14px, 3vw, 32px); padding: clamp(14px, 2.2vh, 20px) 6px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.3s ease, padding-left 0.3s var(--ease-out);
}
.index-row:hover { background: rgba(61, 155, 255, 0.05); padding-left: 14px; }
.index-row .idx { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--primary); }
.index-row .name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.15rem, 3vw, 1.8rem); letter-spacing: -0.01em;
  text-transform: uppercase; line-height: 1.05;
}
.index-row .role {
  font-family: var(--font-mono); font-size: clamp(10.5px, 1.2vw, 12px);
  letter-spacing: 0.06em; color: var(--ink-faint); text-align: right;
}
@media (max-width: 700px) {
  .index-row { grid-template-columns: 40px 1fr; }
  .index-row .role { grid-column: 2; text-align: left; }
}

/* ================================================================
   4) SCENE-ROW MODULE — chaque module devient une demi-scène
   L'alternance gauche/droite est explicite via .mod--alt (les pages
   réelles intercalent d'autres sections : pas de :nth-of-type ici).
   ================================================================ */
.mod {
  position: relative; overflow: hidden;
  padding: clamp(80px, 13vh, 150px) clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--hairline);
}
.mod--alt { background: #0c0e17; }
.mod__num {
  position: absolute; z-index: 1; top: 50%; transform: translateY(-50%);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(11rem, 30vw, 22rem); line-height: 0.8; letter-spacing: -0.05em;
  color: var(--num-fill); user-select: none; pointer-events: none; white-space: nowrap;
  right: -0.08em;
}
.mod--alt .mod__num {
  left: -0.08em; right: auto;
  color: transparent; -webkit-text-stroke: 1.5px var(--num-stroke);
}
.mod__inner {
  position: relative; z-index: 3; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 80px); align-items: center;
}
.mod--alt .mod__inner > .mod__copy { order: 2; }
.mod--alt .mod__inner > .mod__visual { order: 1; }
.mod__label {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 20px;
}
.mod__label::before { content: ""; width: 28px; height: 1px; background: var(--primary-line); }
.mod__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 0.98;
  letter-spacing: -0.02em; text-transform: uppercase; margin-bottom: 20px;
}
.mod__desc {
  font-size: clamp(15px, 1.5vw, 17.5px); color: var(--ink-dim);
  line-height: 1.65; margin-bottom: 26px; max-width: 46ch;
}
.mod__desc strong { color: var(--ink); font-weight: 500; }
.mod__proofs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.mod__proofs li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink-dim); }
.mod__proofs .tick {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4);
  display: grid; place-items: center; font-size: 10px; color: var(--success);
}
.mod__more { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; color: var(--primary); }
.mod__more:hover { text-shadow: 0 0 12px rgba(61, 155, 255, 0.55); }

/* Le cadre de capture produit : viseur HUD + libellé de l'image attendue */
.shot {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(61, 155, 255, 0.07), rgba(13, 13, 21, 0) 55%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(232, 236, 244, 0.03) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(232, 236, 244, 0.03) 39px 40px),
    var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; padding: 28px;
  box-shadow: var(--shadow-strong);
}
.shot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(232, 236, 244, 0.045) 50%, transparent 58%);
}
.shot__corner { position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--primary-line); opacity: 0.8; }
.shot__corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.shot__corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.shot__corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.shot__corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.shot__label {
  text-align: center; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; line-height: 1.8; color: var(--ink-faint); max-width: 34ch;
  margin: 0;
}
.shot__label b {
  display: block; font-weight: 400; color: var(--warning);
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 10.5px; margin-bottom: 8px;
}
.shot__caption {
  position: absolute; left: 14px; bottom: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}
.shot__live {
  position: absolute; right: 14px; top: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--primary);
}
.shot__live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: chapter-ping 2.4s ease-out infinite; }
@keyframes chapter-ping {
  0% { box-shadow: 0 0 0 0 rgba(61, 155, 255, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(61, 155, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 155, 255, 0); }
}

@media (max-width: 880px) {
  .mod__inner { grid-template-columns: 1fr; gap: 34px; }
  .mod--alt .mod__inner > .mod__copy { order: 1; }
  .mod--alt .mod__inner > .mod__visual { order: 2; }
}

/* ================================================================
   5) INTERLUDE — respiration chiffrée entre modules
   ================================================================ */
.interlude {
  padding: clamp(90px, 14vh, 160px) clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--hairline); background: #0b0d14;
}
.interlude__inner { max-width: 1180px; margin: 0 auto; }
.num-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 5vw, 64px); }
.num-cell .figure {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 9vw, 7.5rem); line-height: 0.9; letter-spacing: -0.04em;
  margin-bottom: 16px;
}
.num-cell:nth-child(2) .figure { color: var(--primary); }
.num-cell .figure sup { font-size: 0.35em; color: var(--ink-dim); }
.num-cell .label {
  font-size: clamp(14px, 1.5vw, 16px); color: var(--ink-dim); max-width: 28ch;
  border-top: 1px solid var(--hairline); padding-top: 14px;
}
.num-cell .label strong { color: var(--ink); font-weight: 500; }
@media (max-width: 820px) { .num-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ================================================================
   6) CARTON FINAL
   ================================================================ */
.final {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(110px, 18vh, 200px) clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--hairline);
}
.final__glow {
  position: absolute; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  left: 50%; top: 55%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(236, 72, 153, 0.07) 0%, rgba(61, 155, 255, 0.05) 40%, transparent 65%);
  pointer-events: none;
}
.final__inner { position: relative; max-width: 900px; margin: 0 auto; }
.final__kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--brand-magenta); margin-bottom: 30px;
}
.final__card {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 4.2vw, 3rem); line-height: 1.14; letter-spacing: -0.015em;
  margin-bottom: 24px;
}
.final__card em {
  font-style: normal;
  background: linear-gradient(100deg, var(--primary) 20%, var(--brand-magenta) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.final__sub {
  font-size: clamp(15px, 1.5vw, 17px); color: var(--ink-dim);
  max-width: 560px; margin: 0 auto 46px;
}

/* ================================================================
   7) RAIL SCROLL-SPY LATÉRAL (activé par main.js via [data-spy])
   ================================================================ */
.rail {
  position: fixed; z-index: 150; right: clamp(14px, 2vw, 30px); top: 50%;
  transform: translateY(-50%); display: flex; flex-direction: column; gap: 13px;
}
.rail a {
  display: flex; align-items: center; gap: 9px; justify-content: flex-end;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-faint); transition: color 0.3s ease;
}
.rail a::after {
  content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--hairline);
  transition: width 0.4s var(--ease-out), background 0.3s ease, box-shadow 0.3s ease;
}
.rail a.on { color: var(--primary); }
.rail a.on::after {
  width: 30px;
  background: linear-gradient(90deg, var(--primary), #22d3ee);
  box-shadow: 0 0 10px rgba(61, 155, 255, 0.65);
}
@media (max-width: 1080px) { .rail { display: none; } }

/* ================================================================
   8) REVEAL ORCHESTRÉ
   Les états initiaux ne s'appliquent que sous html.js-anim (posée
   par main.js) : sans JS, aucun contenu n'est masqué.
   main.js ajoute .in-view aux conteneurs [data-reveal-scope].
   ================================================================ */
.js-anim .reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js-anim .reveal-x {
  opacity: 0; transform: translateX(70px);
  transition: opacity 1.3s var(--ease-out), transform 1.3s var(--ease-out);
}
.js-anim .mod--alt .reveal-x { transform: translateX(-70px); }
.js-anim .in-view .reveal,
.js-anim .in-view.reveal { opacity: 1; transform: translateY(0); }
.js-anim .in-view .reveal-x { opacity: 1; transform: translateX(0); }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.22s; }
.d3 { transition-delay: 0.34s; }
.d4 { transition-delay: 0.48s; }
.d5 { transition-delay: 0.6s; }

/* ================================================================
   9) PREFERS-REDUCED-MOTION — tout visible, aucune animation
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .js-anim .reveal, .js-anim .reveal-x {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .shot__live .dot { animation: none !important; }
  .index-row, .rail a, .rail a::after, .link-quiet { transition: none !important; }
}

/* ================================================================
   10) AJOUT ADDITIF GÉNÉRIQUE (extension solutions/usp, juillet 2026)
   Variante pleine largeur d'une scène : label + titre + contenu
   empilés, sans colonne visuelle. Réutilise mod__label / mod__title.
   ================================================================ */
.mod__stack { position: relative; z-index: 3; max-width: 1180px; margin: 0 auto; }

/* ---------- Cadres de capture REMPLIS (vraies captures produit) ----------
   .shot--filled : l'image remplace le libellé « Capture à insérer ».
   Les coins de viseur, la caption mono et le badge live restent par-dessus,
   sur pastille sombre pour rester lisibles sur interface claire. */
.shot--filled { background: #f4f6fb; }
.shot__img {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top left;
  border-radius: inherit;
}
.shot--filled .shot__corner { z-index: 2; }
.shot--filled .shot__caption,
.shot--filled .shot__live {
  z-index: 2;
  background: rgba(10, 13, 21, 0.78);
  padding: 4px 10px;
  border-radius: 6px;
}
