/* Calibre RB-01 — candidature Gerald Genta et Daniel Roth.
   Ambiance reprise des pages Gerald Genta : galerie claire, bleu nuit, Futura léger (ici Jost, son équivalent libre),
   beaucoup d'air. Une seule couleur d'accent, le vieux rose des pages Genta, réservée au parcours. */
:root {
  --fond: #f3f3f3;          /* gris galerie */
  --blanc: #ffffff;
  --nuit: #132333;          /* encre Genta : titres et parcours */
  --gris: #687180;          /* histoire : discret */
  --gris-clair: #a8aeb7;
  --rose: #c49a3c;          /* accent : or des gravures de la montre (filets, repères, RB-01, bouton) */
  --rose-fonce: #8a6418;    /* or foncé pour le petit texte (contraste suffisant sur fond clair) */
  --police: 'Jost', 'Futura PT', Futura, 'Century Gothic', sans-serif;
  --col: min(31rem, calc(var(--scene, 100vw) * .36));  /* colonne du récit, à gauche */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fond); color: var(--nuit); font: 300 1rem/1.6 var(--police); -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; cursor: grab; touch-action: pan-y; }
body.saisi, body.saisi #scene { cursor: grabbing; user-select: none; }

/* ---------- Récit ---------- */
#recit { position: relative; z-index: 1; pointer-events: none; }
.chap { min-height: 150vh; padding: 0 clamp(1.25rem, 5vw, 5rem) 0 calc(var(--marge, 0px) + clamp(1.25rem, 5vw, 5rem)); display: flex; flex-direction: column; justify-content: center; }
.chap:not(.intro):not(.fin) { display: block; padding-top: 16vh; }
.chap > * { pointer-events: auto; }
/* le texte reste en place pendant que les pièces descendent ; un voile clair le garde lisible sans cacher la montre */
.colle { position: sticky; top: 14vh; max-width: calc(var(--col) + 3rem); margin-left: -1.5rem; padding: 1.4rem 1.5rem;
  background: radial-gradient(closest-side at 45% 50%, rgba(243, 243, 243, .94) 60%, rgba(243, 243, 243, 0) 100%); }

/* ---------- Accueil ---------- */
.intro { padding: 0 clamp(1.25rem, 5vw, 5rem); min-height: 100vh; align-items: center; text-align: center; }
.intro-txt { max-width: 40rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.surtitre { font: 400 .78rem/1.4 var(--police); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin: 0 0 1.4rem; }
.intro h1 { font: 300 clamp(3rem, 6.4vw, 5.6rem)/.98 var(--police); text-transform: uppercase; letter-spacing: .01em; color: var(--nuit); margin: 0 0 1.6rem; }
.intro h1 .ref { display: block; color: var(--rose); }
.intro-sous { font: 300 clamp(1.1rem, 1.5vw, 1.3rem)/1.55 var(--police); margin: 0 0 2.6rem; color: var(--nuit); max-width: 30ch; }
.intro-aide { font: 300 .92rem/1.5 var(--police); color: var(--gris); margin: 0; max-width: 36ch; }
#demarrer { font: 500 .8rem/1 var(--police); letter-spacing: .12em; text-transform: uppercase; color: var(--blanc); background: var(--rose); border: 1px solid var(--rose);
  border-radius: 999px; padding: .85rem 1.6rem; cursor: pointer; margin: 0 0 1.8rem; transition: background .25s, color .25s; }
#demarrer:hover { background: var(--nuit); border-color: var(--nuit); }
body.accueil #frise, body.accueil #commandes { opacity: 0; pointer-events: none; }

/* ---------- 1. L'histoire : discrète ---------- */
.etape { max-width: var(--col); opacity: .3; transition: opacity .6s ease; }
.chap.on .etape { opacity: 1; }
.etape-num { font: 400 .74rem/1 var(--police); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin-bottom: .9rem; }
.etape h2 { font: 300 clamp(1.7rem, 2.4vw, 2.3rem)/1.1 var(--police); text-transform: uppercase; color: var(--nuit); margin: 0 0 .8rem; }
.etape p { font: 300 1rem/1.65 var(--police); color: var(--gris); margin: 0; max-width: 36ch; }
.provisoire { display: inline-block; margin-top: .8rem; font: 400 .72rem/1 var(--police); color: var(--gris); border: 1px dashed var(--gris-clair); border-radius: 3px; padding: .3rem .5rem; }

/* ---------- 2. Le lien : ce que la pièce dit du candidat ---------- */
.lien { max-width: var(--col); margin-top: 1.5rem; opacity: .3; transition: opacity .6s ease .1s; }
.chap.on .lien { opacity: 1; }
.lien-titre { font: 300 clamp(1.2rem, 1.7vw, 1.45rem)/1.3 var(--police); font-style: italic; color: var(--nuit); margin: 0 0 .55rem; }
.lien ul { list-style: none; margin: 0; padding: 0; }
.lien li { font: 300 .97rem/1.5 var(--police); color: var(--gris); margin-bottom: .25rem; }

