/* ============================================================
   cinema.css — שכבת העיצוב הקולנועית, נטענת אחרי styles.css
   ------------------------------------------------------------
   מאחורי העמוד מתנגן סרט (film.js). הכלל שמנחה את הקובץ הזה:
   הסרט הוא התמונה, והטקסט יושב עליו כמו כותרות בסרט — גדול, מעט,
   ותמיד על רקע כהה מספיק כדי להיקרא.

   סדר השכבות: .film (0) < .hud (1) < main / footer (1, אחריו ב-DOM) < .nav (100)
   ============================================================ */

:root {
  --bg: #03070c;
  --nav-bg: rgba(3, 7, 12, 0.66);
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --ghost: rgba(232, 238, 246, 0.44);
  --scrim: 3, 7, 12;
}

/* ---------- the film ---------- */
.film {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.film canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* The frames only change with the scroll. This slow drift keeps the picture
     alive when the reader stops to read. Transform only: the compositor does it. */
  animation: drift 16s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes drift {
  from { transform: scale(1.005) translate3d(0, 0, 0); }
  to { transform: scale(1.05) translate3d(-0.7%, -0.9%, 0); }
}

.film__dim {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
}

/* גרעין חי מעל הסרט: הפריימים עצמם קפואים כשלא גוללים, הגרעין לא */
.film__grain {
  position: absolute;
  inset: -100%;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(1) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-7%, 4%); }
  34% { transform: translate(5%, -9%); }
  51% { transform: translate(-3%, 8%); }
  68% { transform: translate(9%, 2%); }
  85% { transform: translate(-6%, -5%); }
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 238, 246, 0.46);
}

.hud__rail {
  position: absolute;
  left: 20px;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  white-space: nowrap;
}

.hud__read {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  gap: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.hud__read b {
  font-weight: 600;
  color: var(--ink);
}

.hud__ticks {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  justify-items: end;
  gap: 11px;
}

.hud__ticks i {
  display: block;
  width: 12px;
  height: 1px;
  background: rgba(232, 238, 246, 0.3);
  transform-origin: right;
  transition: transform 0.25s var(--ease), background-color 0.25s ease;
}

.hud__ticks i.on {
  transform: scaleX(2.4);
  background: var(--accent);
}

/* ---------- nav: שקוף מעל הסרט, נאטם אחרי תחילת הגלילה ---------- */
.nav {
  background: transparent;
  border-block-end-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.scrolled .nav {
  background: var(--nav-bg);
  border-block-end-color: var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
}

/* ---------- shared type ---------- */
.kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 238, 246, 0.72);
  /* dir="ltr" על האלמנט; מיישרים אותו לתחילת השורה העברית */
  justify-content: flex-end;
}

.kicker::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  background: var(--accent-logo);
}

.ghost,
.hero__line--ghost {
  color: var(--ghost);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  margin-block-start: calc(var(--nav-h) * -1);
  padding: 0;
}

/* הצללה בצד של הטקסט ובתחתית. המעבד נשאר נקי בצד השני. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to left, rgba(var(--scrim), 0.9) 0%, rgba(var(--scrim), 0.62) 30%, rgba(var(--scrim), 0) 60%),
    linear-gradient(to top, rgba(var(--scrim), 0.92) 0%, rgba(var(--scrim), 0.35) 30%, rgba(var(--scrim), 0) 55%);
}

.hero__inner {
  position: relative;
  display: grid;
  gap: clamp(1.4rem, 3.2vh, 2.4rem);
  padding-block: calc(var(--nav-h) + 2rem) clamp(1.6rem, 4.5vh, 3rem);
}

.hero__title {
  font-size: clamp(2.9rem, 7.4vw, 8rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.hero__line {
  display: block;
  max-width: 9.2em;
}

.hero__title mark {
  display: inline;
  color: var(--ink);
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
}

.hero__lead {
  margin: 0;
  max-width: 42ch;
  color: #c3ceda;
}

.hero__cta {
  margin: 0;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem clamp(1.75rem, 5vw, 4.5rem);
  margin: 0;
  padding: 1.15rem 0 0;
  list-style: none;
  border-block-start: 1px solid var(--line);
}

.specs li {
  display: grid;
  gap: 0.35rem;
}

.specs b {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.specs span {
  font-size: 0.86rem;
  color: var(--ink-2);
}

.hero__end {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  height: 1px;
}

/* כניסה: שורה אחרי שורה, פעם אחת בטעינה */
.hero .kicker,
.hero__line,
.hero__foot,
.specs {
  animation: rise 0.75s var(--ease) both;
}

