/* S8 · concrètement [lot B5]
   Le titre, puis trois preuves, une à la fois : le texte, et dessous une carte de verre debout sur le sol, au
   ras de l'horizon, où la démonstration avance avec le pouce. Ordinateur : le texte d'un côté, la carte de
   l'autre. Une seule mise en page pour les trois : le texte commence à la même hauteur, la carte a la même
   hauteur (celle de la planche). Les tailles qui dépendent de la place sont posées par js/scenes/s8.js
   (`--s8-text-h`, `--s8-t-h`, `--s8-card-h`, `--s8-cell-h`, `--s8-fs`, `--s8-bh`, `--s8-th`, `--s8-sh`).
   Tout le film est rangé sous `html.film #s8`. */

/* ------------------------------------------------------------------ sans le film : une section qui se lit */
html:not(.film) #s8 .s8-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-width: 24rem;
}
html:not(.film) #s8 .s8-board img { width: 100%; max-height: none; margin: 0; border-radius: var(--r-xs); }
html:not(.film) #s8 .s8-card { padding: var(--s-4); }
html:not(.film) #s8 .s8-ok { color: var(--amber); font-weight: 700; }
html:not(.film) #s8 img.s8-static { width: 100%; max-height: none; object-fit: cover; object-position: 0 50%; height: 5.5rem; border-radius: var(--r-xs); }

/* ------------------------------------------------------------------ dans le film */
html.film #s8 {
  --s8-floor: calc(24% - 14px);   /* le sol : le bas des cartes, compté depuis le bas (l'horizon de S8 est à 76 %) */
  --s8-pad: 14px;
  --s8-cols: 4;
  --s8-cell-h: 96px;
  --s8-card-h: auto;              /* la hauteur de la carte, la même pour les trois preuves */
  --s8-fs: 112px;                 /* les chiffres du compteur (preuve 2) */
  --s8-bh: 84px;                  /* hauteur de la bande du film (preuve 2) */
  --s8-rh: 16px;                  /* la règle du temps (preuve 3) */
  --s8-th: 88px;                  /* hauteur de la piste d'images */
  --s8-tg: 20px;                  /* l'écart entre les deux pistes */
  --s8-sh: 92px;                  /* hauteur de la piste du son */
  --s8-y0: calc(var(--s8-rh) + 6px);
}
html.film #s8 .s8-static { display: none; }

/* le titre : seul, grand, au-dessus de l'horizon */
html.film #s8 .s8-title {
  position: absolute;
  left: max(var(--gutter), var(--safe-l));
  right: max(var(--gutter), var(--safe-r));
  top: calc(var(--safe-t) + (76% - var(--safe-t)) * .46);
  transform: translateY(-50%);
  text-align: center;
}

/* une preuve : du haut de la zone libre jusqu'au sol, tout calé en bas */
html.film #s8 .s8-proof {
  position: absolute;
  left: max(var(--gutter), var(--safe-l));
  right: max(var(--gutter), var(--safe-r));
  top: calc(var(--safe-t) + 8px);
  bottom: var(--s8-floor);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 16px;
}
html.film #s8 .s8-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 8px;
  align-content: start;
  height: var(--s8-text-h, auto);   /* le plus long des trois : tous commencent à la même hauteur */
  text-align: start;
}
html.film #s8 .s8-t { text-wrap: balance; min-height: var(--s8-t-h, 0px); }
html.film #s8 .s8-d { line-height: 1.45; }
html.film #s8 .s8-t,
html.film #s8 .s8-d { text-shadow: 0 0 3px rgb(var(--night-rgb) / .9), 0 0 14px rgb(var(--night-rgb) / .8); }

/* les trois crans : où l'on en est, sans un chiffre */
html.film #s8 .s8-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  direction: inherit;
}
html.film #s8 .s8-step {
  position: relative;
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: rgb(var(--white-rgb) / .2);
  overflow: hidden;
}
html.film #s8 .s8-step.is-done { background: rgb(var(--orange-rgb) / .55); }
html.film #s8 .s8-step__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--grad-orange);
  transform-origin: 0 50%;
}
html.film[dir='rtl'] #s8 .s8-step__fill { transform-origin: 100% 50%; }

