/* =========================================================
   דף הבית: סרטון וסיפור הטעינה
   סרטון הפתיחה וסיפור המכונות.
   ========================================================= */

/* ---------- opening globe ---------- */
.globe {
  position: relative;
  height: 620vh;
}
.gpin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: radial-gradient(55% 60% at 50% 52%, rgba(255, 255, 255, 0.04), transparent 70%), hsl(var(--bg));
}
.hvid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  will-change: opacity, transform;
}
.hvid video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hvid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.2) 42%,
    rgba(0, 0, 0, 0) 62%,
    rgba(0, 0, 0, 0.35) 100%
  );
}
.gside,
.glegend,
.gcue {
  will-change: opacity;
}
.gside {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + max(84px, 13vh));
  text-align: center;
  z-index: 2;
}
.gside .eyebrow {
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.gside h1 {
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 10px;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.45);
}
.gside p {
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
}

.gcue {
  z-index: 2;
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: hsl(var(--muted));
}
.gcue .ln {
  position: relative;
  width: 1px;
  height: 36px;
  background: hsl(var(--stroke));
  overflow: hidden;
}
.gcue .ln i {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 50%;
  background: hsl(var(--text) / 0.8);
  animation: scroll-down 1.5s ease-in-out infinite;
}
@media (max-width: 767px) {
  .gside {
    right: 20px;
    left: 20px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
  }
  .gside h1 {
    font-size: 32px;
  }
  .gside p {
    font-size: 14px;
  }
}
/* ---------- loading story ---------- */
.works {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
  z-index: 3;
  overflow: hidden;
}
.sfloor {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--fy, 74%);
  height: 30%;
  background: radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 70%);
  pointer-events: none;
}
.sfloor::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}
.stack {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.sc {
  position: absolute;
  display: block;
  filter: brightness(0.9);
}
.sshd {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -6%;
  height: 12%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
}
#stScene {
  position: absolute;
  left: 0;
  top: 0;
}
.stg {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.whead {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 96px);
  text-align: center;
  z-index: 5;
  padding: 0 20px;
}
.whead .eyebrow {
  letter-spacing: 0.25em;
  margin-bottom: 10px;
}
.whead h2 {
  font-weight: 400;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
}
.dwrap {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  z-index: 2;
}
.dwrap .mach {
  position: relative;
  width: 100%;
  aspect-ratio: 1774/887;
}
.wfloor {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -12%;
  height: 44%;
  background: radial-gradient(50% 40% at 50% 92%, rgba(255, 255, 255, 0.07), transparent 70%);
  pointer-events: none;
}
.dfx {
  position: absolute;
  left: -12%;
  top: -30%;
  width: 124%;
  height: 140%;
  pointer-events: none;
}
.dtrk {
  position: absolute;
  background: repeating-linear-gradient(90deg, #19191a 0 58%, #47474a 58% 66%, #232324 66% 100%);
  background-size: var(--tp, 10px) 100%;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
}
.dtb {
  left: 39.46%;
  width: 33.82%;
  top: 94.9%;
  height: 1.75%;
}
.dtt {
  left: 45.1%;
  width: 23.68%;
  top: 80.83%;
  height: 1.58%;
}
.dspr {
  position: absolute;
  left: 69.5%;
  top: 85.57%;
  width: 4.85%;
  height: 9.7%;
  transform-origin: 50% 50%;
  pointer-events: none;
}
.wcap {
  text-align: center;
  will-change: opacity;
}
.dwrap .wcap {
  margin-top: 14px;
}
#scap {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 2;
}
.wcap b {
  display: block;
  font-weight: 500;
  font-size: 18px;
  color: #fff;
}
.wcap b::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  margin: 8px auto 6px;
  background: #1d1c1a;
  opacity: 0.85;
}
.wcap span {
  font-size: 13.5px;
  color: hsl(0 0% 60%);
}
@media (max-width: 767px) {
  .whead {
    top: calc(env(safe-area-inset-top, 0px) + 80px);
  }
  .whead h2 {
    font-size: 28px;
  }
  .whead .eyebrow {
    margin-bottom: 6px;
  }
  .dwrap .wcap {
    margin-top: 4px;
  }
  .wcap b {
    font-size: 16px;
  }
  .wcap b::after {
    margin: 5px auto 4px;
  }
  .wcap span {
    font-size: 12.5px;
  }
}
.scene .mach {
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
}
.mach {
  position: relative;
  width: 100%;
  will-change: transform;
}
.mrig {
  position: absolute;
  inset: 0;
}
.mach .lay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.whl {
  position: absolute;
  display: block;
  will-change: transform;
}
.boomg {
  transform-origin: 19.165% 46.223%;
  will-change: transform;
}
.cylg {
  transform-origin: 46.787% 74.634%;
  will-change: transform;
}
.sprg {
  will-change: transform;
}
.lock {
  position: absolute;
  width: 1.1%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 10px 3px rgba(255, 170, 60, 0.85);
  opacity: 0;
  transition: opacity 0.25s;
}
.lock.on {
  opacity: 1;
}
.beacon {
  position: absolute;
  width: 2.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 170, 60, 0.95), rgba(255, 140, 40, 0) 70%);
  animation: beacon 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes beacon {
  0%,
  100% {
    opacity: 0.15;
  }
  45% {
    opacity: 1;
  }
}
.shd {
  position: absolute;
  left: 3.4%;
  width: 60.9%;
  top: 73.1%;
  height: 47.35%;
  transform: rotateX(90deg);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent);
}
.rev {
  position: absolute;
  left: 95%;
  top: 70%;
  width: 3%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 250, 235, 0.95), rgba(255, 240, 210, 0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}

