/* ==========================================================================
   מגדלור — home.css
   The home page only: the lighthouse scene and the two chapters that are
   pinned over it. Everything below them is ordinary site.css on paper.

   One idea: Migdalor's lighthouse at night, and its light. The scene is the
   organisation's own film of the tower, fixed behind the page; scrolling
   moves toward the lamp until its light fills the screen and becomes the
   paper the rest of the page is written on.

   The page is complete without the film and without JavaScript: the rules
   here lay the chapters out statically over the film's first frame, and the
   `.js` class (set by home.js) is what turns on pinning and scroll-driven
   reveals. Under prefers-reduced-motion the script sets `.reduced` and the
   static layout stays. Scroll progress arrives as custom properties written
   through the CSSOM — the CSP forbids inline styles.
   ========================================================================== */

/* ---------- the scene ---------- */
.scene{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:var(--night)}
.scene-v{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
         object-position:var(--ox,30%) var(--oy,30%);
         transform-origin:var(--lx,30%) var(--ly,27%);transform:scale(var(--zoom,1))}
/* the dark laid under the words: the header's strip at the top, and the corner the copy sits in */
.scene-shade{position:absolute;inset:0;opacity:var(--shade,1);
             background:linear-gradient(180deg,rgba(4,6,13,.62),rgba(4,6,13,0) 21%),
                        radial-gradient(125% 100% at 100% 100%,rgba(4,6,13,.95) 0,rgba(4,6,13,.82) 34%,rgba(4,6,13,0) 70%)}
