/* Téléphone : expérience à part, activée par la classe « mobile » posée sur <html> (mobile.js : pointeur grossier et petit écran).
   Debout : l'îlot en haut, la légende ou la feuille en bas, et tout en bas le mètre ruban, sous le pouce.
   Couché : l'îlot à gauche, le texte à droite, le ruban sur toute la largeur. */
html.mobile { --ruban: 64px; --feuille: clamp(248px, 35%, 290px); }
html.mobile body { font-size: 15.5px; -webkit-tap-highlight-color: transparent; }
html.mobile .rayons, html.mobile .fleche, html.mobile .pastilles { display: none; }

/* ---------- Barre : le nom, le dossier, le CV. Le menu des univers est remplacé par le ruban ---------- */
html.mobile .bar { flex-wrap: nowrap; align-items: flex-start; gap: 10px; padding: 10px 16px 0; }
html.mobile .bar-name { flex: 1; min-width: 0; }
html.mobile .bar-name b { font-size: 16px; }
html.mobile .bar-name span { display: block; font-size: 12px; max-width: 17em; }
html.mobile .bar-act { margin-left: auto; gap: 6px; }
html.mobile .bar-act a { padding: 10px 13px; font-size: 14px; line-height: 20px; }

/* ---------- Le mètre ruban : on le tire pour changer d'univers ---------- */
html.mobile .ruban { display: block; position: fixed; z-index: 14; left: 0; right: 0; bottom: 0; height: calc(var(--ruban) + env(safe-area-inset-bottom, 0px)); background: var(--deep); overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none; box-shadow: 0 -8px 24px rgba(0, 32, 60, .22); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
html.mobile body.explore .ruban { transform: translateY(105%); box-shadow: none; }
html.mobile .ruban-b { position: absolute; left: 50%; top: 0; height: var(--ruban); background-color: var(--yellow); border-radius: 3px 0 0 3px;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 13.2px); background-size: 100% 9px; background-repeat: no-repeat; background-position: -.75px 0;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
html.mobile .ruban.tire .ruban-b { transition: none; }
html.mobile .ruban-b::before { content: ''; position: absolute; left: -10px; top: 0; bottom: 0; width: 13px; border-radius: 3px; background: linear-gradient(#e3e6e7, #9aa3a7 55%, #c4cacc); box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }   /* le crochet du ruban */
html.mobile .ruban::after { content: ''; position: absolute; left: 50%; top: 0; margin-left: -9px; border: 9px solid transparent; border-top: 12px solid var(--blue); border-bottom: 0; pointer-events: none; }   /* le repère fixe */
html.mobile .cran { position: absolute; top: 0; height: 100%; width: 132px; margin-left: -66px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 7px; color: var(--ink); opacity: .55; transition: opacity .25s; }
html.mobile .cran::before { content: ''; position: absolute; top: 0; left: 50%; width: 2.5px; height: 17px; margin-left: -1.25px; background: var(--ink); }
html.mobile .cran b { font-size: 20px; line-height: 1; font-weight: 700; }
html.mobile .cran span { font-size: 13px; line-height: 1.25; font-weight: 700; white-space: nowrap; }
html.mobile .cran.on { opacity: 1; }
html.mobile .cran:focus-visible { outline-offset: -4px; }

/* ---------- Pastilles posées sur le modèle : assez grandes pour le doigt ---------- */
html.mobile .points button { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 17px; }
html.mobile .points button::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }

/* ---------- Légende ---------- */
html.mobile .legende { bottom: calc(var(--ruban) + env(safe-area-inset-bottom, 0px) + 18px); width: calc(100% - 32px); }
html.mobile h1 { font-size: 30px; margin: 5px 0 7px; }
html.mobile .legende.hero h1 { font-size: 39px; }
html.mobile .leg-k { font-size: 12.5px; letter-spacing: .1em; }
html.mobile .leg-c { font-size: 15.5px; line-height: 1.45; }
html.mobile .leg-a { gap: 8px; margin-top: 14px; }
html.mobile .btn { font-size: 15px; padding: 12px 18px; }
html.mobile .aide { display: block; z-index: 13; bottom: calc(var(--feuille) + 12px); padding: 6px 13px; border-radius: 999px; background: rgba(0, 48, 86, .86); color: var(--white); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; }
html.mobile body.explore.longe .aide { opacity: 1; }
html.mobile.longe-su body.explore.longe .aide { opacity: 0; }   /* le geste est compris : l'invitation s'efface */

/* ---------- Debout : la feuille basse, un fait par volet, on feuillette de gauche à droite ---------- */
@media (orientation: portrait) {
  html.mobile .fiche { height: var(--feuille); padding: 8px 0 0; display: flex; flex-direction: column; overflow: hidden; background: var(--white); }
  html.mobile .fiche-x { align-self: flex-start; margin: 0 0 2px 10px; padding: 9px 10px; font-size: 14.5px; }
  html.mobile .reperes { display: flex; gap: 6px; position: absolute; top: 24px; right: 20px; }
  html.mobile .reperes i { width: 7px; height: 7px; border-radius: 4px; background: var(--ink); opacity: .25; transition: width .25s, opacity .25s, background .25s; }
  html.mobile .reperes i.on { width: 20px; opacity: 1; background: var(--blue); }
  html.mobile .fi-rail { flex: 1; min-height: 0; display: flex; gap: 22px; padding-left: 20px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-left: 20px; scrollbar-width: none; overscroll-behavior: contain; }
  html.mobile .fi-rail::-webkit-scrollbar { display: none; }
  html.mobile .fi-rail::after { content: ''; flex: 0 0 34px; }
  html.mobile .faits { display: contents; }
  html.mobile .fi-intro, html.mobile .faits li, html.mobile .fi-s { flex: 0 0 calc(100% - 74px); scroll-snap-align: start; overflow-y: auto; margin: 0; border: 0; border-top: 3px solid var(--ink); }
  html.mobile .fi-intro { padding: 12px 0 16px; border-top-color: var(--blue); }
  html.mobile .faits li { padding: 14px 0 16px 44px; }
  html.mobile .faits li::before { top: 13px; }
  html.mobile .faits b { font-size: 16.5px; }
  html.mobile .faits span { font-size: 15.5px; line-height: 1.45; margin-top: 4px; }
  html.mobile .fi-s { padding: 16px 0; align-content: flex-start; }
  html.mobile h2 { font-size: 25px; margin: 3px 0 7px; }
  html.mobile .fi-c { font-size: 15.5px; line-height: 1.45; }
  html.mobile .contact { margin-top: 10px; gap: 6px; }
  html.mobile .contact a { font-size: 16px; }
  html.mobile .mentions { flex: 0 0 100%; margin-top: 4px; font-size: 12.5px; }
}

/* ---------- Couché : l'îlot à gauche, le texte à droite ---------- */
@media (orientation: landscape) {
  html.mobile { --ruban: 50px; }
  html.mobile .bar { padding-top: 8px; }
  html.mobile .bar-name span { max-width: none; }
  html.mobile .cran { padding-bottom: 4px; }
  html.mobile .cran b { font-size: 16px; }
  html.mobile .cran span { font-size: 12.5px; }
  html.mobile .cran::before { height: 13px; }
  html.mobile .legende { left: 54%; right: 16px; width: auto; transform: none; text-align: left; bottom: calc(var(--ruban) + 14px); }
  html.mobile .legende.sort { transform: translateY(14px); }
  html.mobile body.explore .legende { transform: translateY(20px); }
  html.mobile h1 { font-size: 26px; }
  html.mobile .legende.hero h1 { font-size: 33px; }
  html.mobile .leg-c { font-size: 14.5px; margin: 0; }
  html.mobile .leg-a { justify-content: flex-start; margin-top: 12px; }
  html.mobile .question span { font-size: 17px; }
  html.mobile .question span::after { left: 30px; }
  html.mobile .btn { padding: 10px 16px; }
  html.mobile .fiche { top: 0; left: auto; right: 0; bottom: 0; width: 46%; height: auto; padding: 54px 16px 18px 20px; border-radius: 18px 0 0 18px; transform: translateX(104%); box-shadow: -14px 0 40px rgba(0, 32, 60, .2); }
  html.mobile body.explore .fiche { transform: none; }
  html.mobile h2 { font-size: 24px; }
  html.mobile .fi-c { font-size: 15px; }
}
