/* Thème « paddock clair » (repris de Docs/Presentation, version web) : sport auto sur fond
   blanc, pour le vidéoprojecteur. Chaque diapo fait 1280 × 720 et est mise à l'échelle de la
   fenêtre par moteur.js. Aucune ressource chargée depuis Internet. */

@font-face { font-family: "RC"; src: url(../polices/RobotoCondensed-Regular.ttf); font-weight: 400; font-style: normal; }
@font-face { font-family: "RC"; src: url(../polices/RobotoCondensed-Italic.ttf); font-weight: 400; font-style: italic; }
@font-face { font-family: "RC"; src: url(../polices/RobotoCondensed-Bold.ttf); font-weight: 700 900; font-style: normal; }
@font-face { font-family: "RC"; src: url(../polices/RobotoCondensed-BoldItalic.ttf); font-weight: 700 900; font-style: italic; }

:root {
  --fond: #fff; --encre: #15171a; --accent: #e10600; --doux: #5f6368; --filet: #b8bcc2;
  --codefond: #eef0f2; --cadre: #1b1c1e;
  --police: "RC", "Roboto Condensed", "Arial Narrow", sans-serif;
  --police-code: ui-monospace, "DejaVu Sans Mono", monospace;
  --marge: 72px;
  --vite: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--cadre); overflow: hidden; font-family: var(--police); color: var(--encre); }
.deck { position: fixed; inset: 0; display: grid; place-items: center; }

/* ------------------------------------------------------------------ Diapo */
.diapo {
  position: absolute; width: 1280px; height: 720px; padding: 56px var(--marge) 64px;
  background: var(--fond); overflow: hidden; transform-origin: center center;
  display: flex; flex-direction: column; gap: 18px; font-size: 22px; line-height: 1.4;
  visibility: hidden; opacity: 0; transition: opacity .35s ease, visibility 0s .35s;
}
.diapo.active { visibility: visible; opacity: 1; transition: opacity .35s ease; }
.diapo > * { position: relative; z-index: 1; }
.deco { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; }
.notes { display: none !important; }

/* Titre de diapo : bandeau rouge incliné, qui entre par la gauche */
h2 {
  align-self: flex-start; background: var(--accent); color: #fff; font-style: italic; font-weight: 900;
  font-size: 32px; line-height: 1.15; padding: 6px 26px; transform: skewX(-14deg); margin-left: 8px;
}
.diapo.joue h2 { animation: bandeau .6s var(--vite) both; }
@keyframes bandeau {
  from { clip-path: inset(0 100% 0 0); transform: skewX(-14deg) translateX(-40px); }
  to   { clip-path: inset(0 0 0 0);    transform: skewX(-14deg) translateX(0); }
}

/* Rubrique en haut à droite (la partie de l'oral) */
.rubrique {
  position: absolute; top: 22px; right: var(--marge); color: var(--doux); font-size: 17px; font-weight: 700;
  font-style: italic; text-transform: uppercase; letter-spacing: .04em;
}
.rubrique::before {
  content: ""; display: inline-block; width: 22px; height: 3px; background: var(--accent);
  vertical-align: middle; margin-right: 8px;
}

/* Pied (numéro) et barre de progression, ajoutés par moteur.js */
.pied { position: absolute; right: var(--marge); bottom: 22px; font-size: 14px; font-weight: 700; letter-spacing: .04em; z-index: 2; }
.progression { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: color-mix(in srgb, var(--filet) 60%, transparent); }
.progression::after {
  content: ""; position: absolute; inset: 0 auto 0 0; background: var(--accent);
  width: calc(var(--p-avant) * 100%); transition: width .8s var(--vite);
}
.diapo.joue .progression::after { width: calc(var(--p) * 100%); }

/* ------------------------------------------------------------------ Étapes
   [data-etape="n"] apparaît à l'étape n de la diapo (flèche droite / espace).
   Variantes : data-effet="gauche" | "droite" | "zoom" | "fondu". */
