/*
 * Pages Produit : composants partagés (récit sur défilement, registre des statuts compact,
 * liste barrée, règles numérotées, FAQ éditoriale, fin de page pilote).
 * Les noms de classes f-* reprennent ceux des maquettes. Le fil de provenance est
 * réservé aux pages Produit (cahier de refonte) : cette feuille n'est chargée que par elles.
 * Les animations au défilement utilisent animation-timeline : Chrome et Edge les jouent,
 * Safari et Firefox affichent l'état final.
 */

/* ---------- Ambiances ---------- */

.f-dark {
  color: var(--ps-text-on-dark);
  background:
    radial-gradient(ellipse 50% 65% at var(--ps-glow-x, 90%) 0%, rgba(244, 81, 30, 0.26), transparent 68%),
    var(--ps-ember);
}

/* Fond papier sans quadrillage ; la tache orange alterne gauche / droite (voir provseal.css). */
.f-paper {
  color: var(--ps-ink);
  background:
    radial-gradient(ellipse 45% 60% at var(--ps-glow-x, 90%) 0%, rgba(244, 81, 30, 0.12), transparent 70%),
    var(--ps-paper);
}

/* Les tampons et scènes animés ne doivent jamais élargir la page ; clip garde la scène collante. */
.f-dark,
.f-paper {
  overflow-x: clip;
}

.ps-page main .f-paper a:not(.ps-btn):not(.ps-row):not(.ps-card) {
  color: var(--ps-orange-dark);
}

.f-relative {
  position: relative;
  overflow: hidden;
}

/* Même conteneur que le header : le contenu commence à l'aplomb du logo. */
.f-wrap {
  box-sizing: border-box;
  max-width: var(--ps-container);
  margin: 0 auto;
  padding-right: var(--ps-gutter);
  padding-left: var(--ps-gutter);
}

/* Bloc de section standard : 128 px en haut et en bas, colonne. */
.f-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 128px;
  padding-bottom: 128px;
}

.f-section--lg {
  gap: 56px;
}

/* ---------- Typographie ---------- */

.f-big {
  font-family: var(--ps-font-sans);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.f-out {
  color: transparent;
  -webkit-text-stroke: 2px var(--ps-orange-light);
}

.f-display {
  max-width: 10em;
  font-size: clamp(48px, 6.6vw, 108px);
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.f-dark .f-display {
  color: #fff;
}

.f-display--paper {
  max-width: 9em;
  font-size: clamp(52px, 7.4vw, 120px);
  line-height: 0.86;
}

.f-lead {
  max-width: 34em;
  color: var(--ps-muted-light);
  font-size: 20px;
}

.f-dark .f-lead {
  color: var(--ps-muted-dark);
}

.f-note {
  max-width: 46em;
  color: var(--ps-muted-light);
  font-size: 15px;
}

.f-dark .f-note {
  color: var(--ps-faint-dark);
  font-size: 17px;
}

.f-kicker {
  color: var(--ps-orange-dark);
  font-family: var(--ps-font-mono);
  font-size: 14px;
}

.f-dark .f-kicker {
  color: var(--ps-orange-light);
}

.f-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.f-head > p {
  flex: 0 1 24em;
  color: var(--ps-muted-light);
  font-size: 18px;
}

/* ---------- Hero Produit ---------- */

.f-hero {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 56px;
}

.f-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ps-faint-dark);
  font-size: 14px;
}

.ps-page main .f-crumbs a {
  color: #c7ab9d;
  text-decoration: none;
}

.ps-page main .f-crumbs a:hover {
  color: #fff;
}

.f-crumbs [aria-current="page"] {
  color: #fff;
}

.f-h1 {
  max-width: 10em;
  color: #fff;
  font-size: clamp(60px, 9.6vw, 156px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.06em;
}

.f-hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 40px;
}

.f-hero-lead {
  flex: 0 1 30em;
  color: var(--ps-muted-dark);
  font-size: 21px;
  line-height: 1.5;
}

.f-cue-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ps-orange-light);
  font-family: var(--ps-font-mono);
  font-size: 13px;
}

