@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100..125,400..800&family=Saira+Semi+Condensed:wght@500;600&display=swap');

/* EST SÉCURITÉ & EST FORMATIONS — composants (CSS seul, préfixe est-) */

body { margin: 0; font-family: var(--font-texte); font-size: 16px; line-height: 26px; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
.est-pad { padding: var(--space-6); }
.est-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.est-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.est-brand { background: var(--surface); color: var(--ink); }

/* ---------- Filet : trait rouge + libellé espacé, repris du logo ---------- */
.est-filet { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-signal); font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--signal); margin: 0; }
.est-filet::before { content: ""; flex: 0 0 32px; height: var(--trait-fin); background: var(--est-rouge); }
.est-filet--centre::after { content: ""; flex: 0 0 32px; height: var(--trait-fin); background: var(--est-rouge); }
.est-filet--neutre { color: var(--ink-muted); }

/* ---------- Bouton ---------- */
.est-btn { display: inline-flex; align-items: center; gap: var(--space-2); font: 600 16px/20px var(--font-texte); padding: var(--space-3) var(--space-6); border-radius: var(--radius-sm); border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.est-btn:hover { background: var(--est-bleu); border-color: var(--est-bleu); }
[data-theme="formations"] .est-btn:hover, .est-btn[data-theme="formations"]:hover { background: var(--est-marine); border-color: var(--est-marine); }
.est-btn--second { background: transparent; color: var(--accent); }
.est-btn--second:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.est-btn--lien { background: transparent; border-color: transparent; color: var(--accent); padding-left: 0; padding-right: 0; text-decoration: underline; text-decoration-thickness: var(--trait-fin); text-underline-offset: 5px; }
.est-btn--lien:hover { background: transparent; border-color: transparent; color: var(--accent); text-decoration-color: var(--est-rouge); }
.est-btn--inverse { background: var(--ink-inverse); border-color: var(--ink-inverse); color: var(--est-marine); }
.est-btn:focus-visible, .est-champ input:focus-visible, .est-champ select:focus-visible, .est-champ textarea:focus-visible, .est-nav a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.est-btn .est-fleche { display: inline-block; width: 18px; height: var(--trait-fin); background: currentColor; border-radius: var(--radius-trait); position: relative; }
.est-btn .est-fleche::after { content: ""; position: absolute; right: 0; top: -4px; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); border-radius: 1px; }

/* ---------- Cellules : mosaïque à joints, angles vifs ---------- */
.est-cellules { display: grid; gap: var(--joint); background: var(--surface); }
.est-cellule { background: var(--surface-sunken); color: var(--ink); padding: var(--space-6); border-radius: var(--radius-none); display: flex; flex-direction: column; gap: var(--space-2); min-height: 0; }
.est-cellule h3 { margin: 0; font: 600 20px/26px var(--font-titre); }
.est-cellule p { margin: 0; font-size: 15px; line-height: 23px; color: var(--ink-muted); }
.est-cellule--marine { background: var(--est-marine); color: var(--ink-inverse); }
.est-cellule--bleu { background: var(--est-bleu); color: var(--ink-inverse); }
.est-cellule--marine p, .est-cellule--bleu p { color: var(--ink-inverse); opacity: .86; }
.est-cellule--horizon { background: var(--horizon); color: var(--est-marine); }
.est-cellule--horizon p { color: var(--est-marine); }
.est-cellule--aube { background: var(--aube); color: #0f1b3d; }
.est-cellule--aube p { color: #0f1b3d; }
.est-cellule .est-num { font: 600 13px/16px var(--font-signal); letter-spacing: .18em; }
.est-cellule .est-btn--lien { margin-top: auto; color: inherit; }

/* ---------- Horizon : bandeau à arc, une fois par page maximum ---------- */
.est-horizon { position: relative; background: var(--est-marine); color: var(--ink-inverse); overflow: hidden; }
.est-horizon__arc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.est-horizon__arc path { fill: var(--est-bleu); }
.est-horizon__contenu { position: relative; padding: var(--space-12) var(--space-8); max-width: 640px; }
.est-horizon h2 { margin: var(--space-3) 0 var(--space-4); font: 700 40px/46px var(--font-titre); letter-spacing: -.015em; }
.est-horizon p { margin: 0 0 var(--space-6); font-size: 19px; line-height: 30px; }
.est-horizon .est-filet { color: var(--ink-inverse); }
.est-horizon .est-filet::before { background: var(--ink-inverse); }

/* ---------- Rail : parcours en trait continu à bouts arrondis ---------- */
.est-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative; }
.est-rail::before { content: ""; position: absolute; left: 6px; right: 0; top: 10px; height: var(--trait); background: var(--rail); border-radius: var(--radius-trait); }
.est-rail li { position: relative; padding: 36px var(--space-6) 0 0; }
.est-rail li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: var(--radius-trait); background: var(--surface); border: var(--trait) solid var(--rail); box-sizing: border-box; }
.est-rail li.est-rail__actif::before { background: var(--est-rouge); border-color: var(--est-rouge); }
.est-rail .est-num { font: 600 13px/16px var(--font-signal); letter-spacing: .18em; color: var(--ink-muted); text-transform: uppercase; }
.est-rail h3 { margin: var(--space-1) 0 var(--space-2); font: 600 20px/26px var(--font-titre); }
.est-rail p { margin: 0; font-size: 15px; line-height: 23px; color: var(--ink-muted); }

