/*
 * Gemmora Blast : la mise en scène de l'accueil.
 *
 * Deux états, choisis par main.js :
 *   - sans classe « live » (pas de JavaScript, « réduire les animations », écran trop bas) : une page ordinaire, les chapitres
 *     l'un sous l'autre, la galerie qui défile à la main. Rien ne bouge tout seul.
 *   - avec « live » : le téléphone reste épinglé pendant que les chapitres défilent, la galerie avance à l'horizontale,
 *     les blocs apparaissent, la parallaxe joue. main.js n'écrit que des variables CSS (--d, --p, --c…) : tout le dessin est ici.
 */

/* ---------- Bases communes ---------- */
.night {
  position: relative;
  background: var(--night);
  color: var(--ink);
}
.paper {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
}
.eyebrow {
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow--ink {
  color: #8a5a00;
}
.head {
  margin-bottom: clamp(28px, 5vw, 52px);
  max-width: 720px;
}
.head--center {
  margin-inline: auto;
  text-align: center;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  text-wrap: pretty;
}
.paper .sub {
  color: var(--paper-muted);
}
.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}
.note--left {
  margin: 14px 0 22px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--gold);
  font-weight: 800;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link--ink {
  color: #6230cf;
}

/* ---------- Bandeau fixe ---------- */
.home .top {
  position: fixed;
  inset: 0 0 auto 0;
  background: rgb(20 10 58 / 0%);
  backdrop-filter: none;
  border-bottom-color: transparent;
  transition:
    background 0.3s,
    border-color 0.3s,
    backdrop-filter 0.3s;
}
.home .top.is-scrolled,
.home .top.is-open {
  background: rgb(20 10 58 / 78%);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}
.top__nav {
  display: none;
  gap: 4px;
}
.top__nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.top__nav a:hover {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}
.top__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top__burger {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  cursor: pointer;
}
.top__burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2.5px;
  border-radius: 2px;
  background: #fff;
  transition:
    translate 0.3s var(--ease),
    rotate 0.3s var(--ease);
}
.top__burger span:first-child {
  top: 17px;
}
.top__burger span:last-child {
  top: 25px;
}
.top.is-open .top__burger span:first-child {
  translate: 0 4px;
  rotate: 45deg;
}
.top.is-open .top__burger span:last-child {
  translate: 0 -4px;
  rotate: -45deg;
}
.top__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transform-origin: 0 50%;
  transform: scaleX(var(--sp, 0));
}
/* Téléphone : le menu s'ouvre sous le bandeau. */
.js .top__nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  align-content: start;
  gap: 2px;
  height: calc(100dvh - var(--top-h));
  padding: 18px 24px;
  background: #140a3a;
  visibility: hidden;
  opacity: 0;
  translate: 0 -12px;
  transition:
    opacity 0.3s,
    translate 0.4s var(--ease),
    visibility 0s 0.4s;
}
.js .top.is-open .top__nav {
  visibility: visible;
  opacity: 1;
  translate: 0 0;
  transition-delay: 0s;
}
.js .top__nav a {
  padding: 14px 6px;
  border-radius: 14px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
@media (min-width: 900px) {
  .top__nav,
  .js .top__nav {
    position: static;
    display: flex;
    height: auto;
    padding: 0;
    background: none;
    visibility: visible;
    opacity: 1;
    translate: none;
  }
  .js .top__nav a {
    padding: 8px 14px;
    color: var(--muted);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
  }
  .js .top__nav a:hover {
    color: #fff;
  }
  .top__burger {
    display: none;
  }
}

/* Le bandeau passe en clair quand il survole une partie claire (main.js pose « is-light »). */
.home .top.is-light {
  background: rgb(255 247 232 / 78%);
  border-bottom-color: rgb(61 17 80 / 10%);
}
.home .top.is-light .top__brand {
  color: var(--paper-ink);
}
.home .top.is-light .top__burger {
  background: rgb(61 17 80 / 8%);
}
.home .top.is-light:not(.is-open) .langs summary {
  border-color: rgb(61 17 80 / 18%);
  color: var(--paper-ink);
}
.home .top.is-light .top__burger span {
  background: var(--paper-ink);
}
.home .top.is-light.is-open .top__burger span {
  background: #fff;
}
.home .top.is-light.is-open .top__brand {
  color: var(--gold);
}
@media (min-width: 900px) {
  .home .top.is-light .top__nav a,
  .js .home .top.is-light .top__nav a {
    color: var(--paper-muted);
  }
  .home .top.is-light .top__nav a:hover,
  .js .home .top.is-light .top__nav a:hover {
    background: rgb(61 17 80 / 7%);
    color: var(--paper-ink);
  }
}
.link span {
  display: inline-block;
  transition: translate 0.25s var(--ease);
}
.link:hover span {
  translate: 4px 0;
}

/* ---------- Le téléphone ---------- */
.phone {
  --ph: min(70svh, 125vw, 560px);
  --pw: calc(var(--ph) * 0.4625);
  position: relative;
  width: var(--pw);
}
.phone__body {
  position: relative;
  padding: calc(var(--pw) * 0.03);
  border-radius: calc(var(--pw) * 0.14);
  background: linear-gradient(145deg, #3a3866 0%, #0b0a26 38%, #1d1b48 100%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 16%),
    0 0 0 calc(var(--pw) * 0.008) #07061c,
    0 40px 80px rgb(4 2 30 / 55%),
    0 12px 28px rgb(4 2 30 / 35%);
}
.phone__body img {
  display: block;
  width: 100%;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  border-radius: calc(var(--pw) * 0.112);
  background: #1d1a4d;
}
/* Reflet sur la vitre. */
.phone__body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / 16%), transparent 26%, transparent 70%, rgb(255 255 255 / 6%));
  pointer-events: none;
}
/* Boutons sur le côté. */
.phone__body::after {
  content: '';
  position: absolute;
  left: calc(var(--pw) * -0.012);
  top: 18%;
  width: calc(var(--pw) * 0.012);
  height: 11%;
  border-radius: 3px 0 0 3px;
  background: #15133a;
  box-shadow: 0 calc(var(--pw) * 0.2) 0 #15133a;
}
.phone--ink .phone__body {
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 14%),
    0 0 0 calc(var(--pw) * 0.008) #07061c,
    0 36px 60px rgb(74 30 150 / 32%),
    0 10px 20px rgb(74 30 150 / 20%);
}

