/* ══════════════════════════════════════════════════════════════════
   LA BOÎTE À IDÉES DE FLUX — /idees
   La grammaire du film Flux : noir, crème, gris chaud, Space Grotesk,
   un seul mot par écran en italique d'Instrument Serif dans le spectre,
   les coins en capitales espacées, la lueur bleue au pied du cadre.
   Pensée pour un téléphone ouvert depuis un statut WhatsApp.
   ══════════════════════════════════════════════════════════════════ */
:root {
  --noir: #040405;
  --panneau: #0c0d11;
  --creme: #f0ede8;
  --gris: #9b968f;
  --filet: rgba(240, 237, 232, .1);
  --spectre: linear-gradient(100deg, #7af25c 0%, #23d9f2 28%, #4470ff 50%, #8d49ff 72%, #ff52c8 100%);
  --rouge: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* « hidden » doit toujours cacher : sans cette ligne, le formulaire (display: grid) restait à l'écran
   après l'envoi, figé sur « Envoi… 0 % », et le merci s'affichait dessous sans qu'on le voie. */
[hidden] { display: none !important; }
html { background: var(--noir); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--noir); color: var(--creme);
  font: 400 16px/1.5 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }

/* les lueurs du film : violette en haut, bleue au pied */
.lueurs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.lueur { position: absolute; border-radius: 50%; filter: blur(110px); }
.lueur.haut { width: 120vw; height: 60vh; left: -10vw; top: -38vh; background: #8d49ff; opacity: .2; }
.lueur.bas { width: 140vw; height: 70vh; left: -20vw; bottom: -48vh; background: #384aff; opacity: .48; animation: respire 9s ease-in-out infinite alternate; }
@keyframes respire { to { transform: translateY(-4vh) scale(1.06); opacity: .58; } }

.coins, .page, .pied { position: relative; z-index: 1; }
.coins {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 5vw, 48px) 0;
}
.logo img { display: block; width: 92px; height: auto; }
.coin, .surtitre, .pied {
  font-weight: 500; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gris);
}

.page { width: min(640px, 100%); margin: 0 auto; padding: 0 clamp(18px, 5vw, 32px) 40px; }
.tete { padding: clamp(40px, 12vw, 96px) 0 28px; }
.surtitre { margin: 0 0 14px; }
h1, h2 {
  margin: 0; font-weight: 700; font-size: clamp(56px, 17vw, 112px); line-height: .92; letter-spacing: -.045em;
}
h1 em, h2 em {
  font: italic 400 1.08em/1 'Instrument Serif', Georgia, serif; letter-spacing: -.01em;
  background: var(--spectre); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.chapo { margin: 22px 0 0; max-width: 34em; font-size: clamp(16px, 4.4vw, 19px); line-height: 1.5; color: rgba(240, 237, 232, .82); }

/* la boîte */
.boite {
  margin-top: 8px; padding: clamp(18px, 5vw, 28px); border-radius: 26px;
  background: rgba(12, 13, 17, .82); border: 1px solid var(--filet);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: grid; gap: 18px;
}
.champ { display: grid; gap: 8px; min-width: 0; }
.champ label, .etiquette { font-weight: 600; font-size: 14px; }
.champ small, .etiquette small { font-weight: 400; color: var(--gris); margin-left: 6px; }
input, textarea {
  width: 100%; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--filet);
  background: rgba(240, 237, 232, .04); color: var(--creme); font: inherit; font-size: 16px; outline: none;
  transition: border-color .2s, background-color .2s;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: rgba(155, 150, 143, .8); }
input:focus, textarea:focus { border-color: rgba(240, 237, 232, .45); background: rgba(240, 237, 232, .07); }
input[aria-invalid="true"] { border-color: var(--rouge); }
.liens { display: grid; gap: 8px; }
.ajout {
  justify-self: start; padding: 8px 2px; border: 0; background: none; color: var(--creme);
  font: 600 14px 'Space Grotesk', sans-serif; cursor: pointer; opacity: .85;
}
.ajout:hover { opacity: 1; }
.ajout[hidden] { display: none; }
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .rangee { grid-template-columns: 1fr; } }

/* le dépôt de fichiers */
.depot {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px;
  border: 1.5px dashed rgba(240, 237, 232, .22); cursor: pointer; transition: border-color .2s, background-color .2s;
  font-weight: 400; font-size: 14px; line-height: 1.4;
}
.depot:hover, .depot.survol { border-color: rgba(240, 237, 232, .55); background: rgba(240, 237, 232, .04); }
.depot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.depot small { color: var(--gris); }
.depot-plus {
  flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; font-weight: 500; color: var(--noir); background: var(--creme);
}
.fichiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fichiers:empty { display: none; }
.fichier {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px;
  background: rgba(240, 237, 232, .05); overflow: hidden;
}
.vignette {
  flex: 0 0 48px; height: 48px; border-radius: 10px; background: #1a1b21 center / cover no-repeat;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--gris);
}
.fichier-nom { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.fichier-nom b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichier-nom small { color: var(--gris); }
.retirer {
  flex: 0 0 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(240, 237, 232, .08);
  color: var(--creme); font-size: 16px; cursor: pointer;
}
.fichier .avance { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--spectre); transition: width .2s; }
.fichier.fait .avance { width: 100%; }

