/*!
 * MyKTAMap (c) 2026 Flavien VIDAL (alias KARMA)
 * https://myktamap.fr — Licence CC BY-NC-SA 4.0
 * Usage commercial interdit sans accord ecrit prealable.
 */
/* accueil.css — « la descente » de l'accueil du site (index.html, body.kta-page-accueil), chargée sur cette page
   seulement. Reprise de l'écran Bienvenue du community (css/bienvenue.css), préfixe kta-ac- : la page défile
   (fenêtre), pas un écran en surimpression ; l'en-tête du site reste au-dessus du héros.
   Toujours de nuit : jetons locaux --ac-*, jamais ceux du site.
   ⚠️ contrat : fil, tête de suivi et repères atteints sont pilotés par assets/accueil.js (classe kta-ac-js-fil sur
   .kta-ac). Sans elle, ou en mouvement réduit : état final statique (fil complet, ni tête ni flash, ville immobile).
   🩸 Le fil du puits est vide dès le premier rendu (html.js, posé dans <head>) pour ne pas clignoter ; une erreur
   du moteur pose kta-ac-final, qui le remplit. */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("accueil/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("accueil/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("accueil/montserrat-800.woff2") format("woff2"); }
@font-face { font-family: "Permanent Marker"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("accueil/permanent-marker-400.woff2") format("woff2"); }

