/* Murphy 10K — voyage scrub "la loi de Murphy, retournée" + monde sous le hero.
   Pattern éprouvé du repo (neoo-forge-scrub / neoo-home-scrub), préfixe mx-. */

.murphy-page {
  --mx-canvas: #050613;
  --mx-panel: rgba(13, 24, 46, .66);
  --mx-line: rgba(96, 132, 214, .22);
  --mx-accent: #4f7dff;
  --mx-accent-hover: #6f94ff;
  --mx-accent-muted: rgba(79, 125, 255, .32);
  --mx-danger: #ff6b5e;
  --mx-ok: #34d399;
  --mx-text: #eef4ff;
  --mx-text-2: #9fb2d9;
  --mx-ease: cubic-bezier(.23, 1, .32, 1);
  --mx-tshadow: 0 1px 2px rgba(4, 6, 14, .95), 0 3px 12px rgba(4, 6, 14, .78), 0 10px 44px rgba(4, 6, 14, .8);
}

html.murphy-document, .murphy-page {
  overflow-x: hidden;
  overflow-x: clip;
}

/* ---------- Le hero épinglé (1000vh : 3 segments, 5 bandes) ---------- */
.mx-hero {
  position: relative;
  height: 1000vh;
}

.mx-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--mx-canvas);
}

.mx-stage__media {
  position: absolute;
  inset: 0;
  margin: 0;
  background: var(--mx-canvas);
}

.mx-stage__media video,
.mx-stage__media .mx-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  will-change: transform;
  transform: translateZ(0);
}

.mx-stage__media .mx-poster {
  background-position: center;
  background-size: cover;
}

.mx-stage__media video {
  opacity: 0;
  transition: opacity 420ms var(--mx-ease);
}

.mx-stage.mx-video-ready .mx-stage__media video { opacity: 1; }
.mx-stage.mx-video-failed .mx-stage__media video { display: none; }

/* Scrim de base global : aucune frame brute derrière le texte. */
.mx-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 45%, rgba(4, 6, 14, 0) 35%, rgba(4, 6, 14, .62) 100%);
}

.mx-stage__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding-top: var(--cb-topbar-h, 76px);
  display: grid;
  align-items: center;
  width: min(calc(100% - 96px), 1560px);
  margin-inline: auto;
}

.mx-band {
  grid-area: 1 / 1;
  position: relative;
  max-width: 600px;
  opacity: 0;
  pointer-events: none;
}

.mx-band.mx-is-on { pointer-events: auto; }

/* Scrim par bande : s'assombrit avec --k, meurt à 76% pour garder les coins vivants. */
.mx-band::before {
  content: "";
  position: absolute;
  inset: -14% -18%;
  z-index: -1;
  pointer-events: none;
  opacity: calc(.25 + .75 * var(--k, 1));
  background: radial-gradient(ellipse 74% 62% at 50% 50%, rgba(4, 5, 12, var(--mx-scrim, .62)) 0%, rgba(4, 5, 12, calc(var(--mx-scrim, .62) * .66)) 46%, rgba(4, 5, 12, 0) 76%);
}

.mx-band--right { justify-self: end; text-align: left; }
.mx-band--center { justify-self: center; text-align: center; }
.mx-band--center .mx-sub { margin-inline: auto; }

.mx-kicker {
  margin: 0 0 16px;
  color: var(--mx-accent-hover);
  font-size: 12.5px;
  font-weight: 600;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: var(--mx-tshadow);
}

.mx-band--law .mx-kicker { color: #ffb3ab; }

.mx-band h2 {
  margin: 0;
  color: var(--mx-text);
  font-weight: 300;
  font-size: clamp(42px, 4.4vw, 72px);
  letter-spacing: -.052em;
  line-height: 1.06;
  text-shadow: var(--mx-tshadow);
}

.mx-sub {
  margin: 20px 0 0;
  max-width: 36ch;
  color: var(--mx-text-2);
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.55;
  text-shadow: var(--mx-tshadow);
}

.mx-band .mx-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  opacity: var(--kb, 0);
  transform: translateY(calc((1 - var(--kb, 0)) * 14px));
}