/* ---------- 1. La mise en scène (état de base : chapitres l'un sous l'autre) ---------- */
.story {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
}
.story__bg,
.story__iris,
.device,
.odo,
.cotes {
  display: none;
}
.chap {
  display: grid;
  gap: 32px;
  justify-items: center;
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
  padding: 72px 0;
  text-align: center;
}
.chap--hero {
  width: auto;
  margin: 0;
  padding: calc(var(--top-h) + 48px) max(20px, calc((100% - var(--wrap)) / 2)) 72px;
  background:
    radial-gradient(70% 50% at 50% 0%, rgb(120 80 255 / 32%), transparent 72%),
    linear-gradient(180deg, var(--night), var(--night-2));
  color: #fff;
}
.chap__col {
  display: grid;
  gap: 22px;
  max-width: 640px;
}
.chap__copy h1,
.chap__copy h2 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.chap__copy h1 {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
}
.chap__copy h2 {
  font-size: clamp(1.9rem, 5vw, 3rem);
}
.chap__copy p {
  margin-top: 14px;
  color: var(--paper-muted);
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.chap--hero .chap__copy p,
.chap--hero .note {
  color: var(--muted);
}
.chap--hero .eyebrow {
  color: var(--gold);
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 22px;
}
.chap .note {
  margin-top: 10px;
  font-size: 0.92rem;
}
.chap__phone {
  --ph: min(68svh, 125vw, 560px);
}
.chap--statement .phone {
  display: none;
}
.bar {
  display: none;
}
@media (min-width: 900px) {
  .chap:not(.chap--hero, .chap--statement) {
    grid-template-columns: 1fr auto;
    gap: 64px;
    text-align: left;
    justify-items: start;
  }
  .chap:not(.chap--hero, .chap--statement) .chap__phone {
    justify-self: end;
  }
}

/* ---------- 1bis. La mise en scène épinglée ---------- */
.live .story {
  --steps: 9; /* nombre de blocs data-chap moins un */
  height: calc(100vh * (1 + var(--steps) * 1.25));
  height: calc(100svh * (1 + var(--steps) * 1.25));
  background: var(--night);
}
.live .story__pin {
  /* Tout est dessiné par rapport au centre du téléphone (--cx, --cy). --fs, --ir et --hv sont écrites par main.js. */
  --sph: min(56svh, 130vw);
  --cx: 50vw;
  --cy: calc(100svh - var(--sph) / 2 - 18px);
  --odo: 40svh;
  --copyl: 20px;
  --fs: 0;
  --ir: 0px;
  --hv: 1;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--night);
  color: #fff;
}
@media (min-width: 900px) {
  .live .story__pin {
    --sph: min(74svh, 760px);
    --cx: 70vw;
    --cy: 52.5svh;
    --odo: min(49svh, 31vw);
    --copyl: max(24px, 6.4vw);
  }
}
/* Le fond noir : des plans de gemmes et de plateau au trait, comme un dessin technique. */
.live .story__bg {
  display: block;
  position: absolute;
  inset: 0;
  color: rgb(255 255 255 / 15%);
  background:
    radial-gradient(60% 55% at var(--cx) var(--cy), rgb(110 70 255 / 22%), transparent 70%),
    linear-gradient(180deg, var(--night), #07051f);
}
.story__bg svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@media (max-width: 899px) {
  .bp--a,
  .bp--d,
  .bp--e {
    display: none;
  }
}
/* L'iris : un disque clair qui s'ouvre depuis le téléphone. Le texte, en « différence », passe du blanc au noir au passage du cercle. */
.live .story__iris {
  display: block;
  position: absolute;
  inset: 0;
  background: var(--paper);
  clip-path: circle(var(--ir) at var(--cx) var(--cy));
}

.live .chap {
  --d: calc(var(--fs) - var(--i, 0));
  --ad: max(var(--d), calc(var(--d) * -1));
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: auto;
  margin: 0;
  padding: 0;
  text-align: left;
  background: none;
  color: #fff;
  pointer-events: none;
}
.live .chap--hero {
  --i: 0;
  padding: 0;
}
.live .chap__col {
  display: block;
  width: calc(100% - 40px);
  max-width: none;
  margin: calc(var(--top-h) + 8px) 20px 0;
}
@media (min-width: 900px) {
  .live .chap {
    align-items: center;
  }
  .live .chap__col {
    width: min(489px, 40vw);
    margin: 0 0 0 var(--copyl);
  }
}
/* Le texte se lève et s'efface, le suivant arrive d'en bas. Il reste lisible le plus longtemps possible. */
.live .chap__copy {
  mix-blend-mode: difference;
  color: #fff;
  opacity: min(1, max(0, calc((0.5 - var(--ad)) * 5)));
  transform: translateY(calc(var(--d) * -56px));
  will-change: transform, opacity;
}
.live .chap__copy h1,
.live .chap__copy h2 {
  color: #fff;
}
.live .chap__copy h1 {
  font-size: calc(clamp(2.1rem, min(10.4vw, 6svh), 4.6rem) * var(--fit, 1));
  line-height: 1;
  font-weight: 700;
}
.live .chap__copy h2 {
  font-size: calc(clamp(1.7rem, min(8vw, 5svh), 3.3rem) * var(--fit, 1));
  line-height: 1.04;
  font-weight: 700;
}
/* En haut de page, le texte est posé DEVANT les plans au trait et les chiffres géants : en « différence », leurs traits se verraient à
   travers les lettres. La différence ne revient que lorsque le disque clair arrive sur le texte (data-iris, posé par main.js). Les
   couleurs sont celles qu'elle donnait sur la nuit : à l'œil, rien d'autre ne change. */
.live .story__pin:not([data-iris]) .chap--hero .chap__copy {
  mix-blend-mode: normal;
}
.live .story__pin:not([data-iris]) .chap--hero .chap__copy h1 {
  color: #fff3df;
}
.live .story__pin:not([data-iris]) .chap--hero .chap__copy p {
  color: rgb(255 243 223 / 72%);
}
@media (min-width: 900px) {
  .live .chap__copy h1 {
    font-size: clamp(2.6rem, min(5.6vw, 8svh), 5rem);
  }
  .live .chap__copy h2 {
    font-size: clamp(2rem, min(3.6vw, 6svh), 3.6rem);
  }
}
.live .chap__copy p {
  margin-top: 12px;
  color: rgb(255 255 255 / 72%);
  font-size: calc(clamp(0.94rem, 2.1vw, 1.12rem) * var(--fit, 1));
  line-height: 1.42;
}
.live .chap__copy .eyebrow {
  margin: 0 0 12px;
  color: rgb(255 255 255 / 72%);
  font-size: 0.8rem;
}
.live .chap--statement .chap__copy h2 {
  color: rgb(255 255 255 / 55%);
}
.live .chap__actions {
  margin-top: 16px;
  opacity: min(1, max(0, calc((0.5 - var(--ad)) * 5)));
  transform: translateY(calc(var(--d) * -56px));
}
.live .chap[data-on] .chap__actions {
  pointer-events: auto;
}
.live .cta {
  justify-content: flex-start;
}
.live .chap .btn {
  min-height: 48px;
  padding: 0 24px;
  font-size: 1.05rem;
}
.live .chap .note {
  display: none;
  margin-top: 12px;
}
@media (max-width: 899px) {
  .live .bar {
    margin-bottom: 12px;
  }
  .live .chap__copy p {
    margin-top: 8px;
    line-height: 1.34;
  }
  .live .chap__copy .eyebrow {
    margin-bottom: 8px;
  }
}
@media (min-width: 900px) {
  .live .chap .note {
    display: block;
  }
}
@media (min-width: 900px) and (max-height: 760px) {
  .live .chap .note {
    display: none;
  }
}

/* La barre des chapitres, au-dessus du titre. */
.live .bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.live .bar button {
  position: relative;
  flex: 1;
  max-width: 72px;
  /* Le trait fait 3 px, mais le doigt a 44 px de haut pour le toucher : la marge négative garde à la barre sa place (20 px) dans la page. */
  height: 44px;
  margin-block: -12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.live .bar button::before,
.live .bar button::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  height: 3px;
  border-radius: 2px;
  background: rgb(255 255 255 / 22%);
}
.live .bar button::after {
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(min(1, max(0, calc(var(--fs) - var(--k)))));
}
.live .bar button:focus-visible {
  outline-offset: 2px;
}
.live .chap[data-on] .bar button {
  pointer-events: auto;
}

/* Le téléphone : un seul appareil, dont l'écran change avec le chapitre. */
.live .chap__phone {
  display: none;
}
.live .device {
  --ph: var(--sph);
  display: block;
  position: absolute;
  left: calc(var(--cx) - var(--pw) / 2);
  top: calc(var(--cy) - var(--ph) / 2);
  z-index: 2;
}
@media (max-width: 899px) {
  /* Sur téléphone, le héro laisse le bas de l'appareil sortir de l'écran, puis il remonte. */
  .live .device {
    transform: translateY(calc(var(--hv) * 9%));
  }
}
.device__screens {
  position: relative;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: calc(var(--pw) * 0.112);
  background: #1d1a4d;
}
.device__screens img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.device__screens img:first-child {
  opacity: 1;
}

/* Les cotes : des repères de dessin technique autour de l'appareil. */
.live .cotes {
  --ph: var(--sph);
  --pw: calc(var(--ph) * 0.4625);
  display: block;
  position: absolute;
  z-index: 3;
  left: calc(var(--cx) - var(--pw) / 2);
  top: calc(var(--cy) - var(--ph) / 2);
  width: var(--pw);
  height: var(--ph);
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}
@media (max-width: 899px) {
  .live .cotes {
    transform: translateY(calc(var(--hv) * 9%));
  }
}
.cote {
  position: absolute;
}
.cote--t {
  left: 0;
  right: 0;
  top: -16px;
  height: 9px;
  border-inline: 1px solid rgb(255 255 255 / 34%);
}
.cote--t::before,
.cote--r::before {
  content: '';
  position: absolute;
  background: rgb(255 255 255 / 34%);
}
.cote--t::before {
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
}
.cote--r {
  display: none;
  top: 0;
  bottom: 0;
  right: -28px;
  width: 9px;
  border-block: 1px solid rgb(255 255 255 / 34%);
}
.cote--r::before {
  top: 0;
  bottom: 0;
  left: 4px;
  width: 1px;
}
@media (min-width: 900px) {
  .cote--t {
    top: -20px;
  }
  .cote--r {
    display: block;
  }
  .cotes::after {
    content: '+';
    position: absolute;
    left: -20px;
    bottom: -22px;
    color: rgb(255 255 255 / 50%);
    font-size: 14px;
    font-weight: 300;
    line-height: 1;
  }
}
.cote__lab {
  --d: calc(var(--fs) - var(--i, 0));
  --ad: max(var(--d), calc(var(--d) * -1));
  position: absolute;
  color: rgb(255 255 255 / 62%);
  font-size: 12.5px;
  white-space: nowrap;
  opacity: min(1, max(0, calc((0.5 - var(--ad)) * 5)));
}
.cote--t .cote__lab {
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
}
.cote--r .cote__lab {
  left: calc(100% + 6px);
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
}

/* Les chiffres géants, dessinés en creux derrière l'appareil, qui défilent comme un compteur. */
.live .odo {
  display: block;
  position: absolute;
  z-index: 0; /* sous le texte, qui vient après lui dans la page */
  left: var(--cx);
  top: calc(var(--cy) + 5svh);
  font-family: var(--font-display);
  font-size: var(--odo);
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgb(255 255 255 / 22%);
  mix-blend-mode: difference;
  pointer-events: none;
  user-select: none;
}
@media (min-width: 900px) {
  .live .odo {
    -webkit-text-stroke-width: 2.5px;
  }
}
.odo__slot {
  position: absolute;
  top: -0.5em;
  left: calc((var(--j) - 1) * 0.66em - 0.4em);
  width: 0.8em;
  height: 1em;
  overflow: hidden;
  text-align: center;
}
.odo__col {
  display: block;
  transform: translateY(calc(var(--v, 0) * -1em));
  will-change: transform;
}
.odo__col b {
  display: block;
  height: 1em;
  font-weight: inherit;
  line-height: 1em;
}

/* Sur téléphone : pas de chiffres géants (coupés par les bords de l'écran, on ne les lit pas) : l'appareil gagne la place, un peu plus grand ;
   et pas de second bouton « Jouer » dans le héro, celui du bandeau suffit (il reste, lui, sur tous les écrans). */
@media (max-width: 899px) {
  .live .odo {
    display: none;
  }
  .chap--hero .btn--play {
    display: none;
  }
}

/* Arrivée : le texte se lève, l'appareil monte (une seule fois, au chargement). */
@media (prefers-reduced-motion: no-preference) {
  .live .chap--hero .chap__copy > *,
  .live .chap--hero .chap__actions > * {
    animation: lift 0.9s var(--ease) both;
  }
  .live .chap--hero .chap__copy > :nth-child(2) {
    animation-delay: 0.08s;
  }
  .live .chap--hero .chap__copy > :nth-child(3) {
    animation-delay: 0.16s;
  }
  .live .chap--hero .chap__actions > :nth-child(1) {
    animation-delay: 0.24s;
  }
  .live .chap--hero .chap__actions > :nth-child(2) {
    animation-delay: 0.32s;
  }
  .live .device .phone__body {
    animation: rise 1.3s var(--ease) 0.2s both;
  }
  .live .odo {
    animation: fade 1.8s ease-out 0.1s both;
  }
}
@keyframes rise {
  from {
    transform: translateY(40%) rotate(3deg);
    opacity: 0;
  }
}
@keyframes lift {
  from {
    transform: translateY(26px);
    opacity: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pulse {
  50% {
    transform: scale(1.04);
  }
}

/* Les objets qui flottent (appel final). */
.float {
  position: absolute;
  z-index: 0;
  width: clamp(44px, 9vw, 96px);
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 12px 14px rgb(0 0 0 / 35%));
  animation: bobt 6s ease-in-out infinite alternate;
}
.float--a {
  left: 4%;
  top: 22%;
  rotate: -14deg;
  width: clamp(54px, 10vw, 118px);
}
.float--b {
  right: 6%;
  top: 18%;
  rotate: 12deg;
  animation-delay: -2s;
}
.float--d {
  right: 4%;
  bottom: 24%;
  rotate: -10deg;
  width: clamp(36px, 7vw, 78px);
  animation-delay: -1s;
}
.float--f {
  right: 12%;
  bottom: 40%;
  rotate: 18deg;
  width: clamp(44px, 7vw, 92px);
  animation-delay: -5s;
}
@keyframes bobt {
  from {
    transform: translateY(-9px) rotate(-3deg);
  }
  to {
    transform: translateY(11px) rotate(3deg);
  }
}

/* ---------- 2. La phrase de passage ---------- */
.bridge {
  padding: clamp(70px, 12vw, 130px) 0 clamp(60px, 9vw, 100px);
}
.bridge__box {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}
.bridge__text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}
.bridge__text strong {
  font-weight: 600;
}
.live .bridge__text .w {
  color: rgb(61 17 80 / 20%);
  transition: color 0.35s;
}
.live .bridge__text .w.on {
  color: var(--paper-ink);
}

/* ---------- 3. La galerie : une bande de grandes diapositives ---------- */
.devices {
  --slide: 86vw;
  --stage: min(38svh, 340px);
  background: var(--paper);
}
@media (min-width: 900px) {
  .devices {
    --slide: min(68vw, 960px);
    --stage: min(42svh, 480px);
  }
}
.devices__pin {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(40px, 6vw, 80px) 0 clamp(60px, 8vw, 100px);
}
.devices__head {
  max-width: 780px;
  margin-inline: auto;
  padding-inline: 20px;
  text-align: center;
}
.devices__head h2 {
  font-weight: 700;
  letter-spacing: -0.03em;
}
.devices__head .sub {
  margin-top: 10px;
}
.devices__view {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.strip {
  display: flex;
  width: max-content;
  padding-left: calc((100vw - var(--slide)) / 2);
  padding-right: calc((100vw - var(--slide)) / 2);
}
.strip[hidden] {
  display: none;
}
.strip.is-in {
  animation: fade 0.4s ease-out;
}
.slide {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: var(--slide);
  padding-inline: 2vw;
  scroll-snap-align: center;
}
.slide__stage {
  position: relative;
  width: 100%;
  height: var(--stage);
}
.slide__stage .phone {
  --ph: var(--stage);
  position: absolute;
  top: 50%;
  left: 50%;
}
.slide__stage .phone--m {
  z-index: 2;
  transform: translate(-50%, -50%);
}
.slide__stage .phone--l,
.slide__stage .phone--r {
  --ph: calc(var(--stage) * 0.8);
}
.slide__stage .phone--l {
  transform: translate(calc(-50% - var(--stage) * 0.3), -50%) rotate(-3deg);
}
.slide__stage .phone--r {
  transform: translate(calc(-50% + var(--stage) * 0.3), -50%) rotate(3deg);
}
@media (min-width: 900px) {
  .slide__stage .phone--l {
    transform: translate(calc(-50% - var(--stage) * 0.36), -50%) rotate(-3deg);
  }
  .slide__stage .phone--r {
    transform: translate(calc(-50% + var(--stage) * 0.36), -50%) rotate(3deg);
  }
}
.slide .phone__body {
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 14%),
    0 0 0 calc(var(--pw) * 0.008) #07061c,
    0 30px 50px rgb(74 30 150 / 28%),
    0 8px 18px rgb(74 30 150 / 18%);
}
.slide__cap {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.slide__cap h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.slide__cap p {
  color: var(--paper-muted);
  font-size: 0.95rem;
  line-height: 1.42;
  text-wrap: balance;
}
@media (min-width: 900px) {
  .slide__cap h3 {
    font-size: 1.5rem;
  }
  .slide__cap p {
    font-size: 1.06rem;
  }
}
/* La dernière diapositive : du texte et un appareil. */
.slide--text {
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 28px;
  padding-inline: 4vw;
}
.slide--text .phone {
  --ph: var(--stage);
  justify-self: center;
}
.slide__copy h3 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.nots {
  margin-top: 18px;
}
.nots li {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid rgb(61 17 80 / 12%);
}
.nots li:last-child {
  border-bottom: 1px solid rgb(61 17 80 / 12%);
}
.nots strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.nots span {
  color: var(--paper-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.slide__copy .small {
  margin-top: 12px;
  color: var(--paper-muted);
  font-size: 0.9rem;
}
@media (min-width: 900px) {
  .slide--text {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
  }
  .slide__copy h3 {
    font-size: 3.5rem;
  }
  .nots strong {
    font-size: 1.3rem;
  }
  .nots span {
    font-size: 1.02rem;
  }
}
/* Le sélecteur d'ensemble. */
.devices__tabs {
  display: inline-grid;
  grid-auto-flow: column;
  align-self: center;
  padding: 3px;
  border-radius: 999px;
  background: #f7e3c4;
}
.devices__tabs button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--paper-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.3s var(--ease),
    color 0.3s,
    box-shadow 0.3s;
}
.devices__tabs button:hover {
  color: var(--paper-ink);
}
.devices__tabs button[aria-selected='true'] {
  background: #fff;
  color: var(--paper-ink);
  box-shadow: 0 2px 8px rgb(74 30 150 / 18%);
}

/* La bande épinglée : le défilement vertical la fait avancer à l'horizontale. */
.live .devices {
  height: calc(100vh + var(--dy, 0px));
  height: calc(100svh + var(--dy, 0px));
}
.live .devices__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--top-h) + 4px) 0 28px;
  overflow: hidden;
}
@media (min-width: 900px) {
  .live .devices__pin {
    gap: 22px;
  }
}
.live .devices__head h2 {
  font-size: clamp(1.6rem, min(6.4vw, 5svh), 3rem);
}
.live .devices__head .sub {
  margin-top: 6px;
  font-size: clamp(0.88rem, 1.9vw, 1.1rem);
}
.live .devices__view {
  overflow: hidden;
}
.live .strip {
  --d: calc(var(--q, 0) - var(--k, 0));
  transform: translateX(calc(var(--p, 0) * var(--dx, 0px) * -1));
  will-change: transform;
}
.live .slide {
  --d: calc(var(--q, 0) - var(--k, 0));
  --ad: max(var(--d), calc(var(--d) * -1));
}
.live .slide__stage {
  scale: calc(1 - min(1, var(--ad)) * 0.1);
  opacity: min(1, max(0.45, calc(1 - (var(--ad) - 0.6) * 1.128)));
}
.live .slide__cap {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}
.live .slide.is-active .slide__cap {
  opacity: 1;
  visibility: visible;
}
.live .slide--text {
  scale: calc(1 - min(1, var(--ad)) * 0.06);
  opacity: min(1, max(0.45, calc(1 - (var(--ad) - 0.6) * 1.128)));
}
@media (max-width: 899px) {
  .live .slide--text .phone {
    display: none;
  }
  /* La diapositive de texte se resserre avec la hauteur de l'écran : sa dernière ligne reste visible. */
  .live .slide--text {
    gap: 0;
  }
  .live .slide__copy h3 {
    font-size: clamp(1.4rem, min(8vw, 4.4svh), 3.5rem);
  }
  .live .nots {
    margin-top: min(18px, 1.4svh);
  }
  .live .nots li {
    padding-block: min(12px, 0.9svh);
  }
  .live .nots strong {
    font-size: clamp(0.95rem, 2.3svh, 1.15rem);
  }
  .live .nots span {
    font-size: clamp(0.8rem, 1.95svh, 0.95rem);
    line-height: 1.35;
  }
  .live .slide__copy .small {
    margin-top: min(12px, 1.2svh);
    font-size: clamp(0.8rem, 1.85svh, 0.9rem);
  }
}
/* Écran bas : le sous-titre de la galerie laisse sa place aux diapositives. */
@media (max-height: 640px) {
  .live .devices__head .sub {
    display: none;
  }
}
@media (min-width: 900px) and (max-height: 780px) {
  .live .slide__copy h3 {
    font-size: clamp(1.8rem, 5.4svh, 3.5rem);
  }
  .live .nots {
    margin-top: 1.4svh;
  }
  .live .nots li {
    padding-block: 0.9svh;
  }
  .live .nots strong {
    font-size: clamp(1rem, 2.4svh, 1.3rem);
  }
  .live .nots span {
    font-size: clamp(0.84rem, 2.1svh, 1.02rem);
    line-height: 1.3;
  }
  .live .slide__copy .small {
    margin-top: 1svh;
    font-size: clamp(0.8rem, 1.9svh, 0.9rem);
  }
}

