/* ==========================================================================
   POPUP DE CHOIX + BARRE DE VERSION
   Autonome : même apparence sur les 3 pages, quelle que soit la feuille de style.
   ========================================================================== */
.chooser, .vbar {
  --c-paper: #fbf9f5;
  --c-ink: #1d1f1e;
  --c-ink-soft: #4a4d4b;
  --c-ink-mute: #7c7f7b;
  --c-line: rgba(29, 31, 30, .14);
  --c-forest: #1f3d2f;
  --c-forest-deep: #12251b;
  --c-forest-accent: #2f6b4c;
  --c-oak: #b8895a;
  --c-teal: #1d757f;
  --c-salmon: #e06549;
  --c-ease: cubic-bezier(.2, .7, .2, 1);
  --c-head: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --c-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --c-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-family: var(--c-body);
  line-height: 1.5;
}

.chooser-open, .chooser-open body { overflow: hidden; }

.chooser {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.chooser[hidden] { display: none; }

.chooser__overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 20, 17, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .45s var(--c-ease);
}

.chooser__dialog {
  position: relative;
  width: min(1000px, 100%);
  margin: auto;
  background: var(--c-paper);
  color: var(--c-ink);
  border-radius: 12px;
  padding: clamp(28px, 4vw, 48px);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(24px) scale(.985);
  transition: opacity .5s var(--c-ease), transform .65s var(--c-ease);
  outline: none;
}
.chooser__dialog::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, var(--c-teal) 0 50%, var(--c-forest) 50% 85%, var(--c-oak) 85%);
}

.chooser.is-open .chooser__overlay { opacity: 1; }
.chooser.is-open .chooser__dialog { opacity: 1; transform: none; }
.chooser.is-closing .chooser__overlay { opacity: 0; }
.chooser.is-closing .chooser__dialog { opacity: 0; transform: translateY(12px) scale(.99); transition-duration: .35s; }
.chooser.is-leaving .chooser__dialog { transform: scale(.98); opacity: .6; transition-duration: .25s; }

.chooser__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: #fff;
  color: var(--c-ink-soft);
  cursor: pointer;
  transition: background .3s, color .3s, transform .4s var(--c-ease), border-color .3s;
}
.chooser__close svg { width: 18px; height: 18px; }
.chooser__close:hover { background: var(--c-ink); border-color: var(--c-ink); color: #fff; transform: rotate(90deg); }

.chooser__head { max-width: 640px; margin-bottom: clamp(24px, 3vw, 34px); padding-right: 48px; }
.chooser__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font: 500 11px/1.3 var(--c-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-forest-accent);
}
.chooser__eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--c-oak); }
.chooser__title {
  margin: 0;
  font: 700 clamp(26px, 3.2vw, 40px)/1.1 var(--c-head);
  letter-spacing: -.025em;
}
.chooser__intro { margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: var(--c-ink-soft); }

.chooser__options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Cartes de choix (liens entièrement cliquables) ---------- */
.choice {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--c-ease), transform .55s var(--c-ease), border-color .3s, box-shadow .4s var(--c-ease);
}
.chooser.is-open .choice { opacity: 1; transform: none; }
.chooser.is-open .choice:nth-child(1) { transition-delay: .15s, .15s, 0s, 0s; }
.chooser.is-open .choice:nth-child(2) { transition-delay: .25s, .25s, 0s, 0s; }
.chooser.is-open .choice:hover,
.chooser.is-open .choice:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, .45);
  transition-delay: 0s;
}
.choice--classique:hover, .choice--classique:focus-visible { border-color: var(--c-teal); }
.choice--nouvelle:hover, .choice--nouvelle:focus-visible { border-color: var(--c-forest); }
.choice:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 3px; }

.choice__visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e9e6df;
  border-bottom: 1px solid var(--c-line);
}
.choice__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .8s var(--c-ease);
}
.choice:hover .choice__visual img { transform: scale(1.04); }
.choice__badge {
  position: absolute;
  left: 12px; top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  font: 500 10.5px/1.2 var(--c-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-ink);
}