.mx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  opacity: var(--kb, 0);
}

.mx-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--mx-line);
  border-radius: 999px;
  background: rgba(8, 12, 24, .55);
  backdrop-filter: blur(10px);
  color: var(--mx-text-2);
  font-size: 12.5px;
  text-shadow: 0 1px 3px rgba(4, 6, 14, .85);
}

.mx-chips li i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mx-ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, .9);
}

.mx-btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: none;
  transition: transform 160ms var(--mx-ease), box-shadow 180ms var(--mx-ease), border-color 180ms var(--mx-ease), background-color 180ms var(--mx-ease);
}

.mx-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mx-btn--primary {
  color: #fff;
  background: linear-gradient(120deg, #4b55f2, var(--mx-accent));
  box-shadow: 0 14px 32px rgba(75, 85, 242, .28);
}

.mx-btn--ghost {
  color: var(--mx-text);
  border-color: rgba(132, 146, 190, .34);
  background: rgba(10, 14, 28, .6);
}

@media (hover: hover) and (pointer: fine) {
  .mx-btn:hover { transform: translateY(-2px); }
  .mx-btn--primary:hover { box-shadow: 0 18px 38px rgba(75, 85, 242, .4); }
  .mx-btn--ghost:hover { border-color: var(--mx-accent); }
}

@media (pointer: coarse) {
  .mx-btn { min-height: 44px; }
}

/* Split-text : l'assemblage roule sur le --k de chaque bande. */
.mx-w { display: inline-block; white-space: pre; }
.mx-c { display: inline-block; }

/* (f) drift-down — bande 1 : les mots tombent, comme tout le reste */
.e-drift .mx-w {
  --kc: clamp(0, calc((var(--k, 0) - var(--th, 0)) * 2.8), 1);
  opacity: var(--kc);
  transform: translateY(calc((1 - var(--kc)) * -26px));
}

/* (d) word-punch — bande 2 : les impacts */
.e-punch .mx-w {
  --kc: clamp(0, calc((var(--k, 0) - var(--th, 0)) * 3), 1);
  --ks: clamp(0, calc((var(--k, 0) - var(--th, 0) - .12) * 3), 1);
  opacity: var(--kc);
  transform: scale(calc(.6 + .52 * var(--kc) - .12 * var(--ks)));
}

/* (c) blur-to-sharp — bande 3 : la mise au point dans le noir */
.e-blur .mx-blur-stack { position: relative; display: block; }
.e-blur .mx-blur-soft {
  position: absolute;
  inset: 0;
  filter: blur(10px);
  opacity: calc(1 - var(--k, 0));
}
.e-blur .mx-blur-sharp { opacity: var(--k, 0); }

/* (a) scatter-assemble — bande 4 : l'ordre se recompose */
.e-scatter .mx-c {
  --kc: clamp(0, calc((var(--k, 0) - var(--th, 0)) * 2.6), 1);
  opacity: var(--kc);
  transform: translate(calc((1 - var(--kc)) * var(--jx, 0px)), calc((1 - var(--kc)) * var(--jy, 0px))) rotate(calc((1 - var(--kc)) * var(--jr, 0deg)));
}

/* (e) rise étagé — le settle */
.e-rise .mx-w {
  --kc: clamp(0, calc((var(--k, 0) - var(--th, 0)) * 3), 1);
  opacity: var(--kc);
  transform: translateY(calc((1 - var(--kc)) * 22px));
}

.e-rise .mx-sub {
  opacity: var(--ks2, 0);
  transform: translateY(calc((1 - var(--ks2, 0)) * 12px));
}

/* Particules whisper du hero (6, dérive lente) */
.mx-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mx-particles i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mx-accent-muted);
  opacity: .5;
}
.mx-particles i:nth-child(1) { top: 22%; left: 12%; }
.mx-particles i:nth-child(2) { top: 64%; left: 8%; }
.mx-particles i:nth-child(3) { top: 30%; left: 84%; }
.mx-particles i:nth-child(4) { top: 74%; left: 78%; }
.mx-particles i:nth-child(5) { top: 12%; left: 55%; }
.mx-particles i:nth-child(6) { top: 84%; left: 42%; }

