/* ==========================================================================
   Section 8 · what it built for others. Dark: on black the text is
   soft white and the one marked word («לאחרים») is chrome. Two parts:
   1. the run, pinned: the title, then five big projects, one after another.
      The same run as section 4: the name drops in letter by letter and
      three real screens of the project rise over it (two desktop, one phone).
   2. all 14, not pinned: ten with a screen in a grid, then the four systems
      that run the business (name and line until their real screens are shot).
   Motion lives in js/s8.js. Every length is N * --u.
   ========================================================================== */
.s8 { position: relative; background: var(--black); color: var(--soft-white); }
.s8__stage { background: var(--black); }

/* which project you are in: five small names at the top */
.s8__nav {
  position: absolute; top: calc(56 * var(--u)); left: 0; right: 0; z-index: 3; margin: 0;
  display: flex; justify-content: center; gap: calc(35 * var(--u));
  font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .06em;
}
.s8__nav span { color: var(--silver-dark); opacity: .6; transition: color .4s, opacity .4s; white-space: nowrap; }
.s8__nav span.is-on { color: var(--soft-white); opacity: 1; }

/* the title */
.s8__head {
  position: absolute; inset: 0; padding: 0 var(--m);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
}
.s8__kicker { margin: 0; font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); }
.s8__title { margin: calc(24 * var(--u)) 0 0; font-weight: 700; font-size: calc(150 * var(--u)); line-height: 1.08; }
.s8__sub { margin: calc(40 * var(--u)) 0 0; max-width: calc(900 * var(--u)); font-weight: 300; font-size: calc(40 * var(--u)); line-height: 1.45; color: var(--silver); }

/* a project: the words in the middle, the screens over them */
.s8__part { position: absolute; inset: 0; pointer-events: none; }
.s8__text {
  position: absolute; left: 0; right: 0; top: calc(330 * var(--u)); padding: 0 var(--m);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.s8__count { margin: 0; font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); opacity: 0; }
.s8__name { margin: calc(24 * var(--u)) 0 0; font-weight: 700; font-size: calc(200 * var(--u)); line-height: 1.15; overflow: hidden; white-space: nowrap; max-width: 100%; }
.s8__name i { display: inline-block; font-style: normal; transform: translateY(-110%); }
.s8__line { margin: calc(36 * var(--u)) 0 0; max-width: calc(860 * var(--u)); font-weight: 300; font-size: calc(40 * var(--u)); line-height: 1.4; color: var(--silver); opacity: 0; }

/* the screens: a desktop shot (16:10) or a phone shot, rising from below the window */
.s8__shot {
  position: absolute; top: 0; margin: 0; z-index: 2; overflow: hidden; background: #111214;
  border: var(--hair) solid rgba(255,255,255,.16);
  box-shadow: 0 calc(30 * var(--u)) calc(80 * var(--u)) rgba(0,0,0,.6);
  transform: translate3d(0, 110vh, 0); will-change: transform;
}
.s8__shot--d { width: calc(600 * var(--u)); aspect-ratio: 16 / 10; border-radius: calc(16 * var(--u)); }
.s8__shot--p { width: calc(230 * var(--u)); aspect-ratio: 600 / 1298; border-radius: calc(30 * var(--u)); }
.s8__shot--l { left: calc(100 * var(--u)); }
.s8__shot--r { left: calc(1570 * var(--u)); }
.s8__shot--m { left: calc(700 * var(--u)); }
.s8__shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* ---- all 14 ---------------------------------------------------------------- */
.s8__all { position: relative; padding: calc(200 * var(--u)) var(--m) calc(220 * var(--u)); }
.s8__all-head { text-align: center; margin: 0 0 calc(90 * var(--u)); }
.s8__all-title { margin: calc(20 * var(--u)) 0 0; font-weight: 700; font-size: calc(72 * var(--u)); line-height: 1.12; text-wrap: balance; }
.s8__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(56 * var(--u)) calc(36 * var(--u)); }
.s8__tools-head { margin: calc(130 * var(--u)) 0 calc(44 * var(--u)); font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); text-align: center; }
.s8__tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(36 * var(--u)); }

.s8c { margin: 0; min-width: 0; }
.s8c__img {
  position: relative; aspect-ratio: 16 / 10; border-radius: calc(12 * var(--u)); overflow: hidden; background: #111214;
  border: var(--hair) solid rgba(255,255,255,.14);
}
.s8c__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.s8c__tag { margin: calc(22 * var(--u)) 0 0; font-weight: 500; font-size: calc(16 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); }
.s8c__name { margin: calc(8 * var(--u)) 0 0; font-weight: 700; font-size: calc(32 * var(--u)); line-height: 1.2; text-align: right; }
.s8c__line { margin: calc(10 * var(--u)) 0 0; font-weight: 300; font-size: calc(21 * var(--u)); line-height: 1.5; color: var(--silver); }
/* the grid comes up a column at a time */
.s8__grid .s8c:nth-child(5n+2), .s8__tools .s8c:nth-child(4n+2) { transition-delay: .08s; }
.s8__grid .s8c:nth-child(5n+3), .s8__tools .s8c:nth-child(4n+3) { transition-delay: .16s; }
.s8__grid .s8c:nth-child(5n+4), .s8__tools .s8c:nth-child(4n+4) { transition-delay: .24s; }
.s8__grid .s8c:nth-child(5n+5) { transition-delay: .32s; }