[data-etape] { opacity: 0; transition: opacity .45s ease, transform .55s var(--vite); }
[data-etape]:not(g):not([data-effet="fondu"]) { transform: translateY(14px); }
[data-etape][data-effet="gauche"]:not(g) { transform: translateX(-30px); }
[data-etape][data-effet="droite"]:not(g) { transform: translateX(30px); }
[data-etape][data-effet="zoom"]:not(g)   { transform: scale(.92); }
[data-etape].vu { opacity: 1; transform: none !important; }
/* Inverse : disparaît à l'étape n */
[data-cache-etape] { transition: opacity .4s ease; }
[data-cache-etape].cache { opacity: 0; }

/* Entrées automatiques à l'arrivée sur la diapo : class="entree" style="--retard: .3s" */
.entree { opacity: 0; }
.diapo.joue .entree { animation: entree .7s var(--vite) var(--retard, 0s) both; }
@keyframes entree { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Badge de difficulté (Q4)
   Numéroté automatiquement dans l'ordre de l'oral par moteur.js. */
.difficulte {
  display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 18px;
  border-left: 8px solid var(--accent); background: var(--codefond); padding: 14px 22px; font-size: 19px; line-height: 1.3;
}
.difficulte .badge {
  background: var(--encre); color: #fff; font-weight: 900; font-style: italic; font-size: 17px;
  padding: 4px 14px; transform: skewX(-14deg); white-space: nowrap;
}
.difficulte .probleme { color: var(--doux); }
.difficulte .probleme b, .difficulte .solution b { color: var(--encre); }
.difficulte .vers { color: var(--accent); font-weight: 900; font-size: 30px; }
.difficulte.vu .vers { animation: pousse .9s var(--vite) .25s both; }
@keyframes pousse { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ Diapo de titre */
.diapo-titre { justify-content: center; padding-left: 96px; }
.diapo-titre .surtitre { color: var(--doux); font-size: 20px; letter-spacing: .02em; }
.diapo-titre h1 { font-style: italic; font-weight: 900; font-size: 210px; line-height: .9; letter-spacing: -.02em; }
.diapo-titre .sous-titre { color: var(--accent); font-style: italic; font-weight: 700; font-size: 38px; }
.diapo-titre .auteurs { margin-top: 26px; font-size: 20px; font-weight: 700; }
.diapo-titre .auteurs span { color: var(--doux); font-weight: 400; margin-left: 16px; }
.diapo-titre .version { position: absolute; right: 26px; bottom: 14px; font-size: 13px; color: var(--doux); }
.diapo-titre .pied, .diapo-titre .progression { display: none; }

/* La bande rouge et le damier traversent l'écran ; le titre arrive comme une voiture */
.diapo-titre .bande { position: absolute; left: 0; bottom: 92px; height: 14px; width: 100%; background: var(--accent); transform-origin: left; }
.diapo-titre .damier {
  position: absolute; left: 0; bottom: 40px; height: 52px; width: 100%;
  background: conic-gradient(var(--encre) 25%, transparent 0 50%, var(--encre) 0 75%, transparent 0) 0 0 / 26px 26px;
}
.diapo-titre .traine {
  position: absolute; top: 318px; left: 0; height: 6px; width: 420px;
  background: linear-gradient(90deg, transparent, var(--accent)); opacity: 0;
}
.diapo-titre.joue .bande  { animation: bande 1s var(--vite) .1s both; }
.diapo-titre.joue .damier { animation: damier 1.2s var(--vite) .25s both; }
.diapo-titre.joue h1      { animation: voiture .9s var(--vite) .35s both; }
.diapo-titre.joue .traine { animation: traine 1.1s ease-out .35s both; }
@keyframes bande  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes damier { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes voiture {
  0%   { opacity: 0; transform: translateX(-260px) skewX(-18deg); filter: blur(6px); }
  70%  { opacity: 1; transform: translateX(10px) skewX(-6deg); filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes traine {
  0%   { opacity: 0; transform: translateX(-420px) scaleX(.4); }
  40%  { opacity: .9; }
  100% { opacity: 0; transform: translateX(120px) scaleX(1.4); }
}

/* ------------------------------------------------------------------ Schémas SVG animés */
.schema { width: 100%; flex: 1; min-height: 0; overflow: visible; }
.schema text { font-family: var(--police); fill: var(--encre); }
.schema .boite { fill: var(--codefond); stroke: var(--filet); stroke-width: 1.5; }
.schema .boite-forte { fill: var(--accent); stroke: var(--accent); }
.schema .titre-boite { font-size: 21px; font-weight: 700; text-anchor: middle; }
.schema .boite-forte + .titre-boite, .schema .clair { fill: #fff; }
.schema .sous { font-size: 14px; fill: var(--doux); text-anchor: middle; }
.schema .topic { fill: #fff; stroke: var(--filet); }
.schema .topic-texte { font-family: var(--police-code); font-size: 13px; text-anchor: middle; }
.schema .etiquette { font-size: 14px; fill: var(--doux); font-style: italic; }
/* Les traits se dessinent quand leur groupe apparaît (pathLength="1" sur le chemin) */
.schema .trait { fill: none; stroke: var(--doux); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s var(--vite) .15s; }
.schema .trait.rouge { stroke: var(--accent); }
.vu > .trait, .vu .trait, .schema .trait.vu { stroke-dashoffset: 0; }
/* Paquets qui circulent sur un chemin .flux (créés par moteur.js) */
.schema .paquet { fill: var(--doux); }
.schema .paquet.com { fill: var(--accent); }

/* ------------------------------------------------------------------ Accroche : une vraie phrase de l'agent */
.citation { position: relative; margin: 14px 40px 0 64px; }
.citation::before { /* le grand guillemet */
  content: "«"; position: absolute; left: -62px; top: -40px; font-size: 150px; line-height: 1;
  font-weight: 900; font-style: italic; color: var(--accent);
}
.citation .machine { font-size: 38px; line-height: 1.28; font-weight: 700; font-style: italic; min-height: 3.84em; }
.machine.tape::after { /* le curseur de la machine à écrire */
  content: ""; display: inline-block; width: 4px; height: .95em; margin-left: 4px; vertical-align: -.1em;
  background: var(--accent); animation: clignote .8s steps(1) infinite;
}
@keyframes clignote { 50% { opacity: 0; } }
.citation .source { margin-top: 14px; font-size: 22px; color: var(--doux); }
.citation .source::before { content: ""; display: inline-block; width: 34px; height: 3px; background: var(--accent); vertical-align: middle; margin-right: 12px; }
.citation .source b { color: var(--accent); font-size: 26px; }
.piliers { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.pilier { border-top: 6px solid var(--encre); padding: 14px 4px 0; display: flex; gap: 14px; align-items: flex-start; }
.pilier svg { flex: none; width: 46px; height: 46px; color: var(--accent); }
.pilier h3 { font-size: 24px; font-weight: 900; font-style: italic; line-height: 1.15; }
.pilier p { font-size: 17px; color: var(--doux); line-height: 1.35; margin-top: 4px; }

/* ------------------------------------------------------------------ Objectifs : une grille de départ
   Les places sont décalées comme sur une grille de F1 (colonne de droite plus bas) ; chaque
   place est marquée au sol par un crochet blanc… ici noir, sur fond clair. */
.grille-depart {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr;
  column-gap: 64px; row-gap: 26px; padding: 8px 40px 24px; position: relative;
}
.grille-depart::before { /* ligne médiane de la piste, en pointillés */
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px;
  background: repeating-linear-gradient(var(--filet) 0 18px, transparent 18px 34px);
}
.place {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr;
  column-gap: 22px; align-content: start; padding: 18px 24px 16px;
  border-top: 6px solid var(--encre); background: linear-gradient(var(--codefond), transparent 85%);
}
.place::before, .place::after { /* les deux branches du crochet */
  content: ""; position: absolute; top: -6px; width: 6px; height: 34px; background: var(--encre);
}
.place::before { left: 0; } .place::after { right: 0; }
.place:nth-child(even) { transform: translateY(46px); }
.grille-depart .place:nth-child(even).vu { transform: translateY(46px) !important; }
.place .pos {
  grid-row: 1 / 3; font-size: 64px; line-height: 1; font-weight: 900; font-style: italic; color: var(--accent);
}
.place h3 { font-size: 32px; font-weight: 900; font-style: italic; line-height: 1.1; }
.place p { font-size: 19px; color: var(--doux); line-height: 1.35; margin-top: 6px; }
/* Entrée : la place arrive comme une voiture qui se gare sur la grille */
.grille-depart .place[data-etape] { transform: translateX(-60px); }
.grille-depart .place[data-etape]:nth-child(even) { transform: translate(60px, 46px); }
.place.vu .pos { animation: allume .7s var(--vite) .2s both; }
@keyframes allume { from { opacity: 0; transform: scale(1.6); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Démo : le vrai front dans un navigateur
   Les pages sont rendues en 1640 × 820 puis réduites dans le cadre (voir .navigateur-contenu). */
.diapo-demo { padding: 22px 28px 30px; gap: 12px; }
.diapo-demo .pied { display: none; }
.demo-entete { display: flex; align-items: center; gap: 22px; }
.demo-entete h2 { font-size: 26px; padding: 4px 22px; }
.demo-legende { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; font-style: italic; }
.demo-legende .n {
  display: grid; place-items: center; width: 34px; height: 34px; background: var(--encre); color: #fff;
  font-weight: 900; transform: skewX(-14deg);
}
.demo-legende .t { animation: entree .45s var(--vite) both; }
.demo-simule { margin-left: auto; font-size: 15px; color: var(--doux); font-style: italic; }
.navigateur { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--filet);
  box-shadow: 0 10px 30px rgb(0 0 0 / .18); background: #2a2c30; }
.navigateur-barre { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #e9ebee; }
.navigateur-barre i { width: 11px; height: 11px; border-radius: 50%; background: #c4c7cc; }
.navigateur-barre i:first-child { background: var(--accent); }
.navigateur-url { margin-left: 14px; flex: 1; max-width: 560px; background: #fff; border-radius: 4px; padding: 2px 12px;
  font-family: var(--police-code); font-size: 13px; color: var(--doux); }
.navigateur-url::before { content: "🔒 "; font-size: 11px; }
.navigateur-contenu { position: relative; flex: 1; overflow: hidden; }
.navigateur-contenu iframe {
  position: absolute; top: 0; left: 0; width: 1640px; height: 820px; border: 0; background: #111;
  transform-origin: 0 0; transform: scale(var(--echelle-demo, .7512));
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.navigateur-contenu iframe.visible { opacity: 1; pointer-events: auto; }
.demo-apercu { display: grid; place-items: center; color: #ddd; font-size: 24px; font-style: italic; }
/* Le faux curseur */
.curseur { position: absolute; left: 0; top: 0; z-index: 5; width: 26px; height: 26px; pointer-events: none; opacity: 0;
  transition: transform .8s cubic-bezier(.4, 0, .2, 1), opacity .3s ease; }
.curseur.visible { opacity: 1; }
.curseur svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .5)); }
.curseur::after { content: ""; position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--accent); opacity: 0; }
.curseur.clic::after { animation: clic .5s ease-out; }
@keyframes clic { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(1.6); } }

/* ------------------------------------------------------------------ Divers */
.fort { font-weight: 700; }
.discret { color: var(--doux); }
.ecran-noir { position: fixed; inset: 0; background: #000; z-index: 100; display: none; }
body.noir .ecran-noir { display: block; }

/* Aperçus du mode présentateur : état final immédiat, sans animation */
body.apercu .diapo, body.apercu .diapo * { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .diapo *, .diapo { animation-duration: .01s !important; transition-duration: .01s !important; }
}

@media print {
  @page { size: 1280px 720px; margin: 0; }
  body { background: none; overflow: visible; }
  .deck { position: static; display: block; }
  .diapo { position: relative; visibility: visible; opacity: 1; transform: none !important; break-after: page; }
  [data-etape], .entree { opacity: 1 !important; transform: none !important; }
  .schema .trait { stroke-dashoffset: 0; }
  .grille-depart .place:nth-child(even) { transform: translateY(46px) !important; }
  .progression::after { width: calc(var(--p) * 100%); }
}
