/* ═══════════════════════════════════════════════════════════
   2ND MOTION — extras.css
   Chargé APRÈS styles.css (canonique, non modifié).
   1. Palette « vert technologique » — remappe les tokens du template
   2. Styles des sections ajoutées (chiffres, films, livrables,
      galerie, à propos, devis)
   Règle : le vert est un SIGNAL (chiffres, état actif, trait qui se
   remplit) — jamais plus de ~10 % de l'écran. Le reste en noir et
   blanc cassé.
   ═══════════════════════════════════════════════════════════ */

html[data-theme="dark"] {
  --ground:      #070A09;   /* fond de page */
  --surface:     #0D1211;   /* cartes, panneaux */
  --surface-2:   #141B18;   /* survol, zones actives */
  --line:        #1C2622;   /* filets, séparateurs */
  --line-2:      #2C3A34;   /* bordures marquées */
  --text:        #E9F2ED;   /* texte principal */
  --muted:       #8FA69B;   /* texte secondaire */
  --signal:      #3DF08B;   /* accent unique */
  --signal-dim:  #1FA862;   /* survol de l'accent */
  --signal-wash: #0C2418;   /* fonds teintés */
  --on-signal:   #051109;   /* texte posé sur l'accent */

  /* tokens du template → palette */
  --ink-rgb: 233, 242, 237;
  --bone: var(--ground);
  --ink: var(--text);
  --ash: var(--muted);
  --white: var(--surface);
  --lime: var(--signal);
  --lime-ink: var(--on-signal);
  --ink-faint: rgba(var(--ink-rgb), 0.16);
}

/* ── le vert comme signal ─────────────────────────────────── */
::selection { background: var(--signal); color: var(--on-signal); }
.loader-rule i { background: var(--signal); }                    /* trait qui se remplit */
.box-svg path, .pill-svg path, .cta-oval path { stroke: var(--signal); }
.fill-text.greyed .box-svg path { stroke: var(--line-2); }
.dock-link::after, .footer-mail-text::after { background: var(--signal); }
.dock-cta:hover { background: var(--signal-dim); filter: none; }
.footer-bottom { border-top-color: var(--line-2); }
.x-dot { color: var(--signal); }
.x-signal { color: var(--signal); }

/* bande devise : plein écran vert = trop de vert. Elle passe en
   surface sombre, les mots en blanc cassé, le hint en signal. */
.to-lime   { background: linear-gradient(to bottom right, transparent 49.7%, var(--surface) 50.3%); }
.from-lime { background: linear-gradient(to bottom right, var(--surface) 49.7%, transparent 50.3%); }
.s-motto .pin { background: var(--surface); }
.mw { color: var(--text); }
.motto-kicker { color: var(--muted); opacity: 1; }
.motto-hint { color: var(--signal); }

/* ═══════════ SECTIONS AJOUTÉES — socle commun ═══════════ */
.x-stats, .x-sec {
  position: relative; z-index: 2;
  background: var(--ground);
}
.x-sec { padding: 16vh var(--gutter); }
.x-head { text-align: center; margin-bottom: 8vh; }
.x-title { font-size: var(--t-heading); letter-spacing: -0.02em; line-height: 1.1; margin: 14px 0 10px; font-weight: 400; }
.x-sub { color: var(--muted); max-width: 36em; margin: 0 auto; }

/* ═══════════ CHIFFRES ═══════════ */
.x-stats { padding: 12vh var(--gutter); }
.x-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1240px; margin: 0 auto;
  border-top: 1px solid var(--line);
}
.x-stat { padding: 28px 22px 0; border-right: 1px solid var(--line); }
.x-stat:last-child { border-right: 0; }
.x-num {
  font-weight: 300;
  font-size: clamp(56px, 7vw, 112px); line-height: 1; letter-spacing: -0.06em;
  color: var(--signal); font-variant-numeric: tabular-nums;
}
.x-num small { font-size: 0.42em; letter-spacing: 0; margin-left: 0.06em; color: var(--text); }
.x-lbl { color: var(--muted); margin-top: 16px; max-width: 18em; }