/* ---------- 5. Les chiffres ---------- */
.stats {
  padding: clamp(56px, 8vw, 96px) 0;
}
.stats__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 16px;
  text-align: center;
}
.stats__list strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 5.6rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #9a55f5, #4b22b0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stats__list span {
  display: block;
  margin-top: 6px;
  color: var(--paper-muted);
  font-weight: 800;
  font-size: 1.05rem;
}
@media (min-width: 760px) {
  .stats__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- 6 et 7. Les cartes ---------- */
.modes,
.more {
  padding: clamp(60px, 9vw, 110px) 0;
}
.modes {
  padding-top: 0;
}
.cards {
  --gap: 18px;
  display: grid;
  gap: var(--gap);
  perspective: 1000px;
}
/* Deux listes de cartes à la suite (les mondes de l'Espace, puis ceux du Temps) : entre elles, le même écart qu'entre deux
   rangées d'une même liste. Sans cela, les deux rangées se touchent. */
.cards + .cards {
  margin-top: var(--gap);
}
@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .cards--5 {
    grid-template-columns: repeat(5, 1fr);
  }
}
.card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 26px 24px 28px;
  border-radius: 28px;
  background: #fff;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 80%) inset,
    0 18px 40px rgb(74 30 150 / 14%);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition:
    transform 0.25s ease-out,
    box-shadow 0.3s;
}
.card img {
  width: auto;
  height: 76px;
  margin-bottom: 6px;
  filter: drop-shadow(0 8px 8px rgb(74 30 150 / 25%));
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.15;
}
.card p {
  color: var(--paper-muted);
  font-size: 1rem;
  line-height: 1.5;
}
/* Les dix réussites des Origines : un bandeau sous les cinq mondes, leurs badges alignés. */
.feats {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 26px clamp(16px, 4vw, 40px) 28px;
  border-radius: 28px;
  background: #fff;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 80%) inset,
    0 18px 40px rgb(74 30 150 / 14%);
  text-align: center;
}
.feats h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.15;
}
.feats p {
  max-width: 62ch;
  color: var(--paper-muted);
  font-size: 1rem;
  line-height: 1.5;
}
.feats__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px 10px;
  width: 100%;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.feats__list li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  color: var(--paper-ink);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}