/* ---------- Chiffre clé ---------- */
.est-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--joint); }
.est-chiffre { background: var(--surface-raised); padding: var(--space-6); border-top: var(--trait) solid var(--rail); }
.est-chiffre b { display: block; font: 600 48px/48px var(--font-signal); color: var(--accent); }
.est-chiffre span { display: block; margin-top: var(--space-2); font-size: 15px; line-height: 22px; color: var(--ink); }
.est-chiffre small { display: block; margin-top: var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.est-avalider { display: inline-block; font: 600 11px/16px var(--font-signal); letter-spacing: .14em; text-transform: uppercase; padding: 1px var(--space-2); border: 1px dashed var(--warning); color: var(--warning); border-radius: var(--radius-sm); vertical-align: middle; }

/* ---------- Encadrés de mémoire technique ---------- */
.est-encadre { padding: var(--space-4) var(--space-6) var(--space-6); border-radius: var(--radius-none); }
.est-encadre__tete { display: flex; align-items: center; gap: var(--space-2); font: 600 12px/16px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; margin-bottom: var(--space-2); }
.est-encadre__tete::before { content: ""; width: 10px; height: 10px; flex: 0 0 10px; }
.est-encadre p { margin: 0; font-size: 15px; line-height: 23px; }
.est-encadre--fait { background: var(--surface-sunken); color: var(--ink); }
.est-encadre--fait .est-encadre__tete::before { background: var(--ink); }
.est-encadre--engagement { background: var(--est-marine); color: #ffffff; }
.est-encadre--engagement .est-encadre__tete::before { background: var(--est-rouge); border-radius: var(--radius-trait); }
.est-encadre--perso { background: var(--surface-raised); color: var(--ink); outline: 2px dashed var(--line-strong); outline-offset: -2px; }
.est-encadre--perso .est-encadre__tete::before { border: 2px dashed var(--ink-muted); width: 6px; height: 6px; flex-basis: 6px; }
.est-encadre--perso mark { background: var(--accent-soft); color: var(--ink); padding: 0 2px; }
.est-encadre--piece { background: var(--horizon); color: var(--est-marine); }
.est-encadre--piece .est-encadre__tete::before { border: 2px solid var(--est-marine); background: transparent; width: 6px; height: 8px; }
[data-theme="nuit"] .est-encadre--piece, [data-theme="nuit"].est-encadre--piece { color: #eef1f8; }

/* ---------- En-tête de site ---------- */
.est-famille { display: flex; justify-content: flex-end; gap: var(--space-6); padding: var(--space-1) var(--space-8); background: var(--est-marine); font: 600 11px/24px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; }
.est-famille a { color: #ffffff; text-decoration: none; opacity: .72; }
.est-famille a[aria-current] { opacity: 1; box-shadow: inset 0 -2px 0 var(--est-rouge); }
.est-entete { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-4) var(--space-8); background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.est-entete img { height: 52px; width: auto; display: block; }
.est-nav { display: flex; gap: var(--space-4); margin-left: auto; }
.est-nav a { white-space: nowrap; }
.est-nav a { font: 500 15px/20px var(--font-texte); color: var(--ink); text-decoration: none; padding: var(--space-2) 0; border-bottom: var(--trait-fin) solid transparent; }
.est-nav a:hover, .est-nav a[aria-current] { border-bottom-color: var(--est-rouge); }

/* ---------- Session de formation ---------- */
.est-sessions { width: 100%; border-collapse: collapse; background: var(--surface-raised); font-size: 15px; line-height: 22px; }
.est-sessions th { text-align: left; font: 600 12px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-sunken); padding: var(--space-3) var(--space-4); }
.est-sessions td { padding: var(--space-4); border-top: 1px solid var(--line); vertical-align: middle; }
.est-sessions .est-donnee { font: 500 15px/20px var(--font-signal); letter-spacing: .02em; white-space: nowrap; }
.est-domaine { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/16px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.est-domaine::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; background: var(--aube); box-shadow: 3px 3px 0 var(--est-marine); }
.est-statut { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 14px; }
.est-statut::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-trait); background: currentColor; }
.est-statut--ouverte { color: var(--success); }
.est-statut--presque { color: var(--warning); }
.est-statut--complete { color: var(--ink-muted); }
.est-statut--complete::before { background: transparent; border: 2px solid currentColor; width: 4px; height: 4px; }

/* ---------- Champ de formulaire ---------- */
.est-champ { display: flex; flex-direction: column; gap: var(--space-1); max-width: 360px; }
.est-champ label { font-weight: 600; font-size: 15px; line-height: 20px; color: var(--ink); }
.est-champ input, .est-champ select, .est-champ textarea { font: 400 16px/24px var(--font-texte); color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px var(--space-3); }
.est-champ .est-aide { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.est-champ--erreur input { border: 2px solid var(--danger); padding: 9px 11px; }
.est-champ--erreur .est-aide { color: var(--danger); font-weight: 600; }

/* =====================================================================
   RELIEF — matière, lumière, strates (V2)
   ===================================================================== */

/* Textures de marque, en variables pour être réutilisées */
:root {
  --tex-niveaux-clair: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M0 1200 Q840 1186 1200 600'/%3E%3Cpath d='M0 1170 Q840 1156 1200 570'/%3E%3Cpath d='M0 1140 Q840 1126 1200 540'/%3E%3Cpath d='M0 1110 Q840 1096 1200 510'/%3E%3Cpath d='M0 1080 Q840 1066 1200 480'/%3E%3Cpath d='M0 1050 Q840 1036 1200 450'/%3E%3Cpath d='M0 1020 Q840 1006 1200 420'/%3E%3Cpath d='M0 990 Q840 976 1200 390'/%3E%3Cpath d='M0 960 Q840 946 1200 360'/%3E%3Cpath d='M0 930 Q840 916 1200 330'/%3E%3Cpath d='M0 900 Q840 886 1200 300'/%3E%3Cpath d='M0 870 Q840 856 1200 270'/%3E%3Cpath d='M0 840 Q840 826 1200 240'/%3E%3Cpath d='M0 810 Q840 796 1200 210'/%3E%3Cpath d='M0 780 Q840 766 1200 180'/%3E%3Cpath d='M0 750 Q840 736 1200 150'/%3E%3Cpath d='M0 720 Q840 706 1200 120'/%3E%3Cpath d='M0 690 Q840 676 1200 90'/%3E%3Cpath d='M0 660 Q840 646 1200 60'/%3E%3Cpath d='M0 630 Q840 616 1200 30'/%3E%3Cpath d='M0 600 Q840 586 1200 0'/%3E%3Cpath d='M0 570 Q840 556 1200 -30'/%3E%3Cpath d='M0 540 Q840 526 1200 -60'/%3E%3Cpath d='M0 510 Q840 496 1200 -90'/%3E%3Cpath d='M0 480 Q840 466 1200 -120'/%3E%3Cpath d='M0 450 Q840 436 1200 -150'/%3E%3Cpath d='M0 420 Q840 406 1200 -180'/%3E%3Cpath d='M0 390 Q840 376 1200 -210'/%3E%3Cpath d='M0 360 Q840 346 1200 -240'/%3E%3Cpath d='M0 330 Q840 316 1200 -270'/%3E%3Cpath d='M0 300 Q840 286 1200 -300'/%3E%3Cpath d='M0 270 Q840 256 1200 -330'/%3E%3Cpath d='M0 240 Q840 226 1200 -360'/%3E%3Cpath d='M0 210 Q840 196 1200 -390'/%3E%3Cpath d='M0 180 Q840 166 1200 -420'/%3E%3Cpath d='M0 150 Q840 136 1200 -450'/%3E%3Cpath d='M0 120 Q840 106 1200 -480'/%3E%3Cpath d='M0 90 Q840 76 1200 -510'/%3E%3Cpath d='M0 60 Q840 46 1200 -540'/%3E%3Cpath d='M0 30 Q840 16 1200 -570'/%3E%3Cpath d='M0 0 Q840 -14 1200 -600'/%3E%3C/g%3E%3C/svg%3E");
  --tex-niveaux-sombre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 600' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23193478' stroke-width='1'%3E%3Cpath d='M0 1200 Q840 1186 1200 600'/%3E%3Cpath d='M0 1170 Q840 1156 1200 570'/%3E%3Cpath d='M0 1140 Q840 1126 1200 540'/%3E%3Cpath d='M0 1110 Q840 1096 1200 510'/%3E%3Cpath d='M0 1080 Q840 1066 1200 480'/%3E%3Cpath d='M0 1050 Q840 1036 1200 450'/%3E%3Cpath d='M0 1020 Q840 1006 1200 420'/%3E%3Cpath d='M0 990 Q840 976 1200 390'/%3E%3Cpath d='M0 960 Q840 946 1200 360'/%3E%3Cpath d='M0 930 Q840 916 1200 330'/%3E%3Cpath d='M0 900 Q840 886 1200 300'/%3E%3Cpath d='M0 870 Q840 856 1200 270'/%3E%3Cpath d='M0 840 Q840 826 1200 240'/%3E%3Cpath d='M0 810 Q840 796 1200 210'/%3E%3Cpath d='M0 780 Q840 766 1200 180'/%3E%3Cpath d='M0 750 Q840 736 1200 150'/%3E%3Cpath d='M0 720 Q840 706 1200 120'/%3E%3Cpath d='M0 690 Q840 676 1200 90'/%3E%3Cpath d='M0 660 Q840 646 1200 60'/%3E%3Cpath d='M0 630 Q840 616 1200 30'/%3E%3Cpath d='M0 600 Q840 586 1200 0'/%3E%3Cpath d='M0 570 Q840 556 1200 -30'/%3E%3Cpath d='M0 540 Q840 526 1200 -60'/%3E%3Cpath d='M0 510 Q840 496 1200 -90'/%3E%3Cpath d='M0 480 Q840 466 1200 -120'/%3E%3Cpath d='M0 450 Q840 436 1200 -150'/%3E%3Cpath d='M0 420 Q840 406 1200 -180'/%3E%3Cpath d='M0 390 Q840 376 1200 -210'/%3E%3Cpath d='M0 360 Q840 346 1200 -240'/%3E%3Cpath d='M0 330 Q840 316 1200 -270'/%3E%3Cpath d='M0 300 Q840 286 1200 -300'/%3E%3Cpath d='M0 270 Q840 256 1200 -330'/%3E%3Cpath d='M0 240 Q840 226 1200 -360'/%3E%3Cpath d='M0 210 Q840 196 1200 -390'/%3E%3Cpath d='M0 180 Q840 166 1200 -420'/%3E%3Cpath d='M0 150 Q840 136 1200 -450'/%3E%3Cpath d='M0 120 Q840 106 1200 -480'/%3E%3Cpath d='M0 90 Q840 76 1200 -510'/%3E%3Cpath d='M0 60 Q840 46 1200 -540'/%3E%3Cpath d='M0 30 Q840 16 1200 -570'/%3E%3Cpath d='M0 0 Q840 -14 1200 -600'/%3E%3C/g%3E%3C/svg%3E");
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --halo: rgba(141,178,245,.5);
  --halo-fort: rgba(141,178,245,.2);
  --mot-lumiere: var(--lueur);
  --ease-est: cubic-bezier(.2,.7,.1,1);
}
[data-theme="formations"] { --halo: rgba(242,169,59,.34); --halo-fort: rgba(242,169,59,.14); --mot-lumiere: var(--aube); }

/* Titres d'ouverture : Archivo élargie, très grasse */
.est-titre-ouverture { font-family: var(--font-titre); font-weight: 800; font-stretch: 112%; font-size: 60px; line-height: 62px; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.est-titre-ouverture em { font-style: normal; color: var(--mot-lumiere); }

/* ---------- Matière : le plan profond ---------- */
.est-matiere { position: relative; isolation: isolate; overflow: hidden; background: var(--abysse); color: var(--ink-inverse); }
.est-matiere::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: cover; background-position: center; opacity: .085;
  -webkit-mask-image: radial-gradient(120% 90% at 85% 10%, #000 0%, rgba(0,0,0,.6) 45%, transparent 85%); mask-image: radial-gradient(120% 90% at 85% 10%, #000 0%, rgba(0,0,0,.6) 45%, transparent 85%); }
.est-matiere::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background-image: var(--tex-grain); opacity: .07; mix-blend-mode: soft-light; }
.est-halo { position: absolute; z-index: -1; pointer-events: none; right: -12%; top: -38%; width: 75%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--halo), var(--halo-fort) 45%, transparent 100%); filter: blur(8px); animation: est-lever 2.4s var(--ease-est) both; }
@keyframes est-lever { from { opacity: 0; transform: translateY(14%); } to { opacity: 1; transform: none; } }

/* Lignes de niveau sur fond clair */
.est-niveaux { position: relative; isolation: isolate; }
.est-niveaux::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-sombre); background-size: cover; opacity: .07; pointer-events: none;
  -webkit-mask-image: linear-gradient(105deg, transparent 20%, #000 75%); mask-image: linear-gradient(105deg, transparent 20%, #000 75%); }

/* L'arc en strates : trois plans et une arête de lumière */
.est-strates-arc { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; z-index: -1; width: 100%; display: block; }
.est-strates-arc .p1 { fill: var(--est-bleu); }
.est-strates-arc .p2 { fill: var(--est-marine); }
.est-strates-arc .p3 { fill: var(--abysse); }
.est-strates-arc .arete { fill: none; stroke: var(--mot-lumiere); stroke-width: 1.5; opacity: .9; vector-effect: non-scaling-stroke; }

/* ---------- Ouverture (hero) ---------- */
.est-ouverture { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; padding: 72px 64px 120px; min-height: 420px; }
.est-ouverture .est-filet { color: var(--ink-inverse); }
.est-ouverture .est-chapeau { margin: 20px 0 32px; font-size: 19px; line-height: 30px; color: var(--ink-inverse-muted); max-width: 520px; }
.est-ouverture .est-row { gap: 16px; }

/* Pile de strates : trois cellules décalées du joint × 4 */
.est-pile { position: relative; height: 300px; }
.est-pile > * { position: absolute; inset: 0; }
.est-pile .s3 { background: var(--est-marine); transform: translate(48px,-48px); box-shadow: var(--shadow-relief); }
.est-pile .s2 { background: var(--est-bleu); transform: translate(24px,-24px); box-shadow: var(--shadow-relief); background-image: var(--tex-niveaux-clair); background-size: 900px; background-blend-mode: soft-light; }
.est-pile .s1 { background: var(--surface-raised); color: var(--ink); padding: 24px 26px; box-shadow: var(--shadow-relief); display: flex; flex-direction: column; gap: 10px; animation: est-poser .9s .2s var(--ease-est) both; }
@keyframes est-poser { from { opacity: 0; transform: translate(24px,-24px); } to { opacity: 1; transform: none; } }
.est-pile .s1 h3 { margin: 0; font: 700 20px/26px var(--font-titre); }
.est-pile .s1 p { margin: 0; font-size: 14px; line-height: 21px; color: var(--ink-muted); }
.est-jeton { position: absolute; left: -28px; bottom: -22px; z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--abysse); color: var(--ink-inverse); font: 600 11px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; box-shadow: var(--shadow-relief); border-top: 1px solid rgba(255,255,255,.14); }
.est-pouls { width: 8px; height: 8px; border-radius: var(--radius-trait); background: var(--est-rouge); box-shadow: 0 0 0 0 rgba(229,27,33,.6); animation: est-pouls 2.4s ease-out infinite; }
@keyframes est-pouls { 0% { box-shadow: 0 0 0 0 rgba(229,27,33,.55); } 70%,100% { box-shadow: 0 0 0 10px rgba(229,27,33,0); } }

