/* ==========================================================================
   La page de l'appel (21/10/2026, demande de Dorian : « refais toute la page de l'appel avec les transcriptions,
   moi qui parle, elle qui parle ; c'est moche, on voit rien, on comprend rien ; dans notre DA »).
   Chargée après nuit.css. La DA du site : Inter Tight (graisse 500, interlettrage serré), étiquettes en IBM Plex Mono
   capitales, pastille blanche à point bleu, bleu #2764ff, verre sombre sur le ciel de nuit.
   À gauche, qui est en ligne : la sphère (la sienne, puis celle de l'équipe), son nom, ce qui se passe, les commandes.
   À droite, la conversation transcrite en direct : elle (et l'équipe) en texte plein, vous en bulles bleues.
   ========================================================================== */
#act-prete {
  --a-sans: 'Inter Tight', 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --a-mono: 'IBM Plex Mono', 'Geist Mono', ui-monospace, Menlo, monospace;
  --a-bleu: #2764ff;
  --a-encre-2: rgba(232, 237, 252, 0.74);
  --a-encre-3: rgba(232, 237, 252, 0.52);
  --a-filet: rgba(255, 255, 255, 0.1);
  --a-rouge: #d6363c;   /* 4,7:1 sous le texte blanc (WCAG AA) */
  --a-vert: #4ade80;
  --a-ambre: #ffb562;
  font-family: var(--a-sans);
}
/* l'écran « prête » prend la même typographie que le site */
#act-prete .h-hero { font-weight: 500; letter-spacing: -0.05em; line-height: 0.95; }
#act-prete .btn, #act-prete .linkbtn, #act-prete .in { font-family: var(--a-sans); }
#act-prete .m-label { font-family: var(--a-mono); }

/* ---------- pendant l'appel : la page entière devient l'appel ---------- */
.prete.is-call { display: block; min-height: 0; height: 100%; padding: 0; text-align: left; }
.prete.is-call > :not(.appel) { display: none !important; }

.appel {
  height: 100%; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 780px); justify-content: center;
  column-gap: clamp(28px, 5vw, 80px);
  padding: clamp(12px, 2.6vh, 32px) var(--gutter) clamp(16px, 3.2vh, 36px);
  color: #fff;
}
.appel.swap-in .appel__scene { animation: appel-scene 620ms var(--ease-out) both; }
.appel.swap-in .appel__fil { animation: appel-fil 720ms var(--ease-out) 80ms both; }
@keyframes appel-scene { from { opacity: 0; transform: translateY(10px); } }
@keyframes appel-fil { from { opacity: 0; transform: translateX(24px); filter: blur(6px); } }