/* la carte, debout sur le sol */
html.film #s8 .s8-stand {
  position: relative;
  perspective: 1200px;
  perspective-origin: 50% 100%;
}
html.film #s8 .s8-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--s8-card-h);
  padding: var(--s8-pad);
  transform-origin: 50% 100%;
}
html.film #s8 .s8-reflet {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  height: 86px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background:
    radial-gradient(60% 100% at 50% 0%, rgb(var(--orange-rgb) / .3), rgb(var(--orange-rgb) / 0) 70%),
    linear-gradient(180deg, rgb(40 78 200 / .22), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / .55) 0%, rgb(0 0 0 / .2) 40%, transparent 80%);
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / .55) 0%, rgb(0 0 0 / .2) 40%, transparent 80%);
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- preuve 1 : la planche */
html.film #s8 .s8-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--s8-cols), minmax(0, 1fr));
  grid-auto-rows: var(--s8-cell-h);
  gap: 7px;
}
html.film #s8 .s8-cell {
  position: relative;
  border-radius: 7px;
  overflow: hidden;
  background: rgb(var(--white-rgb) / .035);
  box-shadow: inset 0 0 0 1px rgb(var(--ice-rgb) / .2);
}
html.film #s8 .s8-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
html.film #s8 .s8-cell__n {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 2;
  font-size: .625rem;
  line-height: 1;
  letter-spacing: .04em;
  color: rgb(var(--white-rgb) / .78);
  text-shadow: 0 0 4px rgb(var(--night-rgb) / .9), 0 0 2px rgb(var(--night-rgb) / .9);
}
html.film #s8 .s8-cell__ring {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--amber), inset 0 0 14px 1px rgb(var(--orange-rgb) / .7);
  opacity: 0;
}
/* le tampon : à cheval sur le bas de la carte */
html.film #s8 .s8-ok {
  position: absolute;
  inset-inline-end: 12px;
  bottom: -15px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  margin: 0;
  padding: .5em .95em .5em .7em;
  border: 2px solid var(--amber);
  border-radius: 9px;
  font-family: var(--font-wide);
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-size: .9375rem;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgb(18 8 4 / .86);
  box-shadow: 0 0 0 3px rgb(var(--night-rgb) / .5), 0 8px 26px -6px rgb(var(--orange-rgb) / .7), inset 0 0 12px rgb(var(--orange-rgb) / .22);
}
html.film #s8 .s8-ok:lang(he) { letter-spacing: 0; font-size: 1.0625rem; }
html.film #s8 .s8-ok .icon { width: 1.15em; height: 1.15em; stroke-width: 3; }

/* ---------------------------------------------------------------- preuve 2 : les 45 heures */
html.film #s8 .s8-hours {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  row-gap: 12px;
  direction: ltr;
}
html.film #s8 .s8-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .16em;
  font-size: var(--s8-fs);
  line-height: 1;
  color: var(--white);
}
html.film #s8 .s8-count .icon {
  width: .42em;
  height: .42em;
  stroke-width: 1.6;
  color: var(--amber);
  filter: drop-shadow(0 0 10px rgb(var(--orange-rgb) / .6));
}
html.film #s8 .s8-odo { display: inline-flex; }   /* pas de lueur : les colonnes la couperaient en rectangle */
html.film #s8 .s8-odo__col { display: block; height: .92em; overflow: hidden; }
html.film #s8 .s8-odo__strip { display: block; }
html.film #s8 .s8-odo__strip > span { display: block; height: .92em; line-height: .92em; text-align: center; }

