/* Deuxième page (maquette i5, puis retours de relecture) : planisphère fixe
   en fond. Sous son équateur, le texte du site et les trois catégories,
   posés là où la carte est vide. Aucun voile, aucun encart. Tout fond du
   jour à la nuit ensemble.

   La carte et le texte se calent sur la même grandeur, --eq : la hauteur de
   l'équateur à l'écran. Le texte commence toujours à la même distance sous
   la bande, quelle que soit la fenêtre.

     --u         un pas de la carte à l'écran (elle est dessinée sur 1440 x 900
                 et couvre toujours la fenêtre)
     --eq-carte  l'équateur si le haut de la carte touche le haut de la fenêtre
     --sous      la place qu'il faut au texte sous l'équateur : l'écart à la
                 bande, puis le bloc et le pied (450 px sur deux colonnes)
     --eq        l'équateur retenu : --eq-carte sur un écran assez haut ; sinon
                 la carte remonte pour laisser --sous au texte, sans jamais
                 perdre plus de 45 % de son hémisphère nord

   La hauteur vient de lvh et svh, pas de vh : sur un téléphone, rien ne
   bouge quand les barres du navigateur se replient. */

:root {
  --fade: 0.6s;
}
html,
body.carte {
  min-height: 100%;
}
body.carte {
  --u: max(100vw / 1440, 100vh / 900);
  --eq-carte: calc(var(--u) * 430);
  --sous: calc(var(--sous-bande) + 450px);
  --eq: clamp(max(150px, var(--eq-carte) * 0.55), calc(100svh - var(--sous)), var(--eq-carte));
  /* le bas de la bande, halo compris, descend à 46 pas sous l'équateur */
  --sous-bande: calc(var(--u) * 48 + 18px);
}
@supports (height: 100lvh) {
  body.carte {
    --u: max(100vw / 1440, 100lvh / 900);
  }
}

.bg--carte {
  z-index: -3;
  bottom: auto;
  height: 100vh;
  height: 100lvh;
}
.bg--carte svg {
  position: absolute;
  left: 50%;
  top: calc(var(--eq) - var(--eq-carte));
  width: calc(var(--u) * 1440);
  height: calc(var(--u) * 900);
  margin-left: calc(var(--u) * -720);
  overflow: visible;
}
/* la carte s'estompe sous la bande, là où le texte se pose sur elle */
.bg--carte::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent calc(var(--eq) + var(--u) * 30),
    color-mix(in srgb, var(--bg) 55%, transparent) calc(var(--eq) + var(--u) * 30 + 22vh),
    color-mix(in srgb, var(--bg) 72%, transparent) 100%
  );
  transition: background var(--fade);
  pointer-events: none;
}
.bg--carte svg * {
  transition:
    fill var(--fade),
    stroke var(--fade),
    opacity var(--fade);
}
.g-grat,
.g-eq {
  stroke: var(--ink);
}
.g-lands {
  fill: var(--ink);
}
.g-band {
  fill: var(--accent);
}

/* les villes : allumées la nuit seulement, elles scintillent */
.g-cities circle {
  fill: var(--accent);
  animation: ville 5s ease-in-out infinite;
}
@keyframes ville {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.95;
  }
}
:root[data-theme="light"] .g-cities {
  opacity: 0;
}

/* sous l'équateur : le texte du site à gauche, les trois catégories à sa
   droite. Le bloc part du haut, à distance fixe de la bande (jamais calé en
   bas : sa position ne dépend ni de la hauteur du texte ni de l'arrivée des
   polices). Le pied prend le bas de l'écran. La page ne défile que si
   l'écran est trop bas pour tout montrer. */
.sous-carte {
  box-sizing: border-box;
  min-height: 100svh;
  padding: calc(var(--eq) + var(--sous-bande)) var(--mx) clamp(18px, 3vh, 36px);
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(40px, 6vw, 110px);
  row-gap: 30px;
  align-items: start;
}
.cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  /* aligné sur le sous-titre du bloc de gauche, sous le nom du site */
  padding-top: clamp(52px, 5.6vw, 78px);
}
.cat h2 {
  font-family: var(--f-title);
  font-weight: var(--w-title);
  font-size: 21px;
  line-height: 1.2;
  margin: 0 0 6px;
}
.cat h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
/* la flèche du nom : elle avance d'un cran au survol */
.cat-fleche-lien {
  white-space: nowrap;
}
.cat-fleche {
  display: inline-block;
  width: 0.72em;
  height: 0.45em;
  margin-left: 0.18em;
  vertical-align: 0.12em;
  opacity: 0.55;
  transition:
    transform 0.2s ease,
    opacity 0.2s;
}
.cat h2 a:hover .cat-fleche,
.cat h2 a:focus-visible .cat-fleche {
  transform: translateX(4px);
  opacity: 1;
}
.cat h2 a:hover,
.cat h2 a:focus-visible {
  color: var(--accent);
}
.cat-ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.cat-genre {
  font-family: var(--f-label);
  font-weight: var(--w-label);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.cat-intro {
  font-size: 14px;
  line-height: 1.65;
  opacity: 0.8;
  margin: 0 0 14px;
}
/* le nombre de textes : une mention, pas un lien */
.cat-n {
  white-space: nowrap;
  font-family: var(--f-title);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  opacity: 0.6;
  margin: 0;
}
.sous-carte .pied {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: 6px;
}
/* poids et taille validés par le client sur i5 : inchangés */
.hero .wm {
  font-weight: 600;
  font-size: clamp(40px, 5vw, 62px);
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.hero .coords {
  font-family: var(--f-text);
  font-weight: var(--w-label);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  opacity: 0.62;
  margin: 0 0 18px;
}
.hero .lede {
  font-size: 15.5px;
  line-height: 1.7;
  opacity: 0.85;
  margin: 0 0 14px;
}
.hero .lede:last-of-type {
  margin-bottom: 20px;
}
/* le lien vers /contribuer, sous le texte du site */
.hero-contribuer {
  margin: 0;
  font-family: var(--f-text);
  font-weight: var(--w-label);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.hero-contribuer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.hero-contribuer a:hover {
  border-bottom-color: var(--accent);
}
.hero .wm .fr {
  opacity: 0.4;
  font-weight: 400;
}

/* sur une colonne le texte est long et la page défile : l'équateur se tient
   au tiers haut de l'écran */
@media (max-width: 1099px) {
  body.carte {
    --sous: 68svh;
  }
  .sous-carte {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
  }
  .cats {
    padding-top: 6px;
  }
}
@media (max-width: 719px) {
  .cats {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-cities circle {
    animation: none;
    opacity: 0.7;
  }
  .cat-fleche {
    transition: none;
  }
  .cat h2 a:hover .cat-fleche,
  .cat h2 a:focus-visible .cat-fleche {
    transform: none;
  }
}

.hero {
  max-width: 430px;
}
