/* La page d’intégration du cœur (src/lib/integration.mjs). Fond transparent par défaut : le cœur
   se pose sur la page hôte, claire ou sombre ; ?fond=clair ou ?fond=sombre lui donne un fond plein.
   Les mentions sont des pastilles lisibles sur les deux. */
@font-face {
  font-family: Manrope;
  src: url("/parcours/vendor/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --encre: #32243c;
  --violet: #604276;
  --fond-mention: rgba(255, 255, 255, 0.84);
  --trait: rgba(96, 66, 118, 0.2);
}
:root[data-fond="clair"] {
  background: #ffffff;
}
:root[data-fond="sombre"] {
  --encre: #f6f2fa;
  --violet: #e3d6ef;
  --fond-mention: rgba(37, 29, 43, 0.84);
  --trait: rgba(201, 182, 220, 0.26);
  background: #1b1520;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
body {
  font:
    600 12px/1.45 Manrope,
    ui-sans-serif,
    system-ui,
    sans-serif;
  color: var(--encre);
  -webkit-text-size-adjust: 100%;
}
main {
  position: fixed;
  inset: 0;
}
.repli,
.scene,
.prise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.repli {
  object-fit: contain;
  transition:
    opacity 0.6s,
    visibility 0s 0.6s;
}
/* La toile du viewer ne reçoit aucun geste : la prise les reçoit tous, et seulement quand le
   cœur est vivant. Sans quoi, image affichée, ses propres écouteurs retiendraient la molette et
   un clic choisirait un vaisseau sur un cœur qu’on ne voit pas. */
.scene {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}
.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}
[data-etat="vivant"] .scene {
  opacity: 1;
}
[data-etat="vivant"] .repli {
  opacity: 0;
  visibility: hidden;
}
.prise {
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.prise[hidden] {
  display: none;
}
.prise[data-tenu] {
  cursor: grabbing;
}
.prise:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: -3px;
  border-radius: 12px;
}
.mentions {
  position: absolute;
  inset: auto 10px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.mentions > * {
  pointer-events: auto;
}
.mention {
  box-sizing: border-box;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: var(--fond-mention);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--violet);
}
summary.mention,
a.mention {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  min-height: 28px;
  padding: 3px 11px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.marque {
  font-weight: 750;
}
summary {
  list-style: none;
  font-weight: 600;
}
summary::-webkit-details-marker {
  display: none;
}
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
.credits {
  position: relative;
}
.credits p.mention {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(300px, calc(100vw - 20px));
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--encre);
  font-weight: 500;
  font-size: 11.5px;
}
.credits p a {
  color: var(--violet);
  font-weight: 650;
}
@media (prefers-reduced-motion: reduce) {
  .repli,
  .scene {
    transition: none;
  }
}
