/* Page « Coming soon ». Les couleurs, la police et les fonds viennent du thème (themes/). */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-text);
  color: var(--color-text);
  background-color: var(--color-background);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

img {
  display: block;
}

/* Téléphone : tout s'empile, du titre aux boutons des réseaux. */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "scene"
    "content";
  justify-items: center;
  min-height: 100dvh;
  padding: 58px 16px 28px;
}

/* Sans ce minimum à 0, les grandes images forcent la colonne à dépasser l'écran. */
.title,
.scene,
.content {
  min-width: 0;
  max-width: 100%;
}

.title {
  grid-area: title;
  position: relative;
  width: min(88%, 640px);
  margin: 0;
  /* Trois ombres serrées empilées dessinent le contour néon, la large fait le halo.
     Le titre a sa propre couleur de néon (--color-neon), plus électrique que l'accent. */
  filter:
    drop-shadow(0 0 2px var(--color-neon))
    drop-shadow(0 0 2px var(--color-neon))
    drop-shadow(0 0 2px var(--color-neon))
    drop-shadow(0 0 24px var(--color-neon));
}

.title img {
  width: 100%;
}

/* Une étoile à 4 branches autour du titre. Sa place et sa taille viennent du HTML (--x, --y, --size). */

.sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  pointer-events: none;
  filter:
    drop-shadow(0 0 3px var(--color-accent))
    drop-shadow(0 0 8px var(--color-accent));
}

/* La forme est découpée sur un enfant, sinon le découpage couperait aussi le halo. */
.sparkle::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--color-text);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.scene {
  grid-area: scene;
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
}

.scene-tap,
.scene-zumi {
  position: absolute;
  bottom: 0;
  height: auto;
}

/* Chaque capitaine et son calque de lueur partagent la même règle de taille : ils restent superposés. */
.scene-tap,
.scene-glow-tap {
  left: 0;
  width: 56%;
}

.scene-zumi,
.scene-glow-zumi {
  right: 0;
  width: 58%;
}

/* Deux ombres superposées : une serrée et vive, une large et douce, pour un vrai halo.
   Couleurs du thème telles quelles : Safari ignore un drop-shadow dont la couleur est calculée. */
.scene-tap {
  filter:
    drop-shadow(0 0 8px var(--color-glow-tap))
    drop-shadow(0 0 36px var(--color-glow-tap));
}

.scene-zumi {
  filter:
    drop-shadow(0 0 8px var(--color-glow-zumi))
    drop-shadow(0 0 36px var(--color-glow-zumi));
}

.scene-bolt {
  position: absolute;
  bottom: -8%;
  left: 49%;
  width: 10%;
  height: auto;
  transform: translateX(-50%);
  z-index: 2;
  filter:
    drop-shadow(0 0 4px var(--color-accent))
    drop-shadow(0 0 28px var(--color-accent));
}

.content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 3;
}

/* Le bandeau : le cadre, le mot COMING SOON posé dedans, et le liseré violet lumineux dessous. */

.banner {
  position: relative;
  width: min(100%, 560px);
  margin-top: -10%;
}

.banner-frame {
  width: 100%;
  filter: drop-shadow(0 6px 12px var(--color-background));
}

/* Le mot est posé deux fois au même endroit : derrière, une copie qui ne sert qu'à porter
   la lueur violette (c'est elle qui clignote) ; devant, le mot avec son ombre de relief. */
.banner-word,
.banner-glow {
  position: absolute;
  top: 22%;
  left: 50%;
  width: 70%;
  transform: translateX(-50%);
}

.banner-word {
  filter: drop-shadow(0 4px 2px var(--color-shadow));
}

.banner-glow {
  filter: drop-shadow(0 0 18px var(--color-accent));
}

.banner-line {
  position: absolute;
  top: 74%;
  left: 50%;
  width: 58%;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background-color: var(--color-accent);
  box-shadow:
    0 0 6px var(--color-accent),
    0 0 16px var(--color-accent);
}

.tagline,
.stores,
.follow {
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 8px var(--color-background);
}

.tagline {
  margin-top: 18px;
  font-size: clamp(1.5rem, 5.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  /* Les fiches de langue coupent l'accroche avec un \n : on le respecte. */
  white-space: pre-line;
}

.stores {
  margin-top: 10px;
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  color: var(--color-text-soft);
}

.follow {
  margin-top: 22px;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 700;
}

.networks {
  display: flex;
  gap: clamp(12px, 3vw, 24px);
  margin-top: 12px;
}

.network {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(60px, 16vw, 88px);
  aspect-ratio: 1;
  background-image: url("images/rond-reseau.webp");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 10px var(--color-accent));
}

.network img {
  width: 44%;
}

.language {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--color-text-soft);
  border-radius: 999px;
  background-color: var(--color-card);
  cursor: pointer;
}

.language-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.language-choice img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.language-choice:hover {
  background-color: var(--color-background);
}

.language-flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.language-chevron {
  width: 8px;
  height: 8px;
  margin-bottom: 4px;
  border-right: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  transform: rotate(45deg);
}