/* ═══════════ FILMS 9:16 ═══════════ */
.x-reel {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 28px);
  max-width: 1040px; margin: 0 auto;
}
.x-film { margin: 0; }
.x-film figcaption { margin-top: 12px; }
.x-frame {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line);
}
.x-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: translateZ(0);   /* calque GPU dédié : pas de repeint de la page à chaque image */
  object-fit: cover; opacity: 0; transition: opacity .6s var(--ease-out);
  background: transparent;
}
.x-frame.has-poster video, .x-frame.live video { opacity: 1; }
/* habillage animé tant que le fichier manque : scanlines + balayage signal */
.x-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.x-fallback::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(var(--ink-rgb), .035) 0 1px, transparent 1px 4px);
}
.x-fallback i {
  position: absolute; left: 0; right: 0; height: 30%;
  background: linear-gradient(180deg, transparent, var(--signal-wash) 50%, transparent);
  animation: x-sweep 3.6s linear infinite;
}
.x-fallback span { position: relative; color: var(--muted); }
.x-fallback span::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); margin-right: 9px; vertical-align: 1px;
  animation: x-blink 1.4s steps(2, start) infinite;
}
/* vidéo ou affiche chargée : l'habillage animé s'arrête (plus rien à peindre en continu) */
.x-frame.has-poster .x-fallback, .x-frame.live .x-fallback { display: none; }
@keyframes x-sweep { from { top: -30%; } to { top: 100%; } }
@keyframes x-blink { to { visibility: hidden; } }
.x-snd {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; padding: 0; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  color: var(--text); background: rgba(7, 10, 9, .72);
  border: 1px solid var(--line-2);   /* pas de backdrop-filter : trop coûteux sur une vidéo en lecture */
  transition: background .25s, color .25s, border-color .25s;
}
.x-frame.live .x-snd { display: flex; }
.x-snd svg { width: 16px; height: 16px; }
.x-snd .on { display: none; }
.x-snd[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); border-color: var(--signal); }
.x-snd[aria-pressed="true"] .on { display: block; }
.x-snd[aria-pressed="true"] .off { display: none; }

/* lecture / pause : un clic sur la vidéo suffit. Aucun gros bouton :
   seule une petite icône discrète s'affiche quand la vidéo est en pause. */
.x-play {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.x-play svg {
  position: absolute; left: 12px; bottom: 12px;
  width: 26px; height: 26px; padding: 6px; border-radius: 50%;
  fill: var(--text); background: rgba(7, 10, 9, .55);
  opacity: 0; transition: opacity .25s;
}
.x-play .i-pause { display: none; }
.x-frame.paused .x-play svg { opacity: .8; }
.x-play:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.x-play:focus-visible svg { opacity: .8; }

/* deux exemples : cadres plus grands, centrés */
.x-duo .x-reel { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }

/* ═══════════ VOS IDÉES LES PLUS FOLLES ═══════════ */
.x-wild-in {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 96px); align-items: center;
  max-width: 1080px; margin: 0 auto;
}
.x-wild-copy .x-title { font-size: clamp(34px, 4.8vw, 68px); line-height: 1.02; margin: 16px 0 22px; text-align: left; }
.x-wild-copy .x-sub { margin: 0; max-width: 30em; }
.x-wild-cta {
  display: inline-block; margin-top: 30px; padding: 14px 22px;
  background: var(--signal); color: var(--on-signal); border-radius: var(--radius);
  transition: background .25s;
}
.x-wild-cta:hover { background: var(--signal-dim); }

/* ═══════════ APERÇU — bande de 4 extraits ═══════════ */
.x-showreel { padding-top: 0; padding-bottom: 10vh; }
.x-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px); max-width: 1240px; margin: 0 auto;
}
.x-clip { margin: 0; }
.x-clip .x-frame { border-color: transparent; }
.x-strip-cap { text-align: center; margin-top: 18px; }