/* ---------- à gauche : qui est en ligne ---------- */
.appel__scene { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; text-align: center; }
/* la pastille du site : blanche, texte noir, point bleu ; l'état et le chronomètre */
.appel__pastille {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 13px 7px 12px; border-radius: 999px;
  background: #fff; color: #000; font: 500 13px/1 var(--a-sans); letter-spacing: 0.005em; white-space: nowrap;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.9);
}
.appel__point { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--a-bleu); flex: none; }
.appel__point::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: appel-point 1.8s ease-out infinite; }
@keyframes appel-point { 0% { transform: scale(1); opacity: 0.55; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.appel[data-state="connecting"] .appel__pastille .appel__point { background: #9aa3b8; }
.appel[data-state="ringing"] .appel__pastille .appel__point { background: #f59e0b; }
.appel__chrono { padding-left: 9px; border-left: 1px solid rgba(0, 0, 0, 0.14); font: 500 12px/1 var(--a-mono); font-variant-numeric: tabular-nums; color: rgba(0, 0, 0, 0.56); }
.appel[data-state="connecting"] .appel__chrono { display: none; }

/* la sphère : le moteur de l'onde la dessine dans ce carré (Orb.sphere) ; ses ondes quand ça sonne chez l'équipe */
.appel__sphere { position: relative; flex: none; width: clamp(170px, min(32vh, 26vw), 320px); aspect-ratio: 1; margin: clamp(10px, 2.4vh, 28px) 0 clamp(6px, 1.4vh, 16px); border-radius: 50%; }
.appel__sphere::before, .appel__sphere::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px rgba(160, 190, 255, 0.75), 0 0 24px rgba(39, 100, 255, 0.35);
}
.appel[data-state="ringing"] .appel__sphere::before, .appel[data-state="ringing"] .appel__sphere::after { animation: appel-sonne 1.6s cubic-bezier(0.2, 0.7, 0.3, 1) infinite; }
.appel[data-state="ringing"] .appel__sphere::after { animation-delay: 0.8s; }
@keyframes appel-sonne { 0% { transform: scale(0.96); opacity: 0.9; } 100% { transform: scale(1.32); opacity: 0; } }
/* la sphère s'éteint pendant les sonneries (elle a passé la main), puis prend la couleur chaude de l'équipe */
body:has(.appel[data-state="ringing"]) #orb { filter: brightness(1.1) saturate(0.55); opacity: 0.55; }
body:has(.appel[data-who="team"]) #orb { filter: brightness(1.7) sepia(1) saturate(3.2) hue-rotate(-18deg); }
#orb { transition: filter 700ms var(--ease-out), opacity 700ms var(--ease-out); }

.appel__qui { display: grid; gap: 8px; }
.appel__nom { margin: 0; font: 500 clamp(40px, min(6.4vh, 4.6vw), 72px)/0.92 var(--a-sans); letter-spacing: -0.05em; color: #fff; text-wrap: balance; }
.appel__role { margin: 0; font: 400 15.5px/1.4 var(--a-sans); color: var(--a-encre-2); text-wrap: balance; }
.appel[data-who="team"] .appel__nom { color: #ffe2bd; }

/* ce qui se passe, en une phrase : elle vous écoute, elle vous répond, elle note, ça sonne chez l'équipe… */
.appel__activite {
  display: inline-flex; align-items: center; gap: 10px; margin: clamp(14px, 2.6vh, 26px) 0 0; min-height: 36px; padding: 0 16px 0 14px;
  border-radius: 999px; font: 500 15px/1.2 var(--a-sans); color: #fff; white-space: nowrap;
  background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px var(--a-filet);
}
.appel__eq { display: inline-flex; align-items: center; gap: 2.5px; height: 16px; color: rgba(255, 255, 255, 0.55); }
.appel__eq i { display: block; width: 3px; height: 4px; border-radius: 2px; background: currentColor; transition: height 160ms ease; }
.appel[data-her="1"] .appel__eq, .appel[data-you="1"] .appel__eq { color: #8fb0ff; }
.appel[data-who="team"][data-her="1"] .appel__eq { color: #ffc98a; }
.appel[data-her="1"] .appel__eq i, .appel[data-you="1"] .appel__eq i { animation: appel-eq 0.9s ease-in-out infinite; }
.appel__eq i:nth-child(2) { animation-delay: 0.15s !important; }
.appel__eq i:nth-child(3) { animation-delay: 0.3s !important; }
.appel__eq i:nth-child(4) { animation-delay: 0.45s !important; }
@keyframes appel-eq { 0%, 100% { height: 4px; } 50% { height: 15px; } }
.appel[data-state="noting"] .appel__eq i, .appel[data-state="agenda"] .appel__eq i, .appel[data-state="ringing"] .appel__eq i { animation: appel-pense 1s ease-in-out infinite; height: 5px; }
@keyframes appel-pense { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* les commandes : le micro (ouvert, ou coupé pendant qu'elle parle sur Safari), et raccrocher */
.appel__actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: clamp(16px, 3.4vh, 34px); }
.appel__micro {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 15px; border-radius: 999px;
  font: 500 14.5px/1 var(--a-sans); color: #fff; background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: color 200ms ease, background-color 200ms ease;
}
.appel__micro svg { width: 17px; height: 17px; flex: none; }
.appel__micro svg:nth-of-type(2), .appel__micro[data-muted="1"] svg:nth-of-type(1) { display: none; }
.appel__micro[data-muted="1"] svg:nth-of-type(2) { display: block; }
.appel__micro[data-muted="1"] { color: var(--a-encre-2); background: rgba(255, 255, 255, 0.05); }
.appel[data-state="connecting"] .appel__micro { opacity: 0.45; }
.appel__raccrocher {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 24px 0 20px; border: 0; border-radius: 999px;
  font: 500 15px/1 var(--a-sans); letter-spacing: 0.01em; color: #fff; background: var(--a-rouge); cursor: pointer;
  box-shadow: 0 14px 30px -16px rgba(214, 54, 60, 0.9); transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.appel__raccrocher svg { width: 18px; height: 18px; }
.appel__raccrocher:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .appel__raccrocher:hover { background: #c92a2f; } }
.appel__aide { margin: 14px 0 0; max-width: 34ch; font: 400 13px/1.45 var(--a-sans); color: var(--a-encre-3); text-wrap: balance; }

/* ---------- à droite : la conversation ---------- */
.appel__fil {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 28px;
  background: rgba(7, 11, 28, 0.62); -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 90px -46px rgba(0, 0, 0, 0.9);
}
.appel__fil-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 26px 17px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.appel__label { font: 500 12px/1 var(--a-mono); letter-spacing: -0.01em; text-transform: uppercase; color: #fff; }
.appel__fil-note { display: inline-flex; align-items: center; gap: 8px; font: 400 13px/1 var(--a-sans); color: var(--a-encre-3); white-space: nowrap; }
.appel__fil-note .appel__point { width: 6px; height: 6px; background: #5b87ff; }
.appel[data-state="connecting"] .appel__fil-note .appel__point { background: #9aa3b8; }
.appel[data-state="connecting"] .appel__fil-note .appel__point::after { animation: none; }

/* le fil : remplit le panneau, défile seul ; le haut s'efface sous l'en-tête */
#call-thread {
  flex: 1; min-height: 0; max-height: none; gap: 20px; padding: 26px 28px 30px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 26px); mask-image: linear-gradient(180deg, transparent 0, #000 26px);
}
#call-thread:focus-visible { outline: 2px solid #8fb0ff; outline-offset: -6px; border-radius: 22px; }
#call-thread:empty::before { content: "La conversation s'affiche ici, en direct."; margin: auto; font: 400 15px/1.5 var(--a-sans); color: var(--a-encre-3); }

/* une réplique : le nom (avec son point), l'instant de l'appel, puis le texte */
#call-thread .msg { display: grid; gap: 8px; max-width: min(90%, 640px); animation: msg-in 320ms var(--ease-out) both; }
.msg__meta { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 13.5px/1 var(--a-sans); color: #fff; }
.msg__av {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 34% 28%, #c7d6ff 0%, #6f95ff 18%, #2764ff 42%, #6d28d9 72%, #0b0c22 100%);
  box-shadow: 0 0 14px rgba(39, 100, 255, 0.55);
}
#call-thread .msg__who { font: 500 13.5px/1 var(--a-sans); letter-spacing: 0; text-transform: none; color: #fff; }
.msg__time { font: 500 11px/1 var(--a-mono); font-variant-numeric: tabular-nums; color: var(--a-encre-3); }
/* elle et l'équipe : du texte plein, aligné sous leur nom, sans bulle */
#call-thread .msg--lea .msg__t, #call-thread .msg--team .msg__t {
  margin: 0; padding: 0 0 0 26px; border-radius: 0; background: none; box-shadow: none;
  font: 400 clamp(17px, 1.3vw, 20px)/1.5 var(--a-sans); letter-spacing: -0.012em; color: #fff;
}
#call-thread .msg--team .msg__av { background: radial-gradient(circle at 34% 28%, #fff6e8 0%, #ffd7a3 26%, #ff9f43 62%, #5c2a08 100%); box-shadow: 0 0 14px rgba(255, 159, 67, 0.5); }
#call-thread .msg--team .msg__who { color: #ffe2bd; }
/* vous : à droite, en bulles bleues, comme vos messages envoyés */
#call-thread .msg--you { align-self: flex-end; justify-items: end; }
#call-thread .msg--you .msg__meta { flex-direction: row-reverse; }
#call-thread .msg--you .msg__av { width: 12px; height: 12px; margin: 0 3px; background: none; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
#call-thread .msg--you .msg__t {
  margin: 0; padding: 12px 18px 13px; border-radius: 22px 22px 6px 22px;
  background: #2764ff linear-gradient(180deg, #3d76ff, #2257ee); box-shadow: 0 16px 32px -20px rgba(39, 100, 255, 0.95);
  font: 400 clamp(16px, 1.2vw, 18px)/1.45 var(--a-sans); color: #fff; text-wrap: pretty;
}
#call-thread .msg--you.is-wait .msg__t { padding: 15px 18px; }
/* la réplique en cours : un curseur au bout, au rythme de sa voix */
#call-thread .msg.is-live .msg__t::after { width: 2px; height: 1.05em; margin-left: 4px; vertical-align: -0.16em; background: #8fb0ff; }
#call-thread .msg--team.is-live .msg__t::after { background: #ffc98a; }
#call-thread .dots i { width: 5px; height: 5px; background: #fff; }

/* les gestes de l'appel : une ligne au milieu du fil (elle note, elle consulte l'agenda), puis ce qu'ils ont donné */
#call-thread .ev { align-self: stretch; display: block; max-width: none; margin: 2px 0; padding: 0; border-radius: 0; background: none; box-shadow: none; font: inherit; letter-spacing: 0; color: inherit; animation: msg-in 320ms var(--ease-out) both; }
.ev__row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font: 500 14px/1.3 var(--a-sans); color: var(--a-encre-2); }
.ev__row::before, .ev__row::after { content: ""; flex: 1; max-width: 120px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14)); }
.ev__row::after { transform: scaleX(-1); }
.ev__ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; color: #fff; background: rgba(255, 255, 255, 0.09); transition: background-color 300ms ease, color 300ms ease; }
.ev__ic svg { width: 15px; height: 15px; }
#call-thread .ev.is-live .ev__t { color: #fff; }
#call-thread .ev.is-done .ev__ic { color: var(--a-vert); background: rgba(74, 222, 128, 0.14); }
#call-thread .ev .dots { color: #fff; }
/* ce qu'elle a noté : la fiche transmise à l'équipe */
.ev__fiche { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; max-width: 460px; margin: 14px auto 0; padding: 16px 20px; border-radius: 18px; text-align: left; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); animation: msg-in 320ms var(--ease-out) both; }
.ev__fiche dt { font: 500 11px/1.75 var(--a-mono); text-transform: uppercase; color: var(--a-encre-3); }
.ev__fiche dd { margin: 0; font: 400 15px/1.45 var(--a-sans); color: #fff; overflow-wrap: anywhere; }
/* les créneaux trouvés dans l'agenda */
.ev__creneaux { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; animation: msg-in 320ms var(--ease-out) both; }
.ev__creneaux li { padding: 9px 15px; border-radius: 999px; font: 500 13.5px/1 var(--a-sans); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24); }
.ev__creneaux li::first-letter { text-transform: uppercase; }
/* une note de l'appel (micro coupé pendant qu'elle parle…) */
#call-thread .ev--note { align-self: center; max-width: 46ch; font: 400 13.5px/1.5 var(--a-sans); text-align: center; color: var(--a-encre-3); }

/* le transfert : une carte qui sonne, puis l'équipe qui décroche */
.xfer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; row-gap: 3px; max-width: 460px; margin: 0 auto; padding: 16px 20px 16px 16px; border-radius: 20px; background: linear-gradient(180deg, rgba(39, 100, 255, 0.2), rgba(39, 100, 255, 0.07)); box-shadow: inset 0 0 0 1px rgba(91, 135, 255, 0.4); }
.xfer__ic { grid-row: 1 / span 2; position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--a-bleu); transition: background-color 300ms ease; }
.xfer__ic svg { width: 19px; height: 19px; }
.xfer__ic::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 1px rgba(91, 135, 255, 0.7); opacity: 0; }
.ev--transfert.is-live .xfer__ic svg { animation: xfer-vibre 1.5s ease-in-out infinite; }
.ev--transfert.is-live .xfer__ic::after { animation: appel-sonne 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) infinite; }
@keyframes xfer-vibre { 0%, 40%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(-14deg); } 10%, 20%, 30% { transform: rotate(14deg); } }
.xfer__t { margin: 0; font: 500 15.5px/1.25 var(--a-sans); color: #fff; }
.xfer__s { margin: 0; font: 400 14px/1.35 var(--a-sans); color: var(--a-encre-2); }
.ev--transfert.is-done .xfer__ic { background: #16a34a; }
.ev--transfert.is-ko .xfer__ic { background: #6b7280; }
.xfer__note { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1); font: 400 13.5px/1.45 var(--a-sans); color: var(--a-encre-2); animation: msg-in 320ms var(--ease-out) both; }

/* ---------- téléphone et petites fenêtres : la sphère en vignette, le fil prend la hauteur, les commandes en bas ---------- */
@media (max-width: 899px) {
  .appel {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    grid-template-areas: "sphere pastille" "sphere qui" "sphere activite" "fil fil" "actions actions" "aide aide";
    column-gap: 16px; row-gap: 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .appel__scene { display: contents; }
  .appel__pastille { grid-area: pastille; justify-self: start; align-self: end; padding: 6px 11px 6px 10px; font-size: 12px; }
  .appel__sphere { grid-area: sphere; width: 104px; margin: 0; align-self: center; }
  .appel__qui { grid-area: qui; gap: 2px; margin-top: 8px; text-align: left; }
  .appel__nom { font-size: 30px; line-height: 1; }
  .appel__role { font-size: 13.5px; }
  .appel__activite { grid-area: activite; justify-self: start; margin: 8px 0 0; min-height: 30px; padding: 0 12px 0 10px; font-size: 13.5px; }
  .appel__fil { grid-area: fil; margin-top: 14px; border-radius: 22px; background: rgba(7, 11, 28, 0.8); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .appel__fil-tete { padding: 13px 18px 12px; }
  .appel__fil-note { font-size: 12px; }
  #call-thread { gap: 16px; padding: 18px 16px 22px; }
  #call-thread .msg { max-width: 94%; }
  #call-thread .msg--lea .msg__t, #call-thread .msg--team .msg__t { padding-left: 0; font-size: 17px; }
  .appel__actions { grid-area: actions; margin-top: 12px; flex-wrap: nowrap; }
  .appel__micro { flex: none; padding: 0 14px; }
  .appel__raccrocher { flex: 1; }
  .appel__aide { grid-area: aide; justify-self: center; margin-top: 8px; font-size: 12.5px; text-align: center; }
}
@media (max-width: 380px) {
  .appel__micro-t { display: none; }
  .appel__fil-note { display: none; }
}
@media (max-height: 620px) and (min-width: 900px) {
  .appel__sphere { width: clamp(120px, 24vh, 200px); }
  .appel__nom { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .appel.swap-in .appel__scene, .appel.swap-in .appel__fil, #call-thread .msg, #call-thread .ev, .ev__fiche, .ev__creneaux, .xfer__note { animation: none; }
  .appel__point::after, .appel__sphere::before, .appel__sphere::after, .appel__eq i, .ev--transfert.is-live .xfer__ic svg, .ev--transfert.is-live .xfer__ic::after { animation: none !important; }
}