/* les cases */
.case { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; cursor: pointer; }
.case input {
  flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; padding: 0; border-radius: 7px; appearance: none; -webkit-appearance: none;
  border: 1.5px solid rgba(240, 237, 232, .4); background: transparent; display: grid; place-items: center; cursor: pointer;
}
.case input:checked { background: var(--creme); border-color: var(--creme); }
.case input:checked::after { content: ''; width: 10px; height: 6px; border: solid var(--noir); border-width: 0 0 2.2px 2.2px; transform: translateY(-1px) rotate(-45deg); }
.case input[aria-invalid="true"] { border-color: var(--rouge); }

/* le piège : hors de l'écran, jamais caché par display:none (certains robots le savent) */
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.erreur { margin: 0; min-height: 0; color: var(--rouge); font-size: 14px; font-weight: 500; }
.erreur:empty { display: none; }

.envoyer {
  position: relative; overflow: hidden; width: 100%; padding: 17px 20px; border: 0; border-radius: 999px;
  background: var(--creme); color: var(--noir); font: 700 17px 'Space Grotesk', sans-serif; letter-spacing: -.01em;
  cursor: pointer; transition: transform .15s ease, opacity .2s;
}
.envoyer:active { transform: scale(.98); }
.envoyer:disabled { cursor: progress; }
.envoyer span { position: relative; z-index: 1; }
.envoyer .barre { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--spectre); opacity: .9; transition: width .25s ease; }
.mot { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--gris); text-align: center; }
.mot a { color: var(--creme); }

/* ce que deviennent les envois */
.confi { margin-top: 18px; padding: 16px 20px; border-radius: 18px; border: 1px solid var(--filet); background: rgba(12, 13, 17, .6); font-size: 14px; line-height: 1.55; color: rgba(240, 237, 232, .82); }
.confi summary { cursor: pointer; font-weight: 600; color: var(--creme); }
.confi p { margin: 10px 0 0; }
.confi b { color: var(--creme); font-weight: 600; }

/* le merci */
.merci { padding: clamp(40px, 12vw, 96px) 0 20px; outline: none; }
.merci[hidden] { display: none; }
.merci h2 { font-size: clamp(52px, 15vw, 100px); }
.merci-actions { display: grid; gap: 16px; margin-top: 32px; justify-items: center; }

.pied {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 24px clamp(18px, 5vw, 48px) max(24px, env(safe-area-inset-bottom));
}

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

/* ══════════════════════════════════════════════════════════════════
   DÉCOUVRIR FLUX : la présentation sur place (assets/decouvrir.js)
   La mise en page est ici ; le mouvement (le défilement comme tête de
   lecture, l'écran qui se recompose d'un chapitre à l'autre) est en JS.
   ══════════════════════════════════════════════════════════════════ */