.feats__list img {
  width: auto;
  height: 60px;
  filter: drop-shadow(0 6px 6px rgb(74 30 150 / 22%));
}
@media (min-width: 900px) {
  .feats__list {
    grid-template-columns: repeat(5, 1fr);
  }
}
/* Un second titre dans la même section : il prend ses distances avec les cartes du dessus. */
.head--next {
  margin-top: clamp(56px, 9vw, 104px);
}
/* Les dix mondes : des cartes plus serrées, l'emblème du monde en tête, son gardien en pied. */
.card--world {
  grid-template-rows: auto auto auto 1fr auto;
  gap: 6px;
  padding: 22px 18px 18px;
}
.card--world h3 {
  font-size: 1.14rem;
}
.card--world p {
  font-size: 0.94rem;
  line-height: 1.45;
}
.card .card__range {
  color: var(--violet);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card .card__guard {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgb(74 30 150 / 12%);
  color: var(--paper-ink);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
}
/* Sur téléphone, l'emblème passe à gauche du texte : dix cartes à la suite restent courtes. */
@media (max-width: 599px) {
  .card--world {
    grid-template-columns: 68px 1fr;
    grid-template-rows: none;
    column-gap: 14px;
    padding: 18px 18px 16px;
  }
  .card--world > img {
    grid-area: 1 / 1 / 4 / 2;
    width: 68px;
    height: auto;
    margin: 0;
  }
  .card--world .card__guard {
    grid-column: 1 / -1;
  }
}
.card .card__guard em {
  display: block;
  color: var(--paper-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card .card__guard img {
  flex: none;
  height: 44px;
  margin: 0;
  filter: drop-shadow(0 4px 4px rgb(74 30 150 / 22%));
}
.cards--night .card {
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 4%));
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgb(0 0 0 / 25%);
}
.cards--night .card h3 {
  color: #fff;
}
.cards--night .card p {
  color: var(--muted);
}
.more {
  background:
    radial-gradient(70% 40% at 50% 0%, rgb(120 80 255 / 24%), transparent 70%),
    var(--night);
}

/* ---------- 8. La mascotte ---------- */
.mascot {
  padding: clamp(60px, 9vw, 110px) 0;
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
}
.mascot__grid {
  display: grid;
  gap: 32px;
  align-items: center;
}
.mascot__art {
  display: grid;
  place-items: center;
}
.mascot__art img {
  width: min(100%, 440px);
  filter: drop-shadow(0 24px 24px rgb(74 30 150 / 28%));
}
.faces {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.faces li {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--paper-muted);
  text-align: center;
  line-height: 1.2;
}
/* Le renard est plus grand que sa pastille et posé devant : ses oreilles
   (et ses étoiles ou ses cœurs) en dépassent, rien n'est rogné. */
.faces__pic {
  position: relative;
  width: 100px;
  height: 108px;
}
.faces__pic::before {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 18px rgb(74 30 150 / 18%);
  transition: transform 0.3s var(--ease);
}
.faces img {
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgb(74 30 150 / 30%));
  transform-origin: 50% 100%;
  transition: transform 0.3s var(--ease);
}
.faces li:hover img {
  transform: translateY(-8px) rotate(-4deg) scale(1.06);
}
.faces li:hover .faces__pic::before {
  transform: scale(1.04);
}
@media (min-width: 860px) {
  .mascot__grid {
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
  }
}