.hero__line:nth-child(1) { animation-delay: 0.06s; }
.hero__line:nth-child(2) { animation-delay: 0.14s; }
.hero__foot { animation-delay: 0.24s; }
.specs { animation-delay: 0.32s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

/* ---------- services: פתיח + ארבע סצנות נעוצות ---------- */
.services {
  position: relative;
}

.lead-in {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 115vh;
}

/* ממשיך את ההצללה של סוף ה-hero, ומחשיך את הצד של הטקסט */
.lead-in::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(var(--scrim), 0.92) 0%, rgba(var(--scrim), 0) 26%),
    linear-gradient(to left, rgba(var(--scrim), 0.9) 0%, rgba(var(--scrim), 0.7) 36%, rgba(var(--scrim), 0) 66%);
}

.lead-in .wrap {
  position: relative;
  display: grid;
  gap: 1.5rem;
}

.lead-in__title {
  font-size: clamp(2.3rem, 5.8vw, 5.75rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
}

.lead-in__title .ghost {
  display: block;
}

.lead-in__text {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(1.08rem, 1.45vw, 1.3rem);
  color: #c3ceda;
}

/* כל סצנה גבוהה ממסך אחד; הטקסט נעוץ בזמן שהמצלמה טסה אל התחנה וחולפת על פניה.
   לכל שירות הצבע של התחנה שלו בסרט. */
.scene {
  --acc: var(--accent);
  position: relative;
  display: grid;
  min-height: 140vh;
  overflow-x: clip;
}

.scene--wa { --acc: #2fe07a; }
.scene--sync { --acc: #22d3ee; }
.scene--rep { --acc: #ffb347; }
.scene--ai { --acc: #a78bfa; }

.scene .kicker::after {
  background: var(--acc);
  box-shadow: 0 0 14px var(--acc);
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to left, rgba(var(--scrim), 0.92) 0%, rgba(var(--scrim), 0.72) 30%, rgba(var(--scrim), 0) 56%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.scene--flip::before {
  background: linear-gradient(to right, rgba(var(--scrim), 0.92) 0%, rgba(var(--scrim), 0.72) 30%, rgba(var(--scrim), 0) 56%);
}

.scene .wrap {
  position: relative;
}

.scene__copy {
  position: sticky;
  inset-block-start: max(calc(var(--nav-h) + 1.5rem), 19vh);
  display: grid;
  gap: 1.1rem;
  max-width: min(31rem, 40vw);
  margin-block: 24vh;
}

.scene--flip .scene__copy {
  margin-inline-start: auto;
}

.scene__num {
  font-size: clamp(4.5rem, 10vw, 9.5rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--acc);
  font-variant-numeric: tabular-nums;
}

.scene__title {
  font-size: clamp(2.1rem, 4.4vw, 4.1rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.scene__text {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.62;
  color: #c3ceda;
}

.scene .card__tags {
  margin: 0;
  padding-block-start: 1rem;
  border-block-start: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
  color: var(--ink-2);
}

/* ---------- the rest of the page: text over the dimmed film ---------- */
.section-title {
  font-weight: 900;
  font-size: clamp(2.1rem, 5.4vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.proof {
  border-block-color: var(--line);
}

/* ---------- marquee ---------- */
.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  direction: ltr;
  padding-block: clamp(1rem, 2.4vw, 1.75rem);
  border-block: 1px solid var(--line);
  background: rgba(var(--scrim), 0.5);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  width: max-content;
  animation: marquee 44s linear infinite;
}

.marquee span {
  font-size: clamp(2rem, 5.6vw, 4.75rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: var(--ghost);
}

.marquee span:nth-of-type(4n + 1) {
  color: var(--ink);
}

.marquee i {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent-logo);
}

@keyframes marquee {
  to {
    transform: translateX(calc(-50% - 1.375rem));
  }
}

/* ---------- footer: הסרט חוזר ונגלה מאחוריו ---------- */
.footer {
  background: linear-gradient(to bottom, rgba(var(--scrim), 0.15), rgba(var(--scrim), 0.8) 55%, rgba(var(--scrim), 0.94));
}

.footer h2 {
  font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ghost);
}

/* ---------- accessibility modes ---------- */
.a11y-contrast .film canvas,
.a11y-contrast .film__grain {
  opacity: 0;
}

.a11y-contrast .hud {
  display: none;
}

.a11y-contrast .hero::before,
.a11y-contrast .scene::before {
  background: #000;
  -webkit-mask-image: none;
  mask-image: none;
}

.a11y-contrast {
  --ghost: #ffffff;
}

.a11y-contrast .scene__num {
  color: #ffffff;
  -webkit-text-stroke: 0;
}

/* ---------- narrow screens ---------- */
@media (max-width: 899px) {
  .hud__rail,
  .hud__ticks {
    display: none;
  }

  .hud__read {
    left: 16px;
    bottom: auto;
    top: calc(var(--nav-h) + 12px);
    gap: 1rem;
    font-size: 9px;
  }

  /* הנושא של הסרט בחצי העליון, הטקסט בחצי התחתון */
  .hero::before {
    background: linear-gradient(to top, rgba(var(--scrim), 0.97) 0%, rgba(var(--scrim), 0.92) 48%, rgba(var(--scrim), 0.55) 62%, rgba(var(--scrim), 0) 80%);
  }

  /* The page rests at fixed stops, so nothing may sit behind the bottom bar */
  .hero__inner {
    gap: 1.1rem;
    padding-block-end: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  .hero__title {
    font-size: clamp(2.5rem, 11.5vw, 4.2rem);
  }

  .hero__lead {
    font-size: 1rem;
  }

  .specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .lead-in {
    min-height: 100svh;
    align-items: flex-end;
    padding-block-end: 18svh;
  }

  .lead-in::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to bottom, rgba(var(--scrim), 0.92) 0%, rgba(var(--scrim), 0) 20%),
      linear-gradient(to top, rgba(var(--scrim), 0.92), rgba(var(--scrim), 0.7) 45%, rgba(var(--scrim), 0) 80%);
    pointer-events: none;
  }

  .lead-in .wrap {
    position: relative;
  }

  .scene {
    min-height: 150svh;
  }

  .scene::before,
  .scene--flip::before {
    background: none;
  }

  .scene__copy {
    inset-block-start: auto;
    position: sticky;
    top: 44svh;
    max-width: none;
    margin-block: 50svh 16svh;
    gap: 0.8rem;
  }

  /* רצועה כהה מאחורי הטקסט, לכל רוחב המסך, שנמוגה למעלה ולמטה */
  .scene__copy::before {
    content: "";
    position: absolute;
    inset: -5rem calc(var(--gutter) * -1) -4rem;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(var(--scrim), 0), rgba(var(--scrim), 0.9) 22%, rgba(var(--scrim), 0.94) 80%, rgba(var(--scrim), 0));
  }

  .scene--flip .scene__copy {
    margin-inline-start: 0;
  }

  .scene__num {
    font-size: 4rem;
  }

  .scene__title {
    font-size: clamp(1.9rem, 8.4vw, 2.6rem);
  }
}
