/* S7 · erreur 404 [lot B5]
   La carte du T-Rex arrive du fond du tunnel, centrée sur la ligne d'horizon ; il rugit ; puis elle s'éteint
   comme un vieil écran et sa ligne blanche devient l'horizon de S8.
   La géométrie (taille de la carte, hauteur de l'horizon, place de la carte) est calculée dans
   js/scenes/s7.js et posée en variables sur #s7. Tout est rangé sous `html.film #s7`. */

/* ------------------------------------------------------------------ sans le film */
html:not(.film) #s7 .s7-btn__label { display: inline; }
html:not(.film) #s7 .s7-calm { margin-top: var(--s-4); }

/* ------------------------------------------------------------------ dans le film */
html.film #s7 {
  --s7-hy: .54;            /* hauteur de l'horizon pendant la scène, en fraction de l'écran (posée par le JS) */
  --s7-cx: 50%;            /* centre de la carte, horizontal */
  --s7-w: 216px;           /* la carte */
  --s7-h: 384px;
  --s7-gap: 20px;
}
html.film #s7 .s7-static { display: none; }

/* la scène, sauf la ligne de la fin. Rien n'y bouge au rugissement que les copies du titre (voir s7.js) */
html.film #s7 .s7-shake {
  position: absolute;
  inset: 0;
}

/* la carte : un point posé sur l'horizon, la carte centrée dessus */
html.film #s7 .s7-rig {
  position: absolute;
  left: var(--s7-cx);
  top: calc(var(--s7-hy) * 100%);
  width: 0;
  height: 0;
  margin: 0;
  perspective: 1100px;
}
html.film #s7 .s7-mover {
  position: absolute;
  left: calc(var(--s7-w) / -2);
  top: calc(var(--s7-h) / -2);
  width: var(--s7-w);
  height: var(--s7-h);
  will-change: transform, opacity;
}
html.film #s7 .s7-squash {
  position: absolute;
  inset: 0;
  will-change: transform;
}
html.film #s7 .s7-kick {
  position: absolute;
  inset: 0;
}
html.film #s7 .s7-kick .card {
  --card-w: 100%;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
/* la dernière image de l'extrait, posée sur la vidéo dès qu'elle a fini (et quand on arrive après le rugissement) */
html.film #s7 .s7-fin {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
}
/* l'extrait ne fond pas : l'affiche est sa première image, il part net */
html.film #s7 .card__video { transition: none; }
/* la carte ouvre le film une fois le rugissement passé : la même icône de coin que les cartes de S4, seule */
html.film #s7 .card__badge--play { display: none; }
html.film #s7 .card__badge--expand { will-change: transform, opacity; }
html.film #s7 .card.is-live { cursor: pointer; }

/* le reflet sur le sol : la même image retournée, estompée */
html.film #s7 .s7-reflet {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 22px;
  transform: scaleY(-1);
  opacity: .3;
  filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .35) 14%, transparent 30%);
  mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .35) 14%, transparent 30%);
  pointer-events: none;
}
/* l'écran qui s'éteint : l'image se tasse, puis blanchit en devenant ligne */
html.film #s7 .s7-white {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 22px;
  /* le blanc vient du milieu : la ligne de l'écran se forme pendant que l'image se tasse dessus */
  background: linear-gradient(180deg, rgb(255 255 255 / .3) 0%, #fff 40%, #fff 60%, rgb(255 255 255 / .3) 100%);
  box-shadow: 0 0 34px 6px rgb(var(--ice-rgb) / .8);
  opacity: 0;
  pointer-events: none;
}

