/* Téléphone : mise en forme d'application. Chargée seulement sous 760 px de large. */
:root { --tb: 56px; --nav: 62px; --safe: env(safe-area-inset-bottom, 0px); }
body { padding-bottom: calc(var(--nav) + var(--safe)); -webkit-tap-highlight-color: transparent; }
section, header.page-head { scroll-margin-top: var(--tb); }

/* barre du haut */
.topbar { height: auto; min-height: var(--tb); padding: env(safe-area-inset-top, 0px) 10px 0 14px; }
.topbar a { gap: 10px; min-width: 0; }
.topbar a svg { width: 26px; height: 26px; flex: none; }
.topbar .r { gap: 6px; flex: none; }
.topbar .rbtn { height: 38px; min-width: 38px; padding: 0 10px; }
#menu-btn { display: none; }

/* barre d'onglets */
.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--nav) + var(--safe)); padding-bottom: var(--safe);
  background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font: 500 10.5px var(--sans); letter-spacing: .01em; }
.tabbar svg { width: 22px; height: 22px; padding: 4px 16px; box-sizing: content-box; border-radius: 999px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: background .25s, transform .15s; }
.tabbar a.on { color: var(--violet); }
.tabbar a.on svg { background: var(--violet-soft); }
.tabbar a:active svg { transform: scale(.9); }
.toast { bottom: calc(var(--nav) + var(--safe) + 14px); }