html.film #s8 .s8-reel { position: relative; padding-top: 30px; }
html.film #s8 .s8-reel__win {
  position: relative;
  height: var(--s8-bh);
  border-radius: 9px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgb(var(--ice-rgb) / .16) 0 1px, transparent 1px 12px),
    rgb(var(--white-rgb) / .04);
  box-shadow: inset 0 0 0 1px rgb(var(--ice-rgb) / .2);
  transform: translateZ(0);
}
html.film #s8 .s8-band {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  aspect-ratio: 4480 / 284;
  background-size: 100% 100%;
  background-color: rgb(var(--deep-rgb));
}
html.film #s8.s8-on .s8-band { background-image: url('../img/s8-bissli-bande.jpg'); }
/* ce qui n'est pas encore passé sous la tête de lecture reste dans l'ombre */
html.film #s8 .s8-reel__veil {
  position: absolute;
  left: 50%;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgb(var(--night-rgb) / .5), rgb(var(--night-rgb) / .78));
}
html.film #s8 .s8-reel__head {
  position: absolute;
  left: 50%;
  top: 24px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--amber);
  box-shadow: 0 0 10px 1px rgb(var(--orange-rgb) / .9);
}
html.film #s8 .s8-reel__head::before {      /* la poignée de la tête de lecture */
  content: '';
  position: absolute;
  left: 50%;
  top: -1px;
  width: 11px;
  height: 9px;
  margin-left: -5.5px;
  background: var(--amber);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%);
}
html.film #s8 .s8-tc {
  position: absolute;
  left: 50%;
  top: 0;
  display: flex;
  justify-content: center;
  transform: translateX(-50%);
  min-width: 3.6em;
  padding: .22em .5em;
  border-radius: 6px;
  font-size: .8125rem;
  line-height: 1;
  text-align: center;
  color: var(--ink);
  background: var(--grad-orange);
}
/* ses chiffres : des bandes qui se placent d'un coup (aucun texte réécrit) */
html.film #s8 .s8-tc__col { display: block; height: 1em; overflow: hidden; }
html.film #s8 .s8-tc__strip { display: block; }
html.film #s8 .s8-tc__strip > span { display: block; height: 1em; line-height: 1em; text-align: center; }
html.film #s8 .s8-tc__sep { display: block; line-height: 1em; padding-inline: .04em; }
/* la mention de Bissli : jamais sous 12 px, et lisible sans effort sur le verre */
html.film #s8 .s8-mention { flex: 0 0 auto; margin: 12px 2px 0; font-size: .8125rem; line-height: 1.35; text-align: start; color: rgb(var(--white-rgb) / .72); }
html.film[dir='rtl'] #s8 .s8-mention { direction: rtl; }

/* ---------------------------------------------------------------- preuve 3 : le son calé sur l'image */
html.film #s8 .s8-tl {
  position: relative;
  flex: 1 1 auto;
  direction: ltr;
}
/* la règle du temps : douze secondes du film, un trait par seconde, un petit par demi-seconde */
html.film #s8 .s8-ruler {
  height: var(--s8-rh);
  margin-bottom: 6px;
  border-bottom: 1px solid rgb(var(--ice-rgb) / .28);
  background:
    repeating-linear-gradient(90deg, rgb(var(--white-rgb) / .62) 0 1px, transparent 1px calc(100% / 12)) 0 100% / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, rgb(var(--ice-rgb) / .4) 0 1px, transparent 1px calc(100% / 24)) 0 100% / 100% 4px no-repeat;
}
html.film #s8 .s8-trk {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(var(--ice-rgb) / .2);
  background: rgb(var(--white-rgb) / .04);
  transform: translateZ(0);
}
html.film #s8 .s8-trk--img { display: flex; height: var(--s8-th); margin-bottom: var(--s8-tg); }
html.film #s8 .s8-frame {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgb(var(--night-rgb) / .9);
}
html.film #s8 .s8-frame__img {
  position: absolute;
  top: 0;
  height: 100%;
  width: calc(var(--s8-th) * 4.507);
  left: calc(50% - (var(--i) + .5) * var(--s8-th) * .5634);
  background-size: 100% 100%;
}
html.film #s8.s8-on .s8-frame__img { background-image: url('../img/s8-piste.jpg'); }
html.film #s8 .s8-frame__veil {
  position: absolute;
  inset: 0;
  background: rgb(var(--night-rgb) / .62);
}
html.film #s8 .s8-trk--snd { height: var(--s8-sh); }
html.film #s8 .s8-wave { position: absolute; inset: 8px 0; width: 100%; height: calc(100% - 16px); }
html.film #s8 .s8-wave--base { fill: rgb(var(--ice-rgb) / .42); }
html.film #s8 .s8-wave--on { fill: var(--amber); }
html.film #s8 .s8-played,
html.film #s8 .s8-played__in { position: absolute; inset: 0; overflow: hidden; }
html.film #s8 .s8-played__in { overflow: visible; }
html.film #s8 .s8-icon {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 2;
  width: 14px;
  height: 14px;
  color: rgb(var(--white-rgb) / .8);
  filter: drop-shadow(0 0 3px rgb(var(--night-rgb) / .9));
}
/* les repères d'effets : un losange posé sur la piste du son, un trait qui monte jusqu'à l'image */
html.film #s8 .s8-marks { position: absolute; inset: var(--s8-y0) 0 0 0; pointer-events: none; }
html.film #s8 .s8-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
}
html.film #s8 .s8-mark__link {
  position: absolute;
  left: -1px;
  width: 2px;
  top: calc(var(--s8-th) - 14px);
  height: calc(var(--s8-tg) + 14px);   /* 14 px dans l'image, puis l'écart entre les deux pistes */
  background: linear-gradient(180deg, rgb(var(--amber-rgb) / .25), var(--amber));
  transform-origin: 50% 100%;
}
html.film #s8 .s8-mark__link::before {     /* le point d'attache, sur l'image */
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 6px 1px rgb(var(--orange-rgb) / .9);
}
html.film #s8 .s8-mark__key {
  position: absolute;
  left: -6px;
  top: calc(var(--s8-th) + var(--s8-tg) - 6px);
  width: 12px;
  height: 12px;
}
html.film #s8 .s8-mark__key::before {      /* le losange d'une clé d'animation */
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 2px;
  background: var(--grad-orange);
  box-shadow: 0 0 0 1.5px rgb(var(--night-rgb) / .85), 0 0 10px 1px rgb(var(--orange-rgb) / .85);
  transform: rotate(45deg);
}
html.film #s8 .s8-head {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
html.film #s8 .s8-head::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 2px;
  bottom: -6px;
  width: 2px;
  border-radius: 2px;
  background: var(--white);
  box-shadow: 0 0 10px 1px rgb(var(--ice-rgb) / .9);
}
html.film #s8 .s8-head::after {
  content: '';
  position: absolute;
  left: -6.5px;
  top: 0;
  width: 13px;
  height: 11px;
  background: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%);
}