@media (prefers-reduced-motion: no-preference) {
  .mx-stage.mx-anim .mx-particles i { animation: mx-drift 9s ease-in-out infinite alternate; }
  .mx-particles i:nth-child(2n) { animation-delay: -3.2s; animation-duration: 11s; }
  .mx-particles i:nth-child(3n) { animation-delay: -5.6s; animation-duration: 13s; }

  @keyframes mx-drift {
    from { transform: translate3d(0, 0, 0); opacity: .28; }
    to { transform: translate3d(14px, -20px, 0); opacity: .6; }
  }
}

/* Le repère de scroll */
.mx-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--mx-text-2);
  font-size: 11px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: var(--cue, 1);
  transition: opacity 300ms var(--mx-ease);
  pointer-events: none;
}

.mx-cue i {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, var(--mx-accent), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .mx-cue i { animation: mx-cue-drop 2.4s var(--mx-ease) -1.2s infinite; transform-origin: top; }

  @keyframes mx-cue-drop {
    0% { transform: scaleY(0); }
    45%, 100% { transform: scaleY(1); }
  }
}

@media (max-height: 560px) {
  .mx-cue, .mx-chips { display: none; }
}

/* ---------- Le hero statique (téléphones, portrait, reduced motion) ---------- */
.mx-static-hero {
  display: none;
  position: relative;
  min-height: 92svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--mx-canvas);
}

.mx-static-hero .mx-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: 72% center;
  background-size: cover;
}

.mx-static-hero .mx-static-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 6, 14, .92) 0%, rgba(4, 6, 14, .78) 34%, rgba(4, 6, 14, .38) 62%, rgba(4, 6, 14, .12) 100%),
    linear-gradient(0deg, rgba(4, 6, 14, .82) 0%, rgba(4, 6, 14, 0) 40%);
}

.mx-static-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  width: min(calc(100% - 48px), 1560px);
  min-height: 92svh;
  margin-inline: auto;
  padding: calc(var(--cb-topbar-h, 76px) + 24px) 0 56px;
}

.mx-static-copy .mx-kicker { color: #ffb3ab; }

.mx-static-copy h2 {
  margin: 0;
  max-width: 640px;
  color: var(--mx-text);
  font-weight: 300;
  font-size: clamp(40px, 8.2vw, 68px);
  letter-spacing: -.052em;
  line-height: 1.06;
}

.mx-static-copy .mx-lede {
  margin: 18px 0 0;
  max-width: 44ch;
  color: var(--mx-text-2);
  font-size: clamp(16px, 2.1vw, 21px);
  line-height: 1.55;
}

.mx-static-copy .mx-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.mx-static-copy .mx-chips { opacity: 1; }

/* Les cinq gates — chaînes identiques dans murphy-scrub.js. */
@media (max-width: 720px),
       (orientation: portrait) and (max-width: 1024px),
       (orientation: portrait) and (pointer: coarse),
       (orientation: landscape) and (pointer: coarse) and (max-height: 560px),
       (prefers-reduced-motion: reduce) {
  .mx-hero { display: none; }
  .mx-static-hero { display: block; }
}

/* ---------- L'environnement fixe derrière la page ---------- */
.mx-env {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 52% at 62% 30%, rgba(53, 84, 220, .13), transparent 65%),
    radial-gradient(ellipse 40% 30% at 12% 8%, rgba(70, 60, 200, .07), transparent 65%),
    var(--mx-canvas);
}