.tshd {
  position: absolute;
  left: 2%;
  width: 96%;
  top: 80%;
  height: 10%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent);
}
.speedo {
  position: absolute;
  left: max(24px, 5vw);
  top: calc(env(safe-area-inset-top, 0px) + 100px);
  z-index: 6;
  direction: ltr;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: hsl(0 0% 62%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.speedo b {
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}
.gcover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  z-index: 6;
  background: hsl(var(--surface));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px 28px 0 0;
  transform: translateY(101%);
  pointer-events: none;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.35);
}
.gcover span {
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.25em;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: hsl(var(--muted));
  white-space: nowrap;
}
.tcov {
  z-index: 21;
  transform: none;
}
#tspd {
  z-index: 21;
  opacity: 1;
}
@media (max-width: 767px) {
  .speedo {
    top: calc(env(safe-area-inset-top, 0px) + 84px);
    left: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .beacon {
    animation: none;
    opacity: 0.6;
  }
}
#mStk,
#rStk,
.boomg,
.sprg,
.c3 {
  transform-style: preserve-3d;
}
.cr {
  transform-origin: 83% 50%;
  transform: rotateY(90deg);
}
.ff3 {
  position: absolute;
  display: block;
  backface-visibility: hidden;
}
.chf {
  left: 51.75%;
  top: 67.64%;
  width: 22.55%;
  height: 29.31%;
  transform: rotateY(90deg);
}
.cabf {
  left: 34.1%;
  top: 50.17%;
  width: 9.58%;
  height: 21.98%;
  transform: rotateY(90deg);
}
.bbot {
  position: absolute;
  left: 24.24%;
  top: 41.15%;
  width: 40%;
  height: 12.4%;
  transform-origin: 0 50%;
  transform: rotate(-15.55deg) rotateX(-90deg);
  background: linear-gradient(90deg, #3a2a24, #5a4038 30%, #4a352e 70%, #2e221d), #3a2a24;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.35);
}
.shf {
  left: -0.7%;
  width: 100.85%;
  top: -43.2%;
  height: 50.5%;
  transform: translateZ(calc(var(--hz, 40px) + 2px));
}
.shh {
  left: 30.27%;
  width: 31.9%;
  top: -70.9%;
  height: 30.9%;
  transform: translateZ(calc(var(--hz, 40px) - 4px));
}
.cbox .lock {
  transform: translate(-50%, -50%) translateZ(calc(var(--hz, 40px) + 2px));
}

.send {
  position: absolute;
  left: 35.01%;
  width: 29.97%;
  top: -35%;
  height: 46%;
  transform: rotateY(-90deg) translateZ(var(--lz, 130px));
  backface-visibility: hidden;
  background: url(../img/story/spreader-beam.webp) center/100% 100% no-repeat;
}
.send.sr {
  transform: rotateY(90deg) translateZ(var(--lz, 130px));
}
.cbox {
  position: absolute;
  transform-style: preserve-3d;
}
.cf {
  position: absolute;
  display: block;
  backface-visibility: hidden;
}
.ff,
.fb {
  inset: 0;
  width: 100%;
  height: 100%;
  filter: brightness(0.92);
}
.ff {
  transform: translateZ(var(--hz, 40px));
}
.fe {
  filter: brightness(0.8);
}
.fb {
  transform: rotateY(180deg) translateZ(var(--hz, 40px));
}
.fe {
  top: 0;
  height: 100%;
  left: 35.01%;
  width: 29.97%;
}
.fl {
  transform: rotateY(-90deg) translateZ(var(--lz, 130px));
}
.fr {
  transform: rotateY(90deg) translateZ(var(--lz, 130px));
}
.fbot {
  left: 0;
  width: 100%;
  top: 3%;
  height: 94%;
  background: linear-gradient(90deg, #2a1f1b, #3b2b25 50%, #2a1f1b);
  transform: rotateX(-90deg) translateZ(var(--hh, 40px));
}
.trk {
  position: absolute;
  left: 66%;
  top: 56.38%;
  width: 49.62%;
  height: 47.6%;
  visibility: hidden;
  will-change: transform;
}
.tflip {
  position: absolute;
  inset: 0;
}
.hand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  visibility: hidden;
  pointer-events: none;
  display: block;
}
.hb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hw {
  position: absolute;
  width: 5.125%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: 100% 100%;
}
/* the truck section overlaps the end of the opening story by one screen plus 360px:
   for those 360px both scenes stand still, so the hand-off between them can't jump,
   even when the browser scrolls a frame ahead of the scripts (see HANDOFF in home.js) */
#top {
  margin-top: calc(-100vh - 360px);
  margin-top: calc(-100svh - 360px);
  z-index: 5;
}
.tbase {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.twh {
  position: absolute;
  width: 5.125%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-size: 100% 100%;
  will-change: transform;
}
.lock {
  position: absolute;
  width: 1.1%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffb347;
  box-shadow: 0 0 10px 3px rgba(255, 170, 60, 0.85);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s;
}
.lock.on {
  opacity: 1;
}
.beacon {
  position: absolute;
  width: 2.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 170, 60, 0.95), rgba(255, 140, 40, 0) 70%);
  animation: beacon 1.1s ease-in-out infinite;
  pointer-events: none;
}
@keyframes beacon {
  0%,
  100% {
    opacity: 0.15;
  }
  45% {
    opacity: 1;
  }
}
.dfx {
  position: absolute;
  left: -12%;
  top: -30%;
  width: 124%;
  height: 140%;
  pointer-events: none;
}

@media (max-width: 767px) {
  .works {
    padding: calc(env(safe-area-inset-top, 0px) + 80px) 0 16px;
    justify-content: flex-start;
  }
  .whead {
    margin-bottom: 10px;
  }
  .whead h2 {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .beacon {
    animation: none;
    opacity: 0.6;
  }
}
