/* neoria-v5. Sombre, culot, typo liee a --p. Tokens du socle seulement. */
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
}

html {
  --p: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 80;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: var(--accent-fg);
}

.skip:focus {
  top: 0.4rem;
}

/* Tete : marque + nav + verbe. Telephone cache la nav. */
.tete {
  background: var(--veil);
}

.tete__marque {
  letter-spacing: 0.04em;
}

/* Chapitre pin. Un progress. Le monde change d'etat. */
.chapitre-3d {
  position: relative;
  height: 320vh;
  min-height: 2200px;
}

.chapitre-3d--court {
  height: 180vh;
  min-height: 1400px;
}

.chapitre-3d--start {
  height: 220vh;
  min-height: 1700px;
}

.chapitre-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.scene,
#scene-host,
.scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#scene-host {
  pointer-events: none;
}

.scene__poster[hidden] {
  display: none;
}

.scene__poster:not([hidden]),
html[data-socle-scene="fallback"] .scene__poster {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 1;
  align-items: flex-end;
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  background: var(--bg-mute);
}

.voile {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(18, 20, 26, 0.2) 0%,
    rgba(18, 20, 26, 0.45) 42%,
    var(--veil) 100%
  );
}

/* Typo machine. Les lignes se deplacent avec --p. */
.typo-machine {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: calc(var(--header-h) + 1.6rem) var(--gutter) 9rem;
  pointer-events: none;
}

.typo-ghost {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 28%;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 14rem);
  font-weight: var(--fw-bold);
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--fg);
  opacity: calc(0.05 + (var(--p) * 0.1));
  transform: scale(calc(0.84 + (var(--p) * 0.42)));
  transform-origin: left center;
  pointer-events: none;
  user-select: none;
}

.typo-kicker {
  margin: 0 0 0.7rem;
  max-width: 28rem;
  pointer-events: auto;
}

.typo-titre {
  margin: 0;
  max-width: 18ch;
}

.typo-ligne {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  font-weight: var(--fw-bold);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--fg);
  will-change: transform;
}

.typo-ligne--a {
  transform: translate3d(
    calc(var(--p) * var(--sx, -16) * 1vw),
    calc(var(--p) * var(--sy, -7) * 1vh),
    0
  );
}

.typo-ligne--b {
  margin-top: 0.12em;
  transform: translate3d(
    calc(var(--p) * var(--sx, 14) * 1vw),
    calc(var(--p) * var(--sy, 5) * 1vh),
    0
  );
}

html[data-etat="preuve"] .typo-ligne--a,
html[data-etat="methode"] .typo-ligne--a {
  opacity: 0.72;
}

html[data-etat="sortie"] .typo-ligne,
html[data-etat="page"] .typo-ligne {
  opacity: 0.38;
}

.barre-p {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 3px;
  background: var(--line);
  pointer-events: none;
}

.barre-p::after {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(var(--p));
  transform-origin: left center;
}

.ruban {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.1rem;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  white-space: nowrap;
}

.ruban__inner {
  display: inline-block;
  padding-left: var(--gutter);
  transform: translate3d(calc(var(--p) * -35%), 0, 0);
}

.bande {
  display: none;
}

@media (min-width: 960px) {
  .bande {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    position: absolute;
    top: calc(var(--header-h) + 1.4rem);
    right: var(--gutter);
    z-index: 3;
    width: 7.5rem;
    pointer-events: none;
    transform: translate3d(0, calc(var(--p) * -28%), 0);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    letter-spacing: var(--ls-meta);
    text-transform: uppercase;
    color: var(--fg-faint);
  }

  .bande span {
    display: block;
    border-top: 1px solid var(--line);
    padding-top: 0.35rem;
  }
}

.beats {
  position: relative;
  z-index: 4;
  height: 100%;
  pointer-events: none;
}

[data-beat] {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 3.4rem;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
}

[data-beat].is-on {
  opacity: 1;
  pointer-events: auto;
}

[data-beat] .sur-decor {
  max-width: 38rem;
}

[data-beat] .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

