/* Couche « illustrations » : images, Ken Burns, diaporamas, interludes, fond d'ambiance.
   Se charge après style.css. Toutes les animations sont coupées par prefers-reduced-motion (style.css). */

/* ---------- Fond d'ambiance flouté ---------- */
html {
  background: radial-gradient(ellipse at 75% 0, #233d51 0, transparent 45%) no-repeat fixed, var(--bg);
  min-height: 100%;
}
body {
  background: transparent;
}
#backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
#backdrop img {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  filter: blur(26px) saturate(1.25) brightness(0.42);
  opacity: 0;
  transition: opacity 1.4s ease;
}
#backdrop img.in {
  opacity: 0.7;
}
#backdrop img.out {
  opacity: 0;
}
#backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 20%, transparent 0, #0a1320b0 70%);
}
.panel {
  backdrop-filter: blur(10px);
}

/* ---------- Logo ---------- */
.mark {
  background: url("assets/logo.svg") center / contain no-repeat;
  clip-path: none;
  padding: 0;
  filter: drop-shadow(0 0 8px #f3c78155);
}

/* ---------- Images de héros ---------- */
.pic {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #13263a;
}
.hero .art.pic,
.hero .art.slides {
  opacity: 1;
}
.kb {
  animation: kenburns 44s ease-in-out infinite;
  transform-origin: 60% 40%;
  will-change: transform;
}
.nokb {
  animation: none;
}
@keyframes kenburns {
  0%,
  100% {
    transform: scale(1.03) translate(0, 0);
  }
  50% {
    transform: scale(1.14) translate(-1.6%, -1.2%);
  }
}
/* Grain + vignette (au-dessus de l'image, sous le dégradé de lisibilité) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 45%, #050b1499 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: soft-light;
  opacity: 0.55;
}
.hero.story::after {
  background: linear-gradient(
    0deg,
    #0a1524 4%,
    color-mix(in srgb, var(--accent, #0a1524) 14%, #0a1524b0) 40%,
    #0a15241a 88%
  );
}
.hero h1,
.hero p,
.hero .tagline {
  text-shadow: 0 2px 18px #050b14c0;
}
.hero.tall {
  min-height: 46vh;
}
.hero.slim {
  min-height: 190px;
}
.hero.center-hero {
  text-align: center;
  justify-items: center;
  align-content: center;
}
.hero.center-hero h1 {
  font-size: clamp(2rem, 4.6vw, 4rem);
  max-width: 22ch;
}
.projection .hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  letter-spacing: -0.03em;
}

/* Diaporama en fondu */
.slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.slides .pic {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.slides .pic.on {
  opacity: 1;
}

/* Alerte (crise) : pulsation rouge + lignes de balayage */
.hero.alert::before {
  mix-blend-mode: normal;
  opacity: 1;
  background:
    repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 70% 25%, #ff3b3b55, transparent 60%);
  animation: alertpulse 1.8s ease-in-out infinite;
}
.hero.alert {
  border-color: #ff6b6b70;
  box-shadow: 0 0 0 1px #ff6b6b30, 0 0 40px #ff3b3b22;
}
.hero.alert .eyebrow {
  color: #ffb3a8;
}
.hero.alert .eyebrow::before {
  content: "⚠ ";
}
@keyframes alertpulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}
/* Aube (épilogue) : halo chaud */
.hero.dawn::before {
  mix-blend-mode: screen;
  opacity: 0.8;
  background: radial-gradient(ellipse at 60% 30%, #f3c78140, transparent 65%);
}

/* ---------- Cartes couverture (accueil, projection « Vivre ») ---------- */
.covercard {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 240px;
  display: grid;
  align-content: end;
  border: 1px solid #ffffff20;
  isolation: isolate;
  background: #13263a;
}
.covercard .pic {
  position: absolute;
  inset: 0;
  z-index: -2;
  animation-play-state: paused;
  transition: transform 0.8s ease;
}
.covercard:hover .pic {
  animation-play-state: running;
}
.covercard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #08121ff2 8%, #08121f99 42%, transparent 75%);
}
.covertext {
  padding: 16px;
  display: grid;
  gap: 5px;
}
.covertext .themechip {
  color: var(--accent);
}
.covertext h3 {
  font-size: 1.15rem;
}
.projection .covercard {
  min-height: 260px;
}
.projection .covertext h3 {
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
}

/* Bandeau signature */
.bannerstrip {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ffffff1a;
  aspect-ratio: 1536 / 126;
  min-height: 70px;
}
.bannerstrip .pic {
  object-fit: cover;
}

/* ---------- Vignettes dans les cartes de résultat ---------- */
.resultcard.withthumb {
  overflow: hidden;
}
.thumb {
  position: relative;
  margin: -17px -17px 2px;
  height: 120px;
  overflow: hidden;
}
.thumb .pic {
  height: 100%;
}
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #142333 0, transparent 70%);
}
.projection .thumb {
  height: 150px;
}

