/* ==========================================================================
   Sections 2 and 3. Design frames: 1920 and 393. Every length is N * --u.
   The marked word is chrome on black (s2 «להפעיל») and blue on light
   (s3 «מכונה»). Motion lives in js/story.js.
   ========================================================================== */
:root {
  --chrome: linear-gradient(180deg, #FFFFFF 0%, #D9D9D9 38%, #7A7A7A 52%, #E9E9E9 66%, #8C8C8C 100%);
  --cols: 12;
  --m: calc(160 * var(--u));
}
.hl-chrome { font-weight: inherit; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hl-blue { font-weight: inherit; background: var(--blue); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- the grid: thin vertical lines, 12 on a computer, 6 on a phone --------- */
.grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(90deg, rgba(247,247,247,.07) var(--hair), transparent var(--hair));
  background-size: calc(100% / var(--cols)) 100%;
}
/* rain: a thin white line falling along a grid line (js/story.js) */
.rain {
  position: absolute; top: 0; left: 0; width: var(--hair); opacity: 0;
  background: linear-gradient(180deg, rgba(184,184,184,0), rgba(255,255,255,.75));
  will-change: transform;
}

/* ---- 2 · how it started -------------------------------------------------- */
.s2__stage { background: var(--black); }
.s2__a, .s2__b {
  position: absolute; inset: 0; padding: 0 var(--m);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.s2__kicker { margin: 0; font-weight: 500; font-size: calc(22 * var(--u)); letter-spacing: .08em; color: var(--silver-dark); }
.s2__title { margin: calc(40 * var(--u)) 0 0; font-weight: 700; font-size: calc(104 * var(--u)); line-height: 1.12; color: var(--soft-white); }
.s2__echo { margin: 0 0 calc(64 * var(--u)); font-weight: 700; font-size: calc(44 * var(--u)); line-height: 1.15; color: var(--soft-white); opacity: 0; }
.s2__story { margin: 0; max-width: calc(1120 * var(--u)); font-weight: 300; font-size: calc(46 * var(--u)); line-height: 1.5; color: var(--soft-white); }
.s2__turn { margin-top: calc(32 * var(--u)); font-weight: 500; }
.s2__story .w { display: inline-block; opacity: 0; filter: blur(8px); }

/* ---- 3 · the turn --------------------------------------------------------- */
.s3__stage { background: var(--black); }
/* below the stage (Safari's address bar hidden) the section shows: light once the circle fills the stage */
.s3.is-lit { background: var(--soft-white); }
.s3__circle {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5,5,5,.06) var(--hair), transparent var(--hair)) 0 0 / calc(100% / var(--cols)) 100%, var(--soft-white);
  clip-path: circle(0 at 50% 100%);
}
.s3__line {
  position: absolute; top: 50%; right: var(--m); margin: 0;
  font-weight: 700; font-size: calc(240 * var(--u)); line-height: 1.3; white-space: nowrap;
  color: var(--black); overflow: hidden; transform: translateY(-50%);
}
.s3__line.is-split .hl-blue { background: none; -webkit-background-clip: border-box; background-clip: border-box; }
.s3__line i { display: inline-block; font-style: normal; transform: translateY(-110%); }

/* ---- the placeholder after it: light, like section 4 will be -------------- */
.next { background: var(--soft-white); }
.next__tag { color: var(--silver-dark); }
.next__title { color: var(--black); }

/* ---- phone: the 393 frames ------------------------------------------------- */
@media (max-width: 899px) {
  :root { --cols: 6; --m: calc(24 * var(--u)); }
  .s2__kicker { font-size: calc(13 * var(--u)); }
  .s2__title { margin-top: calc(14 * var(--u)); font-size: calc(40 * var(--u)); }
  .s2__echo { margin-bottom: calc(30 * var(--u)); font-size: calc(17 * var(--u)); }
  .s2__story { max-width: 100%; font-size: calc(22 * var(--u)); }
  .s2__turn { margin-top: calc(16 * var(--u)); }
  .s3__line { font-size: calc(96 * var(--u)); }
}

/* ---- reduced motion: no pin, everything simply there ---------------------- */
@media (prefers-reduced-motion: reduce) {
  .s2__stage, .s3__stage { position: relative; min-height: 100vh; min-height: 100svh; }
  .s2__a, .s2__b { position: relative; inset: auto; padding-top: calc(120 * var(--u)); }
  .s2__b { padding-bottom: calc(120 * var(--u)); }
  .s2__echo { display: none; }
  .s2__story .w { opacity: 1; filter: none; }
  .s3__stage { display: grid; place-items: center; background: var(--soft-white); }
  .s3__circle { clip-path: none; }
  .s3__line { position: relative; top: auto; right: auto; transform: none; white-space: normal; text-align: center;
              padding: 0 var(--m); font-size: calc(150 * var(--u)); line-height: 1.08; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 899px) {
  .s3__line { font-size: calc(42 * var(--u)); }
}
