/* Codes Balenciaga : noir et blanc stricts, grotesque en capitales, filets 1 px,
   angles vifs, aplats pleins. Ni ombre, ni arrondi, ni dégradé : l'image du film
   apporte toute la couleur. */

:root {
  --k: #000;
  --w: #fff;
  --bar: 40px;
  --rail: 44px;
  --gap: 16px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fast: 160ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

html {
  background: var(--k);
  scrollbar-width: none; /* le filet d'avancement et le fil d'étapes situent le visiteur */
}

html::-webkit-scrollbar {
  display: none;
}

body {
  font: 400 13px/1.45 var(--font);
  color: var(--k);
  background: var(--k);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Focus : un filet intérieur de la couleur du texte, donc visible sur fond
   blanc comme sur fond noir. */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

[hidden] {
  display: none !important;
}

/* Petites capitales d'interface */
.bar,
.rail,
.hint,
.restart,
.loader,
.cartel__index,
.cartel__title,
.detail__label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  line-height: 1.2;
}

/* ───── Image ───── */

#stage,
#still {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#still {
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

#still.is-on {
  opacity: 1;
  transition: opacity 200ms linear;
}

/* ───── Repères sur l'image ───── */

.hotspots {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  background: var(--w);
  border: 1px solid var(--k);
  outline: 1px solid var(--w);
  font-weight: 700;
  font-size: 12px;
  line-height: 28px;
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
}

/* Zone tactile élargie sans grossir le repère */
.hotspot::before {
  content: "";
  position: absolute;
  inset: -9px;
}

.hotspots.is-on .hotspot {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fast) linear;
  transition-delay: calc(var(--i) * 70ms);
}

.hotspot:hover,
.hotspot[aria-pressed="true"] {
  background: var(--k);
  color: var(--w);
  border-color: var(--w);
  outline-color: var(--k);
}

/* Posés sur l'image, claire ou sombre : au focus, l'élément s'inverse et
   prend un filet blanc intérieur. */
.hotspot:focus-visible,
.controls button:focus-visible,
.restart:focus-visible {
  background: var(--k);
  color: var(--w);
  outline: 2px solid var(--w);
  outline-offset: -5px;
}

/* ───── Bandeau ───── */

.bar {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap);
  padding: 0 14px;
  background: var(--w);
  border-bottom: 1px solid var(--k);
}

.bar__brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.bar__place {
  display: flex;
  gap: 18px;
  white-space: nowrap;
}

.bar__tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.bar__loading {
  font-variant-numeric: tabular-nums;
}

.lang {
  display: flex;
  gap: 2px;
}

