/* Exergue — feuille de style.
   Palette et typographie reprises de docs/04-IDENTITE-MARQUE.md.
   Registre éditorial : beaucoup de blanc, un seul accent, aucun effet. */

:root {
  --ink:      #0F1419;
  --ink-soft: #3C4650;
  --muted:    #6B7280;
  --line:     #E4E0D6;
  --surface:  #FCFBF7;
  --card:     #FFFFFF;
  --accent:   #A8821C;   /* laiton — contraste AA sur surface claire */
  --accent-w: #F3ECD8;
  --ok:       #2D6A4F;
  --bad:      #A33A2A;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* --- en-tête --- */
.top {
  display: flex; align-items: baseline; gap: 18px;
  padding: 22px 40px; border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-size: 19px;
  letter-spacing: .16em;
}
.brand svg { fill: var(--ink); }
.tag { margin: 0; color: var(--muted); font-family: var(--serif); font-style: italic; }

main { max-width: 1080px; margin: 0 auto; padding: 40px 40px 100px; }

/* --- étapes --- */
.step { margin-bottom: 56px; }
.step.hidden { display: none; }
.step-head { display: flex; gap: 16px; margin-bottom: 22px; }
.num {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: var(--accent-w); color: var(--accent);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
}
.step-head h2 {
  margin: 0 0 4px; font-family: var(--serif);
  font-size: 26px; font-weight: 700; letter-spacing: -.01em;
}
.sub { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }

/* --- dépôt de fichiers --- */
.drop {
  display: block; padding: 40px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 10px;
  background: var(--card); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #FFFDF6; }
.drop strong { display: block; font-size: 17px; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 14px; }
.filelist { list-style: none; margin: 18px 0 0; padding: 0; }
.filelist li {
  display: inline-block; margin: 4px; padding: 5px 12px;
  background: var(--accent-w); border-radius: 20px;
  font-size: 13px; color: var(--ink-soft);
}

/* --- champs --- */
.row { display: flex; gap: 16px; margin: 22px 0; flex-wrap: wrap; }
.field { flex: 1 1 340px; display: block; }
.field.narrow { flex: 0 0 130px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card);
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* --- boutons --- */
.primary, .ghost {
  display: inline-block; padding: 12px 24px; border-radius: 7px;
  font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
}
.primary { background: var(--ink); color: #fff; }
.primary:hover:not(:disabled) { background: #000; }
.primary:disabled { opacity: .35; cursor: not-allowed; }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ghost:hover { border-color: var(--ink); }
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* --- la matrice --- */
.matrix { display: flex; flex-direction: column; gap: 12px; }
.slide {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 16px 18px;
}
.slide-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.badge {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-w);
  padding: 3px 9px; border-radius: 4px; font-weight: 700; white-space: nowrap;
}
.slide-title {
  flex: 1; font-family: var(--serif); font-size: 17.5px; font-weight: 700;
  border: none; background: transparent; color: var(--ink);
  padding: 4px 6px; border-radius: 5px; min-width: 0;
}
.slide-title:hover { background: #FAF8F2; }
.slide-title:focus { outline: 2px solid var(--accent); background: #fff; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--bad); font-weight: 700; }

.items { list-style: none; margin: 6px 0 0; padding: 0; }
.items li { padding: 5px 0 5px 16px; position: relative; font-size: 14.5px; color: var(--ink-soft); }
.items li::before {
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.quote {
  display: block; margin-top: 3px; padding-left: 10px;
  border-left: 2px solid var(--accent-w);
  font-size: 12.5px; color: var(--muted); font-style: italic;
}
.stat { display: inline-block; margin-right: 26px; }
.stat b { font-family: var(--serif); font-size: 21px; color: var(--accent); display: block; }
.stat span { font-size: 12.5px; color: var(--muted); }
.figure-tag {
  display: inline-block; margin-top: 6px; font-size: 12.5px;
  color: var(--ok); background: #EAF3EE; padding: 3px 9px; border-radius: 4px;
}

/* --- empreintes --- */
.themes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.theme {
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); cursor: pointer; font: inherit; font-size: 14px;
  text-transform: capitalize;
}
.theme:hover { border-color: var(--ink); }
.theme[aria-pressed="true"] {
  border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600;
}

/* --- sortie --- */
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--muted);
}
.preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.preview img {
  width: 100%; display: block; border: 1px solid var(--line); border-radius: 7px;
  background: #fff;
}

/* --- état --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 7px;
  font-size: 14px; z-index: 50; max-width: 80vw;
}
.toast.hidden { display: none; }
.toast.bad { background: var(--bad); }

.spin { display: inline-block; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  main, .top { padding-left: 20px; padding-right: 20px; }
  .preview { grid-template-columns: 1fr; }
}

/* --- narration, diapositive par diapositive --- */
.voice { display: grid; grid-template-columns: 128px 1fr; gap: 20px; align-items: start; }

.filmstrip {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 620px; overflow-y: auto; padding-right: 4px;
}
.thumb {
  position: relative; border: 2px solid transparent; border-radius: 6px;
  cursor: pointer; background: var(--card); padding: 0; overflow: hidden;
  transition: border-color .12s;
}
.thumb img { width: 100%; display: block; }
.thumb:hover { border-color: var(--line); }
.thumb[aria-current="true"] { border-color: var(--accent); }
.thumb .n {
  position: absolute; left: 4px; top: 4px;
  background: rgba(15,20,25,.78); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
}
/* une diapositive sans voix off doit se repérer d'un coup d'œil */
.thumb .mute {
  position: absolute; right: 4px; top: 4px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--bad);
}

.stage { min-width: 0; }
.stage-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.grow { flex: 1; }
.counter { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.small { padding: 5px 13px; font-size: 15px; line-height: 1.1; }

.stage-img {
  width: 100%; display: block; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; margin-bottom: 16px;
}

.vo-label {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.vo-meta { font-variant-numeric: tabular-nums; }
.vo-meta.long { color: var(--bad); font-weight: 700; }

#vo {
  width: 100%; padding: 13px 15px; font: inherit; font-size: 15px; line-height: 1.6;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--ink); resize: vertical;
}
#vo:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.saved { color: var(--ok); font-weight: 600; }

@media (max-width: 720px) {
  .voice { grid-template-columns: 1fr; }
  .filmstrip { flex-direction: row; max-height: none; overflow-x: auto; }
  .thumb { flex: 0 0 108px; }
}

/* --- l'autre porte d'entrée --- */
.other-door {
  margin-left: auto; font-size: 14px; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px;
}
.other-door:hover { color: var(--ink); border-color: var(--ink); }

/* --- vidéo --- */
.vid { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #000; }
.vid.hidden { display: none; }

/* --- deux points de départ, un seul parcours --- */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.option {
  text-align: left; padding: 16px 18px; border: 1.5px solid var(--line);
  border-radius: 9px; background: var(--card); cursor: pointer; font: inherit;
}
.option:hover { border-color: var(--ink); }
.option[aria-selected="true"] { border-color: var(--accent); background: #FFFDF6; }
.option strong { display: block; font-size: 15.5px; margin-bottom: 3px; }
.option span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* --- estimation --- */
.estimate {
  margin: 20px 0; padding: 14px 18px; border-radius: 9px;
  background: var(--accent-w); border: 1px solid #E6DCC0;
}
.estimate.hidden { display: none; }
.est-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.est-total { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--ink); }
.est-detail { font-size: 13.5px; color: var(--ink-soft); }
.est-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.est-note.bad { color: var(--bad); font-weight: 600; }

@media (max-width: 720px) { .options { grid-template-columns: 1fr; } }
.hidden { display: none; }