/* ---------- Régie : bandeau de la phase projetée ---------- */
.stage-head.imaged {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  padding: 20px 22px;
  border: 1px solid #ffffff1c;
  min-height: 150px;
}
.stage-head.imaged > .art {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.stage-head.imaged::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #0a1524f2 25%, #0a152499 60%, #0a152455);
}

/* ---------- Lobby : QR et carte de connexion ---------- */
.joinpanel {
  padding: 20px;
  border-radius: 18px;
  background: #0b1626cc;
  border: 1px solid #ffffff22;
  backdrop-filter: blur(10px);
}
.qr {
  width: min(250px, 60vw);
  margin: 4px auto;
  padding: 10px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 0 4px #f3c78155, 0 10px 40px #0008;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.projection .lobby-hero {
  min-height: 62vh;
}

/* ---------- Téléphone ---------- */
.lobbyart,
.waitart,
.scenecut {
  position: relative;
  overflow: hidden;
  border-radius: 13px;
  height: 150px;
  margin-bottom: 4px;
}
.waitart {
  height: 130px;
  margin: -6px -6px 12px;
}
.waitart .pic {
  filter: saturate(0.85) brightness(0.8);
}
.scenecut {
  height: clamp(150px, 34vw, 260px);
  border: 1px solid #ffffff1a;
}
.scenecut::after,
.lobbyart::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #0a1524aa, transparent 50%);
}
.cardbutton .artbox {
  height: 130px;
}
.cardbutton .artbox .pic {
  transition: transform 0.6s ease;
}
.cardbutton:hover .artbox .pic {
  transform: scale(1.08);
}
.cardbutton {
  border-top: 3px solid var(--accent, #40576d);
}

/* ---------- Interlude plein écran ---------- */
.interlude {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #050b14;
  display: grid;
  align-content: end;
  padding: 12vh 6vw;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  animation: fadein 0.6s ease both;
  transition: opacity 1s ease;
}
.interlude.leave {
  opacity: 0;
}
.interlude .pic {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.interlude::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, #050b14 0, #050b14 8vh, transparent 8vh, transparent calc(100% - 8vh), #050b14 calc(100% - 8vh)),
    linear-gradient(0deg, #050b14e6 10%, transparent 60%);
}
.interlude.alert::after {
  background:
    linear-gradient(0deg, #050b14 0, #050b14 8vh, transparent 8vh, transparent calc(100% - 8vh), #050b14 calc(100% - 8vh)),
    linear-gradient(0deg, #1a0508e6 10%, #ff3b3b22 60%);
}
.zoomin {
  animation: zoomin 5s ease-out both;
}
@keyframes zoomin {
  from {
    transform: scale(1.18);
  }
  to {
    transform: scale(1.02);
  }
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.interlude-text {
  animation: rise 1s 0.25s ease-out both;
}
.interlude-text h1 {
  font-size: clamp(3rem, 11vw, 9rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-shadow: 0 4px 30px #000c;
}
.interlude-text .eyebrow {
  font-size: clamp(0.8rem, 1.6vw, 1.2rem);
  letter-spacing: 0.3em;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (max-width: 760px) {
  .hero.tall {
    min-height: 330px;
  }
  .covercard {
    min-height: 200px;
  }
  .stage-head.imaged {
    min-height: 120px;
  }
  .interlude {
    padding: 14vh 7vw;
  }
}

/* Recadrages agrandis : léger flou de profondeur plutôt que des pixels */
.pic.lo {
  filter: blur(0.6px) saturate(1.1) contrast(1.04);
}
.interlude .pic.lo {
  filter: blur(2.2px) saturate(1.15);
}
.scenecut.short {
  height: 110px;
}
/* Projection : occuper un écran 16:9 large */
.projection {
  width: min(1760px, 100% - 64px);
}
.projection .hero.slim {
  min-height: 210px;
}

/* ---------- Temps de débat ---------- */
/* Le passage débat → vote change l'ICÔNE, le MOT et le motif de la barre (pas seulement la couleur). */
.talkbar {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #83b8ff55;
  background: #0d1c2ecc;
  backdrop-filter: blur(10px);
}
.talkhead {
  display: flex;
  align-items: center;
  gap: 10px;
}
.talkicon {
  font-size: 1.3rem;
}
.talklabel {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  flex: 1;
}
.talkclock {
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  color: #a9cdff;
}
.talktrack {
  height: 10px;
  border-radius: 6px;
  background: #ffffff12;
  overflow: hidden;
}
.talktrack i {
  display: block;
  height: 100%;
  background: #83b8ff;
  border-radius: 6px;
  transition: width 0.4s linear;
}
.talkplan {
  color: var(--muted);
}
.talkbar.voting {
  border-color: #f3c78188;
  border-style: dashed;
}
.talkbar.voting .talkclock {
  color: var(--gold);
}
.talkbar.voting .talktrack i {
  background: repeating-linear-gradient(45deg, var(--gold) 0 8px, #c99a4f 8px 14px);
}
.talkbar.over {
  opacity: 0.75;
}
.talkbar.big {
  padding: 18px 26px;
}
.talkbar.big .talklabel {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
}
.talkbar.big .talkicon {
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}
.talkbar.big .talkclock {
  font-size: clamp(2.4rem, 4.5vw, 4.4rem);
  line-height: 1;
}
.talkbar.big .talktrack {
  height: 16px;
}
.talkbar.big .talkplan {
  font-size: clamp(0.85rem, 1.1vw, 1.1rem);
}
.talkbar.compact {
  padding: 10px 13px;
}
/* Conducteur / aperçu du format */
.plan {
  display: grid;
  gap: 6px;
}
.planrow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.planrow span {
  display: grid;
  gap: 1px;
}
.planrow.now {
  color: var(--gold);
  font-weight: 750;
}
.plantalk {
  font-size: 0.74rem;
  color: #a9cdff;
  font-weight: 600;
}
.planbox {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  background: #0f1d2d;
}
.planbox summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}
.planbox .plan {
  margin-top: 10px;
}

/* ---------- « En clair » ---------- */
.plainbox {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border-radius: 11px;
  background: #0f2236;
  border: 1px dashed #83b8ff66;
  font-size: 0.9rem;
  line-height: 1.45;
}
.plainq strong {
  color: #a9cdff;
}
.plainex {
  color: var(--muted);
}
.plainbox.small {
  font-size: 0.82rem;
  padding: 9px 11px;
}
.plainbox.big {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  padding: 16px 20px;
}
.ansex {
  display: block;
  margin-top: 4px;
  color: #a9cdff;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.4;
}
.letter.inline {
  display: inline-grid;
  width: 22px;
  height: 22px;
  font-size: 0.72rem;
  margin-right: 4px;
  vertical-align: 1px;
}
.plainline {
  color: #a9cdff;
}
.anscard {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  border-radius: 12px;
  background: #14263a;
  border: 1px solid #ffffff1a;
}
.anscard strong {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}
.anscard small {
  color: #a9cdff;
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
}

/* ---------- Exemples ---------- */
.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid #52667a;
  background: #172a3e;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.8rem;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--gold);
}
.examples {
  display: grid;
  gap: 8px;
}
.examples.wall {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.example {
  border-left: 4px solid var(--team);
  background: #13243a;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.example p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.projection .example p {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
}
.example.masked {
  opacity: 0.45;
  border-left-style: dashed;
}
.example.masked p {
  text-decoration: line-through;
}
.exmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.exans {
  font-weight: 700;
  color: #a9cdff;
}
.likebtn {
  margin-left: auto;
  border: 1px solid #52667a;
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  cursor: pointer;
}
/* « aimé » : le bouton se remplit ET la bordure s'épaissit (pas seulement la couleur) */
.likebtn.on {
  background: var(--gold);
  color: #162433;
  border: 2px solid #fff;
  font-weight: 800;
}
.likecount {
  margin-left: auto;
  font-weight: 700;
}