/* les textes. Téléphone : sous la carte, centrés. */
html.film #s7 .s7-text {
  position: absolute;
  left: max(var(--gutter), var(--safe-l));
  right: max(var(--gutter), var(--safe-r));
  top: calc(var(--s7-hy) * 100% + var(--s7-h) / 2 + var(--s7-gap));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  row-gap: 10px;
  text-align: center;
}
/* une ombre serrée : elle détache le texte du sol sans repeindre un grand flou à chaque image */
html.film #s7 .s7-kicker,
html.film #s7 .s7-note,
html.film #s7 .s7-hear {
  text-shadow: 0 0 3px rgb(var(--night-rgb) / .95), 0 1px 12px rgb(var(--night-rgb) / .85);
}
html.film #s7 .s7-kicker { will-change: transform, opacity; }
/* le titre et le temps calme occupent la même place, l'un après l'autre */
html.film #s7 .s7-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  width: 100%;
}
html.film #s7 .s7-slot > * { grid-area: 1 / 1; }
html.film #s7 .s7-title-wrap {
  position: relative;
  width: 100%;
  will-change: transform, opacity;
}
html.film #s7 .s7-title { font-size: calc(min(var(--fs-wide), 4.6rem) * var(--fit, 1)); }
/* les deux copies de couleur du titre : derrière lui, décalées pendant le rugissement */
html.film #s7 .s7-ghost {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
html.film #s7 .s7-ghost,
html.film #s7 .s7-ghost .em,
html.film #s7 .s7-ghost .s-word {
  color: var(--s7-ghost);
  -webkit-text-fill-color: var(--s7-ghost);
  background-image: none;
  text-shadow: none;
}
html.film #s7 .s7-ghost--r { --s7-ghost: #ff2b4f; }
html.film #s7 .s7-ghost--c { --s7-ghost: #1fe4ff; }
html.film #s7 h2.s7-title { position: relative; z-index: 1; }

html.film #s7 .s7-calm {
  display: grid;
  justify-items: center;
  row-gap: 14px;
}
html.film #s7 .s7-btn {
  --btn-h: 50px;
  padding-inline: 1.3rem 1.5rem;
  white-space: nowrap;
  will-change: transform, opacity;
}
html.film #s7 .s7-btn .icon { color: var(--amber); }
html.film #s7 .s7-btn[data-state='sound'] .s7-btn__replay,
html.film #s7 .s7-btn[data-state='replay'] .s7-btn__sound { display: none; }
/* la mention : discrète, mais elle se lit sans effort sur le sol */
html.film #s7 .s7-note {
  max-width: 21rem;
  margin-top: 2px;
  color: rgb(var(--white-rgb) / .72);
  will-change: opacity;
}

/* la ligne de la fin : l'écran éteint, qui devient l'horizon. Son porteur fait la hauteur de la scène : le
   déplacer de N % le pose à N % de l'écran, comme l'horizon du décor. */
html.film #s7 .s7-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}
html.film #s7 .s7-line__hot,
html.film #s7 .s7-line__warm {
  position: absolute;
  left: 0;
  right: 0;
  top: -1.5px;
  height: 3px;
  opacity: 0;
  will-change: transform, opacity;
}
html.film #s7 .s7-line__hot {
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(255 255 255 / 0) 0%, #fff 6%, #fff 94%, rgb(255 255 255 / 0) 100%);
  box-shadow: 0 0 10px 1px rgb(255 255 255 / .9), 0 0 34px 5px rgb(var(--ice-rgb) / .55);
}
html.film #s7 .s7-line__warm { top: -1px; height: 2px; }
html.film #s7 .s7-line__dot {
  position: absolute;
  left: var(--s7-cx);
  top: 0;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 0%, rgb(255 255 255 / .92) 7%, rgb(var(--ice-rgb) / .5) 20%, rgb(var(--electric-rgb) / .16) 48%, transparent 72%);
  opacity: 0;
  will-change: transform, opacity;
}

/* ------------------------------------------------------------------ ordinateur : la carte d'un côté, le texte de l'autre */
@media (min-width: 760px) {
  html.film #s7 .s7-text {
    left: auto;
    right: auto;
    inset-inline-start: 46%;
    inset-inline-end: max(var(--gutter), 4%);
    /* le titre est posé sur la ligne d'horizon, la mention pend dessous : la ligne ne traverse aucun texte */
    top: auto;
    bottom: calc((1 - var(--s7-hy)) * 100% + 20px);
    justify-items: start;
    row-gap: 16px;
    text-align: start;
  }
  html.film #s7 .s7-slot,
  html.film #s7 .s7-calm { justify-items: start; }
  html.film #s7 .s7-slot { align-items: end; }
  html.film #s7 .s7-calm { row-gap: 22px; }
  html.film #s7 .s7-hear { font-size: var(--fs-line); }
  html.film #s7 .s7-note {
    position: absolute;
    inset-inline-start: 0;
    top: calc(100% + 42px);
    width: min(26rem, 100%);
    margin: 0;
  }
  html.film #s7 .s7-reflet {
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .4) 20%, transparent 46%);
    mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / .4) 20%, transparent 46%);
  }
}
