/* ==========================================================================
   Composants : boutons, curseur, préchargement, bandeau défilant,
   formulaire, lecteur vidéo, salle de projection, fiches.
   ========================================================================== */

/* --- Bouton principal : plat, carré, une seule couleur --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3.4rem;
  padding: 0 1.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--step-body);
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn__arrow { flex: none; width: 1.05em; height: 1.05em; transition: transform var(--t-ui) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--incandescent-vif); }
  [data-field="incandescent"] .btn:hover { background: #22262d; }
  .btn:hover .btn__arrow { transform: translateX(4px); }
}
/* Aimant : le contenu suit le pointeur (js/modules/magnetic.js), le bouton reste cliquable. */
.magnetic { will-change: transform; }
.magnetic > .magnetic__inner { display: inline-flex; align-items: center; gap: inherit; transition: transform 380ms var(--ease-out); }

/* --- Curseur : point précis + halo qui s'agrandit sur les cibles --- */
.cursor {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  display: none;
}
html.has-cursor .cursor { display: block; }
html.has-cursor,
html.has-cursor a,
html.has-cursor button,
html.has-cursor [role="button"],
html.has-cursor label,
html.has-cursor summary { cursor: none; }
html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select { cursor: auto; }
.cursor__dot,
.cursor__halo {
  position: absolute;
  left: 0; top: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor__dot {
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--incandescent);
  transition: opacity var(--t-hover) ease, width var(--t-ui) var(--ease-out), height var(--t-ui) var(--ease-out), margin var(--t-ui) var(--ease-out);
}
.cursor__halo {
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  display: grid;
  place-items: center;
  background: var(--incandescent);
  color: var(--acier);
  font-size: var(--step-small);
  font-weight: 700;
  scale: 0.38;
  opacity: 0.16;
  transition: scale 420ms var(--ease-out), opacity 300ms ease, background-color 300ms ease;
}
.cursor__label { opacity: 0; transition: opacity 200ms ease; }
.cursor.is-link .cursor__halo { scale: 0.62; opacity: 0.28; }
.cursor.is-label .cursor__halo { scale: 1; opacity: 1; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-field .cursor__halo { background: var(--acier); }
.cursor.is-hidden { opacity: 0; }

/* --- Préchargement « mise en chauffe » --- */
.preloader { display: none; }
html.js.preload .preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-preloader);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--gutter);
  background: var(--acier);
  color: var(--craie);
  clip-path: inset(0 0 0 0);
}
.preloader__temp {
  align-self: end;
  font-family: "Schibsted Grotesk Block", var(--font);
  height: 0.82em;
  font-size: clamp(5rem, 1rem + 19vw, 19rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
  color: #3a3f47;
  white-space: nowrap;
}
.preloader__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: var(--step-small);
  color: var(--gris-acier);
}
.preloader__bar { height: 3px; margin-top: 0.9rem; background: #23272e; overflow: hidden; }
.preloader__bar span { display: block; height: 100%; background: var(--incandescent); transform-origin: left; transform: scaleX(var(--p, 0)); }
.preloader.is-done { clip-path: inset(0 0 100% 0); transition: clip-path 1000ms var(--ease-in-out); }

/* --- Bandeau défilant : une phrase, très grande, qui traverse l'écran --- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding-block: clamp(1.5rem, 1rem + 2vw, 3rem);
  font-size: var(--step-poster);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: var(--track-display);
  user-select: none;
}
.marquee__track { display: inline-flex; gap: 0.35em; padding-right: 0.35em; }
.marquee__track span { display: inline-flex; align-items: center; gap: 0.35em; }
.marquee__track span::after {
  content: "";
  width: 0.42em; height: 0.42em;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 38s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* --- Formulaire (champ incandescent) --- */
.form { display: grid; gap: 1.4rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field { display: grid; gap: 0.5rem; }
.field label { font-weight: 700; font-size: var(--step-small); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  background: color-mix(in srgb, var(--craie) 26%, var(--bg));
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  transition: background-color var(--t-hover) ease;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field select { appearance: none; background-image: none; }
.field .select { position: relative; }
.field .select::after {
  content: "";
  position: absolute;
  right: 1.1rem; top: 50%;
  width: 0.55rem; height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--ink) 55%, transparent); }
.field input:focus,
.field select:focus,
.field textarea:focus { background: color-mix(in srgb, var(--craie) 40%, var(--bg)); outline: 2px solid var(--ink); outline-offset: 2px; }
.field__hint { font-size: var(--step-small); color: var(--muted); }
.field [aria-invalid="true"] { border-bottom-color: #5a0f00; background: color-mix(in srgb, #fff 34%, var(--bg)); }
.field__error { font-size: var(--step-small); font-weight: 700; color: #3d0a00; min-height: 1.2em; }
.form__status { font-weight: 600; min-height: 1.5em; }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }

/* --- Lecteur vidéo (boutons son et plein écran) --- */
.player { position: relative; }
.player__controls {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}
.player__btn {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  background: color-mix(in srgb, var(--acier) 82%, transparent);
  color: var(--craie);
  transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.player__btn:active { transform: scale(0.94); }
.player__btn svg { width: 1.2rem; height: 1.2rem; }
.player__btn[aria-pressed="true"] { background: var(--incandescent); color: var(--acier); }
@media (hover: hover) and (pointer: fine) {
  .player__btn:hover { background: var(--acier); }
  .player__btn[aria-pressed="true"]:hover { background: var(--incandescent-vif); }
}
.player .icon-on { display: none; }
.player__btn[aria-pressed="true"] .icon-on { display: block; }
.player__btn[aria-pressed="true"] .icon-off { display: none; }

/* Vidéo différée : l'affiche (picture) reste visible jusqu'à la lecture. */
.lazy-video { position: relative; overflow: hidden; background: var(--calamine); }
.lazy-video > picture,
.lazy-video > picture img,
.lazy-video > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lazy-video > video { opacity: 0; transition: opacity 500ms ease; }
.lazy-video.is-playing > video,
html:not(.js) .lazy-video > video { opacity: 1; }
.lazy-video--contain > picture img,
.lazy-video--contain > video { object-fit: contain; }

/* --- Salle de projection (boîte de dialogue native) --- */
.cinema {
  width: min(100vw, 100%);
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: var(--gutter);
  border: 0;
  background: #050608;
  color: var(--craie);
}
.cinema[open] { display: grid; grid-template-rows: auto 1fr; gap: 1rem; }
.cinema::backdrop { background: rgb(5 6 8 / 0.92); }
.cinema__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cinema__title { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; }
.cinema__close {
  min-height: 44px;
  padding: 0 1.1rem;
  background: var(--craie);
  color: var(--acier);
  font-weight: 700;
}
.cinema__stage { display: grid; place-items: center; min-height: 0; }
.cinema video { max-width: 100%; max-height: calc(100svh - 7rem); width: auto; height: 100%; aspect-ratio: 9 / 16; background: #000; }
@media (prefers-reduced-motion: no-preference) {
  .cinema[open] { animation: cinema-in 380ms var(--ease-out); }
  @keyframes cinema-in { from { opacity: 0; transform: scale(0.98); } }
}

/* --- Liste de définitions (fiches projet) --- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1.25rem var(--gutter); }
.facts dt { font-size: var(--step-small); color: var(--muted); margin-bottom: 0.3rem; }
.facts dd { font-weight: 600; line-height: 1.35; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.chips li {
  padding: 0.45rem 0.8rem;
  background: var(--surface);
  font-size: var(--step-small);
  font-weight: 600;
  line-height: 1.2;
}