/* ═══════════ CE QUE VOUS RECEVEZ ═══════════ */
.x-deliv-in { max-width: 980px; margin: 0 auto; }
.x-deliv .x-title { margin-bottom: 5vh; }
.x-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.x-list li {
  display: flex; align-items: baseline; gap: 22px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
  font-size: clamp(21px, 2.4vw, 34px); letter-spacing: -0.015em; line-height: 1.2;
}
.x-list .mono { color: var(--signal); flex: none; width: 2.4em; }

/* ═══════════ EMPLACEMENTS PHOTOS ═══════════ */
/* tant que le fichier manque : un cadre nommé (fichier + dimensions) */
.x-ph {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  border: 1px dashed var(--line-2);
}
.x-ph::before, .x-ph::after {
  position: absolute; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
}
.x-ph::before { content: attr(data-file); top: calc(50% - 1.3em); color: var(--text); }
.x-ph::after  { content: attr(data-dim);  top: calc(50% + 0.3em); color: var(--muted); }
.x-ph img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
.x-ph:has(img) { border-color: transparent; }   /* photo présente : plus de cadre pointillé */
.x-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 20px); max-width: 1240px; margin: 0 auto;
}

/* ═══════════ DEVIS ═══════════ */
.x-form, .x-done { max-width: 820px; margin: 0 auto; }
.x-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.x-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.x-field label { font-family: var(--mono); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--text); }
.x-field input, .x-field select, .x-field textarea {
  font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 13px 14px; width: 100%;
  transition: border-color .25s, background .25s;
}
.x-field textarea { resize: vertical; min-height: 7.5em; }
.x-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.x-field input:hover, .x-field select:hover, .x-field textarea:hover { background-color: var(--surface-2); }
.x-field input:focus, .x-field select:focus, .x-field textarea:focus { outline: none; border-color: var(--signal); }
.x-field [aria-invalid="true"] { border-color: #ff6b5a; }
.x-err { color: #ff8b7d; font-size: 14px; min-height: 0; }
.x-err:empty { display: none; }
.x-consent { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.x-consent input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--signal); padding: 0; }
.x-consent label { flex: 1; text-transform: none; font-family: var(--sans); font-size: 15px; letter-spacing: 0; color: var(--muted); }
.x-consent .x-err { flex-basis: 100%; }
.x-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.x-submit {
  font: inherit; font-size: 17px; cursor: pointer;
  background: var(--signal); color: var(--on-signal);
  border: 0; border-radius: var(--radius); padding: 15px 24px; margin-top: 6px;
  transition: background .25s;
}
.x-submit:hover { background: var(--signal-dim); }
.x-submit:disabled { opacity: .6; cursor: progress; }
.x-submit:focus-visible, .x-snd:focus-visible, .x-consent input:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.x-status { margin-top: 14px; color: var(--muted); font-size: 15px; }
.x-status a { color: var(--signal); text-decoration: underline; }
.x-done { text-align: center; padding: 6vh 0; outline: none; }

/* ═══════════ SIGNATURE 2ND MOTION — sortir du look « modèle » ═══════════ */

/* typographie « impact condensé » : Anton en majuscules pour les titres et
   grands textes (style affiche de film / légendes TikTok) ; Geist pour la
   lecture ; Geist Mono pour les étiquettes. Le logo reste en minuscules. */
html[data-theme="dark"] {
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --geo: var(--display);
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hero-title, .spot-intro, .night-line, .x-title, .coll-title, .final-text,
.pstep h3, .mw, .x-num {
  font-family: var(--display); font-weight: 400;
  text-transform: uppercase; letter-spacing: -0.005em; line-height: .98;
}
.footer-name { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }
.fill-text { letter-spacing: -0.035em; }                     /* manifeste : reste en Geist, plus lisible */
.x-list li { letter-spacing: -0.02em; }
.loader-wordmark, .dock-wordmark { font-family: var(--sans); font-weight: 600; letter-spacing: -0.05em; }

/* Anton est étroite : les titres peuvent être grands */
.hero-title { font-size: clamp(40px, 6.2vw, 92px); }
.spot-intro { font-size: clamp(34px, 5vw, 76px); }
.night-line { font-size: clamp(38px, 5.4vw, 82px); }
.x-title, .coll-title { font-size: clamp(38px, 5.6vw, 84px); }
.final-text { font-size: clamp(38px, 5.4vw, 80px); line-height: 1.02; }
.pstep h3 { font-size: clamp(44px, 5.6vw, 84px); }
.x-num { font-size: clamp(64px, 8vw, 128px); letter-spacing: 0; }
.footer-name { font-size: clamp(60px, 14vw, 280px); }
.x-wild-copy .x-title { font-size: clamp(44px, 5.6vw, 88px); line-height: .95; }

/* mots clés : en gras, soulignés d'un trait vert qui se trace au scroll */
.boxed, .pill { font-weight: 600; }
.box-svg path, .pill-svg path, .cta-oval path { stroke-width: 3; stroke-linecap: round; }

/* titres : au survol, un reflet vert léger balaie les lettres, une seule fois */
.x-title, .coll-title {
  background: linear-gradient(100deg, var(--text) 44%, var(--signal) 50%, var(--text) 56%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.x-title:hover, .coll-title:hover { animation: x-tscan 1.2s var(--ease-inout) forwards; }
@keyframes x-tscan { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .x-title:hover, .coll-title:hover { animation: none; } }

/* chargement : le nom en grand (il rétrécit ensuite en volant jusqu'à la barre) */
.loader-wordmark { font-size: clamp(34px, 5.6vw, 84px); letter-spacing: -0.045em; font-weight: 500; line-height: 1; }
.loader-rule { width: clamp(120px, 12vw, 190px); }

/* séquence de démarrage (pendant le chargement) */
.x-boot {
  position: absolute; left: var(--gutter); bottom: clamp(24px, 6vh, 56px);
  margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.7;
  color: var(--muted); white-space: pre; text-align: left;
  transition: opacity .35s var(--ease-out);
}
.x-boot b { color: var(--signal); font-weight: 400; }
.loader.done .x-boot { opacity: 0; }

/* grain de pellicule : calque fixe et IMMOBILE (plus d'animation : un calque
   plein écran qui bouge en continu coûtait des images par seconde) */
.x-grain {
  position: fixed; inset: 0; z-index: 250; pointer-events: none;
  opacity: .075;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* nuage d'ouverture : la vidéo du métro (9:16, plus haute que la photo
   d'origine) recouvrait le 6e visuel juste en dessous → retiré */
.floaters .fl:nth-child(6) { display: none; }

/* nuage d'ouverture : mini-vidéos */
.fl video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius); transform: scale(1.3); transition: transform 1.7s var(--ease-out); transition-delay: calc(var(--fi, 0) * 90ms + .15s); }
body.is-ready .fl video { transform: scale(1); }
/* 1er visuel (gauche) : cadre raccourci pour ne pas toucher le titre */
.floaters .fl:nth-child(1) video { aspect-ratio: 3 / 4; }


/* ═══════════ MATRIX — pluie de code sur le zoom de la scène Méthode ═══════════
   Même cadrage que l'image du zoom (100vw × 100vh centrés) ; l'image
   (images/egg.svg) est dessous et se dévoile sous la loupe. */
.x-matrix {
  position: absolute; top: 50%; left: 50%;
  width: 100vw; height: 100vh;
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 1;
}

/* ═══════════ SURVOL DES PHOTOS — scan vert ═══════════
   Galerie + cartes des secteurs. Au survol : une ligne de scan balaie
   l'image une fois, un liseré signal apparaît, la photo se resserre.
   Sobre : un seul passage, pas de boucle. */
.x-ph:has(img)::before { content: none; }
.x-ph:has(img)::after, .card-img::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  height: 36%; pointer-events: none;
  /* version discrète : voile quasi invisible + une ligne fine, blanche teintée de vert */
  background:
    linear-gradient(180deg, transparent 0%, rgba(233, 242, 237, .02) 60%, rgba(61, 240, 139, .07) 94%, rgba(210, 255, 228, .55) 99.4%, transparent 100%);
  transform: translateY(-105%); opacity: 0;
  mix-blend-mode: screen;
}
.x-ph:has(img):hover::after, .card:hover .card-img::after { animation: x-scan 1.4s var(--ease-inout) forwards; }
@keyframes x-scan {
  0%   { transform: translateY(-105%); opacity: 1; }
  80%  { opacity: .9; }
  100% { transform: translateY(285%); opacity: 0; }
}
.x-ph img, .card-img img { transition: transform .9s var(--ease-out), filter .6s var(--ease-out); }
.x-ph:has(img):hover img, .card:hover .card-img img { transform: scale(1.03); filter: contrast(1.04); }
.x-ph:has(img), .card-img { transition: box-shadow .5s var(--ease-out); }
.x-ph:has(img):hover, .card:hover .card-img { box-shadow: 0 0 0 1px rgba(233, 242, 237, .14); }
@media (prefers-reduced-motion: reduce) {
  .x-ph:has(img):hover::after, .card:hover .card-img::after { animation: none; }
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  /* Méthode : textes d'étape plus longs → le bloc descend sous le chiffre géant */
  .psteps { top: 58%; }
  /* Anton au téléphone */
  .hero-title { font-size: clamp(34px, 10.5vw, 52px); }
  .spot-intro { font-size: clamp(28px, 8.4vw, 42px); }
  .night-line { font-size: clamp(30px, 9vw, 46px); }
  .x-title, .coll-title { font-size: clamp(32px, 9.6vw, 48px); }
  .x-wild-copy .x-title { font-size: clamp(36px, 10.4vw, 52px); }
  .final-text { font-size: clamp(30px, 8.8vw, 44px); }
  .pstep h3 { font-size: clamp(36px, 10.4vw, 52px); }
  .mw { font-size: clamp(56px, 17vw, 96px); }
  .x-num { font-size: clamp(54px, 15vw, 84px); }
  .footer-name { font-size: clamp(40px, 13vw, 80px); }
  /* nuage d'ouverture : la vidéo n° 7 (9:16) touchait le visuel n° 10 */
  .floaters .fl:nth-child(10) { left: 66%; }
  .x-sec { padding: 10vh var(--gutter); }
  .x-stats { padding: 8vh var(--gutter); }
  .x-stats-grid { grid-template-columns: 1fr 1fr; }
  .x-stat { padding: 22px 16px 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .x-stat:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--line); }
  .x-stat:nth-child(even) { padding-left: 16px; }
  .x-num { font-size: clamp(52px, 15vw, 84px); }
  .x-lbl { font-size: 11px; }
  /* films : défilement horizontal avec aimantation */
  .x-reel {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px;
    -webkit-overflow-scrolling: touch;
  }
  .x-film { flex: none; width: min(68vw, 300px); scroll-snap-align: center; }
  .x-strip {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px;
  }
  .x-clip { flex: none; width: min(42vw, 200px); scroll-snap-align: start; }
  .x-grid { grid-template-columns: 1fr 1fr; }
  .x-wild-in { grid-template-columns: 1fr; }
  .x-wild-film { width: min(78vw, 340px); margin: 0 auto; }
    .x-row { grid-template-columns: 1fr; }
  .x-list li { gap: 14px; padding: 16px 0; }
}

/* ═══════════ MODE STATIQUE / RÉDUIT ═══════════ */
body.static .x-stats { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .x-fallback i { animation: none; top: 35%; }
  .x-fallback span::before { animation: none; }
}