@keyframes f-cue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.f-cue {
  display: inline-block;
  animation: f-cue 1.6s ease-in-out infinite;
}

/* Fil qui descend du hero vers le récit. */
.f-thread {
  position: relative;
  height: 120px;
}

.f-hthread {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(90px + (100% - 120px) * 0.53488);
  width: 2px;
  background: linear-gradient(rgba(255, 138, 61, 0), var(--ps-orange-light));
}

/* ---------- Récit sur défilement ---------- */

.f-scrolly {
  position: relative;
  timeline-scope: --s1, --s2, --s3, --s4, --s5;
}

.f-s1 { view-timeline-name: --s1; }
.f-s2 { view-timeline-name: --s2; }
.f-s3 { view-timeline-name: --s3; }
.f-s4 { view-timeline-name: --s4; }
.f-s5 { view-timeline-name: --s5; }

.f-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
}

.f-stick {
  position: sticky;
  top: var(--ps-header-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  height: calc(100vh - var(--ps-header-height));
  min-height: 640px;
}

.f-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Boîte 3D standard de la scène collante. */
.f-scene {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 450px;
  perspective: 1500px;
}

.f-steps {
  position: relative;
  padding-left: 56px;
}

.f-step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-height: 88vh;
  padding: 60px 0;
}

.f-final {
  min-height: 100vh;
}

.f-num {
  color: transparent;
  font-family: var(--ps-font-sans);
  font-size: clamp(120px, 13vw, 210px);
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1.5px rgba(255, 138, 61, 0.75);
}

.f-step h2 {
  color: #fff;
  font-size: clamp(40px, 4.4vw, 64px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.f-step.f-final h2 {
  font-size: clamp(48px, 5.6vw, 84px);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.f-step p {
  max-width: 26em;
  color: var(--ps-muted-dark);
  font-size: 19px;
  line-height: 1.6;
}

.f-step-tag {
  padding-left: 12px;
  border-left: 2px solid var(--ps-orange-light);
  color: var(--ps-orange-light);
  font-family: var(--ps-font-mono);
  font-size: 13px;
}

.f-closed {
  color: #34d399;
  font-family: var(--ps-font-mono);
  font-size: 13px;
}

.f-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  background: rgba(255, 138, 76, 0.16);
}

.f-seg {
  position: absolute;
  left: 10px;
  width: 2px;
  height: 20%;
  background: linear-gradient(var(--ps-orange-light), var(--ps-orange));
  box-shadow: 0 0 14px rgba(255, 138, 61, 0.6);
  transform-origin: top;
}

.f-g1 { top: 0; }
.f-g2 { top: 20%; }
.f-g3 { top: 40%; }
.f-g4 { top: 60%; }
.f-g5 { top: 80%; }

.f-node {
  position: absolute;
  top: 50%;
  left: -55px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 138, 76, 0.4);
  border-radius: 50%;
  background: var(--ps-ember);
}

.f-final .f-node {
  left: -58px;
  width: 22px;
  height: 22px;
}

/* Journal façon terminal sous la scène. */
.f-tick {
  box-sizing: border-box;
  width: 100%;
  max-width: 440px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 138, 76, 0.2);
  border-radius: 14px;
  background: rgba(28, 17, 11, 0.8);
  color: #6f5a4f;
  font-family: var(--ps-font-mono);
  font-size: 13px;
  line-height: 1.75;
}

.f-tick span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

.f-tick .f-tick-title {
  margin-bottom: 8px;
  color: var(--ps-orange-light);
  font-size: 11px;
}

/* Étiquette d'une scène 3D (contre-rotation définie par la page). */
.f-label {
  position: absolute;
  transform-origin: 0 0;
}

.f-label-inner {
  display: flex;
  align-items: center;
  transform: translate(10px, -50%);
}

.f-label-line {
  width: 30px;
  height: 1.5px;
  background: var(--ps-orange-light);
}

.f-label-dot {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ps-orange-light);
}