.choice__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.choice__num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 10.5px/1.3 var(--c-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-ink-mute);
  margin-bottom: 10px;
}
.choice__title { font: 700 21px/1.25 var(--c-head); letter-spacing: -.015em; }
.choice__text { margin-top: 8px; flex: 1; font-size: 14.5px; line-height: 1.6; color: var(--c-ink-soft); }
.choice__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 6px;
  font: 700 15px/1.2 var(--c-head);
  color: #fff;
  transition: background .3s;
}
.choice__cta svg { width: 16px; height: 16px; flex: none; transition: transform .3s var(--c-ease); }
.choice--classique .choice__cta { background: var(--c-teal); }
.choice--classique:hover .choice__cta { background: #0f5d67; }
.choice--nouvelle .choice__cta { background: var(--c-forest); }
.choice--nouvelle:hover .choice__cta { background: var(--c-forest-deep); }
.choice:hover .choice__cta svg { transform: translateX(4px); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot--classique { background: linear-gradient(135deg, var(--c-teal) 0 55%, var(--c-salmon) 55%); }
.dot--nouvelle { background: linear-gradient(135deg, var(--c-forest) 0 55%, var(--c-oak) 55%); }

.chooser__skip {
  display: block;
  margin: 22px auto 0;
  min-height: 44px;
  padding: 10px 16px;
  background: none;
  border: 0;
  font: 500 14.5px/1.2 var(--c-body);
  color: var(--c-ink-soft);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color .3s, text-decoration-color .3s;
}
.chooser__skip:hover { color: var(--c-ink); text-decoration-color: currentColor; }
.chooser__credit {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-ink-mute);
}

/* ---------- Barre de version (bas de page, versions 1 et 2) ---------- */
.vbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(27, 30, 29, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
  color: #fbf9f5;
  transform: translateX(-50%);
  animation: vbarIn .6s var(--c-ease) .6s both;
}
@keyframes vbarIn { from { opacity: 0; transform: translate(-50%, 20px); } }
.vbar__current, .vbar__switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background .25s;
}
.vbar__current:hover { background: rgba(255, 255, 255, .08); }
.vbar__current span { display: grid; gap: 2px; }
.vbar__current small { font: 500 9.5px/1 var(--c-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(251, 249, 245, .55); }
.vbar__current b { font: 700 14px/1.1 var(--c-head); }
.vbar__switch { background: #fbf9f5; color: var(--c-ink); font: 700 14px/1.1 var(--c-head); }
.vbar__switch:hover { background: #fff; }
.vbar__switch svg { width: 15px; height: 15px; transition: transform .3s var(--c-ease); }
.vbar__switch:hover svg { transform: translateX(3px); }
.vbar .dot { width: 14px; height: 14px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.menu-open .vbar { opacity: 0; pointer-events: none; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .chooser { padding: 10px; }
  .chooser__dialog { padding: 26px 16px 18px; border-radius: 10px; }
  .chooser__close { top: 10px; right: 10px; }
  .chooser__head { padding-right: 44px; }
  .chooser__intro { font-size: 15px; }
  .chooser__options { grid-template-columns: 1fr; gap: 14px; }
  .choice__visual { aspect-ratio: 16 / 8; }
  .choice__body { padding: 18px 18px 18px; }
  .choice__title { font-size: 19px; }
  .choice__text { font-size: 14.5px; }

  .vbar { bottom: 12px; max-width: calc(100% - 20px); }
  .vbar__current { padding: 6px 10px; }
  .vbar__current small { display: none; }
  .vbar__current b { font-size: 13px; }
  .vbar__switch { padding: 6px 12px; font-size: 13px; }
}
@media (max-width: 400px) {
  .vbar__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chooser *, .vbar { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   TRANSITION DE SCÈNE (rideau entre les pages)
   ========================================================================== */
html.scene-arriving body { visibility: hidden; }

.scene {
  --s-bg: #141816;
  --s-accent: #2f6b4c;
  --s-ease: cubic-bezier(.76, 0, .24, 1);
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: visible;
  pointer-events: all;
  overflow: hidden;
}
.scene--classique { --s-bg: #0f5d67; --s-accent: #e06549; }
.scene--nouvelle  { --s-bg: #1f3d2f; --s-accent: #c49a6c; }

.scene__band, .scene__panel {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
}
.scene__band { background: var(--s-accent); }
.scene__panel {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--s-bg);
  color: #fbf9f5;
}
.scene__content {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
}
.scene__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font: 800 20px/1 "Manrope", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .04em;
}
.scene__brand svg { width: 34px; height: 34px; color: #fbf9f5; }
.scene__brand--classique { font: 800 26px/1 "Raleway", "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em; }
.scene__brand--classique i { font-style: normal; color: var(--s-accent); font-weight: 600; }
.scene__label {
  font: 500 11px/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(251, 249, 245, .6);
}
.scene__label::before, .scene__label::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin: 0 12px;
  vertical-align: middle;
  background: var(--s-accent);
}
.scene__title {
  max-width: 16ch;
  font: 700 clamp(30px, 4.6vw, 60px)/1.05 "Manrope", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.025em;
}
.scene--classique .scene__title { font-family: "Raleway", "Helvetica Neue", Arial, sans-serif; font-weight: 800; letter-spacing: -.01em; }

/* Départ : la bande d'accent puis le panneau montent, le texte apparaît */
.scene.is-entering .scene__band  { animation: sceneUp .7s var(--s-ease) forwards; }
.scene.is-entering .scene__panel { animation: sceneUp .7s var(--s-ease) .09s forwards; }
.scene.is-entering .scene__content { animation: sceneText .5s var(--s-ease) .45s forwards; }

/* Arrivée : rideau déjà en place… */
.scene.is-covering .scene__band,
.scene.is-covering .scene__panel { transform: none; }
.scene.is-covering .scene__content { opacity: 1; transform: none; }
/* …puis il se lève vers le haut */
.scene.is-leaving { pointer-events: none; }
.scene.is-leaving .scene__band,
.scene.is-leaving .scene__panel { transform: none; }
.scene.is-leaving .scene__content { opacity: 1; transform: none; animation: sceneTextOut .35s var(--s-ease) forwards; }
.scene.is-leaving .scene__panel { animation: sceneAway .8s var(--s-ease) .2s forwards; }
.scene.is-leaving .scene__band  { animation: sceneAway .8s var(--s-ease) .3s forwards; }

@keyframes sceneUp      { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sceneAway    { from { transform: translateY(0); }    to { transform: translateY(-100%); } }
@keyframes sceneText    { to { opacity: 1; transform: none; } }
@keyframes sceneTextOut { to { opacity: 0; transform: translateY(-18px); } }

@media (prefers-reduced-motion: reduce) {
  html.scene-arriving body { visibility: visible; }
  .scene { display: none; }
}