/* ouverture : un écran de profil */
.ouv { min-height: calc(100svh - var(--tb) - var(--nav) - var(--safe)); padding: 26px 0 22px; align-items: stretch; }
.ouv .wrap { display: flex; }
.ouv-grid { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; gap: 0; }
.ouv-grid > div { display: contents; }
@property --anneau { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ouv .portrait { order: 1; width: 136px; height: 136px; padding: 4px; margin: 4px 0 20px; border-radius: 50%; justify-self: auto;
  background: conic-gradient(from var(--anneau), var(--violet), var(--amber-2), #e5484d, var(--violet)); animation: anneau 7s linear infinite; }
@keyframes anneau { to { --anneau: 360deg; } }
.ouv .portrait::after { display: none; }
.ouv .portrait img { width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-position: 50% 28%; border: 3px solid var(--bg); box-shadow: none; }
.ouv h1 { order: 2; font-size: 44px; margin: 0 0 12px; }
.ouv h1 br { display: none; }
.ouv h1 .soft::before { content: " "; }
.ouv .status { order: 3; justify-content: center; font-size: 10.5px; letter-spacing: .12em; }
.ouv .these-titre { order: 4; font-size: 21px; line-height: 1.32; margin: 18px 0 10px; }
.ouv .meta { display: none; }
.ouv .pilote { order: 5; }
.ouv .logo-cnam { order: 6; margin: 18px 0 0; padding: 5px 11px; border-radius: 10px; }
.ouv .logo-cnam img { height: 22px; }
.ouv .cta { order: 7; margin-top: auto; padding-top: 24px; width: 100%; display: grid; gap: 10px; }
.ouv .cta .btn { justify-content: center; padding: 15px 22px; font-size: 15.5px; }
.descend { display: none; }

/* lecteur d'étapes (thèse et correcteur) */
.pas-barre { display: flex; gap: 4px; position: absolute; top: 12px; left: 16px; right: 16px; z-index: 3; pointer-events: none; }
.pas-barre i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .2); transition: background .3s; }
.pas-barre i.fait { background: rgba(245, 179, 1, .55); }
.pas-barre i.on { background: var(--amber-2); }
.pas-astuce { display: block; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; pointer-events: none; font: 500 11px var(--mono); letter-spacing: .08em; color: #fff; background: rgba(20, 8, 50, .7); border: 1px solid rgba(200, 180, 255, .3); border-radius: 999px; padding: 6px 12px; white-space: nowrap; animation: astuce 2.4s ease-in-out infinite; transition: opacity .4s; }
.scene.touche .pas-astuce { opacity: 0; }
@keyframes astuce { 50% { transform: translateX(-50%) translateY(-4px); } }
.pas-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 14px; }
.pas-nav .rbtn { width: 46px; height: 46px; font-size: 18px; color: #fff; border-color: rgba(200, 180, 255, .4); }
.pas-nav .rbtn:last-child { background: var(--amber-2); border-color: var(--amber-2); color: #1b1135; }
.pas-n { font: 400 13px var(--mono); color: var(--on-night-2); letter-spacing: .1em; }
.pas-n b { color: #fff; font-weight: 500; font-size: 15px; }

/* chapitres : moins de vide */
section.ch { padding: 56px 0 64px; }
.ch-head { margin-bottom: 28px; gap: 4px; }
.ch-letter { font-size: 34px; margin-top: 0; }
h2 { font-size: 32px; }
.lede { font-size: 17px; }
.pc-only { display: none !important; }
.tel-only { display: block; }

/* la thèse : le cerveau en haut, les étapes à faire glisser */
.these .ch-head { padding-top: 56px; }
.these .recit { display: flex; flex-direction: column; height: calc(100svh - var(--tb) - var(--nav) - var(--safe)); margin-top: 22px; }
.these .scene { position: relative; top: auto; height: auto; flex: 1; min-height: 0; opacity: 1; cursor: pointer; }
.these .etapes { display: flex; flex: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0; }
.these .etapes::-webkit-scrollbar { display: none; }
.these .etape { flex: 0 0 100%; min-height: 0; padding: 0 16px; opacity: 1; justify-content: stretch; scroll-snap-align: center; scroll-snap-stop: always; }
.these .etape > div { height: 100%; max-height: 46svh; overflow-y: auto; padding: 16px 18px 14px; }
.these .etape h3 { font-size: 22px; margin: 6px 0 8px; }
.these .etape p { font-size: 15px; line-height: 1.55; margin: 0 0 8px; }
.these .etape .fait { font-size: 13px; margin-top: 10px; }
.these .glyph-tip { display: none; }
.these .these-fin { padding: 18px 0 64px; }

/* l'espace des mots : plus grand */
.espace { height: min(118vw, 500px); }
#espace { -webkit-mask-image: radial-gradient(ellipse 56% 62% at 50% 50%, #000 48%, transparent 100%); mask-image: radial-gradient(ellipse 56% 62% at 50% 50%, #000 48%, transparent 100%); }
.espace-scene .mot-lu { font-size: 24px; min-height: 64px; }
.orb-leg { flex-wrap: wrap; gap: 8px 16px; font-size: 12px; }
.projets { margin-top: 36px; gap: 14px; }

/* le parcours : une frise verticale */
.frise-wrap, .frise-card { display: none; }
.etabs { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 26px; }
.etabs > div { padding: 12px 10px; gap: 8px; align-items: center; text-align: center; border-radius: 14px; }
.etabs img { height: 22px; align-self: center; padding: 4px 6px; }
.etabs .small-caps { font-size: 9.5px; letter-spacing: .08em; }
.frise-legend { display: flex; gap: 6px 14px; font-size: 11px; margin: 0 0 6px; }
.ftel { display: block; position: relative; margin: 8px 0 0; }
.ftel svg { position: absolute; left: 0; top: 0; overflow: visible; }
.ftel .an { stroke: var(--line); stroke-dasharray: 2 6; }
.ftel .an-t { font: 500 10px var(--mono); fill: var(--muted); letter-spacing: .08em; }
.ftel .voie { stroke: var(--line-2); stroke-dasharray: 1 5; }
.ftel .per { stroke-width: 7; stroke-linecap: round; stroke: var(--teal); stroke-opacity: .45; }
.ftel .lien { fill: none; stroke: var(--violet); stroke-width: 1.7; stroke-opacity: .75; }
.ftel .fil { stroke: var(--line-2); stroke-dasharray: 1 3; }
.ftel .bande { fill: url(#ft-g); }
.ftel .auj { stroke: var(--amber-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.ftel .nd { fill: var(--bg); stroke-width: 2.2; stroke: var(--ink-2); cursor: pointer; }
.ftel .nd.f-formation { stroke: var(--teal); } .ftel .nd.f-recherche { stroke: var(--violet); } .ftel .nd.f-diffusion { stroke: var(--amber); }
.ftel .nd.futur { stroke-dasharray: 2.5 2.5; }
.ftel .nd.fort { fill: var(--violet); stroke: var(--violet); }
.ftel .nd.sel { fill: currentColor; }
.ft-coul .nd { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--violet) 55%, transparent)); }
/* ce qui n'est pas encore tracé reste en gris clair */
.ft-base > * { stroke: var(--line-2) !important; stroke-opacity: 1; filter: none; }
.ft-base .per { stroke-opacity: .5; }
.ft-base .bande { fill: var(--bg-2); stroke: none !important; }
.ft-base .lien { stroke-opacity: .7; }
#ft-ligne { stroke: var(--amber-2); stroke-width: 2; stroke-linecap: round; }
#ft-point { fill: var(--amber-2); filter: drop-shadow(0 0 6px var(--amber-2)); }
.ftel.debut #ft-ligne, .ftel.debut #ft-point, .ftel.debut .ft-date { opacity: 0; }
.ft-date { position: absolute; left: 0; transform: translateY(-50%); font: 500 9.5px var(--mono); letter-spacing: .02em; background: var(--amber-2); color: #1b1135; border-radius: 999px; padding: 3px 6px; white-space: nowrap; z-index: 2; pointer-events: none; }
.ft-lab { position: absolute; left: 150px; right: 0; transform: translateY(-9px); display: grid; justify-items: start; gap: 3px; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; opacity: .32; transition: opacity .45s, transform .45s; }
.ft-lab.vu { opacity: 1; transform: translateY(-9px) translateX(0); }
.ft-lab:not(.vu) { transform: translateY(-9px) translateX(8px); }
.ft-lab .d { font: 500 10.5px var(--mono); color: var(--muted); letter-spacing: .04em; line-height: 18px; }
.ft-lab .t { font: 400 15.5px/1.28 var(--serif); }
.ft-lab img { height: 17px; width: auto; padding: 3px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--line); box-sizing: content-box; margin: 1px 0 2px; }
.ft-lab.fort .t { font-size: 18px; color: var(--violet); }
.ft-lab.futur .t { color: var(--ink-2); font-style: italic; }
.ft-lab.sel .t { color: var(--violet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ft-lab.auj { cursor: default; transform: translateY(-50%) !important; }
.ft-lab.auj .t { font: 500 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); background: var(--bg); padding: 0 8px; margin-left: -8px; }
.ftel-fiche { display: block; position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav) + var(--safe) + 10px); z-index: 65; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 16px; box-shadow: 0 -10px 50px rgba(14, 8, 32, .22); transform: translateY(calc(100% + 90px)); transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.ftel-fiche.open { transform: none; }
.ftel-fiche .x { position: absolute; right: 12px; top: 12px; width: 32px; min-width: 32px; height: 32px; padding: 0; font-size: 18px; }
.ftel-fiche .d { font: 400 11px var(--mono); color: var(--muted); letter-spacing: .04em; }
.ftel-fiche .d b { font-weight: 500; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--violet); }
.ftel-fiche .d b.f-formation { color: var(--teal); } .ftel-fiche .d b.f-logiciel { color: var(--ink-2); } .ftel-fiche .d b.f-diffusion { color: var(--amber); }
.ftel-fiche h3 { font-size: 21px; margin: 6px 36px 6px 0; }
.ftel-fiche p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.ftel-fiche img { height: 22px; width: auto; margin-top: 12px; padding: 4px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line); box-sizing: content-box; }

/* contact : de gros boutons */
.contact { margin-top: 10px; gap: 10px; }
.contact a { padding: 16px 18px; border-radius: 16px; }

/* Kab-board : onglets sur une ligne */
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; }
.kb > *, .with-notes > * { min-width: 0; }
.shot { min-height: 0; padding: 12px; }
.page-head { padding: 40px 0 34px; }
.page-head h1 { font-size: 44px; margin: 18px 0 14px; }

/* carte d'installation */
.install { position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav) + var(--safe) + 10px); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(14, 8, 32, .25); transform: translateY(20px); opacity: 0; transition: transform .35s, opacity .35s; }
.install.show { transform: none; opacity: 1; }
.install img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.install b { font: 500 14.5px var(--sans); }
.install div > span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.install .btn { padding: 9px 14px; font-size: 13.5px; flex: none; }
.install .rbtn { flex: none; width: 32px; min-width: 32px; height: 32px; padding: 0; font-size: 18px; }

/* menu des langues : un panneau qui monte du bas */
.langues { left: 8px; right: 8px; top: auto; bottom: calc(var(--nav) + var(--safe) + 8px); width: auto; transform: translateY(30px); }
.topbar .rbtn.lg { gap: 5px; padding: 0 9px; }
