/* ============================================================
   עולם הלגו · lego-page.css  (v4, 27.11.2026: סצנה, עומק ותנועה)
   v3 (26.11): הסיפור של דניאל בגוף ראשון, כותרת אחת, והסרטון שממחיש כל נקודה.
   v4, אחרי "תן יותר עומק, יותר רקע יפה, שייראו":
     - הפתיחה היא סצנה: רנדר אמיתי של הסט של קופה ראשית, והכותרת לפניו.
     - שכבות שזזות בקצב שונה בגלילה (הסצנה שוקעת, הפריימים מרחפים). רק היכן שהדפדפן תומך.
     - "משם רק השתפרתי": הפריימים גדלים מסרטון לסרטון.
     - קטע התאורה: האור של הפריים עצמו נדלק על העמוד. בעצירה הצבע יורד.
   כל התמונות הן פריימים אמיתיים שלו (research/lego/build_assets.py). בלי AI: זה הסיפור של העמוד.
   השפה של האתר (dy.css): לילה, Daniel Letters, קו דיו וצל קשיח.
   גיבויים: research/lego/backup-2026-11-26 (v2), backup-2026-11-27 (v3)
   ============================================================ */
.lgp { --brick: #f6c531; --brick-lo: #c99a12; --accent: var(--brick); }

/* ---------- הפתיחה: סצנה ---------- */
.lgs-hero { position: relative; isolation: isolate; overflow: clip; display: grid; align-items: center; min-height: min(100svh, 880px);
  padding: calc(var(--nav-h) + clamp(30px, 5vw, 70px)) 0 clamp(50px, 7vw, 100px); }
/* הרנדר בצד שמאל, נמס אל הלילה לכיוון הטקסט ולמטה */
.lgs-scene { --sink: 12vh; position: absolute; z-index: -1; inset-block: 0; left: 0; width: 62%;
  -webkit-mask: linear-gradient(90deg, #000 70%, transparent 100%), linear-gradient(180deg, #000 64%, transparent 100%); -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, #000 70%, transparent 100%), linear-gradient(180deg, #000 64%, transparent 100%); mask-composite: intersect; }
.lgs-scene img { position: absolute; left: 0; top: calc(var(--sink) * -1); display: block; width: 100%; height: calc(100% + var(--sink)); object-fit: cover; object-position: 36% 40%; }   /* גבוהה מהמסגרת: שוקעת בגלילה בלי לחשוף קצה */
.lgs-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(12, 16, 48, .6), transparent 24%); }   /* שהתפריט יישאר קריא */
.lgs-hero__copy { max-width: min(34rem, 42vw); }
.lgs-hero__title { font: 900 var(--fs-hero)/1 var(--f-brand); color: #fff; white-space: nowrap; -webkit-text-stroke: .045em var(--ink); paint-order: stroke fill; text-shadow: .05em .06em 0 var(--ink); }
.lgs-hero__title span { color: var(--brick); }
.lgs-lede { margin-top: clamp(18px, 2.4vw, 30px); font-size: clamp(1.2rem, 1rem + .75vw, 1.6rem); line-height: 1.7; color: #eef0ff; text-wrap: pretty; }
/* הרגע שבו הכל התחיל: המשפט שהוא אמר לעצמו */
.lgs-wow { font: 900 1.18em/1.2 var(--f-brand); color: var(--brick); white-space: nowrap; }

/* הכניסה: הסצנה מתיישבת, והכותרת עולה מולה. פעם אחת */
.js-motion .lgs-scene img { animation: lgs-scene 1.5s var(--ease) both; }
.js-motion .lgs-hero__title { animation: lgs-rise .9s var(--ease) .15s both; }
.js-motion .lgs-lede { animation: lgs-rise .9s var(--ease) .32s both; }
@keyframes lgs-scene { from { opacity: 0; scale: 1.09; } }
@keyframes lgs-rise { from { opacity: 0; transform: translateY(26px); } }

/* ---------- הסיפור ---------- */
/* השדרה: שורת בליטות לאורך צד הקריאה */
.lgs { position: relative; padding-block: clamp(20px, 4vw, 50px) clamp(70px, 9vw, 120px); padding-inline-start: clamp(46px, 5vw, 70px); }
.lgs::before { content: ""; position: absolute; top: 0; bottom: 160px; inset-inline-start: 6px; width: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(246, 197, 49, .34) 0 4.5px, transparent 5px) 0 0 / 14px 28px repeat-y;
  -webkit-mask: linear-gradient(180deg, transparent, #000 60px, #000 calc(100% - 120px), transparent); mask: linear-gradient(180deg, transparent, #000 60px, #000 calc(100% - 120px), transparent); }

.beat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 80px); margin-block: clamp(80px, 11vw, 160px); }
.beat:first-child { margin-top: clamp(30px, 5vw, 60px); }
.beat__txt { position: relative; }
.beat__txt, .beat__txt p { font-size: clamp(1.2rem, 1rem + .8vw, 1.72rem); line-height: 1.72; color: #eef0ff; max-width: 25em; text-wrap: pretty; }
.beat__txt--big { font: 900 clamp(1.9rem, 1.2rem + 2.8vw, 3.6rem)/1.24 var(--f-brand); color: #fff; max-width: 20em; text-wrap: balance; }
/* תאריך: לבנה קטנה */
.stamp { display: inline-grid; place-items: center; height: 34px; padding: 0 12px; margin-bottom: 14px; border-radius: 6px; background: var(--brick); color: var(--ink); border: var(--stroke) solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 900 1.02rem/1 var(--f-brand); rotate: -3deg; }

/* ---------- פריים של סרטון ---------- */
.frame { position: relative; display: block; border-radius: 14px; overflow: hidden; background: #000; border: var(--stroke) solid var(--ink); box-shadow: var(--hard); color: #fff; transition: translate .5s var(--spring), box-shadow .3s var(--ease); }
.frame img { display: block; width: 100%; height: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.frame--wide img { aspect-ratio: 16 / 9; }
.set__play { position: absolute; left: 14px; bottom: 14px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--brick); color: var(--ink); border: var(--stroke) solid var(--ink); box-shadow: 3px 4px 0 var(--ink); transition: scale .4s var(--spring); }
.set__play svg { width: 22px; height: 22px; margin-inline-start: 3px; }
.frame--wide .set__play { left: 50%; top: 50%; bottom: auto; translate: -50% -50%; }   /* בתמונה רחבה הכיתוב למטה: הכפתור נשאר באמצע */
@media (hover: hover) {
  .frame:hover { translate: -3px -4px; box-shadow: 9px 11px 0 var(--ink); }
  .frame:hover .set__play { scale: 1.1; }
}
.frame:focus-visible { outline: 3px solid var(--brick); outline-offset: 4px; }
.beat__media { margin: 0; justify-self: center; width: 100%; }
.beat__media:has(.frame--tall) { max-width: 330px; }
.beat figcaption { margin-top: 14px; font-size: .9rem; line-height: 1.45; color: var(--muted); }
.beat figcaption b { display: block; font: 900 1.12rem/1.25 var(--f-brand); color: #fff; }

/* הלמידה: הקלטת המסך רחבה */
.beat--wide { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }

/* משם רק השתפרתי: כל הסרטונים לפי הסדר, וכל אחד קצת יותר גדול מהקודם */
.beat--grow { grid-template-columns: 1fr; gap: clamp(26px, 3.5vw, 44px); }
.grow { display: grid; grid-template-columns: .76fr .83fr .9fr .97fr 1.04fr 1.11fr 1.18fr 1.25fr; align-items: end; gap: clamp(10px, 1.3vw, 18px); margin: 0; padding: 0; list-style: none; }
.grow li { display: grid; align-content: start; gap: 10px; }
.grow .frame { border-radius: 12px; }
.grow .set__play { left: 8px; bottom: 8px; width: 34px; height: 34px; }
.grow .set__play svg { width: 15px; height: 15px; margin-inline-start: 2px; }
.grow__cap { display: grid; align-content: start; gap: 2px; min-height: 4.1em; }   /* גובה קבוע: כדי שהפריימים יעמדו על אותו קו גם כשהשם בשתי שורות */
.grow__cap b { font: 700 .95rem/1.25 var(--f-brand); color: #fff; }
.grow__cap small { font-size: .8rem; color: var(--muted); }

/* התאורה: הפריים הכי גדול בעמוד, והאור שלו נדלק על הקטע כולו */
.beat--light { position: relative; isolation: isolate; padding-block: clamp(60px, 9vw, 130px); margin-block: clamp(20px, 3vw, 40px); }
.beat--light::before { content: ""; position: absolute; z-index: -1; inset-block: 0; inset-inline: -100vw; pointer-events: none;
  background: url("../assets/lego/amb-light.jpg") center / cover no-repeat; opacity: .5;
  -webkit-mask: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.beat--light .beat__media:has(.frame--tall) { max-width: 400px; }
.beat--light .frame { rotate: -1.5deg; box-shadow: var(--hard-lg); }

/* העצירה: האור כבה. הצבע יורד, וחוזר כשנוגעים */
.beat__media.beat__pair:has(.frame--tall) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); max-width: 520px; }
.beat__pair figure { margin: 0; }
.beat__pair figure:nth-child(2) { margin-top: clamp(24px, 4vw, 48px); }
.beat--stop .beat__txt p { color: #c3c8e6; }
.beat--stop .frame img { filter: saturate(.3) brightness(.78); transition: filter .6s var(--ease); }
.beat--stop .frame:hover img, .beat--stop .frame:focus-visible img { filter: none; }

/* האהבה שנשארה: הצבע חוזר */
.beat--love { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); }
.beat__note:has(.frame--tall) { max-width: 290px; }
.beat__note .frame { rotate: 4deg; box-shadow: var(--hard-lg); }

/* ---------- הזמנה ---------- */
.lgp-cta { position: relative; margin-top: clamp(40px, 6vw, 80px); padding: clamp(28px, 4vw, 44px); border-radius: var(--r-lg); background: var(--paper); color: var(--paper-ink); border: var(--stroke) solid var(--ink); box-shadow: var(--hard-lg); text-align: center; }
.lgp-cta::before { content: ""; position: absolute; top: -11px; height: 12px; inset-inline: 30px; pointer-events: none;
  background: radial-gradient(circle at 50% 70%, var(--paper) 0 6px, var(--ink) 6.5px 8px, transparent 8.4px) 0 0 / 34px 12px repeat-x; }
.lgp-cta p { font: 900 clamp(1.45rem, 1.1rem + 1.4vw, 2.3rem)/1.2 var(--f-brand); text-wrap: balance; }
.lgp-cta > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
.lgp-cta .btn--ghost { --b-fg: var(--paper-ink); border-color: rgba(28, 23, 64, .5); }
.lgp-cta .btn--ghost:hover { --b-bg: rgba(28, 23, 64, .08); border-color: var(--paper-ink); }

/* ---------- עומק בגלילה: כל שכבה בקצב שלה (Chrome, Edge, Safari חדש; בשאר העמוד פשוט עומד) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .lgs-scene img { animation: lgs-sink linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .js-motion .lgs-scene img { animation: lgs-scene 1.5s var(--ease) both, lgs-sink linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 100vh; }
    .lgs-hero__copy { animation: lgs-lift linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .beat__media { animation: lgs-drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .beat--light .beat__media { --drift: 54px; }
    .beat__note { --drift: 44px; }
    .beat--light::before { animation: lgs-lit linear both; animation-timeline: view(); animation-range: entry 20% cover 48%; }
  }
}
@keyframes lgs-sink { to { translate: 0 var(--sink); } }
@keyframes lgs-lift { to { translate: 0 -5vh; } }
@keyframes lgs-drift { from { translate: 0 var(--drift, 30px); } to { translate: 0 calc(var(--drift, 30px) * -1); } }
@keyframes lgs-lit { from { opacity: 0; } }

/* ---------- טאבלט ---------- */
@media (max-width: 1000px) {
  .grow { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 26px; }
  .grow__cap { min-height: 0; }
  .grow li:nth-child(4n+2), .grow li:nth-child(4n+4) { margin-top: 18px; }
}
/* ---------- טלפון: הסצנה למעלה והכותרת עליה. עמודה אחת, הסרטון אחרי המשפט ---------- */
@media (max-width: 760px) {
  .lgs-hero { display: block; min-height: 0; padding: 0 0 30px; }
  .lgs-scene { --sink: 7vh; position: relative; width: 100%; height: min(104vw, 470px);
    -webkit-mask: linear-gradient(180deg, #000 52%, transparent 100%); mask: linear-gradient(180deg, #000 52%, transparent 100%); }
  .lgs-scene img { object-position: 38% 30%; }
  .lgs-hero__in { margin-top: -27vw; }
  .lgs-hero__copy { max-width: none; }
  .lgs { padding-inline-start: 30px; }
  .lgs::before { inset-inline-start: 2px; width: 10px; background: radial-gradient(circle at 50% 50%, rgba(246, 197, 49, .34) 0 3.4px, transparent 3.9px) 0 0 / 10px 22px repeat-y; }
  .beat, .beat--wide, .beat--love { grid-template-columns: 1fr; gap: 24px; margin-block: 68px; }
  .beat__media:has(.frame--tall) { max-width: 240px; }
  .beat--light { padding-block: 56px; margin-block: 12px; }
  .beat--light .beat__media:has(.frame--tall) { max-width: 280px; }
  .beat__media.beat__pair:has(.frame--tall) { max-width: none; }
  .beat__note:has(.frame--tall) { max-width: 210px; }
  .beat__media, .beat--light .beat__media, .beat__note { --drift: 14px; }
}
@media (max-width: 560px) {
  .grow { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 12px; }
  .grow li { flex: 0 0 calc((100% - 24px) / 3); }
  .grow li:nth-child(n) { margin-top: 0; }
  .grow__cap b { font-size: .86rem; }
  .grow__cap small { font-size: .74rem; }
  .grow .set__play { left: 6px; bottom: 6px; width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .lgp *, .lgp *::before { animation: none !important; } }
html.reduce-motion .lgs-scene, html.reduce-motion .lgs-scene img, html.reduce-motion .lgs-hero__copy, html.reduce-motion .lgs-hero__title, html.reduce-motion .lgs-lede,
html.reduce-motion .beat__media, html.reduce-motion .beat--light::before { animation: none !important; }