/* ---------- 3. Le parcours : la partie à retenir ---------- */
.fiche { max-width: 27rem; margin-top: 2.2rem; padding: .1rem 0 .1rem 1.3rem; position: relative;
  transform: translateY(1rem); opacity: 0; transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .5s ease; }
.fiche::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--rose);
  transform: scaleY(0); transform-origin: top; transition: transform .9s .15s cubic-bezier(.2, .7, .2, 1); }
.chap.on .fiche { transform: none; opacity: 1; }
.chap.on .fiche::before { transform: scaleY(1); }
.fiche-dates { font: 300 2.5rem/1 var(--police); color: var(--nuit); margin: 0 0 .45rem; letter-spacing: -.01em; }
.fiche-poste { font: 500 .95rem/1.3 var(--police); letter-spacing: .1em; text-transform: uppercase; color: var(--nuit); margin: 0 0 1.1rem; }
.fiche-entreprise { display: block; font: 400 1.05rem/1.3 var(--police); letter-spacing: 0; text-transform: none; color: var(--rose-fonce); margin-top: .2rem; }
.fiche h4 { font: 400 .72rem/1 var(--police); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin: 0 0 .6rem; }
.fiche ul { list-style: none; margin: 0 0 1.1rem; padding: 0; }
.realisations li { font: 400 .97rem/1.45 var(--police); color: var(--nuit); padding-left: 1.1rem; position: relative; margin-bottom: .35rem; }
.realisations li::before { content: ''; position: absolute; left: 0; top: .72em; width: .55rem; height: 1px; background: var(--rose); }   /* index de cadran */
.qualites { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.qualites li { font: 300 .93rem/1.4 var(--police); font-style: italic; color: var(--rose-fonce); position: relative; padding-left: .75rem; }
.qualites li::before { content: ''; position: absolute; left: 0; top: .55em; width: 3px; height: 3px; border-radius: 50%; background: var(--rose); }
.fiche-texte { font: 400 .95rem/1.5 var(--police); color: var(--nuit); margin: 0; }
.fiche-texte a { color: inherit; text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: .2em; }
.fiche + .fiche { margin-top: 1.6rem; }
/* point à confirmer avec Roberto avant la mise en ligne (disparaîtra dans la version finale) */
.a-valider { margin: .4rem 0 0; padding: .5rem .7rem; font: 400 .8rem/1.45 var(--police); color: var(--gris); border: 1px dashed var(--rose); border-radius: 3px; }
/* mise en ligne : étiquettes de travail masquées (les retirer de cette règle pour les revoir) */
.provisoire, .a-valider { display: none !important; }
.a-valider strong { font-weight: 500; color: var(--rose-fonce); margin-right: .3rem; }

/* ---------- Frise du parcours (à droite) ---------- */
#frise { position: fixed; right: max(clamp(.8rem, 2vw, 2rem), calc(var(--marge, 0px) - 13rem));   /* écran large : juste à droite du cadre, sans passer sur la montre */ top: 50%; transform: translateY(-50%); z-index: 2; transition: opacity .6s; }
#frise ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; position: relative; }
#frise ol::before { content: ''; position: absolute; right: .32rem; top: .3rem; bottom: .3rem; width: 1px; background: var(--gris-clair); }
#frise li { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; font: 400 .8rem/1 var(--police); color: var(--gris); }
#frise li span { opacity: 0; transform: translateX(.4rem); transition: opacity .4s, transform .4s; }
#frise li::after { content: ''; width: .66rem; height: .66rem; border-radius: 50%; border: 1px solid var(--gris-clair); background: var(--fond); transition: background .4s, border-color .4s; }
#frise li.fait { color: var(--nuit); }
#frise li.fait::after { background: var(--rose); border-color: var(--rose); }
#frise li.fait span, #frise:hover li span { opacity: 1; transform: none; }

/* ---------- Fin : l'offre point par point, puis le contact ---------- */
.fin { min-height: 130vh; padding-top: 14vh; padding-bottom: 14vh; justify-content: flex-start; }
.fin .colle { position: static; max-width: min(52rem, calc(var(--scene, 100vw) * .52)); background: none; }
.fin h2 { font: 300 clamp(2rem, 3.6vw, 3.2rem)/1.05 var(--police); text-transform: uppercase; color: var(--nuit); margin: 0 0 1rem; }
.fin .colle > p { font: 300 1.05rem/1.6 var(--police); color: var(--gris); max-width: 46ch; margin: 0 0 2rem; }
.offre { list-style: none; margin: 0 0 2.5rem; padding: 0; border-top: 1px solid var(--gris-clair); }
.offre li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid rgba(168, 174, 183, .5); }
.offre .demande { font: 400 .98rem/1.45 var(--police); color: var(--nuit); }
.offre .preuve { font: 300 .95rem/1.5 var(--police); color: var(--gris); }
.fin .fiche { opacity: 1; transform: none; margin-top: 1rem; }
.fin .fiche::before { transform: none; }