/* Suite vente. Vraie hauteur. */
.suite {
  position: relative;
  z-index: 2;
  padding: 4.5rem var(--gutter) 5rem;
  max-width: 76rem;
  margin: 0 auto;
}

.bloc {
  padding-block: 3.2rem;
  border-top: 1px solid var(--line);
}

.bloc:first-child {
  border-top: 0;
  padding-top: 0;
}

.bloc__tete {
  display: grid;
  gap: 0.7rem;
  max-width: 46rem;
  margin-bottom: 1.8rem;
}

.bloc h2 {
  margin: 0;
}

.bloc .t-body {
  margin: 0;
}

/* Deux tickets. Pas quatre cartes. */
.tickets__rang {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 800px) {
  .tickets__rang {
    grid-template-columns: 1fr 1fr;
  }
}

.ticket {
  display: grid;
  gap: 0.45rem;
  padding: 1.6rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 800px) {
  .ticket {
    padding: 1.8rem 2rem 2.2rem 0;
    border-bottom: 0;
  }

  .ticket + .ticket {
    border-left: 1px solid var(--line);
    padding-left: 2rem;
    padding-right: 0;
  }
}

.ticket__n {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.ticket__prix {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: var(--fw-bold);
  line-height: 0.95;
  letter-spacing: var(--ls-display);
  color: var(--fg);
}

.ticket h2 {
  margin: 0.4rem 0 0;
  font-family: var(--font-body);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.ticket p {
  margin: 0;
  color: var(--fg-mute);
}

.filet {
  margin: 1.4rem 0 0;
  max-width: 46rem;
  color: var(--fg-mute);
}

/* Methode : une pile, pas trois cartes identiques. */
.methode {
  list-style: none;
  margin: 0;
  padding: 0;
}

.methode li {
  display: grid;
  gap: 0.35rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
}

.methode li:last-child {
  border-bottom: 1px solid var(--line);
}

.methode__n {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.methode__l {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
}

.methode li:nth-child(1) .methode__l {
  font-size: var(--fs-xl);
}

.methode li:nth-child(2) .methode__l {
  font-size: var(--fs-2xl);
}

.methode li:nth-child(3) .methode__l {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

/* Teaser. Quatre noms, statuts vrais. */
.teaser {
  list-style: none;
  margin: 0;
  padding: 0;
}

.teaser li {
  border-top: 1px solid var(--line);
}

.teaser li:last-child {
  border-bottom: 1px solid var(--line);
}

.teaser a {
  display: grid;
  grid-template-columns: minmax(7rem, 0.4fr) 1fr auto;
  gap: 0.8rem 1.2rem;
  align-items: baseline;
  min-height: var(--tap-min);
  padding: 1.05rem 0;
  text-decoration: none;
}

.teaser__nom {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

.teaser__etat {
  color: var(--fg-mute);
}

.teaser__verbe {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--accent);
}

@media (max-width: 700px) {
  .teaser a {
    grid-template-columns: 1fr auto;
  }

  .teaser__etat {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Temoins sans photo. */
.temoins {
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .temoins {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.preuve {
  max-width: none;
}

.pastille {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--fg-mute);
}

.cas__photo {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.8rem;
  padding: 1rem;
  background: var(--bg-mute);
  color: var(--fg-mute);
  text-align: center;
}

/* FAQ */
.faq {
  display: grid;
  gap: 0;
  max-width: 46rem;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0.85rem 0;
  cursor: pointer;
  font-weight: var(--fw-semibold);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq details p {
  margin: 0 0 1.1rem;
  color: var(--fg-mute);
  max-width: 46ch;
}

/* Formulaire */
.formulaire {
  margin-top: 1.2rem;
}

.champ__ctrl {
  min-height: var(--tap-min);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--bg-elev);
  color: var(--fg);
  font: inherit;
}

.champ__ctrl:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-note,
[data-form-ok] {
  margin: 0.7rem 0 0;
  color: var(--fg-mute);
}

/* Work : un projet a la fois, puis la liste. */
.livre {
  display: grid;
  gap: 1.4rem;
  margin-bottom: 3rem;
}

.livre__cadre {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 900px) {
  .livre__cadre {
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 2.4rem;
  }
}

.livre__media {
  overflow: hidden;
  background: var(--bg-mute);
  border-radius: var(--radius-card);
}

.livre__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: rotate(calc((var(--livre-dir, 0)) * -4deg)) scale(1.04);
  transition: transform 700ms var(--ease-appear), opacity 500ms var(--ease-ui);
}

.livre.is-swap .livre__media img {
  opacity: 0.35;
}

.livre__corps {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.livre__corps h2 {
  margin: 0;
}

.livre__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}

.livre__nav button {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.livre__nav button:hover,
.livre__nav button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.livre__compte {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-meta);
  color: var(--fg-mute);
}

.grille {
  display: grid;
  gap: 2.2rem;
}

@media (min-width: 900px) {
  .grille {
    grid-template-columns: 1fr 1fr;
  }
}

.projet .carte__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-mute);
}

.projet .carte__corps {
  display: grid;
  gap: 0.35rem;
}

.projet .carte__verbe {
  position: static;
  opacity: 1;
  pointer-events: auto;
  margin: 0.5rem 0 0;
  width: fit-content;
}

/* Start : video-slot, pas de media au first load. */
.video-slot {
  position: relative;
  z-index: 2;
  width: min(100%, 72rem);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  background: var(--bg-mute);
  color: var(--fg);
  text-align: left;
  padding: 1.4rem;
}

.video-slot .sur-decor {
  max-width: 36rem;
}

.page-start .typo-machine {
  justify-content: flex-start;
  padding-top: calc(var(--header-h) + 1rem);
  padding-bottom: 0;
}

.page-start .typo-titre {
  max-width: 16ch;
}

.page-start .video-slot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: calc(var(--header-h) + 8.2rem);
  bottom: 8.4rem;
  width: auto;
  margin: 0;
  aspect-ratio: auto;
}

.machines-nommees {
  display: grid;
  gap: 0;
}

.machines-nommees li {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.machines-nommees {
  list-style: none;
  margin: 0;
  padding: 0;
}

.machines-nommees li:last-child {
  border-bottom: 1px solid var(--line);
}

.machines-nommees .n {
  font-family: var(--font-mono);
  color: var(--fg-mute);
}

.badge {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* 404 */
.page-404 main {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-content: center;
  padding: 3rem var(--gutter) 4rem;
}

.page-404 h1 {
  max-width: 12ch;
}

/* Pied */
.pied {
  padding: 2.2rem var(--gutter) 2.6rem;
  border-top: 1px solid var(--line);
  color: var(--fg-mute);
}

.pied__rang {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.4rem;
  align-items: center;
  max-width: 76rem;
  margin: 0 auto 0.8rem;
}

.pied a {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.pied a:hover,
.pied a:focus-visible {
  color: var(--fg);
}

.pied__note {
  max-width: 76rem;
  margin: 0 auto;
}

.mentions {
  max-width: 46rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Reduced motion : le texte reste. L'etat peut encore changer. */
@media (prefers-reduced-motion: reduce) {
  .typo-ligne,
  .typo-ligne--a,
  .typo-ligne--b,
  .typo-ghost,
  .ruban__inner,
  .bande,
  .livre__media img {
    transform: none;
    opacity: 1;
  }

  .typo-ghost {
    opacity: 0.08;
  }
}

@media (max-width: 700px) {
  .typo-machine {
    padding-bottom: 9.5rem;
  }

  [data-beat] {
    bottom: 4.4rem;
  }

  .typo-ghost {
    top: 22%;
    font-size: clamp(3.2rem, 22vw, 6rem);
  }

  .video-slot {
    aspect-ratio: auto;
    min-height: 18rem;
  }

  .page-start .video-slot {
    top: calc(var(--header-h) + 7.2rem);
    bottom: 9.2rem;
    min-height: 0;
  }

  .page-start .typo-ligne {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }
}