/* ---------- 9. Installer ---------- */
.install {
  padding: clamp(70px, 10vw, 120px) 0;
  background:
    radial-gradient(60% 40% at 50% 100%, rgb(120 80 255 / 26%), transparent 70%),
    var(--night);
}
.install__grid {
  display: grid;
  gap: 28px;
  align-items: start;
  max-width: 980px;
  margin-inline: auto;
}
@media (min-width: 860px) {
  .install__grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
  }
}
.install__steps .os {
  margin-top: 6px;
}
.qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 24px;
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 4%));
  border: 1px solid rgb(255 197 51 / 45%);
}
.qr h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.qr__img {
  width: 190px;
  height: 190px;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 35%);
}
.qr p {
  color: var(--muted);
}
/* Sur un téléphone, le code QR n'a pas de sens : on propose d'envoyer le jeu à un ami. */
.qr__mob {
  display: none;
}
@media (max-width: 719px) {
  .qr__desk {
    display: none;
  }
  .qr__mob {
    display: inline;
  }
  .qr p.qr__mob {
    display: block;
  }
}

/* ---------- 10. Questions ---------- */
.faqs {
  padding: clamp(60px, 9vw, 110px) 0;
}
.faq--ink details {
  background: #fff;
  border-color: rgb(61 17 80 / 10%);
  box-shadow: 0 8px 24px rgb(74 30 150 / 8%);
}
.faq--ink details[open] {
  border-color: rgb(138 92 255 / 50%);
}
.faq--ink summary::after {
  border-color: #6230cf;
}
.faq--ink p {
  color: var(--paper-muted);
}