.lang button {
  padding: 5px 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.lang button:hover {
  border-color: var(--k);
}

.lang button:focus-visible {
  outline-offset: -2px;
}

.lang button[aria-pressed="true"] {
  background: var(--k);
  color: var(--w);
}

/* Avancement de la visite : un filet épais sous le bandeau */
.bar__progress {
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: var(--k);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

/* ───── Fil d'étapes ───── */

.rail {
  position: fixed;
  z-index: 3; /* ses titres au survol passent devant les boutons précédent / suivant */
  top: var(--bar);
  right: 0;
  bottom: 0;
  width: var(--rail);
  background: var(--w);
  border-left: 1px solid var(--k);
}

.rail ol {
  list-style: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.rail li {
  flex: 1;
  min-height: 0;
  position: relative;
  border-bottom: 1px solid var(--k);
}

.rail li:last-child {
  border-bottom: 0;
}

.rail button {
  width: 100%;
  height: 100%;
  font-variant-numeric: tabular-nums;
}

.rail button:hover,
.rail button[aria-current="step"] {
  background: var(--k);
  color: var(--w);
  font-weight: 700;
}

/* Titre de l'arrêt, déployé à gauche du fil au survol */
.rail button::after {
  content: attr(data-title);
  position: absolute;
  top: -1px;
  bottom: -1px;
  right: 100%;
  display: none;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  font-weight: 700;
  background: var(--k);
  color: var(--w);
}

.rail button:hover::after,
.rail button:focus-visible::after {
  display: flex;
}

/* ───── Cartel ───── */

.cartel {
  position: fixed;
  z-index: 2;
  left: var(--gap);
  bottom: var(--gap);
  width: min(400px, calc(100vw - var(--rail) - 2 * var(--gap)));
  max-height: calc(100vh - var(--bar) - 2 * var(--gap));
  display: flex;
  flex-direction: column;
  background: var(--w);
  border: 1px solid var(--k);
  animation: cartel-in var(--fast) linear;
}

@keyframes cartel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.cartel__head button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 13px 14px 12px;
  text-align: left;
}

.cartel__index {
  font-variant-numeric: tabular-nums;
}

.cartel__title {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.cartel__sign {
  font-size: 18px;
  line-height: 0.6;
  font-weight: 400;
}

.cartel__sign::before {
  content: "+";
}

.cartel__head button[aria-expanded="true"] .cartel__sign::before {
  content: "−";
}

.cartel__body {
  overflow-y: auto;
  border-top: 1px solid var(--k);
}

.cartel__text {
  padding: 14px 14px 16px;
  max-width: 62ch;
}

.cartel__details {
  list-style: none;
}

.detail {
  border-top: 1px solid var(--k);
}

.detail button {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  text-align: left;
}

.detail__num {
  width: 22px;
  height: 22px;
  border: 1px solid var(--k);
  font-weight: 700;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.detail button:hover .detail__num,
.detail button[aria-expanded="true"] .detail__num {
  background: var(--k);
  color: var(--w);
}

.detail__label {
  font-weight: 700;
}

.detail__sign::before {
  content: "+";
  font-size: 15px;
  line-height: 1;
}

.detail button[aria-expanded="true"] .detail__sign::before {
  content: "−";
}

.detail__text {
  padding: 2px 14px 14px 48px;
}

/* ───── Précédent / suivant ───── */

.controls {
  position: fixed;
  z-index: 2;
  right: calc(var(--rail) + var(--gap));
  bottom: var(--gap);
  display: flex;
  flex-direction: column;
}

.controls button {
  width: 40px;
  height: 40px;
  background: var(--w);
  border: 1px solid var(--k);
  font-size: 15px;
  line-height: 1;
}

.controls button + button {
  margin-top: -1px;
}

.controls button:hover {
  background: var(--k);
  color: var(--w);
}

/* ───── Invitation à défiler, retour au début ───── */

.hint,
.restart {
  position: fixed;
  z-index: 2;
  left: calc((100vw - var(--rail)) / 2);
  bottom: var(--gap);
  transform: translateX(-50%);
  padding: 11px 14px;
  background: var(--w);
  border: 1px solid var(--k);
  font-weight: 700;
  white-space: nowrap;
}

.hint {
  pointer-events: none;
  transition: opacity var(--fast) linear;
}

.hint.is-off {
  opacity: 0;
}

.restart:hover {
  background: var(--k);
  color: var(--w);
  border-color: var(--w);
}

/* ───── Chargement : carton-titre ───── */

.loader {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  grid-template: "title title" 1fr "count label" auto / 1fr auto;
  align-items: end;
  padding: 20px;
  background: var(--k);
  color: var(--w);
  transition: opacity 200ms linear;
}

.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader__title {
  grid-area: title;
  align-self: start;
  display: grid;
  gap: 5px;
}

.loader__brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.loader__count {
  grid-area: count;
  font-weight: 700;
  font-size: clamp(96px, 24vw, 340px);
  line-height: 0.74;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-left: -0.05em;
}

.loader__label {
  grid-area: label;
  font-weight: 700;
}

.loader.is-error .loader__count {
  display: none;
}

.loader.is-error .loader__label {
  grid-area: count;
  max-width: 44ch;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  line-height: 1.4;
}

/* ───── Mobile ───── */

@media (max-width: 720px) {
  :root {
    --rail: 0px;
    --gap: 12px;
  }

  .rail,
  .bar__place {
    display: none;
  }

  .bar {
    grid-template-columns: 1fr auto;
  }

  .cartel {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 62vh;
    border-width: 1px 0 0;
  }

  .controls {
    top: calc(var(--bar) + var(--gap) + 4px);
    bottom: auto;
    right: var(--gap);
  }

  .hint,
  .restart {
    bottom: calc(var(--gap) + env(safe-area-inset-bottom, 0px));
  }
}

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