/* Pleine largeur : le cadre commun des pages (1120 px, marges) ne s'applique pas à la descente. */
.kta-page-accueil { background: #0a0d18; }
.kta-page-accueil .kta-cadre.kta-sans-toc { max-width: none; padding: 0; }
.kta-page-accueil .kta-contenu { padding: 0; }
/* Le bouton 🚨 flotte en bas à droite : le pied garde de quoi rester lisible dessous. */
@media screen { .kta-page-accueil .kta-pied { padding-bottom: 80px; } }

.kta-ac {
  --ac-fond: #0a0d18; --ac-fond-haut: #0e1220; --ac-fond-nuit: #070912; --ac-surface: #1a1f2e;
  --ac-bord: #3a4560; --ac-galerie: #2a3348; --ac-texte: #e8eaf0; --ac-texte-2: #c8d0e0; --ac-texte-3: #98a1b3;
  --ac-or: #f4c542; --ac-sur-or: #14110a; --ac-bleu: #8cb4ff;
  /* Hauteur de l'en-tête du site au-dessus du héros (collant au PC, dans le flux au téléphone) : estimation, la
     ville se cale en bas du premier écran à quelques pixels près. */
  --h-entete-site: 118px;
  --h-ville: clamp(200px, calc(100svh - 620px), 320px);
  --marge-galerie: max(24px, min(66px, calc(66px - (100vw - 1180px) / 2)));
  position: relative; overflow: hidden; background: var(--ac-fond); color: var(--ac-texte);
  font-family: Montserrat, system-ui, sans-serif;
}
.kta-ac a { color: var(--ac-bleu); }
.kta-ac a:focus-visible { outline: 3px solid var(--ac-or); outline-offset: 3px; }
.kta-ac-feutre { font-family: "Permanent Marker", cursive; color: var(--ac-or); font-weight: 400; }

/* ── Héros : accroche, lune, la ville en surface, le puits ── */
.kta-ac-entete { position: relative; background: var(--ac-fond-haut); min-height: calc(100svh - var(--h-entete-site));
  display: flex; flex-direction: column; }
.kta-ac-entete:focus { outline: none; }
.kta-ac-hero { position: relative; padding: 20px 16px 0; }
.kta-ac-hero .kta-alerte { margin: 0 0 16px; max-width: 820px; }
.kta-ac .kta-heros { position: relative; z-index: 1; padding: 0 0 8px; max-width: 820px; }
.kta-ac .kta-surtitre { font: 600 13px Montserrat, system-ui, sans-serif; letter-spacing: 0.14em; color: var(--ac-or); }
.kta-ac .kta-heros h1 { margin: 6px 0 12px; font-size: 40px; line-height: 1.1; font-weight: 800; color: var(--ac-texte); }
.kta-ac .kta-chapo { font-size: 16px; line-height: 1.6; color: var(--ac-texte-2); }
.kta-ac .kta-pourqui { color: var(--ac-texte-2); }
.kta-ac .kta-note { color: var(--ac-texte-3); }
/* Boutons du héros : pilules de la page de présentation, cibles de 44 px (48 au PC). */
.kta-ac .kta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.kta-ac .kta-bouton-lien { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 16px; font-size: 15px; border-radius: 999px; background: var(--ac-or); color: var(--ac-sur-or); font-weight: 800;
  text-decoration: none; }
.kta-ac .kta-bouton-lien.kta-secondaire { background: transparent; color: var(--ac-or); border: 2px solid var(--ac-or);
  font-weight: 600; }
.kta-ac .kta-bouton-lien:focus-visible { outline-color: var(--ac-texte); }
@media (hover: hover) {
  .kta-ac .kta-bouton-lien:hover { background: #f7d36a; }
  .kta-ac .kta-bouton-lien.kta-secondaire:hover { background: rgba(244, 197, 66, 0.1); }
}
/* Téléphone : les boutons secondaires deviennent des pastilles compactes (style « Licence pro » de l'écran
   Bienvenue) pour que la ville apparaisse au premier écran ; cible tactile gardée à 44 px de haut. */
@media (max-width: 899px) {
  .kta-ac .kta-actions { gap: 8px; }
  .kta-ac .kta-bouton-lien.kta-secondaire { padding: 0 14px; font-size: 14px; border: 1px solid rgba(244, 197, 66, 0.35);
    background: rgba(244, 197, 66, 0.08); }
  .kta-ac .kta-heros .kta-note { font-size: 13px; }
}

.kta-ac-ville { display: block; width: 100%; height: var(--h-ville); margin-top: auto; flex: none; }
/* 🩸 Téléphone : le halo de la lune de la scène dépasse le haut du dessin ; coupé net, il dessinait une démarcation.
   La scène y est calée sur la hauteur (rien d'autre ne déborde) ; au-delà de 900 px, la lune est hors scène. */
@media (max-width: 899px) { .kta-ac-ville { overflow: visible; } }
.kta-ac-lune-haut { display: none; overflow: visible; }
.kta-ac-reseau .kta-ac-masque, .kta-ac-lampes .kta-ac-masque { visibility: hidden; }

/* Puits : la galerie part de la rue, à 270/630 de la hauteur de la ville au-dessus du bas du héros (scène de
   6000 × 630 rognée en largeur, calée en bas). */
.kta-ac-entree { position: absolute; left: 10px; bottom: 0; width: 44px; height: calc(var(--h-ville) * 270 / 630);
  z-index: 3; pointer-events: none; }
.kta-ac-entree-galerie { position: absolute; left: 17px; top: 0; bottom: 0; width: 10px; background: var(--ac-galerie); }
.kta-ac-fil-entree { position: absolute; left: 20px; top: 0; bottom: 0; width: 4px; background: var(--ac-or);
  transform-origin: top; }
html.js .kta-ac:not(.kta-ac-final) .kta-ac-fil-entree { transform: scaleY(var(--entree, 0)); }
.kta-ac-entree .kta-ac-repere { left: 2px; top: calc(var(--h-ville) * 24 / 630 - 20px); }
.kta-ac-speleos { position: absolute; left: 46px; top: -38px; width: 58px; height: 36px; overflow: visible; }
/* Tête de suivi du puits : pointe vers le bas, cachée au repos ; au défilement elle suit le fil doré (--entree, posé
   sur .kta-ac-entree par accueil.js > placerEntree) puis passe le relais à la première galerie. */
.kta-ac-tete-entree { position: absolute; left: 7px; top: calc(var(--h-ville) * 24 / 630 + 6px); width: 30px;
  height: 30px; rotate: 180deg; opacity: 0; }
.kta-ac-js-fil .kta-ac-tete-entree.kta-ac-en-cours { opacity: 1;
  translate: 0 calc(var(--entree, 0) * var(--h-ville) * 270 / 630 - var(--h-ville) * 24 / 630 - 21px); }

/* ── Vie de la ville : boucles longues de durées premières entre elles, transform et opacity seulement ── */
.kta-ac-pieton { animation: kta-ac-pieton 34s linear -6s infinite; }
.kta-ac-jambe, .kta-ac-bras { transform-box: fill-box; transform-origin: top center;
  animation: kta-ac-pas 0.9s ease-in-out infinite alternate; }
.kta-ac-jambe-2 { animation-direction: alternate-reverse; }
.kta-ac-voiture { animation: kta-ac-voiture 23s linear 3s infinite both; }
.kta-ac-vol { animation: kta-ac-vol 29s linear -4s infinite; }
.kta-ac-vol-haut { animation: kta-ac-vol-haut 29s linear -4s infinite; }
.kta-ac-aile { transform-box: fill-box; transform-origin: center; animation: kta-ac-aile 0.7s ease-in-out infinite alternate; }
.kta-ac-aile-2 { animation-delay: -0.25s; }
.kta-ac-aile-3 { animation-delay: -0.5s; }
.kta-ac-lueur { transform-box: fill-box; transform-origin: center; animation: kta-ac-lueur 11s ease-in-out infinite alternate; }
.kta-ac-pieton-2 { animation-duration: 41s; animation-delay: -20s; }
.kta-ac-pieton-3 { animation-duration: 37s; animation-delay: -12s; }
.kta-ac-pieton-4 { animation-duration: 47s; animation-delay: -33s; }
.kta-ac-voiture-2 { animation-duration: 27s; animation-delay: -9s; }
.kta-ac-voiture-3 { animation-duration: 31s; animation-delay: -17s; }
.kta-ac-speleo { animation: kta-ac-pietine 5.3s ease-in-out infinite alternate; }
.kta-ac-speleo-2 { animation-duration: 6.7s; animation-delay: -2.4s; }
.kta-ac-faisceau { transform-box: view-box; transform-origin: 16px 9px;
  animation: kta-ac-faisceau 3.2s ease-in-out infinite alternate, kta-ac-balaie 4.6s ease-in-out infinite alternate; }
.kta-ac-faisceau-2 { transform-origin: 37px 11px; animation-duration: 4.1s, 5.9s; animation-delay: -1.3s, -3s; }
@keyframes kta-ac-pieton { 0% { transform: translateX(-220px); opacity: 0; } 3% { opacity: 1; } 73% { opacity: 1; }
  76% { transform: translateX(580px); opacity: 0; } 100% { transform: translateX(580px); opacity: 0; } }
@keyframes kta-ac-pas { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes kta-ac-voiture { 0% { transform: translateX(1800px); opacity: 1; } 26% { opacity: 1; }
  30% { transform: translateX(-600px); opacity: 0; } 100% { transform: translateX(-600px); opacity: 0; } }
@keyframes kta-ac-vol { 0% { transform: translateX(-120px); opacity: 0; } 4% { opacity: 1; } 46% { opacity: 1; }
  50% { transform: translateX(560px) translateY(-14px); opacity: 0; } 100% { transform: translateX(560px); opacity: 0; } }
@keyframes kta-ac-vol-haut { 0% { transform: translateX(-110px); opacity: 0; } 6% { opacity: 1; } 44% { opacity: 1; }
  50% { transform: translateX(240px) translateY(-10px); opacity: 0; } 100% { transform: translateX(200px); opacity: 0; } }
@keyframes kta-ac-aile { from { transform: scaleY(1); } to { transform: scaleY(0.45); } }
@keyframes kta-ac-lueur { from { opacity: 0.6; transform: scale(1); } to { opacity: 1; transform: scale(1.08); } }
@keyframes kta-ac-pietine { 0% { transform: translateX(0); } 35% { transform: translateX(3px); }
  70% { transform: translateX(-2px); } 100% { transform: translateX(1px); } }
@keyframes kta-ac-faisceau { from { opacity: 0.12; } to { opacity: 0.3; } }
@keyframes kta-ac-balaie { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }

/* ── Stations ── */
/* Même fond que le sous-sol de l'en-tête : les galeries continuent sous la ville, sans marche de couleur au défilement. */
.kta-ac-station { position: relative; background: var(--ac-fond-haut); }
.kta-ac-galerie { position: absolute; left: 10px; top: 0; bottom: 0; width: 44px; z-index: 2; pointer-events: none; }
.kta-ac-galerie svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.kta-ac-fil-sec { position: absolute; inset: 0; }
/* Tête de suivi : placée par accueil.js (--x, --y : point du fil en px de la galerie ; --angle : 180deg = vers le
   bas, 90deg = droite, 270deg = gauche, l'icône pointant vers le haut). Jamais -90deg : de 180 à -90, la transition
   ferait le tour par le haut. */
.kta-ac-tete-sec { display: none; position: absolute; left: 0; top: 0; width: 30px; height: 30px; opacity: 0;
  translate: calc(var(--x, 22px) - 15px) calc(var(--y, 0px) - 15px); rotate: var(--angle, 180deg);
  transition: rotate 0.18s ease-out, opacity 0.15s linear; }
.kta-ac-js-fil .kta-ac-tete-sec { display: block; }
.kta-ac-js-fil .kta-ac-tete-sec.kta-ac-en-cours { opacity: 1; }
/* Fil doré dessiné sur la longueur parcourue (--fil-long, --fil-reste posés sur la galerie). Avant la mesure : vide. */
.kta-ac-js-fil .kta-ac-fil-sec path { stroke-dasharray: var(--fil-long, 0px) var(--fil-long, 100000px);
  stroke-dashoffset: var(--fil-reste, 0px); }

/* Repère (icône de l'app) : « atteint » une fois la tête passée, flash au passage (anneau et halo). */
.kta-ac-repere { position: absolute; left: 12px; top: 44px; width: 40px; height: 40px; z-index: 3; border-radius: 10px;
  transition: box-shadow 0.3s ease-out; }
.kta-ac-repere img { display: block; width: 40px; height: 40px; }
.kta-ac-repere::before, .kta-ac-repere::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px;
  height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; opacity: 0; pointer-events: none; }
.kta-ac-repere::before { border: 3px solid var(--ac-or); }
.kta-ac-repere::after { background: radial-gradient(circle, rgba(244, 197, 66, 0.55), rgba(244, 197, 66, 0) 70%); }
.kta-ac-repere.kta-ac-atteint { box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.7), 0 0 12px rgba(244, 197, 66, 0.3); }
/* Le puits n'est pas un point à valider : ni contour ni flash. */
.kta-ac-entree .kta-ac-repere.kta-ac-atteint { box-shadow: none; }
.kta-ac-repere.kta-ac-flash::before { animation: kta-ac-flash-anneau 0.6s ease-out both; }
.kta-ac-repere.kta-ac-flash::after { animation: kta-ac-flash-halo 0.6s ease-out both; }
@keyframes kta-ac-flash-anneau { from { opacity: 1; transform: scale(0.9); } to { opacity: 0; transform: scale(2.4); } }
@keyframes kta-ac-flash-halo { 0% { opacity: 0; transform: scale(1); } 30% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.2); } }