[dir=ltr] .scene-shade{transform:scaleX(-1)}
/* the lamp's light, growing from the lamp until it is everything */
.scene-glow{position:absolute;left:var(--lx,30%);top:var(--ly,27%);width:260vmax;height:260vmax;
            margin:-130vmax 0 0 -130vmax;border-radius:50%;opacity:var(--glow-o,0);mix-blend-mode:screen;
            transform:scale(var(--glow,.035));
            background:radial-gradient(closest-side,#fffaf0 0,#fff3d6 22%,rgba(255,236,196,.72) 46%,rgba(255,228,170,0) 100%)}
.scene-wash{position:absolute;inset:0;background:var(--paper);opacity:var(--wash,0)}
.scene-off .scene{visibility:hidden}
main,.foot{position:relative;z-index:1}
.paper{position:relative;background:var(--paper)}

/* ---------- pause control (WCAG 2.2.2) ---------- */
.motion{
  position:fixed;inset-inline-end:var(--gutter);bottom:clamp(14px,2.4vw,24px);z-index:30;
  display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:0 16px;border-radius:999px;
  background:rgba(4,6,13,.72);color:var(--text);border:1px solid var(--line-night);
  font:inherit;font-size:14px;cursor:pointer;backdrop-filter:blur(8px);
}
.motion[hidden],.scene-off .motion{display:none}
.motion:focus-visible{outline-color:var(--light)}
.motion-icon{width:10px;height:12px;border-inline:3px solid currentColor}
.motion[aria-pressed=true] .motion-icon{width:0;height:0;border:6px solid transparent;border-inline-end:0;
                                         border-inline-start:10px solid currentColor}
[dir=rtl] .motion[aria-pressed=true] .motion-icon{transform:scaleX(-1)}

/* ---------- chapters: static layout first ---------- */
.ch{position:relative;color:var(--text)}
/* a soft dark edge on the words, so a streak of the beam passing behind a letter never erases it */
.hero-copy,.man-copy{text-shadow:0 0 22px rgba(4,6,13,.75),0 1px 3px rgba(4,6,13,.55)}
.hero-copy .btn{text-shadow:none}
.ch :focus-visible{outline-color:var(--light)}
.pin{min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:flex-end;
     padding:clamp(96px,14vh,150px) var(--gutter) clamp(72px,10vh,110px)}
.ch .idx{color:var(--text-dim)}

/* 01 hero — the words sit low on the reading side; the tower and its beam have the rest of the frame */
.hero-copy{max-width:min(46rem,56vw);position:relative}
.pill{
  display:inline-flex;align-items:center;gap:10px;font-family:var(--mono);font-size:13px;letter-spacing:.06em;color:var(--text);
  border:1px solid var(--line-night);border-radius:999px;padding:8px 16px 8px 18px;background:rgba(4,6,13,.45);
  backdrop-filter:blur(6px);margin-bottom:clamp(20px,3.6vh,36px);
}
.dot{width:8px;height:8px;border-radius:50%;background:var(--light);box-shadow:0 0 0 0 rgba(242,192,99,.6);
     animation:lamp 2.8s ease-out infinite}
@keyframes lamp{0%{box-shadow:0 0 0 0 rgba(242,192,99,.55)}70%,100%{box-shadow:0 0 0 12px rgba(242,192,99,0)}}
.hero h1{font-weight:200;font-size:clamp(2.3rem,1rem + 4.4vw,5.2rem);line-height:1.06;letter-spacing:-.028em}
.hero h1 em{color:var(--light);letter-spacing:-.02em}
.hero-sub{margin-top:clamp(16px,2.6vh,26px);font-size:clamp(1.1rem,.95rem + .7vw,1.5rem);font-weight:300;color:var(--text);
          max-width:32ch;line-height:1.4}
.for{margin-top:clamp(14px,2.2vh,22px);font-size:clamp(1rem,.9rem + .45vw,1.2rem);color:var(--text-dim);
     display:flex;flex-wrap:wrap;gap:.45em;align-items:baseline;min-height:1.7em}
.for-rotor{display:none;color:var(--text);border-bottom:1px solid var(--light);padding-bottom:2px;
           transition:opacity .45s var(--ease),transform .45s var(--ease)}
.for-rotor.out{opacity:0;transform:translateY(.35em)}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:clamp(24px,4vh,40px)}
.hero .btn-line:hover{background:#fff;color:var(--night);border-color:#fff}
.scroll-hint{position:absolute;inset-inline-start:50%;bottom:clamp(16px,3vh,30px);display:none;
             align-items:center;gap:12px;font-family:var(--mono);font-size:13px;letter-spacing:.1em;color:var(--text-dim)}
.scroll-hint i{display:block;width:1px;height:44px;background:linear-gradient(var(--light),transparent);
               transform-origin:top;animation:drip 2.4s var(--ease) infinite}
@keyframes drip{0%{transform:scaleY(0)}60%{transform:scaleY(1);opacity:1}100%{transform:scaleY(1);opacity:0}}

/* 02 manifesto — low on the screen too, under the beam */
.man-copy{max-width:min(50rem,62vw)}
.lines{font-weight:200;font-size:clamp(1.8rem,.9rem + 3.3vw,4rem);line-height:1.18;letter-spacing:-.025em}
.lines span{display:block}
.lines span + span{margin-top:.18em}
.lines em{color:var(--light)}

/* small pieces of the paper sections that only the home page has */
.about-logo{width:clamp(150px,16vw,210px);margin-top:clamp(22px,4vh,40px)}
.aud-h{margin:34px 0 14px}
.negev-more{margin-top:clamp(26px,4vh,40px)}
.sec-head .btn{margin-top:8px}

/* ==========================================================================
   With JavaScript: pinned chapters, scroll-driven reveals
   ========================================================================== */
.js .hero{height:200vh}
.js .manifesto{height:320vh}
.js .pin{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden}

/* hero copy leaves as you set off toward the light */
.js .hero-copy{
  opacity:clamp(0,calc(1 - (var(--p,0) - .3) * 3.2),1);
  transform:translateY(calc(var(--p,0) * -9vh));
}
.js .scroll-hint{display:flex;opacity:clamp(0,calc(1 - var(--p,0) * 8),1)}
.js .for-rotor{display:inline-block}
.js .for-all{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* manifesto: each line lights as it is reached; the block leaves before the flash */
.js .man-copy{opacity:clamp(0,calc(1 - (var(--p,0) - .6) * 9),1)}
.js .lines span{opacity:clamp(.13,calc((var(--p,0) * 8.6 - var(--i)) * 1.25),1);transition:opacity .3s linear}
.lines span:nth-child(1){--i:.25}
.lines span:nth-child(2){--i:1.25}
.lines span:nth-child(3){--i:2.25}
.lines span:nth-child(4){--i:3.25}

/* ---------- reduced motion / paused: no loops ---------- */
.reduced .dot,.reduced .scroll-hint i,.paused .dot,.paused .scroll-hint i{animation:none}

/* ---------- small screens: the tower above, the words below it ---------- */
@media (max-width:860px){
  .scene-shade{background:linear-gradient(180deg,rgba(4,6,13,.62),rgba(4,6,13,0) 18%,rgba(4,6,13,0) 34%,rgba(4,6,13,.8) 56%,rgba(4,6,13,.95) 100%)}
  .pin{padding-top:clamp(92px,15vh,130px);padding-bottom:84px}
  .hero-copy,.man-copy{max-width:none}
  .js .scroll-hint{display:none}
}