/* ---------- 11. Appel final ---------- */
.final {
  overflow: hidden;
  padding: clamp(90px, 13vw, 160px) 0 clamp(80px, 11vw, 140px);
  background:
    radial-gradient(70% 60% at 50% 100%, rgb(120 80 255 / 45%), transparent 70%),
    linear-gradient(180deg, var(--night), var(--night-2));
}
.final__box {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.final__box h2 {
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  color: #fff;
}
.final__box p {
  margin-bottom: 14px;
  color: var(--cream);
  font-size: 1.15rem;
}
.final__mascot {
  width: min(56%, 230px);
  filter: drop-shadow(0 18px 22px rgb(0 0 0 / 45%));
}
.final .float {
  display: block;
}

/* ---------- Apparitions au défilement ---------- */
.live [data-reveal] {
  opacity: 0;
  translate: 0 40px;
  scale: 0.97;
  transition:
    opacity 0.9s var(--ease),
    translate 0.9s var(--ease),
    scale 0.9s var(--ease),
    transform 0.25s ease-out,
    box-shadow 0.3s;
  transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0s, 0s;
}
.live [data-reveal].in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}
.live .mascot__art img {
  will-change: translate;
}

/* ---------- Écrans larges ---------- */
@media (hover: hover) and (pointer: fine) {
  .live .card:hover {
    box-shadow: 0 30px 60px rgb(74 30 150 / 24%);
  }
  .live .cards--night .card:hover {
    box-shadow: 0 30px 60px rgb(0 0 0 / 40%);
  }
}

/* ---------- Réduire les animations ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