/* les couches : seulement pour la preuve qui se voit (`is-on`, posé par js/scenes/s8.js avec sa visibilité).
   Les petits éclats (anneaux des cases, repères, voiles des images) se repeignent : ils sont minuscules. */
html.film #s8 .s8-proof.is-on :is(.s8-text, .s8-d, .s8-card, .s8-reflet, .s8-cell img, .s8-ok, .s8-band, .s8-played, .s8-played__in, .s8-head) {
  will-change: transform, opacity;
}
html.film #s8 .s8-proof.is-on :is(.s8-step__fill, .s8-odo__strip) { will-change: transform; }
/* ------------------------------------------------------------------ ordinateur : le texte d'un côté, la carte de l'autre */
@media (min-width: 760px) {
  html.film #s8 { --s8-cols: 6; }
  html.film #s8 .s8-proof {
    left: auto;
    right: auto;
    inset-inline: max(var(--gutter), 5%) max(var(--gutter), 4.5%);
    top: calc(var(--safe-t) + 12px);
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 4.5%;
  }
  html.film #s8 .s8-text {       /* à côté de la carte ; le plus long des trois textes finit au ras de l'horizon */
    flex: 0 1 33.5%;
    align-self: flex-end;
    margin-bottom: 46px;
    row-gap: 20px;
  }
  html.film #s8 .s8-t {
    font-size: clamp(1.75rem, min(1rem + 2.9vw, calc(var(--vh, 1vh) * 6.4)), 4rem);
    line-height: 1.08;
  }
  html.film #s8 .s8-d { font-size: clamp(1.0625rem, min(.8rem + .75vw, calc(var(--vh, 1vh) * 3.1)), 1.5rem); max-width: 30ch; }
  html.film #s8 .s8-steps { margin-bottom: 12px; }
  html.film #s8 .s8-step { width: 40px; height: 4px; }
  html.film #s8 .s8-stand { flex: 0 0 min(62%, 58rem); }
  html.film #s8 .s8-board { gap: 9px; }
  html.film #s8 .s8-cell { border-radius: 9px; }
  html.film #s8 .s8-cell__n { font-size: .75rem; top: 8px; left: 9px; }
  html.film #s8 .s8-ok { font-size: 1.25rem; bottom: -21px; inset-inline-end: 20px; }
  html.film #s8 .s8-hours { row-gap: 18px; }
  html.film #s8 .s8-tc { font-size: 1rem; }
  html.film #s8 .s8-reel { padding-top: 34px; }
  html.film #s8 .s8-reel__head { top: 27px; }
  html.film #s8 .s8-mention { font-size: .8125rem; }
  html.film #s8 .s8-reflet { height: 120px; }
}
