/* ImedIA, page d'accueil vocale. Charte : project.json (brand) de la refonte.
   Laiton #B08D57 / #E4CE9E, encre #0C0E12 / #1B1A17, ivoire #F2EEE6, Fraunces + Inter (auto-hébergées).
   Rayons : boutons et champs en pilule, carte de synthèse à 14 px. Un seul accent : le laiton. */

@font-face { font-family: "Fraunces"; src: url("polices/fraunces-normal.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("polices/fraunces-italic.woff2") format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("polices/inter-normal.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --fond: #F2EEE6;
  --surface: #E9E3D7;
  --texte: #1B1A17;
  --texte-doux: #4D4A43;
  --trait: rgb(27 26 23 / 0.16);
  --laiton: #B08D57;          /* remplissages */
  --laiton-texte: #7A5C2E;    /* texte laiton sur fond clair (contraste AA) */
  --sur-laiton: #0C0E12;
  --focus: #7A5C2E;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0C0E12;
    --surface: #15171C;
    --texte: #F2EEE6;
    --texte-doux: #A9A49A;
    --trait: rgb(242 238 230 / 0.14);
    --laiton: #B08D57;
    --laiton-texte: #E4CE9E;
    --sur-laiton: #0C0E12;
    --focus: #E4CE9E;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--fond);
  color: var(--texte);
  font: 400 1rem/1.6 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* En-tête : une ligne, 72 px */
.entete {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 clamp(1rem, 4vw, 3.5rem);
}
.logo img { display: block; height: 40px; width: auto; }
.logo-clair { display: none !important; }
@media (prefers-color-scheme: light) { .logo-sombre { display: none !important; } .logo-clair { display: block !important; } }
.lien {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .9375rem; color: var(--texte-doux); text-decoration: none;
  transition: color .3s cubic-bezier(.16, 1, .3, 1);
}
.lien:hover { color: var(--laiton-texte); }

/* Scène : texte à gauche, voix à droite (asymétrique) */
.scene {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 5rem);
  align-items: center;
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: clamp(1rem, 4vh, 4rem) clamp(1rem, 4vw, 3.5rem);
}
.texte { max-width: 40rem; }
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  font-size: clamp(2.5rem, 5.6vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.chapo { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--texte-doux); max-width: 34ch; margin: 0 0 2.25rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem; white-space: nowrap;
  height: 3.25rem; padding: 0 1.6rem; border-radius: 999px;
  font: 500 1rem/1 "Inter", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), background-color .3s, border-color .3s, color .3s;
}
.btn:active { transform: scale(.98); }
.btn-plein { background: var(--laiton); color: var(--sur-laiton); }
.btn-plein:hover { background: #C29E66; }
.btn-trait { background: transparent; color: var(--texte); border-color: var(--trait); }
.btn-trait:hover { border-color: var(--laiton); }

/* Conversation */
.conversation { display: grid; gap: 1rem; }
.mention { font-size: .8125rem; color: var(--texte-doux); margin: 0; }
.fil {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .9rem;
  max-height: min(38vh, 22rem); overflow-y: auto; scroll-behavior: smooth;
  mask-image: linear-gradient(to bottom, transparent 0, #000 1.5rem);
  padding-top: 1.5rem;
}
.fil li { max-width: 34rem; font-size: 1.0625rem; line-height: 1.55; animation: entree .5s cubic-bezier(.16, 1, .3, 1) both; }
.fil .ia { font-family: "Fraunces", Georgia, serif; font-variation-settings: "opsz" 24; font-size: 1.1875rem; }
.fil .visiteur { justify-self: end; text-align: right; color: var(--texte-doux); }
.fil .systeme { font-size: .9375rem; color: var(--laiton-texte); }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.saisie { display: grid; gap: .4rem; }
.saisie label { font-size: .8125rem; color: var(--texte-doux); }
.saisie-ligne {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid var(--trait); border-radius: 999px; padding: .35rem;
  background: var(--surface);
  transition: border-color .3s;
}
.saisie-ligne:focus-within { border-color: var(--laiton); }
.saisie input {
  flex: 1; min-width: 0; height: 2.75rem; border: 0; background: transparent; color: var(--texte);
  font: 400 1rem "Inter", system-ui, sans-serif; padding: 0 .5rem;
}
.saisie input:focus { outline: none; }
.rond {
  display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--trait); background: transparent; color: var(--texte);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), background-color .3s, color .3s, border-color .3s;
}
.rond:active { transform: scale(.94); }
.rond-plein { background: var(--laiton); border-color: var(--laiton); color: var(--sur-laiton); }
#btn-micro[aria-pressed="true"] { background: var(--laiton); border-color: var(--laiton); color: var(--sur-laiton); }

/* Synthèse du projet */
.brief {
  border: 1px solid var(--laiton); border-radius: 14px; padding: 1.25rem 1.4rem 1.4rem;
  background: var(--surface); animation: entree .6s cubic-bezier(.16, 1, .3, 1) both;
}
.brief h2 { font: 400 1.375rem/1.2 "Fraunces", Georgia, serif; margin: 0 0 .9rem; }
.brief dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0 0 1.25rem; font-size: .9375rem; }
.brief dt { color: var(--texte-doux); }
.brief dd { margin: 0; }

/* Visuel de la voix */
.visuel { position: relative; display: grid; place-items: center; min-height: 26rem; }
#voix { width: 100%; height: min(62vh, 34rem); display: block; }
.etat {
  position: absolute; left: 50%; bottom: .5rem; transform: translateX(-50%);
  margin: 0; font-size: .875rem; color: var(--texte-doux); white-space: nowrap;
}
.son {
  position: absolute; right: .25rem; bottom: .1rem;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
  border: 1px solid var(--trait); background: transparent; color: var(--texte-doux); cursor: pointer;
}
.son[aria-pressed="false"] { color: var(--laiton-texte); border-color: var(--laiton); }

.pied {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.25rem clamp(1rem, 4vw, 3.5rem) 1.5rem;
  font-size: .8125rem; color: var(--texte-doux); border-top: 1px solid var(--trait);
}
.pied a { text-decoration: none; }
.pied a:hover { color: var(--laiton-texte); }

/* Une fois la conversation lancée, le titre cède de la place au fil */
body.en-cours h1 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: .75rem; }
body.en-cours .chapo { display: none; }
body.en-cours h1, body.en-cours .chapo { transition: font-size .5s cubic-bezier(.16, 1, .3, 1); }

/* Mobile : une colonne, la voix au-dessus */
@media (max-width: 767px) {
  .entete { height: 64px; }
  .logo img { height: 34px; }
  .scene { grid-template-columns: 1fr; padding-top: .5rem; gap: .5rem; align-items: start; }
  .visuel { order: -1; min-height: 0; }
  #voix { height: 34vh; }
  body.en-cours #voix { height: 22vh; }
  .fil { max-height: 36vh; }
  .btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
