/* ==========================================================================
   Section 5 · the wall. Dark:
   one plane in 3D (perspective on the view, preserve-3d on the plane), 77
   screens of agents at work in 7 columns by 11 rows, each 540 x 337.5 design
   units. The tilt is one line on the plane; every screen moves on its own
   inside it. Motion lives in js/s5.js. «חצי שעה» is chrome, on black.
   The screens: real captures of the work, no client data.
   ========================================================================== */
.s5 { --tile-w: calc(540 * var(--u)); --tile-h: calc(337.5 * var(--u)); }
.s5__stage { background: var(--black); color: var(--soft-white); }
.s5__view { position: absolute; inset: 0; perspective: calc(1700 * var(--u)); perspective-origin: 50% 45%; }
.s5__plane { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.s5__tile {
  position: absolute; left: calc(var(--tile-w) / -2); top: calc(var(--tile-h) / -2);
  width: var(--tile-w); height: var(--tile-h); border-radius: calc(14 * var(--u));
  background: #0B0B0C; overflow: hidden; opacity: 0; will-change: transform, opacity;
  box-shadow: 0 0 0 var(--hair) rgba(255,255,255,.08);
}
.s5__tile img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* the dark that rises at the end, behind the words */
.s5__fade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(5,5,5,.94) 0%, rgba(5,5,5,.8) 45%, rgba(5,5,5,0) 80%); opacity: 0; pointer-events: none; }

.s5__text {
  position: absolute; inset: 0; padding: 0 var(--m);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.s5__kicker { margin: 0; font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); opacity: 0; }
.s5__title { margin: calc(28 * var(--u)) 0 0; font-weight: 700; font-size: calc(110 * var(--u)); line-height: 1.1; opacity: 0; }
.s5__body { margin: calc(44 * var(--u)) 0 0; max-width: calc(1100 * var(--u)); font-weight: 300; font-size: calc(36 * var(--u)); line-height: 1.55; color: #D6D6D6; }
.s5__body .w { display: inline-block; opacity: 0; filter: blur(8px); }

/* ---- phone: the 393 frames ------------------------------------------------- */
@media (max-width: 899px) {
  .s5 { --tile-w: calc(200 * var(--u)); --tile-h: calc(125 * var(--u)); }
  .s5__view { perspective: calc(900 * var(--u)); }
  .s5__tile { border-radius: calc(7 * var(--u)); }
  .s5__kicker { font-size: calc(14 * var(--u)); }
  .s5__title { margin-top: calc(14 * var(--u)); font-size: calc(40 * var(--u)); }
  .s5__body { margin-top: calc(22 * var(--u)); max-width: 100%; font-size: calc(19 * var(--u)); }
}

/* ---- touch phone: the words come in by opacity alone (a blur filter is
   repainted on every frame in Safari) ---------------------------------------- */
@media (max-width: 899px) and (pointer: coarse) {
  .s5__body .w { filter: none !important; }
}
/* a touch phone: 40 screens instead of 77, each 1.4x bigger (js/s5.js adds the class).
   The hairline is a border, not a shadow: measured in WebKit, the shadow alone cost about
   a fifth of every frame here (19.10) */
.s5.s5--few { --tile-w: calc(756 * var(--u)); --tile-h: calc(472.5 * var(--u)); }
.s5.s5--few .s5__tile { box-shadow: none; border: var(--hair) solid rgba(255,255,255,.08); }
@media (max-width: 899px) {
  .s5.s5--few { --tile-w: calc(280 * var(--u)); --tile-h: calc(175 * var(--u)); }
}

/* ---- reduced motion: no wall in motion; six screens flat, then the words ---- */
@media (prefers-reduced-motion: reduce) {
  .s5__stage { position: relative; padding: calc(160 * var(--u)) var(--m); }
  .s5__view { position: relative; inset: auto; perspective: none; }
  .s5__plane { position: relative; left: auto; top: auto; width: auto; height: auto; transform: none;
               display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(30 * var(--u)); }
  .s5__tile { position: relative; left: auto; top: auto; width: 100%; height: auto; aspect-ratio: 16 / 10; opacity: 1; }
  .s5__tile:nth-child(n+7) { display: none; }
  .s5__fade { display: none; }
  .s5__text { position: relative; inset: auto; padding: calc(120 * var(--u)) 0 0; }
  .s5__kicker, .s5__title { opacity: 1; }
  .s5__body .w { opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 899px) {
  .s5__stage { padding: calc(80 * var(--u)) calc(24 * var(--u)); }
  .s5__plane { grid-template-columns: 1fr 1fr; }
}