.ouvrir-flux {
  margin-top: 22px; display: inline-flex; align-items: center; gap: .42em; padding: 12px 18px; border-radius: 999px;
  border: 1px solid rgba(240, 237, 232, .22); background: rgba(240, 237, 232, .04); color: var(--creme);
  font: 500 15px/1 'Space Grotesk', system-ui, sans-serif; cursor: pointer; transition: border-color .2s, background .2s;
}
.ouvrir-flux b { font-weight: 600; background: var(--spectre); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ouvrir-flux:hover { border-color: rgba(240, 237, 232, .45); background: rgba(240, 237, 232, .07); }
.merci-actions .ouvrir-flux { margin-top: 0; }

html.dec-ouvert, html.dec-ouvert body { overflow: hidden; }
.decouvrir { position: fixed; inset: 0; z-index: 50; background: var(--noir); color: var(--creme); }
.dec-barre {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: clamp(12px, 3vw, 24px);
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 18px;
  background: linear-gradient(var(--noir) 35%, rgba(4, 4, 5, 0)); pointer-events: none;
}
.dec-barre > * { pointer-events: auto; }
.dec-logo { display: block; width: 70px; height: auto; flex: 0 0 auto; }
.dec-avance { flex: 1; height: 2px; border-radius: 2px; background: rgba(240, 237, 232, .12); overflow: hidden; }
.dec-avance i { display: block; width: 100%; height: 100%; background: var(--spectre); transform-origin: 0 50%; transform: scaleX(0); }
.dec-fermer {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(240, 237, 232, .2); background: rgba(12, 13, 17, .7); color: var(--creme);
  font: 500 14px/1 'Space Grotesk', system-ui, sans-serif; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.dec-fermer:hover { border-color: rgba(240, 237, 232, .45); }
.dec-defile { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* l'ouverture */
.dec-ouverture { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-content: center; justify-items: center; text-align: center; padding: 90px 24px 60px; }
.dec-ouverture > * { will-change: transform, opacity; }
.dec-grand { font-size: clamp(120px, 36vw, 280px); line-height: .9; }
.dec-grand em { padding-right: .08em; }
.dec-chapo { margin: 18px 0 0; font-size: clamp(16px, 4.4vw, 20px); color: rgba(240, 237, 232, .8); }
.dec-indice { position: absolute; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); margin: 0; display: grid; justify-items: center; gap: 12px;
  font-weight: 500; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gris); }
.dec-indice i { width: 1px; height: 46px; background: linear-gradient(rgba(240, 237, 232, .7), rgba(240, 237, 232, 0)); transform-origin: 50% 0; animation: indice 2.2s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes indice { 0% { transform: scaleY(0); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* la scène : un chapitre par hauteur d'écran, l'écran reste au milieu */
.dec-scene { position: relative; height: calc((var(--n) + 1) * 100vh); height: calc((var(--n) + 1) * 100svh); }
.dec-collant { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.dec-porte { position: absolute; left: 50%; top: 84px; height: min(57svh, calc((100vw - 48px) * 16 / 9)); aspect-ratio: 9 / 16; margin-left: calc(min(57svh, calc((100vw - 48px) * 16 / 9)) * -9 / 32); will-change: transform; }
.dec-porte::before {
  content: ''; position: absolute; inset: -14% -30%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(56, 74, 255, .55), rgba(141, 73, 255, .22) 55%, rgba(4, 4, 5, 0)); filter: blur(30px);
}
.dec-ecran { position: relative; width: 100%; height: 100%; border-radius: clamp(20px, 4.4vw, 34px); overflow: hidden; background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65), 0 0 0 1px rgba(240, 237, 232, .14); }
.dec-plan { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .55s cubic-bezier(.4, 0, .2, 1); }
.dec-plan.on { opacity: 1; }
.dec-textes { position: absolute; left: 22px; right: 22px; bottom: max(26px, env(safe-area-inset-bottom)); }
.dec-chapitre { position: absolute; left: 0; right: 0; bottom: 0; }
.dec-chapitre > * { will-change: transform, opacity; }
.dec-num { margin: 0; font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }
.dec-chapitre h3 { margin: 10px 0 12px; font-weight: 700; font-size: clamp(28px, 8vw, 66px); line-height: .98; letter-spacing: -.04em; }
.dec-chapitre h3 em {
  font: italic 400 1.1em/1 'Instrument Serif', Georgia, serif; letter-spacing: -.01em; padding-right: .06em;
  background: var(--spectre); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dec-l { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.dec-l > * { display: inline-block; will-change: transform; }
.dec-texte { margin: 0; max-width: 30em; font-size: clamp(14.5px, 3.9vw, 18px); line-height: 1.5; color: rgba(240, 237, 232, .78); }

/* sur un grand écran : l'écran à droite, le texte à gauche */
@media (min-width: 900px) {
  .dec-porte { left: auto; right: max(6vw, calc(50vw - 620px)); top: calc(50% - min(39svh, 450px)); height: min(78svh, 900px); margin-left: 0; }
  .dec-textes { left: max(6vw, calc(50vw - 620px)); right: auto; width: min(46vw, 600px); top: 50%; bottom: auto; }
  .dec-chapitre { top: 0; bottom: auto; transform: translateY(-50%); }
  .dec-texte { font-size: 19px; }
}

/* le but, le film, le retour à la boîte */
.dec-but { position: relative; width: min(640px, 100%); margin: 0 auto; padding: 18vh clamp(20px, 5vw, 32px) max(60px, env(safe-area-inset-bottom)); }
.dec-but h2 { font-size: clamp(44px, 12vw, 84px); }
.dec-film { position: relative; width: min(340px, 72vw); aspect-ratio: 9 / 16; margin: 48px auto 56px; border-radius: 28px; overflow: hidden; background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(240, 237, 232, .14), 0 0 90px rgba(56, 74, 255, .35); }
.dec-film video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dec-lire { position: absolute; inset: 0; display: grid; align-content: end; justify-items: start; gap: 14px; padding: 22px; border: 0; cursor: pointer; text-align: left;
  background: linear-gradient(rgba(4, 4, 5, 0) 45%, rgba(4, 4, 5, .85)); color: var(--creme); font: 500 15px/1.2 'Space Grotesk', system-ui, sans-serif; }
.dec-lire b { display: block; font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.dec-lire small { display: block; color: var(--gris); margin-top: 4px; font-size: 13px; }
.dec-rond { width: 62px; height: 62px; border-radius: 50%; background: var(--spectre); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(68, 112, 255, .5); transition: transform .25s; }
.dec-rond::after { content: ''; margin-left: 5px; border-left: 18px solid var(--noir); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.dec-lire:hover .dec-rond { transform: scale(1.06); }
.dec-toi { margin-top: 8px; }
.dec-retour { margin-top: 28px; }
.dec-fin { margin: 64px 0 0; text-align: center; }
.dec-fin em { font: italic 400 clamp(64px, 18vw, 120px)/1 'Instrument Serif', Georgia, serif;
  background: var(--spectre); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }

@media (prefers-reduced-motion: reduce) {
  .dec-plan { transition: none; }
  .dec-indice i { animation: none; }
}