.language-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--color-text-soft);
  border-radius: 14px;
  background-color: var(--color-card);
}

.language.is-open .language-menu {
  display: block;
}


/* Ordinateur : Tap, Zumi et la Station à gauche ; titre, bandeau, textes et boutons à droite. */

@media (min-width: 900px) {
  .language {
    left: 16px;
    right: auto;
  }

  .language-menu { left: 0; right: auto; }

  .page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas:
      "scene ."
      "scene title"
      "scene content"
      "scene .";
    column-gap: 2vw;
    padding: 0 4vw;
  }

  .title {
    width: min(100%, 680px);
  }

  .scene {
    height: 100%;
    aspect-ratio: auto;
  }

  /* Tap, Zumi et l'éclair grandissent ensemble, sans dépasser la hauteur de l'écran. */
  .scene-tap,
  .scene-glow-tap {
    left: 0;
    width: min(54%, 55vh);
  }

  .scene-zumi,
  .scene-glow-zumi {
    right: 0;
    width: min(56%, 59vh);
  }

  .scene-bolt {
    bottom: 0;
    width: min(10%, 10.2vh);
  }

  .banner {
    width: min(100%, 680px);
    margin-top: 12px;
  }

  .banner-line {
    height: 3px;
  }
}

/* Animations. Seulement transform et opacity, pour rester légères sur téléphone. */

/* 1. L'arrivée : le titre descend en fondu, puis Tap et Zumi glissent chacun de leur côté. */

@keyframes arrive-from-top {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes arrive-from-left {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes arrive-from-right {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* will-change garde ces éléments sur leur propre calque : sans ça, le navigateur
   redessine leurs lueurs à la fin de l'animation, et on voit un saut. */
/* Le titre arrive, puis flotte doucement de haut en bas (le flottement prend le relais à 0.8s). */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.title {
  animation:
    arrive-from-top 0.8s ease-out both,
    float 4s ease-in-out 0.8s infinite;
  will-change: transform;
}

.scene-tap {
  animation: arrive-from-left 0.8s ease-out 0.5s both;
  will-change: transform;
}

.scene-zumi {
  animation: arrive-from-right 0.8s ease-out 0.5s both;
  will-change: transform;
}

/* 2. L'éclair qui crépite de temps en temps : stable presque tout le cycle, puis deux brefs vacillements. */

@keyframes crackle {
  0%, 86%, 100% {
    opacity: 1;
  }
  88% {
    opacity: 0.5;
  }
  90% {
    opacity: 1;
  }
  93% {
    opacity: 0.65;
  }
  95% {
    opacity: 1;
  }
}

/* La lueur de COMING SOON grésille comme un néon défaillant : allumée presque tout le temps,
   avec deux salves de coupures très brèves. */
@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 24%, 55% {
    opacity: 0.1;
  }
}

.banner-glow {
  animation: neon-flicker 4.2s linear infinite;
  will-change: opacity;
}

/* L'éclair apparaît en fondu en même temps que Tap et Zumi, puis crépite. */
@keyframes appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.scene-bolt {
  animation:
    appear 0.8s ease-out 0.5s both,
    crackle 5s linear 1.3s infinite;
  will-change: opacity;
}

/* 3. Les boutons des réseaux : un anneau de lueur qui pulse derrière chacun, et le bouton qui s'enfonce. */

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.network {
  position: relative;
  transition: transform 0.1s;
}

/* L'anneau commence au bord du rond (12 px avant le bord du calque) et s'estompe vers l'extérieur. */
.network::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(
    circle closest-side,
    transparent calc(100% - 12px),
    var(--color-accent) calc(100% - 9px),
    transparent 100%
  );
  animation: pulse-glow 2.4s ease-in-out infinite;
}

/* Chaque bouton pulse avec un petit décalage, pour ne pas battre tous ensemble. */
.network:nth-child(2)::before {
  animation-delay: -0.6s;
}

.network:nth-child(3)::before {
  animation-delay: -1.2s;
}

.network:nth-child(4)::before {
  animation-delay: -1.8s;
}

.network:active {
  transform: scale(0.94);
}

/* 4. Les halos de Tap et Zumi respirent : un calque de lueur derrière chacun, dont seule la transparence varie.
   Les calques arrivent avec les capitaines, puis respirent en décalé. */

@keyframes breathe {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.scene-glow {
  position: absolute;
  bottom: 0;
  pointer-events: none;
}

.scene-glow-tap {
  aspect-ratio: 900 / 1296;
  background: radial-gradient(ellipse at 50% 55%, var(--color-glow-tap) 0%, transparent 75%);
  animation:
    arrive-from-left 0.8s ease-out 0.5s both,
    breathe 4s ease-in-out 1.3s infinite;
}

.scene-glow-zumi {
  aspect-ratio: 900 / 1218;
  background: radial-gradient(ellipse at 50% 55%, var(--color-glow-zumi) 0%, transparent 75%);
  animation:
    arrive-from-right 0.8s ease-out 0.5s both,
    breathe 4s ease-in-out 3.3s infinite;
}

/* Le visiteur a demandé « Réduire les animations » dans ses réglages : la page reste fixe. */

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