/* ---------- Commandes de la vue ---------- */
#commandes { position: fixed; right: calc(var(--marge, 0px) + clamp(.8rem, 2vw, 2rem)); bottom: 1.2rem; z-index: 3; display: flex; align-items: center; gap: .5rem; transition: opacity .6s;
  background: rgba(255, 255, 255, .8); border: 1px solid var(--nuit); border-radius: 999px; padding: .25rem .4rem; backdrop-filter: blur(6px); }
#commandes button { font: 400 1rem/1 var(--police); color: var(--nuit); background: none; border: 0; cursor: pointer; min-width: 2rem; height: 2rem; border-radius: 999px; }
#commandes button:hover { color: var(--rose-fonce); }
#recentrer { font-size: .72rem !important; letter-spacing: .12em; text-transform: uppercase; padding: 0 .8rem; border-left: 1px solid var(--gris-clair) !important; border-radius: 0 999px 999px 0 !important; }
#zoom { -webkit-appearance: none; appearance: none; width: 6.5rem; height: 1px; background: var(--nuit); outline-offset: 6px; }
#zoom::-webkit-slider-thumb { -webkit-appearance: none; width: .8rem; height: .8rem; border-radius: 50%; background: var(--nuit); cursor: pointer; }
#zoom::-moz-range-thumb { width: .8rem; height: .8rem; border: 0; border-radius: 50%; background: var(--nuit); cursor: pointer; }

#usinage { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 3; font: 400 .85rem/1 var(--police); color: var(--gris);
  background: rgba(255, 255, 255, .85); padding: .55rem .9rem; border-radius: 999px; transition: opacity .4s; }
#usinage.fini { opacity: 0; transition: opacity 1.2s 1s; }

:focus-visible { outline: 1px solid var(--nuit); outline-offset: 4px; }

/* ---------- Téléphone : la montre en haut, le récit défile dessous sur un voile clair ---------- */
@media (max-width: 760px) {
  :root { --col: 100%; }
  .chap { min-height: 120vh; justify-content: flex-end; padding-bottom: 12vh; }
  .chap:not(.intro):not(.fin) { padding-top: 60vh; }
  .intro { justify-content: flex-end; padding-bottom: 10vh; }
  .intro-txt { background: linear-gradient(to bottom, rgba(243, 243, 243, 0), rgba(243, 243, 243, .95) 3rem); padding-top: 3rem; }
  .colle { position: relative; top: auto; margin-left: 0; padding: 3rem 0 1.5rem; max-width: none; background: linear-gradient(to bottom, rgba(243, 243, 243, 0), rgba(243, 243, 243, .96) 3rem); }
  .fin .colle { max-width: none; }
  .fiche { max-width: none; }
  .offre li { grid-template-columns: 1fr; gap: .3rem; }
  #frise { top: .9rem; right: 50%; transform: translateX(50%); }
  #frise ol { flex-direction: row; gap: .9rem; }
  #frise ol::before { left: .3rem; right: .3rem; top: 50%; bottom: auto; width: auto; height: 1px; }
  #frise li span { display: none; }
  #usinage { top: 2.6rem; bottom: auto; white-space: nowrap; font-size: .8rem; }
  #zoom { display: none; }
  #commandes { bottom: .8rem; right: 50%; transform: translateX(50%); padding: .15rem .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .etape, .lien, .fiche, .fiche::before, #frise li span, #frise li::after { transition: none; }
}
body.a-la-fin #frise { opacity: 0; pointer-events: none; }

/* ---------- Entrée protégée (mot de passe) ---------- */
#porte { position: fixed; inset: 0; z-index: 20; background: var(--fond); display: grid; place-items: center; padding: 1.5rem; transition: opacity .6s; }
#porte.ouverte { opacity: 0; pointer-events: none; }
#porte form { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.1rem; }
#porte .porte-titre { font: 300 2.2rem/1 var(--police); text-transform: uppercase; color: var(--nuit); margin: 0; }
#porte .porte-titre span { color: var(--rose); }
#porte label { font: 400 .74rem/1.4 var(--police); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); }
#porte input { font: 300 1.4rem/1 var(--police); letter-spacing: .5em; text-align: center; width: 9rem; padding: .6rem 0 .6rem .5em; color: var(--nuit);
  background: transparent; border: 0; border-bottom: 1px solid var(--nuit); outline: none; }
#porte input:focus { border-bottom-color: var(--rose); }
#porte button { font: 500 .78rem/1 var(--police); letter-spacing: .12em; text-transform: uppercase; color: var(--blanc); background: var(--rose); border: 0; border-radius: 999px; padding: .8rem 1.5rem; cursor: pointer; }
#porte .porte-erreur { min-height: 1.2em; font: 400 .85rem/1.2 var(--police); color: #a33a2a; margin: 0; }
body.verrou { overflow: hidden; }