/* Contenu d'une station : les blocs de l'accueil (cartes, formules, rubriques) sur le fond de nuit. */
.kta-ac-contenu { max-width: 1180px; margin: 0 auto; padding: 32px 16px 72px 66px; }
.kta-ac-station h2 { margin: 0 0 20px; font-size: 28px; line-height: 1.2; font-weight: 800; color: var(--ac-texte); }
.kta-ac .kta-capacite, .kta-ac .kta-formule, .kta-ac .kta-rub-carte a { background: var(--ac-surface);
  border-color: var(--ac-bord); }
.kta-ac .kta-capacite-icone, .kta-ac .kta-rub-carte-icone { background: #232a3d; }
.kta-ac .kta-capacite p, .kta-ac .kta-formule p, .kta-ac .kta-rub-carte-resume { color: var(--ac-texte-2); }
.kta-ac .kta-rub-carte-nb { color: var(--ac-texte-3); }
.kta-ac .kta-rub-carte-titre { color: var(--ac-bleu); }
.kta-ac .kta-formule-lien a { display: inline-flex; align-items: center; min-height: 44px; }

/* Sortie d'urgence : bouton 🚨 de l'app (fond et bord rouges), en bas à droite pour ne pas couvrir l'en-tête collant
   du site ; montré une fois le héros dépassé (accueil.js > surveillerHeros). Lien d'ancre : sans script ou en
   mouvement réduit, il saute en haut ; sinon remontée progressive. */
.kta-ac-urgence { position: fixed; z-index: 20; right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; display: flex;
  align-items: center; justify-content: center; border-radius: 10px; font-size: 22px; line-height: 1;
  text-decoration: none; background: linear-gradient(rgba(255, 80, 80, 0.22), rgba(255, 80, 80, 0.22)), var(--ac-fond);
  border: 1px solid rgba(255, 80, 80, 0.55); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s linear, visibility 0.2s linear, background 0.15s ease; }
@media (hover: hover) {
  .kta-ac-urgence:hover { background: linear-gradient(rgba(255, 80, 80, 0.4), rgba(255, 80, 80, 0.4)), var(--ac-fond); }
}
/* Caché d'emblée avec script (html.js, posé dans <head>) : il ne clignote pas au chargement. */
html.js .kta-ac-urgence:not(.kta-ac-montre) { opacity: 0; visibility: hidden; pointer-events: none; }

/* ── Grand écran ── */
@media (min-width: 769px) {
  .kta-ac { --h-entete-site: 96px; }
}
@media (min-width: 900px) {
  .kta-ac { --h-ville: clamp(200px, calc(100svh - 570px), 440px); }
  .kta-ac-hero { padding: 40px 24px 0 var(--marge-galerie); }
  .kta-ac .kta-heros h1 { font-size: 60px; }
  .kta-ac .kta-chapo { font-size: 19px; }
  .kta-ac .kta-actions { gap: 12px; margin: 18px 0; }
  .kta-ac .kta-bouton-lien { min-height: 48px; padding: 0 22px; font-size: 16px; }
  .kta-ac-lune-haut { display: block; position: absolute; right: 0; bottom: -70px; width: 340px; height: 240px; }
  .kta-ac-ville .kta-ac-lune-scene { display: none; }
  .kta-ac-station h2 { font-size: 36px; }
  .kta-ac-contenu { padding: 36px 24px 64px var(--marge-galerie); }
}
/* Grand écran peu haut : la lune ne doit pas recouvrir l'accroche. */
@media (min-width: 900px) and (max-height: 820px) {
  .kta-ac-hero { padding-top: 28px; }
  .kta-ac .kta-heros h1 { font-size: 52px; }
}
/* La lune ne passe derrière le texte qu'au-delà de la colonne de l'accroche. */
@media (min-width: 900px) and (max-width: 1180px) { .kta-ac-lune-haut { right: -90px; } }

/* ── Mouvement réduit : état final statique ── */
/* Balise rouge du chevalement (scène du community) : battement lent, brève extinction. */
.kta-ac-balise { animation: kta-ac-balise 1.6s steps(1, end) infinite; }
@keyframes kta-ac-balise { 0% { opacity: 1; } 70% { opacity: 0.15; } 100% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) {
  .kta-ac-pieton, .kta-ac-jambe, .kta-ac-bras, .kta-ac-voiture, .kta-ac-lueur, .kta-ac-faisceau, .kta-ac-speleo,
  .kta-ac-aile, .kta-ac-balise { animation: none; }
  .kta-ac-vol, .kta-ac-vol-haut { display: none; }
  .kta-ac-tete-sec, .kta-ac-js-fil .kta-ac-tete-sec, .kta-ac-tete-entree { display: none; }
  .kta-ac-js-fil .kta-ac-fil-sec path { stroke-dasharray: none; stroke-dashoffset: 0; }
  html.js .kta-ac:not(.kta-ac-final) .kta-ac-fil-entree { transform: none; }
  .kta-ac-repere.kta-ac-flash::before, .kta-ac-repere.kta-ac-flash::after { animation: none; }
  .kta-ac-urgence { transition: none; }
}

/* ── Impression : la scène n'a rien à dire sur papier ── */
@media print {
  .kta-ac-ville, .kta-ac-lune-haut, .kta-ac-entree, .kta-ac-galerie, .kta-ac-repere, .kta-ac-urgence { display: none !important; }
  .kta-ac, .kta-ac-entete, .kta-ac-station { background: #fff; color: #000; min-height: 0; }
  .kta-ac-contenu, .kta-ac-hero { padding: 0; }
  .kta-ac .kta-heros h1, .kta-ac-station h2, .kta-ac .kta-chapo, .kta-ac .kta-pourqui, .kta-ac .kta-note { color: #000; }
}