.mx-env i {
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse 30% 26% at 30% 70%, rgba(79, 125, 255, .05), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  .mx-env i { animation: mx-env-drift 80s linear infinite alternate; }

  @keyframes mx-env-drift {
    from { transform: translate3d(-2%, 1%, 0); }
    to { transform: translate3d(2%, -2%, 0); }
  }
}

/* ---------- Le pont (après le settle) ---------- */
.mx-bridge {
  position: relative;
  border-top: 1px solid rgba(96, 132, 214, .14);
  background: linear-gradient(180deg, rgba(6, 8, 20, .8), rgba(5, 6, 19, 0) 70%);
}

.mx-bridge .n1-shell {
  display: grid;
  gap: 26px;
  padding-top: clamp(64px, 8vw, 110px);
  padding-bottom: clamp(48px, 6vw, 84px);
}

.mx-bridge h2 {
  margin: 0;
  max-width: 24ch;
  color: var(--mx-text);
  font-weight: 300;
  font-size: clamp(30px, 3.4vw, 48px);
  letter-spacing: -.052em;
  line-height: 1.1;
}

.mx-bridge h2 em { font-style: normal; color: var(--mx-accent-hover); }

.mx-bridge__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--mx-text-2);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.mx-bridge__row li { display: inline-flex; align-items: baseline; gap: 10px; }
.mx-bridge__row li b { color: var(--mx-accent-hover); font-weight: 600; }

/* ---------- La ligne de vie Murphy (signature, se dessine au scroll) ---------- */
.mx-lifeline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(12px, calc((100% - 1560px) / 2 - 34px));
  z-index: 0;
  width: 2px;
  pointer-events: none;
}

.mx-lifeline i {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--mx-accent) 8%, var(--mx-accent) 92%, transparent);
  opacity: .34;
  transform-origin: top;
  transform: scaleY(var(--mx-line-k, 0));
}

.mx-lifeline b {
  position: absolute;
  left: 50%;
  top: calc(var(--mx-line-k, 0) * 100%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mx-accent);
  box-shadow: 0 0 14px rgba(79, 125, 255, .9);
  transform: translate(-50%, -50%);
  opacity: calc(.2 + .8 * var(--mx-line-k, 0));
}

@media (max-width: 1100px) { .mx-lifeline { display: none; } }

/* ---------- Le moment interactif : "Laissez Murphy prendre le relais" ---------- */
.mx-takeover {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--mx-line);
  border-radius: 18px;
  background: var(--mx-panel);
  backdrop-filter: blur(12px);
}

.mx-takeover__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mx-takeover__head h3 {
  margin: 0;
  color: var(--mx-text);
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 600;
  letter-spacing: -.02em;
}

.mx-takeover__status {
  color: var(--mx-text-2);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.mx-feed {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.mx-feed li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 107, 94, .26);
  border-radius: 10px;
  background: rgba(50, 16, 20, .38);
  color: #ffc9c4;
  font-size: 14px;
  transition: border-color 420ms var(--mx-ease), background-color 420ms var(--mx-ease), color 420ms var(--mx-ease);
}

.mx-feed li i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mx-danger);
  box-shadow: 0 0 10px rgba(255, 107, 94, .8);
  transition: background-color 420ms var(--mx-ease), box-shadow 420ms var(--mx-ease);
}

.mx-feed li small {
  margin-left: auto;
  color: rgba(255, 201, 196, .6);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: .08em;
  transition: color 420ms var(--mx-ease);
}

.mx-feed li.is-clear {
  border-color: rgba(52, 211, 153, .3);
  background: rgba(10, 38, 30, .4);
  color: #b8efd9;
}

.mx-feed li.is-clear i { background: var(--mx-ok); box-shadow: 0 0 10px rgba(52, 211, 153, .8); }
.mx-feed li.is-clear small { color: rgba(184, 239, 217, .65); }