.f-label-card {
  display: flex;
  flex-direction: column;
  padding: 7px 11px;
  border: 1px solid rgba(255, 138, 76, 0.45);
  border-radius: 9px;
  background: rgba(18, 10, 6, 0.94);
  line-height: 1.25;
  white-space: nowrap;
}

.f-label-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.f-label-code {
  color: var(--ps-peach);
  font-family: var(--ps-font-mono);
  font-size: 11px;
}

.f-cell {
  display: inline-grid;
}

.f-cell > * {
  grid-area: 1 / 1;
}

/* ---------- Registre à tampons (Disponible / En pilote / Prévu) ---------- */

.f-led {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 26px 0;
  border-top: 1.5px solid var(--ps-ink);
}

.f-led:last-child {
  border-bottom: 1.5px solid var(--ps-ink);
}

.f-led-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.f-led-title {
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.03em;
}

.f-led-text {
  max-width: 38em;
  color: var(--ps-muted-light);
  font-size: 16px;
}

.f-stamp {
  display: inline-block;
  padding: 7px 12px;
  border: 2.5px solid currentColor;
  border-radius: 6px;
  font-family: var(--ps-font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.f-stamp--available { color: #047857; }
.f-stamp--pilot { color: var(--ps-orange-dark); }
.f-stamp--planned { color: #57534e; }

/* ---------- Règles numérotées ---------- */

.f-rules {
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-rules li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 138, 76, 0.2);
}

.f-rules-number {
  font-size: 64px;
  -webkit-text-stroke-width: 1.5px;
}

.f-rules-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f-rules-title {
  color: #fff;
  font-size: clamp(28px, 3.4vw, 52px);
  letter-spacing: -0.04em;
}

.f-rules-text {
  color: #c7ab9d;
  font-size: 18px;
}

/* ---------- Liste barrée (« ce que ce n'est pas ») ---------- */

.f-strikes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-strikes li {
  padding: 18px 0;
  border-top: 1px solid #e3cfc4;
}

.f-strikes .f-strike {
  color: var(--ps-ink);
  font-size: clamp(34px, 4.4vw, 68px);
  letter-spacing: -0.045em;
}

.f-dark .f-strikes li {
  border-top-color: rgba(255, 138, 76, 0.2);
}

.f-dark .f-strikes .f-strike {
  color: #fff;
}

.f-strike {
  position: relative;
  display: inline-block;
}

.f-strike::after {
  content: "";
  position: absolute;
  top: 54%;
  right: -1%;
  left: -1%;
  height: 0.09em;
  min-height: 4px;
  border-radius: 3px;
  background: var(--ps-orange);
  transform-origin: left;
}

/* ---------- FAQ éditoriale ---------- */

.f-faqg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 48px 80px;
  padding-top: 120px;
  padding-bottom: 120px;
}

.f-faqg > h2 {
  align-self: start;
  font-size: clamp(44px, 5vw, 76px);
  line-height: 0.9;
}

.f-dark .f-faqg > h2 {
  color: #fff;
}

.f-q {
  padding: 26px 0;
  border-top: 1.5px solid var(--ps-ink);
}

.f-q:last-child {
  border-bottom: 1.5px solid var(--ps-ink);
}

.f-q summary {
  display: flex;
  align-items: baseline;
  gap: 24px;
  min-height: 44px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.025em;
  list-style: none;
  cursor: pointer;
}

.f-q summary::-webkit-details-marker {
  display: none;
}

.f-q-text {
  flex: 1 1 auto;
}

.f-qn {
  color: var(--ps-orange-dark);
  font-family: var(--ps-font-mono);
  font-size: 14px;
  font-weight: 500;
}

.f-qx {
  color: var(--ps-orange-dark);
  font-size: 30px;
  font-weight: 400;
  transition: transform 0.3s var(--ps-ease);
}

.f-q[open] .f-qx {
  transform: rotate(45deg);
}

.f-q p {
  max-width: 40em;
  margin: 16px 0 0 62px;
  color: var(--ps-muted-light);
  font-size: 18px;
  line-height: 1.6;
}

.f-dark .f-q {
  border-color: rgba(255, 138, 76, 0.3);
}

.f-dark .f-q p {
  color: var(--ps-muted-dark);
}

.f-dark .f-qn,
.f-dark .f-qx {
  color: var(--ps-orange-light);
}

/* ---------- Fin de page : appel au pilote ---------- */

.f-cta {
  position: relative;
  overflow: hidden;
}

.f-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 160px;
  background: linear-gradient(rgba(255, 138, 61, 0), var(--ps-orange-light));
}

.f-cta::after {
  content: "";
  position: absolute;
  top: 160px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--ps-orange-light);
  box-shadow: 0 0 0 8px rgba(255, 138, 61, 0.2), 0 0 40px 10px rgba(255, 138, 61, 0.5);
}