/* Mini-rail (dans une carte) */
.est-minirail { display: grid; grid-template-columns: repeat(4,1fr); position: relative; margin-top: auto; padding-top: 22px; }
.est-minirail::before { content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 3px; border-radius: var(--radius-trait); background: var(--line); }
.est-minirail::after { content: ""; position: absolute; left: 4px; top: 4px; height: 3px; width: 40%; border-radius: var(--radius-trait); background: var(--rail); transform-origin: left; animation: est-tracer 1.4s .6s var(--ease-est) both; }
.est-minirail span { position: relative; font: 600 10px/14px var(--font-signal); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.est-minirail span::before { content: ""; position: absolute; left: 0; top: -22px; width: 11px; height: 11px; border-radius: var(--radius-trait); background: var(--surface-raised); border: 3px solid var(--line); box-sizing: border-box; z-index: 1; }
.est-minirail span.fait::before { border-color: var(--rail); background: var(--rail); }
.est-minirail span.actif::before { border-color: var(--est-rouge); background: var(--est-rouge); box-shadow: 0 0 0 4px rgba(229,27,33,.15); }
.est-minirail span.actif { color: var(--ink); }
@keyframes est-tracer { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Bouton : profondeur et mouvement ---------- */
.est-btn { position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(8,18,51,.18); transition: background .2s ease, color .2s ease, transform .2s var(--ease-est), box-shadow .2s ease; }
.est-btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px -10px rgba(8,18,51,.55); }
.est-btn:active { transform: none; }
.est-btn--second, .est-btn--lien { box-shadow: none; }
.est-btn--second:hover { box-shadow: none; }
.est-btn--lien:hover { transform: none; box-shadow: none; }
.est-btn .est-fleche { transition: width .25s var(--ease-est); }
.est-btn:hover .est-fleche { width: 26px; }
.est-btn--lumiere { background: #ffffff; border-color: #ffffff; color: var(--est-marine); box-shadow: 0 0 0 0 var(--halo), 0 12px 30px -12px rgba(0,0,0,.6); }
.est-btn--lumiere:hover { background: #ffffff; border-color: #ffffff; color: var(--est-marine); box-shadow: 0 0 0 6px var(--halo-fort), 0 16px 34px -12px rgba(0,0,0,.7); }
.est-btn--fantome { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.32); color: #ffffff; box-shadow: none; backdrop-filter: blur(6px); }
.est-btn--fantome:hover { background: rgba(255,255,255,.1); border-color: #ffffff; color: #ffffff; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .est-btn, .est-btn:hover { transform: none; } }

/* ---------- Cellules en relief ---------- */
.est-cellule { position: relative; isolation: isolate; overflow: hidden; transition: transform .35s var(--ease-est), box-shadow .35s var(--ease-est); }
a.est-cellule, .est-cellule--active { cursor: pointer; text-decoration: none; }
a.est-cellule:hover, .est-cellule--active:hover { transform: translateY(-6px); box-shadow: var(--shadow-strate); z-index: 2; }
.est-cellule--marine, .est-cellule--bleu { box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.est-cellule--marine::before, .est-cellule--bleu::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: 1100px; background-position: 70% 30%; opacity: .12; transition: opacity .4s ease, background-position 1.2s var(--ease-est); }
a.est-cellule:hover::before { opacity: .22; background-position: 60% 40%; }
.est-cellule--marine { background: linear-gradient(160deg, var(--est-marine) 0%, var(--abysse) 130%); }
.est-fantome { position: absolute; right: -6px; bottom: -34px; z-index: -1; font: 600 150px/1 var(--font-signal); letter-spacing: -.04em; -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px currentColor; opacity: .28; transition: transform .6s var(--ease-est), opacity .4s ease; pointer-events: none; }
a.est-cellule:hover .est-fantome { transform: translateY(-10px); opacity: .45; }
.est-cellule .est-fleche-coin { position: absolute; right: 22px; top: 22px; width: 34px; height: 34px; border-radius: var(--radius-trait); border: 1.5px solid currentColor; opacity: .5; display: grid; place-items: center; transition: transform .35s var(--ease-est), opacity .3s ease, background .3s ease; }
.est-cellule .est-fleche-coin::after { content: ""; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateX(-1px) rotate(45deg); }
a.est-cellule:hover .est-fleche-coin { opacity: 1; transform: translateX(4px); background: rgba(255,255,255,.12); }
.est-cellule--photo { padding: 0; background: var(--est-marine); }

/* ---------- Chiffres sur abysse ---------- */
.est-chiffres--matiere { gap: 0; }
.est-chiffres--matiere .est-chiffre { background: transparent; border-top: 0; padding: 40px 32px 32px; position: relative; }
.est-chiffres--matiere .est-chiffre + .est-chiffre { box-shadow: inset 1px 0 0 rgba(255,255,255,.1); }
.est-chiffres--matiere .est-chiffre::before { content: ""; position: absolute; left: 32px; top: 0; width: 40px; height: var(--trait); border-radius: var(--radius-trait); background: var(--mot-lumiere); }
.est-chiffres--matiere .est-chiffre b { font-size: 88px; line-height: 84px; letter-spacing: -.03em; color: #ffffff; position: relative; }
.est-chiffres--matiere .est-chiffre b sup { font-size: 32px; line-height: 1; vertical-align: top; color: var(--mot-lumiere); margin-left: 4px; }
.est-chiffres--matiere .est-chiffre span { color: #ffffff; font-size: 17px; line-height: 24px; margin-top: 14px; }
.est-chiffres--matiere .est-chiffre small { color: var(--ink-inverse-muted); }
.est-chiffres--matiere .est-avalider { border-color: var(--aube); color: var(--aube); }

/* ---------- Rail tracé ---------- */
.est-rail::before { transform-origin: left; animation: est-tracer 1.6s .1s var(--ease-est) both; }
.est-rail li { animation: est-apparaitre .7s var(--ease-est) both; }
.est-rail li:nth-child(2) { animation-delay: .25s; } .est-rail li:nth-child(3) { animation-delay: .5s; } .est-rail li:nth-child(4) { animation-delay: .75s; }
@keyframes est-apparaitre { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.est-rail li.est-rail__actif::before { box-shadow: 0 0 0 6px rgba(229,27,33,.14); }
.est-rail--sombre::before { background: linear-gradient(90deg, var(--mot-lumiere), rgba(141,178,245,.15)); }
.est-rail--sombre li::before { background: var(--abysse); border-color: var(--mot-lumiere); }
.est-rail--sombre .est-num { color: var(--ink-inverse-muted); }
.est-rail--sombre h3 { color: #ffffff; }
.est-rail--sombre p { color: var(--ink-inverse-muted); }

@media (prefers-reduced-motion: reduce) {
  .est-halo, .est-pile .s1, .est-minirail::after, .est-rail::before, .est-rail li, .est-pouls { animation: none; }
  .est-cellule, .est-fantome { transition: none; }
}

/* ---------- Volume et vie ---------- */
.est-matiere::before { animation: est-derive 90s linear infinite alternate; }
@keyframes est-derive { from { background-position: 50% 40%; } to { background-position: 50% 62%; } }
.est-pile { perspective: 1100px; }
.est-pile .est-volume { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--ry, -10deg)) rotateX(var(--rx, 7deg)); transition: transform .6s var(--ease-est); }
.est-pile .est-volume > * { position: absolute; inset: 0; }
.est-pile .s3 { transform: translate3d(72px,-60px,-120px); }
.est-pile .s2 { transform: translate3d(36px,-30px,-60px); }
.est-pile .s1 { transform: translateZ(0); }
.est-pile .est-jeton { transform: translateZ(60px); }
.est-titre-ouverture em { background: linear-gradient(90deg, var(--mot-lumiere), #ffffff 50%, var(--mot-lumiere)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: est-reflet 6s 1.2s ease-in-out infinite; }
@keyframes est-reflet { 0%,60% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .est-matiere::before, .est-titre-ouverture em { animation: none; }
  .est-titre-ouverture em { color: var(--mot-lumiere); -webkit-text-fill-color: var(--mot-lumiere); }
  .est-pile .est-volume { transition: none; }
}
.est-pile .est-volume > .est-jeton { inset: auto; left: -28px; bottom: -22px; }

/* =====================================================================
   V3 — Calendrier des sessions, mémoire technique
   ===================================================================== */

/* ---------- Calendrier (EST FORMATIONS) ---------- */
.est-cal { display: flex; flex-direction: column; gap: var(--joint); }
.est-cal__filtres { display: inline-flex; flex-wrap: wrap; gap: var(--joint); margin-bottom: 18px; background: transparent; }
.est-cal__filtre { position: relative; display: inline-flex; align-items: baseline; gap: 6px; font: 600 12px/16px var(--font-signal); letter-spacing: .16em; text-transform: uppercase; padding: 12px 18px 13px; border-radius: var(--radius-none); background: var(--surface-raised); color: var(--ink); text-decoration: none; transition: background .2s ease, color .2s ease; }
.est-cal__filtre::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 6px; height: 2px; background: var(--aube); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-est); }
.est-cal__filtre:hover::after { transform: scaleX(1); }
.est-cal__filtre[aria-pressed="true"] { background: var(--abysse); color: #ffffff; }
.est-cal__filtre[aria-pressed="true"]::after { transform: scaleX(1); }
.est-cal__filtre .n { font: 500 11px/16px var(--font-signal); letter-spacing: .04em; opacity: .6; }
.est-cal__mois { display: flex; align-items: baseline; gap: 14px; margin: 18px 0 6px; font: 600 13px/16px var(--font-signal); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.est-cal__mois::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.est-session { position: relative; display: grid; grid-template-columns: 148px 1fr 200px 210px; align-items: stretch; background: var(--surface-raised); text-decoration: none; color: var(--ink); transition: transform .35s var(--ease-est), box-shadow .35s var(--ease-est); }
.est-session:hover { transform: translateY(-4px); box-shadow: var(--shadow-strate); z-index: 2; }
.est-session__date { position: relative; isolation: isolate; overflow: hidden; background: var(--abysse); color: #ffffff; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.est-session__date::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: 700px; background-position: 80% 20%; opacity: .14; }
.est-session__date b { font: 600 44px/40px var(--font-signal); letter-spacing: -.02em; }
.est-session__date span { font: 600 12px/16px var(--font-signal); letter-spacing: .2em; text-transform: uppercase; color: var(--aube); }
.est-session__date small { margin-top: 6px; font: 500 12px/16px var(--font-signal); letter-spacing: .06em; color: var(--ink-inverse-muted); }
.est-session__date::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--surface); }
.est-session__corps { padding: 18px 24px; display: flex; flex-direction: column; justify-content: center; gap: 6px; border-left: 2px dashed var(--line); }
.est-session__corps h3 { margin: 0; font: 700 19px/24px var(--font-titre); }
.est-session__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.est-session__meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); vertical-align: middle; margin-right: 14px; }
.est-session__jauge { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.est-jauge { height: 6px; border-radius: var(--radius-trait); background: var(--surface-sunken); overflow: hidden; }
.est-jauge i { display: block; height: 100%; border-radius: var(--radius-trait); background: var(--rail); transform-origin: left; animation: est-tracer 1.2s .2s var(--ease-est) both; }
.est-session--presque .est-jauge i { background: var(--aube); }
.est-session--complete .est-jauge i { background: var(--line-strong); }
.est-session__jauge small { font: 500 13px/18px var(--font-signal); letter-spacing: .04em; color: var(--ink-muted); }
.est-session__action { padding: 18px 22px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; }
.est-session__action .est-btn { padding: 10px 18px; font-size: 15px; }
.est-session--complete { background: var(--surface-sunken); }
.est-session--complete .est-session__date { background: var(--est-marine); }
.est-session--complete h3 { color: var(--ink-muted); }

/* ---------- Mémoire technique : la page et ses encadrés ---------- */
.est-bureau { background: var(--surface-sunken); padding: 36px 48px; }
.est-feuille { position: relative; background: #ffffff; color: #0f1b3d; max-width: 820px; margin: 0 auto; padding: 0 56px 48px; box-shadow: 0 1px 2px rgba(8,18,51,.08), 0 30px 60px -24px rgba(8,18,51,.35); }
.est-feuille__tete { display: flex; align-items: center; gap: 16px; padding: 22px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.est-feuille__tete img { height: 28px; width: auto; display: block; }
.est-feuille__tete .t { font: 600 11px/16px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; color: #4e5a72; }
.est-feuille__tete .p { margin-left: auto; font: 600 12px/16px var(--font-signal); letter-spacing: .1em; color: #4e5a72; }
.est-feuille h2 { margin: 10px 0 12px; font: 800 26px/32px var(--font-titre); font-stretch: 108%; letter-spacing: -.015em; }
.est-feuille h2 .num { color: var(--est-bleu); margin-right: 10px; }
.est-feuille > p { margin: 0 0 22px; font-size: 15px; line-height: 24px; color: #2b3654; }
.est-legende { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 26px; font: 600 11px/16px var(--font-signal); letter-spacing: .14em; text-transform: uppercase; color: #4e5a72; }
.est-legende span { display: inline-flex; align-items: center; gap: 8px; }
.est-legende i { width: 14px; height: 14px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(15,27,61,.25); }

.est-bloc { position: relative; margin-top: 26px; padding: 22px 24px 20px; font-size: 15px; line-height: 24px; }
.est-bloc__onglet { position: absolute; left: 0; top: -13px; display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; font: 600 11px/26px var(--font-signal); letter-spacing: .18em; text-transform: uppercase; }
.est-bloc p { margin: 0; }
.est-bloc__ref { position: absolute; right: 24px; top: -11px; font: 600 11px/22px var(--font-signal); letter-spacing: .12em; text-transform: uppercase; padding: 0 10px; background: #ffffff; color: #4e5a72; }

.est-bloc--fait, i.est-l--fait { background: #f1f3f8; }
.est-bloc--fait .est-bloc__onglet { background: #0f1b3d; color: #ffffff; }

.est-bloc--engagement, i.est-l--engagement { background: var(--abysse); }
.est-bloc--engagement { color: #ffffff; isolation: isolate; overflow: visible; padding-left: 64px; }
.est-bloc--engagement::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--tex-niveaux-clair); background-size: 900px; background-position: 90% 10%; opacity: .12; }
.est-bloc--engagement::after { content: ""; position: absolute; left: 28px; top: 24px; bottom: 22px; width: 4px; border-radius: var(--radius-trait); background: linear-gradient(var(--est-rouge) 0 14px, var(--lueur) 14px); }
.est-bloc--engagement .est-bloc__onglet { background: var(--est-rouge); color: #ffffff; }
.est-bloc--engagement strong { color: var(--lueur); font-weight: 600; }

.est-bloc--perso, i.est-l--perso { background: repeating-linear-gradient(-45deg, #ffffff 0 7px, #fdf3e2 7px 9px); }
.est-bloc--perso { outline: 1.5px dashed #b5781c; outline-offset: -1.5px; }
.est-bloc--perso .est-bloc__onglet { background: var(--aube); color: #0f1b3d; }
.est-champ-ao { display: inline-block; padding: 0 8px; margin: 0 2px; background: var(--aube); color: #0f1b3d; font: 600 13px/22px var(--font-signal); letter-spacing: .04em; border-radius: 2px; }
.est-bloc--perso small { display: block; margin-top: 10px; font: 500 12px/16px var(--font-signal); letter-spacing: .06em; color: #8a5000; }

.est-bloc--piece, i.est-l--piece { background: var(--horizon); }
.est-bloc--piece { color: #193478; display: grid; grid-template-columns: 46px 1fr; gap: 18px; align-items: center; }
.est-bloc--piece .est-bloc__onglet { background: #193478; color: #ffffff; }
.est-doc { position: relative; width: 38px; height: 48px; background: #ffffff; box-shadow: 0 6px 14px -6px rgba(8,18,51,.4); clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.est-doc::before { content: ""; position: absolute; right: 0; top: 0; width: 28%; height: 22%; background: #9fb4dc; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.est-doc::after { content: ""; position: absolute; left: 7px; right: 9px; top: 20px; height: 2px; background: #c6d2ea; box-shadow: 0 6px 0 #c6d2ea, 0 12px 0 #c6d2ea, 0 18px 0 #e51b21; }
.est-bloc--piece .est-doc + div b { display: block; font: 700 15px/22px var(--font-titre); }
.est-bloc--piece .est-doc + div span { font: 500 13px/18px var(--font-signal); letter-spacing: .04em; color: #2752a0; }

/* Billets de session : version mobile */
@media (max-width: 980px) {
  .est-session { grid-template-columns: 1fr; }
  .est-session__date { flex-direction: row; align-items: baseline; gap: 12px; padding: 14px 18px; }
  .est-session__date b { font-size: 34px; line-height: 34px; order: -1; }
  .est-session__date small { margin: 0 0 0 auto; }
  .est-session__date::after { right: auto; left: 50%; top: auto; bottom: -7px; margin: 0 0 0 -7px; }
  .est-session__corps { border-left: 0; border-top: 2px dashed var(--line); padding: 18px 18px 6px; }
  .est-session__jauge { padding: 10px 18px; }
  .est-session__action { padding: 6px 18px 18px; }
  .est-session__action .est-btn { width: 100%; }
  .est-cal__filtres { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -20px; padding-right: 20px; }
  .est-cal__filtre { white-space: nowrap; flex: 0 0 auto; }
}