.mx-hold {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px 22px 13px 16px;
  border: 1px solid rgba(132, 146, 190, .34);
  border-radius: 12px;
  background: rgba(10, 14, 28, .7);
  color: var(--mx-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 180ms var(--mx-ease), transform 160ms var(--mx-ease);
}

.mx-hold:hover { border-color: var(--mx-accent); }
.mx-hold:active { transform: scale(.99); }

.mx-hold svg { width: 30px; height: 30px; transform: rotate(-90deg); }
.mx-hold svg circle { fill: none; stroke-width: 3; }
.mx-hold svg .mx-hold-track { stroke: rgba(132, 146, 190, .3); }
.mx-hold svg .mx-hold-fill {
  stroke: var(--mx-accent);
  stroke-linecap: round;
  stroke-dasharray: 76;
  stroke-dashoffset: calc(76 * (1 - var(--hold, 0)));
}

.mx-takeover.is-done .mx-hold { border-color: rgba(52, 211, 153, .5); }
.mx-takeover.is-done .mx-hold svg .mx-hold-fill { stroke: var(--mx-ok); }
.mx-takeover__note { margin: 12px 0 0; color: var(--mx-text-2); font-size: 13px; }

/* Les 4 étapes s'allument quand le relais est pris */
.mx-takeover.is-done ~ .murphy-steps .n1-step,
.murphy-how.mx-lit .murphy-steps .n1-step {
  border-color: rgba(79, 125, 255, .4);
  box-shadow: 0 0 0 1px rgba(79, 125, 255, .12), 0 18px 40px rgba(9, 14, 34, .5);
}

/* ---------- Ajustements du monde sous le hero ---------- */
.murphy-cinema { position: relative; }

.murphy-page .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(3, 4, 15, .88), rgba(3, 4, 15, .55) 70%, rgba(3, 4, 15, 0));
  backdrop-filter: blur(10px);
}

/* Le breadcrumb passe sous le header fixe */
.murphy-page .page-breadcrumb--product {
  position: relative;
  z-index: 3;
  padding-top: calc(var(--cb-topbar-h, 76px) + 10px);
}

@media (prefers-reduced-motion: reduce) {
  .mx-env i, .mx-cue i, .mx-particles i { animation: none !important; }
  .mx-band .mx-cta-row, .mx-chips { opacity: 1; transform: none; }
  .mx-lifeline i { transform: scaleY(1); }
  .mx-lifeline b { display: none; }
  .mx-feed li { transition: none; }
}

/* Lisibilité : sous-titres du hero plus clairs que le corps standard */
.mx-band .mx-sub, .mx-static-copy .mx-lede { color: #bcc9e6; }


/* ---------- Le chargement du film : visible, honnête, jamais muet ---------- */
.mx-loader {
  position: absolute;
  bottom: 24px;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--mx-line);
  border-radius: 999px;
  background: rgba(8, 12, 24, .72);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(2, 4, 12, .45);
  color: var(--mx-text-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  transform: translateX(-50%);
  transition: opacity 420ms var(--mx-ease), transform 420ms var(--mx-ease), right 420ms var(--mx-ease), bottom 420ms var(--mx-ease);
  pointer-events: none;
}

.mx-loader svg { width: 22px; height: 22px; transform: rotate(-90deg); flex: none; }
.mx-loader svg circle { fill: none; stroke-width: 4; }
.mx-loader .mx-loader__track { stroke: rgba(132, 146, 190, .28); }
.mx-loader .mx-loader__fill { stroke: var(--mx-accent); stroke-linecap: round; }
.mx-loader b { color: var(--mx-text); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }

.mx-loader--docked {
  left: auto;
  right: 20px;
  bottom: 20px;
  transform: translateX(0) scale(.94);
}

.mx-stage.mx-video-ready .mx-loader { opacity: 0; visibility: hidden; transition: opacity 420ms var(--mx-ease), visibility 0s 420ms; }
.mx-stage.mx-video-failed .mx-loader { display: none; }

.mx-stage:not(.mx-video-ready):not(.mx-video-failed) .mx-cue { opacity: 0; }