.f-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding-top: 240px;
  padding-bottom: 140px;
  text-align: center;
}

.f-cta-title {
  color: #fff;
  font-size: clamp(56px, 9vw, 150px);
  line-height: 0.86;
  letter-spacing: -0.06em;
}

.f-cta-lead {
  max-width: 32em;
  color: var(--ps-muted-dark);
  font-size: 20px;
}

.f-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.f-cta-actions .ps-btn--primary {
  min-height: 62px;
  padding: 20px 34px;
  font-size: 19px;
}

.f-cta-more {
  color: var(--ps-faint-dark);
  font-size: 16px;
}

/* ---------- Animations ---------- */

@keyframes f-op { from { opacity: 0; } to { opacity: 1; } }
@keyframes f-pop { from { opacity: 0; transform: scale(1.9) rotate(-18deg); } to { opacity: 1; transform: none; } }
@keyframes f-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes f-gx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes f-seg { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes f-numin { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes f-stampin { from { opacity: 0; transform: scale(2.2) rotate(-20deg); } to { opacity: 1; transform: rotate(-7deg); } }

@keyframes f-node {
  from {
    border-color: rgba(255, 138, 76, 0.4);
    background: var(--ps-ember);
    box-shadow: none;
  }

  to {
    border-color: var(--ps-orange-light);
    background: var(--ps-orange-light);
    box-shadow: 0 0 0 6px rgba(255, 138, 61, 0.2), 0 0 24px 4px rgba(255, 138, 61, 0.5);
  }
}

@keyframes f-hl {
  from {
    background: transparent;
    color: #4a3a32;
  }

  to {
    background: rgba(244, 81, 30, 0.12);
    color: #ffd9c6;
  }
}

@supports (animation-timeline: view()) {
  .f-step .f-node {
    animation: f-node linear both;
    animation-timeline: view();
    animation-range: entry 60% entry 100%;
  }

  .f-step .f-num {
    animation: f-numin linear both;
    animation-timeline: view();
    animation-range: entry 10% entry 80%;
  }

  .f-strike::after {
    animation: f-gx linear both;
    animation-timeline: view();
    animation-range: entry 60% cover 45%;
  }

  .f-stamp {
    animation: f-stampin linear both;
    animation-timeline: view();
    animation-range: entry 70% cover 40%;
  }

  /* Le fil se remplit et le journal s'allume au rythme des étapes. */
  .f-g1, .f-g2, .f-g3, .f-g4, .f-g5 {
    animation: f-seg linear both;
    animation-range: entry 0% exit 0%;
  }

  .f-g1 { animation-timeline: --s1; }
  .f-g2 { animation-timeline: --s2; }
  .f-g3 { animation-timeline: --s3; }
  .f-g4 { animation-timeline: --s4; }
  .f-g5 { animation-timeline: --s5; }

  .f-t1, .f-t2, .f-t3, .f-t4, .f-t5 {
    animation: f-hl linear both;
    animation-range: entry 40% entry 90%;
  }

  .f-t1 { animation-timeline: --s1; }
  .f-t2 { animation-timeline: --s2; }
  .f-t3 { animation-timeline: --s3; }
  .f-t4 { animation-timeline: --s4; }
  .f-t5 { animation-timeline: --s5; }
}

/* ---------- Mobile et mouvement réduit ---------- */

@media (max-width: 900px), (hover: none) {
  .f-cue {
    animation: none;
  }
}

@media (max-width: 900px) {
  .f-wrap,
  .f-grid {
    padding-right: 20px;
    padding-left: 20px;
  }

  .f-h1 {
    font-size: clamp(42px, 12.5vw, 64px);
  }

  .f-grid {
    display: block;
  }

  /* La scène reste visible en haut pendant que les étapes défilent. */
  .f-stick {
    position: sticky;
    top: 64px;
    z-index: 3;
    gap: 0;
    height: auto;
    min-height: 0;
    padding: 8px 0 24px;
    background: linear-gradient(var(--ps-ember) 82%, rgba(18, 10, 6, 0));
  }

  .f-stage {
    zoom: 0.56;
  }

  .f-tick {
    display: none;
  }

  .f-step {
    min-height: 72vh;
    padding: 28px 0;
  }

  .f-steps {
    padding-left: 36px;
  }

  .f-node {
    left: -33px;
  }

  .f-final .f-node {
    left: -36px;
  }

  .f-num {
    font-size: 84px;
  }

  .f-hthread {
    left: 31px;
  }

  .f-led,
  .f-faqg {
    grid-template-columns: 1fr;
  }

  .f-q p {
    margin-left: 0;
  }

  .f-section {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .f-cta-inner {
    padding-top: 220px;
    padding-bottom: 104px;
  }
}

@media (max-width: 420px) {
  .f-stage {
    zoom: 0.48;
  }
}

@media (prefers-reduced-motion: reduce) {
  .f-cue {
    animation: none;
  }

  .f-qx {
    transition: none;
  }

  /* Sans timeline, les animations au défilement sautent directement à leur état final. */
  .ps-page .f-scrolly *,
  .ps-page .f-strike::after,
  .ps-page .f-stamp {
    animation-timeline: auto;
  }
}

/* ---------- Registre des statuts (Disponible / En pilote / Prévu) : version compacte ----------
   Généralisée à toutes les pages Produit : lignes serrées sur deux colonnes (.f-ledgrid),
   statuts en pastilles aux couleurs ProvSeal, plus de tampon incliné. */

#caps .f-section {
  gap: 40px;
  padding-top: 96px;
  padding-bottom: 96px;
}

.f-ledgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-bottom: 1px solid #e3cfc4;
}

.f-ledgrid .f-led {
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #e3cfc4;
}

.f-ledgrid .f-led:last-child {
  border-bottom: 0;
}

.f-ledgrid .f-led-copy {
  gap: 4px;
}

.ps-page main .f-ledgrid .f-led-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ps-page main .f-ledgrid .f-led-text {
  color: var(--ps-muted-light);
  font-size: 15px;
  line-height: 1.45;
}

/* Statuts : une pastille avec point, de l'orange plein (disponible) au pointillé (prévu). */
.ps-page main .f-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1.5px solid transparent;
  border-radius: var(--ps-radius-pill);
  font-family: var(--ps-font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: none;
  transform: none;
  animation: none;
}

.ps-page main .f-stamp::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ps-page main .f-stamp--available {
  background: var(--ps-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 81, 30, 0.25);
}

.ps-page main .f-stamp--pilot {
  border-color: rgba(244, 81, 30, 0.35);
  background: rgba(244, 81, 30, 0.1);
  color: var(--ps-orange-dark);
}

.ps-page main .f-stamp--pilot::before {
  box-shadow: 0 0 0 3px rgba(244, 81, 30, 0.2);
}

.ps-page main .f-stamp--planned {
  border: 1.5px dashed #d6b8a8;
  background: transparent;
  color: #8a6a5a;
}

.ps-page main .f-stamp--planned::before {
  border: 1.5px solid currentColor;
  background: transparent;
}

@media (max-width: 900px) {
  .f-ledgrid {
    grid-template-columns: 1fr;
  }

  /* Le statut reste à droite du titre, même sur mobile. */
  .f-ledgrid .f-led {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}
