/* Deux fragments de pellicule décalés au point de coupe. */
.film-art {
  position: relative;
  min-width: 0;
  margin-inline: auto;
  width: min(100%, 640px);
}

.film-composition {
  --film-hatch: #70428c30;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.18;
  container-type: inline-size;
}

.film-composition::before,
.film-composition::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 77%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.film-composition::before {
  background: #e9dbf3;
  border: 1px solid #d3bedf;
}


.film-composition::after {
  background: repeating-linear-gradient(135deg, transparent 0 8px, var(--film-hatch) 8px 9px);
  mask-image: linear-gradient(to top right, transparent 36%, #0004 58%, #000 96%);
  pointer-events: none;
}

[data-theme="dark"] .film-composition { --film-hatch: #d0a6e84a; }

.film-splice {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4.4cqw;
  width: 92%;
  transform: rotate(-20deg);
}

.film-splice::before {
  content: "";
  position: absolute;
  inset: -7cqw auto -14cqw 50%;
  width: 1px;
  background: #a66591;
  box-shadow: 0 -4px #a66591, 0 4px #a66591;
}

.film-splice::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -7cqw;
  width: 2.5cqw;
  height: 2.5cqw;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #a66591;
}

.film-piece {
  --film: #292031;
  --perforation: #f1e7f6;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5cqw;
  padding: 6.1cqw 2.6cqw;
  background: var(--film);
  box-shadow: 0 16px 28px #39204524;
}

.film-piece::before, .film-piece::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 3.4cqw;
  /* Two frames per strip. Each edge repeats four BH perforations per frame.
     The flat sides rotate with the film, which runs horizontally here. */
  background: radial-gradient(ellipse 31% 49% at center, var(--perforation) 96%, transparent 100%) 0 0 / 12.5% 100% repeat-x;
  mask: linear-gradient(90deg, transparent 30%, #000 31% 69%, transparent 70%) 0 0 / 12.5% 100% repeat-x;
}
.film-piece::before { top: 1.15cqw; }
.film-piece::after { bottom: 1.15cqw; }
.film-before { transform: translateY(-3cqw); }
.film-after { --film: #694782; transform: translateY(9cqw); }

/* Four phases of a bear’s walk, seen in profile. */
.film-frame {
  display: grid;
  place-items: center;
  aspect-ratio: .86;
  overflow: hidden;
  padding: 4%;
  color: #f8eaf9;
  background: #563b69;
}
.film-frame svg { display: block; width: 100%; height: auto; }
.film-frame-passage { background: #73518a; }
.film-frame-avancee { background: #483255; }
.film-frame-prise-appui { color: #392745; background: #e8ced4; }

.film-demo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  margin: -10px 0 0 auto;
  padding: 8px 0 8px 10px;
  color: #59356e;
  font-size: 14px;
  font-weight: 700;
}
.film-demo svg { width: 17px; height: 17px; }
.film-demo:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .film-art { width: min(100%, 530px); }
  .film-composition { aspect-ratio: 1.28; }
}

.film-composition canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 9px #301d4438);
}

.film-composition:not([data-webgl]) canvas { visibility: hidden; }
/* The 2D artwork is only shown when the 3D scene cannot be rendered. */
.film-splice { visibility: hidden; }
.film-composition[data-film-fallback]:not([data-webgl]) .film-splice { visibility: visible; }

@media (scripting: none) {
  .film-splice { visibility: visible; }
}

.film-frame-appui {
  background: radial-gradient(circle at 0 100%, #865fa4 0 47%, #efdbf3 48% 56%, #bc94d0 57%);
}

.film-frame-passage {
  background: radial-gradient(circle at 88% 73%, #482e5b 0 52%, #eadbf0 53%);
}

.film-frame-avancee {
  background: linear-gradient(115deg, #c096d8 0 36%, #49305c 37% 60%, #d5b2e8 61%);
}

.film-frame-prise-appui {
  background: radial-gradient(circle at 100% 100%, #f1cbb4 0 42%, #79517f 43% 55%, #efc9b5 56%);
}

.film-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 12px;
}

.film-actions .film-demo { margin-top: 0; }
.film-replay {
  min-height: 44px;
  border: 0;
  padding: 6px 0;
  background: none;
  color: var(--brand-accent);
  font-size: 13px;
  font-weight: 700;
}

.film-replay:hover { text-decoration: underline; text-underline-offset: 4px; }
.film-replay[hidden], .film-demo[hidden] { display: none; }