/* Ananas by Chen: nothing to shoot, so the path itself */
.s8c__flow { display: flex; align-items: center; justify-content: center; gap: calc(8 * var(--u)); padding: 0 calc(14 * var(--u));
             background: radial-gradient(120% 90% at 50% 0%, #1D1F23 0%, #0E0F11 70%); }
.s8c__flow span { padding: calc(8 * var(--u)) calc(13 * var(--u)); border-radius: 999px; border: var(--hair) solid rgba(255,255,255,.3);
                  font-weight: 500; font-size: calc(15 * var(--u)); white-space: nowrap; color: var(--soft-white); }
.s8c__flow span:last-child { background: var(--chrome); color: var(--black); border-color: transparent; }
.s8c__flow i { flex: 0 1 calc(16 * var(--u)); height: var(--hair); min-height: 1px; background: var(--silver-dark); }

/* the four systems: no screen yet, a line on top instead */
.s8c--tool { padding-top: calc(26 * var(--u)); border-top: var(--hair) solid rgba(255,255,255,.22); }
.s8c--tool .s8c__tag { margin-top: 0; }

/* ---- phone: the 393 frames ------------------------------------------------- */
/* touch phone: the large blurred shadow under each rising screen was the whole
   cost of this section in Safari (54 to 85 ms a frame; 16 to 28 without it,
   measured 15.10 in WebKit). On black it barely shows; the hairline stays */
@media (max-width: 899px) and (pointer: coarse) {
  .s8__shot { box-shadow: none; }
}

@media (max-width: 899px) {
  .s8__nav { top: calc(24 * var(--u)); gap: calc(12 * var(--u)); font-size: calc(11 * var(--u)); letter-spacing: .02em; }
  .s8__kicker { font-size: calc(14 * var(--u)); }
  .s8__title { margin-top: calc(12 * var(--u)); font-size: calc(46 * var(--u)); }
  .s8__sub { margin-top: calc(18 * var(--u)); max-width: calc(330 * var(--u)); font-size: calc(18 * var(--u)); }
  .s8__text { top: calc(300 * var(--u)); padding: 0 calc(24 * var(--u)); }
  .s8__count { font-size: calc(14 * var(--u)); }
  .s8__name { margin-top: calc(14 * var(--u)); font-size: calc(80 * var(--u)); }
  .s8__line { margin-top: calc(18 * var(--u)); max-width: calc(330 * var(--u)); font-size: calc(18 * var(--u)); }
  .s8__shot--d { width: calc(250 * var(--u)); border-radius: calc(8 * var(--u)); }
  .s8__shot--p { width: calc(118 * var(--u)); border-radius: calc(14 * var(--u)); }
  .s8__shot--l { left: calc(16 * var(--u)); }
  .s8__shot--r { left: calc(259 * var(--u)); }
  .s8__shot--m { left: calc(127 * var(--u)); }

  .s8__all { padding: calc(100 * var(--u)) calc(24 * var(--u)) calc(110 * var(--u)); }
  .s8__all-head { margin-bottom: calc(44 * var(--u)); }
  .s8__all-title { margin-top: calc(10 * var(--u)); font-size: calc(30 * var(--u)); }
  .s8__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(30 * var(--u)) calc(14 * var(--u)); }
  .s8__tools-head { margin: calc(64 * var(--u)) 0 calc(24 * var(--u)); font-size: calc(13 * var(--u)); }
  .s8__tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(26 * var(--u)) calc(14 * var(--u)); }
  .s8c__img { border-radius: calc(8 * var(--u)); }
  .s8c__tag { margin-top: calc(10 * var(--u)); font-size: calc(11 * var(--u)); }
  .s8c__name { margin-top: calc(4 * var(--u)); font-size: calc(17 * var(--u)); }
  .s8c__line { margin-top: calc(5 * var(--u)); font-size: calc(13 * var(--u)); line-height: 1.45; }
  .s8c__flow { gap: calc(3 * var(--u)); padding: 0 calc(5 * var(--u)); }
  .s8c__flow span { padding: calc(4 * var(--u)) calc(6 * var(--u)); font-size: calc(9.5 * var(--u)); }
  .s8c__flow i { flex-basis: calc(5 * var(--u)); }
  .s8c--tool { padding-top: calc(14 * var(--u)); }
  /* two columns: the delays follow the pairs */
  .s8__grid .s8c:nth-child(n), .s8__tools .s8c:nth-child(n) { transition-delay: 0s; }
  .s8__grid .s8c:nth-child(2n), .s8__tools .s8c:nth-child(2n) { transition-delay: .08s; }
}

/* ---- reduced motion: no pin; each project is its name, its line, its screens */
@media (prefers-reduced-motion: reduce) {
  .s8__stage { position: relative; padding: calc(160 * var(--u)) var(--m); }
  .s8__nav { display: none; }
  .s8__head, .s8__part, .s8__text { position: relative; inset: auto; top: auto; }
  .s8__part { margin-top: calc(160 * var(--u)); display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: calc(40 * var(--u)); }
  .s8__text { flex: 0 0 100%; min-width: 0; padding: 0; }   /* so a long name cannot widen it */
  .s8__count, .s8__line { opacity: 1; }
  .s8__name i { transform: none; }
  .s8__shot { position: relative; left: auto; transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 899px) {
  .s8__stage { padding: calc(80 * var(--u)) calc(24 * var(--u)); }
  .s8__part { margin-top: calc(80 * var(--u)); gap: calc(14 * var(--u)); }
}
