/* =====================================================================
   Scene: luka → magacin → put → ulica
   Svaka scena ima pozornicu (.scene__stage) koja se ponaša kao "cover":
   16:9 na širokim ekranima, 9:16 na uspravnim (posebne pozadine iz slike/mobile/).
     .scene__fx  – efekti vezani za pozadinu (svetla, sat, kapija…), u % pozadine
     .scene__set – "set" 16:9 sa kamionom i likovima. Na širokim ekranima pokriva celu
                   pozornicu, a na uspravnim je traka u donjem delu kadra (130% širine),
                   pa pozicije likova ostaju iste u oba slučaja.
     .scene__fg  – prvi plan ispred kamiona
   Mirno stanje svakog elementa = kraj priče, pa scena izgleda smisleno i bez animacija
   (prefers-reduced-motion). Animacije kreću kad scena dobije .is-arrived.
   ===================================================================== */

.scene__view { cursor: pointer; }
.scene--ulica .scene__view { cursor: auto; }

.scene__stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(100%, 177.78svh, 1067px);
  aspect-ratio: 16 / 9;
  transform: translateX(-50%);
  z-index: -2;
}
.scene__img { width: 100%; height: 100%; object-fit: cover; }

.scene__fx,
.scene__fg { position: absolute; inset: 0; pointer-events: none; }
.scene__set {
  position: absolute;
  inset: 0;
  pointer-events: none;
  container-type: inline-size; /* cqw = % širine seta (za putokaz i bilbord) */
}

.scene__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 30%, rgba(0,0,0,0) 48%),
    linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 22%);
}

/* Put koji se beskonačno pomera: slika + njen odraz (nema vidljivog spoja).
   Jedna pločica = 3.537 × visina pozornice; traka je široka dve pločice i klizi za jednu. */
.scene__track {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  width: calc(100% * 3.537 / 1.7778 * 2);
  background: url("../slike/scena-put-petlja.jpg") left center / auto 100% repeat-x;
  background-image: image-set(url("../slike/scena-put-petlja.webp") type("image/webp"), url("../slike/scena-put-petlja.jpg") type("image/jpeg"));
  animation: roadScroll 14s linear infinite;
  will-change: transform;
}

/* ===== Kamion (kombi sa sandukom) ===== */
.truck {
  position: absolute;
  left: 28%;
  bottom: 10%;
  width: 44%;
  aspect-ratio: 1400 / 730;
}
.scene--put .truck { bottom: 8%; }
.scene--ulica .truck { bottom: 9%; }

.truck__body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 70% 100%;
}
.truck__wheel {
  position: absolute;
  width: 13.11%;
  aspect-ratio: 1;
  margin: -6.555% 0 0 -6.555%;
}
.truck__wheel--rear { left: 20.57%; top: 82.47%; }
.truck__wheel--front { left: 80.64%; top: 82.19%; }
.truck__shadow {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: -4%;
  height: 12%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 70%);
}

/* Farovi i stop-svetla */
.truck__beam {
  position: absolute;
  left: 96.5%;
  top: 57.5%;
  width: 75%;
  height: 70%;
  transform: translateY(-50%);
  clip-path: polygon(0 47%, 100% 0, 100% 100%, 0 53%);
  background: linear-gradient(to right, rgba(255,228,170,.6), rgba(255,228,170,.15) 55%, rgba(255,228,170,0));
  mix-blend-mode: screen;
  opacity: 0;
}
.truck__tail {
  position: absolute;
  left: 2.9%;
  top: 69%;
  width: 9%;
  aspect-ratio: 1;
  margin: -4.5% 0 0 -4.5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,60,40,.9), rgba(255,40,20,.3) 35%, rgba(255,40,20,0) 70%);
  mix-blend-mode: screen;
  opacity: 0;
}

/* Prašina iza kamiona dok putuje */
.truck__dust { position: absolute; left: -8%; bottom: 2%; width: 14%; height: 22%; }
.truck__dust span {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,199,122,.35), rgba(230,199,122,0) 70%);
  opacity: 0;
}

/* Dim iza zadnjeg točka (slajfovanje u magacinu) */
.truck__smoke { position: absolute; left: 4%; bottom: 0; width: 22%; height: 30%; }
.truck__smoke span {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225,220,210,.55), rgba(225,220,210,0) 70%);
  opacity: 0;
}

/* ===== Likovi (isečene slike) ===== */
.actor { position: absolute; z-index: 0; }
.actor img { height: 100%; width: auto; max-width: none; }
.actor::after,
.lift::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -2%;
  height: 5%;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.7), rgba(0,0,0,0) 70%);
}

/* "Pokreni kamion" se pojavi tek kad se priča u sceni završi */
.scene.is-departing .scene__hint { animation: none; }

/* =====================================================================
   1. LUKA
   Isti Tron kamion, ali umesto sanduka ima ravnu platformu – kontejner mu postaje tovarni deo.
   Vremenska linija (s): 0.3 kamion ulazi i staje kod krana · 0.4 kran vozi
   kontejner sa broda · 3.1 spušta ga · 5.4 kontejner legne na platformu · 5.6 spreder se
   diže · 6.8 radnik daje znak · 7.2 "Kreni u magacin"
   ===================================================================== */
.crane { position: absolute; left: 25%; bottom: 34%; height: 52%; }
.crane img { height: 100%; width: auto; max-width: none; filter: brightness(1.2); }
.crane__beacon {
  position: absolute;
  left: 77%;
  top: 1%;
  width: 2.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffb347 0 30%, rgba(255,140,30,.4) 50%, rgba(255,140,30,0) 72%);
  animation: blink 1.2s steps(1) infinite;
}
.scene--luka .truck { left: 28%; }
.scene--luka .truck__beam,
.scene--luka .truck__tail { opacity: 1; }
.scene--luka .actor--thumb { left: 74%; }

/* Kontejner na platformi kamiona (u % kamiona): od zlatne ivice platforme do visine kabine */
.truck__box { position: absolute; left: 2.2%; bottom: 42.05%; width: 58.7%; height: 48.8%; }

/* Kontejner (isti na kranu i na kamionu) */
.truck__box > img:first-child,
.hoist__box > img:first-child { width: 100%; height: 100%; object-fit: fill; }
.box-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 46%;
  max-height: 62%;
  transform: translate(-50%, -50%);
  opacity: .92;
}

/* Kolica krana, sajle, spreder i kontejner. Visina = od donje ivice grane (25.44% od vrha)
   do platforme kamiona (27.16% odozdo); spušten teret = 47.47% od vrha. */
.hoist {
  position: absolute;
  left: 28.97%;
  top: 25.44%;
  width: 25.83%;
  height: 47.4%;
  overflow: hidden;
}
.hoist__trolley {
  position: absolute;
  left: 32%;
  top: 0;
  z-index: 1;
  width: 36%;
  height: 3.5%;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: linear-gradient(#2a4a33, #14261a);
}
.hoist__load { position: absolute; left: 0; top: 4%; width: 100%; height: 52.53%; }
.hoist__load::before { /* sajle do kolica (višak iznad kolica odseca overflow) */
  content: "";
  position: absolute;
  left: 41%;
  bottom: 100%;
  width: 18%;
  height: 300%;
  border-left: 2px solid #15140f;
  border-right: 2px solid #15140f;
}
.hoist__spreader { position: absolute; left: -1%; top: 0; width: 102%; height: 20.08%; object-fit: fill; }
.hoist__box { position: absolute; left: 0; top: 20.08%; width: 100%; height: 79.92%; opacity: 0; }

.scene--luka.is-arrived .truck { animation: truckIn 2.4s cubic-bezier(.2,.65,.25,1) .3s both; }
.scene--luka.is-arrived .truck__wheel { animation: wheelSpinOnce 2.4s cubic-bezier(.2,.65,.25,1) .3s both; }
.scene--luka.is-arrived .truck__body { animation: truckBrake .7s ease-out 2.5s both; }
.scene--luka.is-arrived .hoist { animation: hoistMove 2.6s ease-in-out .4s both; }
.scene--luka.is-arrived .hoist__load { animation: hoistLoad 4.3s 3.1s both; }
.scene--luka.is-arrived .hoist__box { animation: boxHide .01s 5.4s both; }
.scene--luka.is-arrived .truck__box { animation: boxShow .01s 5.4s both; }
.scene--luka.is-arrived .actor--thumb { animation: thumbIn .9s ease-out 6.8s both; }
.scene--luka.is-arrived .actor--thumb img { transform-origin: 50% 100%; animation: thumbNod .5s ease-in-out 7.7s 2 alternate; }
.scene--luka.is-arrived .scene__hint { animation: fadeIn .6s ease 7.2s both; }

/* =====================================================================
   2. MAGACIN
   Vremenska linija (s): 0.2 kapija se diže · 0.3 kamion ulazi i koči, farovi se gase
   · 3.2 viljuškar istovari paletu iz uvoza i odveze je · 7.6 i 8.9 radnici unose kutije
   · 11 radnik daje znak, farovi se pale · 11.6 "Pokreni kamion" · polazak: slajfovanje pa start
   ===================================================================== */

/* Rolo kapija desno (otvor na slici: x 94–100%, y 26.5–71.6%) */
.mg-gate {
  position: absolute;
  left: 93.9%;
  top: 26.3%;
  width: 6.2%;
  height: 45.5%;
  transform-origin: top;
  transform: scaleY(0);
  background: repeating-linear-gradient(to bottom, #213a29 0 2.2%, #2f5039 2.2% 3.4%, #12201a 3.4% 3.8%);
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.6);
}

/* Sat na zidu – rano jutro, kazaljke polako idu */
.mg-clock {
  position: absolute;
  left: 88.6%;
  top: 14%;
  width: 3.2%;
  aspect-ratio: 1;
  border: max(1px, .14vw) solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle, #f3e6c4 0 58%, #d9c48f 100%);
  box-shadow: 0 0 18px rgba(230,199,122,.35);
}
.mg-clock span {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 7%;
  margin-left: -3.5%;
  border-radius: 2px;
  background: #1a1a14;
  transform-origin: 50% 100%;
}
.mg-clock__h { height: 26%; transform: rotate(165deg); animation: clockH 120s linear infinite; }
.mg-clock__m { height: 38%; transform: rotate(180deg); animation: clockM 120s linear infinite; }

/* Snopovi svetla ispod lampi */
.mg-beams span {
  position: absolute;
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom, rgba(255,205,130,.26), rgba(255,205,130,.06) 60%, rgba(255,205,130,0));
  mix-blend-mode: screen;
  animation: beam 6s ease-in-out infinite alternate;
}
.mg-beams span:nth-child(1) { left: 11.3%; top: 8.4%; width: 18%; height: 66%; }
.mg-beams span:nth-child(2) { left: 21.3%; top: 21%; width: 10%; height: 44%; animation-delay: -2s; }
.mg-beams span:nth-child(3) { left: 65.7%; top: 21%; width: 10%; height: 44%; animation-delay: -4s; }
.mg-beams span:nth-child(4) { left: 69.8%; top: 8.4%; width: 18%; height: 66%; animation-delay: -1s; }

/* Prašina koja lebdi u svetlu (čestice pravi JS) */
.mg-dust { position: absolute; inset: 0; }
.mg-dust i {
  position: absolute;
  width: var(--s, 3px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,226,170,.85);
  box-shadow: 0 0 6px rgba(255,214,140,.9);
  opacity: 0;
  animation: mote var(--d, 9s) ease-in-out var(--delay, 0s) infinite;
}

/* Magacionerka sa tabletom – stoji kod regala, blago "diše" */
.actor--tablet { left: 80%; bottom: 27%; height: 15%; filter: brightness(.82); }
.actor--tablet img { transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite alternate; }

/* Radnici sa kutijama – unose ih u kamion (prolaze iza njega) */
.actor--box { left: 41%; bottom: 11.5%; height: 22%; opacity: 0; }

/* hod je u samoj slici (animirani WebP) */

/* Viljuškar sa paletom (luka: utovar u kamion, magacin: istovar iz kamiona) */
.lift {
  position: absolute;
  left: -30%;
  bottom: 11%;
  z-index: 0;
  height: 28%;
  display: flex;
}
.lift img { height: 100%; width: auto; max-width: none; }
.lift__body { animation: idleShake .18s linear infinite alternate; }
.lift__pallet { opacity: 0; }
.lift__beacon {
  position: absolute;
  left: 22.5%;
  top: 5.8%;
  width: 12%;
  aspect-ratio: 1;
  margin: -6% 0 0 -6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,170,40,.9), rgba(255,140,20,.25) 35%, rgba(255,140,20,0) 70%);
  mix-blend-mode: screen;
  animation: beacon .8s ease-in-out infinite alternate;
}

/* Radnik daje znak palcem – kamion može da krene */
.actor--thumb { left: 22.5%; bottom: 9.5%; height: 23%; }

.scene--magacin.is-arrived .mg-gate { animation: gateUp 2.6s cubic-bezier(.45,0,.3,1) .2s both; }
.scene--magacin.is-arrived .truck { animation: truckIn 2.4s cubic-bezier(.2,.65,.25,1) .3s both; }
.scene--magacin.is-arrived .truck__wheel { animation: wheelSpinOnce 2.4s cubic-bezier(.2,.65,.25,1) .3s both; }
.scene--magacin.is-arrived .truck__body { animation: truckBrake .7s ease-out 2.5s both; }
.scene--magacin.is-arrived .truck__beam,
.scene--magacin.is-arrived .truck__tail { animation: mgLights 12s linear both; }
.scene--magacin.is-arrived .lift { animation: liftUnload 7s 3.2s both; }
.scene--magacin.is-arrived .lift__pallet { animation: palletOut 7s 3.2s both; }
.scene--magacin.is-arrived .actor--box { animation: boxWalk 3s linear 7.6s both; }
.scene--magacin.is-arrived .actor--box2 { animation-delay: 8.9s; }
.scene--magacin.is-arrived .actor--thumb { animation: thumbIn .9s ease-out 11s both; }
.scene--magacin.is-arrived .actor--thumb img { transform-origin: 50% 100%; animation: thumbNod .5s ease-in-out 11.9s 2 alternate; }
.scene--magacin.is-arrived .scene__hint { animation: fadeIn .6s ease 11.6s both; }

/* =====================================================================
   3. PUT
   Kamion vozi u mestu dok se put pomera. Oblaci plove, zvezde trepere, svitci lete;
   putokaz i bilbord promiču brzinom puta, vozila iz suprotnog smera prolaze dalekom
   trakom (iza kamiona), biljke u prvom planu idu duplo brže (paralaksa).
   ===================================================================== */
.scene--put .truck { transform: translateX(-175%); }
.scene--put .truck__wheel { animation: wheelSpin .5s linear infinite; }
.scene--put .truck__beam,
.scene--put .truck__tail { opacity: 1; }

.put-clouds span {
  position: absolute;
  left: 110%;
  width: 42%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(150,110,55,.32), rgba(150,110,55,0) 70%);
  filter: blur(4px);
  animation: cloudDrift 80s linear infinite;
}
.put-clouds span:nth-child(1) { top: 30%; animation-delay: -10s; }
.put-clouds span:nth-child(2) { top: 37%; width: 30%; animation-duration: 60s; animation-delay: -42s; }
.put-clouds span:nth-child(3) { top: 22%; width: 34%; animation-duration: 100s; animation-delay: -70s; }

.put-sky { position: absolute; inset: 0 0 62% 0; }
.put-sky i {
  position: absolute;
  width: var(--s, 2px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff7e0;
  box-shadow: 0 0 4px rgba(255,247,224,.8);
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

.put-meteor {
  position: absolute;
  top: 7%;
  left: 64%;
  width: 9%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to left, rgba(255,240,200,0), rgba(255,244,214,.95));
  opacity: 0;
  transform: rotate(-18deg);
  animation: meteor 11s ease-out 3s infinite;
}

.put-flies { position: absolute; left: 0; right: 0; top: 44%; height: 24%; }
.put-flies i {
  position: absolute;
  width: var(--s, 3px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(225,255,130,.95);
  box-shadow: 0 0 8px rgba(205,255,100,.9);
  opacity: 0;
  animation: firefly var(--d, 6s) ease-in-out var(--delay, 0s) infinite;
}

/* Putokaz i bilbord pored puta (iza daleke trake) */
.put-sign {
  position: absolute;
  left: 104%;
  bottom: var(--roadside, 33%);
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: brightness(.88);
  animation: signPass 16s linear 1.5s infinite;
}
.put-sign span {
  padding: calc(.45 * var(--u)) calc(1 * var(--u));
  border: calc(.15 * var(--u)) solid var(--gold);
  border-radius: calc(.3 * var(--u));
  background: #1f3a26;
  box-shadow: 0 0 calc(1.2 * var(--u)) rgba(0,0,0,.6);
  font-family: var(--font-head);
  font-size: calc(1 * var(--u));
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  color: var(--gold-light);
}
.put-sign b { display: block; font-size: calc(1.35 * var(--u)); color: var(--white); }
.put-sign::after {
  content: "";
  width: calc(.35 * var(--u));
  height: calc(5 * var(--u));
  background: linear-gradient(to right, #3a352b, #6b6250, #3a352b);
}

.put-board {
  position: absolute;
  left: 104%;
  bottom: var(--roadside, 33%);
  height: 30%;
  filter: brightness(.9);
  animation: boardPass 16s linear 9.5s infinite;
}
.put-board > img { height: 100%; width: auto; max-width: none; }
.put-board__ad {
  position: absolute;
  left: 2.4%;
  right: 2.4%;
  top: 13.4%;
  height: 46.4%;
  border-radius: calc(.25 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(.35 * var(--u));
  overflow: hidden;
  text-align: center;
}
.put-board__ad img { height: 46%; width: auto; }
.put-board__ad span {
  font-family: var(--font-head);
  font-size: calc(.95 * var(--u));
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--gold-light);
}
.put-board__ad small {
  display: block;
  margin-top: calc(.15 * var(--u));
  font-family: var(--font-body);
  font-size: calc(.55 * var(--u));
  font-weight: 500;
  letter-spacing: .22em;
  color: rgba(247,242,231,.8);
}

/* Vozila iz suprotnog smera – daleka traka, prolaze iza kamiona */
.car { position: absolute; left: 105%; bottom: var(--lane, 21%); animation: oncoming var(--dur, 10s) linear var(--delay, 0s) infinite; }
.car img { height: 100%; width: auto; max-width: none; }
.car--sedan { height: 15%; --dur: 10s; --delay: 2s; }
.car--pickup { height: 17%; --dur: 13s; --delay: 6.5s; }
.car--bus { height: 26%; --dur: 17s; --delay: 11s; }
.car--moto { height: 15%; --dur: 8s; --delay: 4.2s; }
.car img { animation: idleShake .2s linear infinite alternate; }

/* Biljke u prvom planu (ispred kamiona) */
.put-fg {
  position: absolute;
  left: 0;
  bottom: -4%;
  height: 15%;
  width: calc(100% * 9.7175 * .15 / 1.7778 * 2); /* dve pločice; jedna = 9.7175 × visina sloja */
  background: url("../slike/put/biljke-petlja.webp") left bottom / auto 100% repeat-x;
  filter: brightness(.5) blur(1px);
  animation: roadScroll 2.8s linear infinite;
  will-change: transform;
}

.scene--put.is-arrived .truck { animation: truckIn 1.8s cubic-bezier(.2,.65,.25,1) .4s both; }
.scene--put.is-arrived .truck__body { animation: truckBump .45s ease-in-out 2.2s infinite alternate; }
.scene--put.is-arrived .truck__dust span { animation: dust 1.2s ease-out infinite; }
.scene--put.is-arrived .truck__dust span:nth-child(2) { animation-delay: .4s; }
.scene--put.is-arrived .truck__dust span:nth-child(3) { animation-delay: .8s; }

/* =====================================================================
   4. ULICA
   Vremenska linija (s): 0.5 kamion ulazi sa upaljenim farovima · 2.9 parkira i koči
   · 3.0 kuvar izlazi i maše · 3.4 svetla se gase, dostavljač izlazi iza kamiona sa
   kolicima i gura robu do kafića · 8.9 stiže do kuvara
   ===================================================================== */
.scene--ulica .truck { transform: translateX(-175%); }

.ul-glow span { position: absolute; mix-blend-mode: screen; }
.ul-glow__garland {
  left: 0;
  right: 0;
  top: 17%;
  height: 18%;
  background: linear-gradient(to bottom, rgba(255,190,90,0), rgba(255,190,90,.16), rgba(255,190,90,0));
  animation: flicker 3.7s steps(6) infinite;
}
.ul-glow__oven {
  left: 61.3%;
  top: 59.5%;
  width: 7%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,140,40,.7), rgba(255,110,20,0) 65%);
  transform: translate(-50%, -50%);
  animation: fire .35s ease-in-out infinite alternate;
}
.ul-glow__lamp {
  width: 4.5%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255,200,110,.55), rgba(255,200,110,0) 65%);
  transform: translate(-50%, -50%);
  animation: flicker 2.9s steps(5) infinite;
}
.ul-glow__lamp:nth-child(3) { left: 1.3%; top: 48%; }
.ul-glow__lamp:nth-child(4) { left: 25.6%; top: 48.6%; animation-delay: -1s; }
.ul-glow__lamp:nth-child(5) { left: 50.7%; top: 49%; animation-delay: -2s; }
.ul-glow__lamp:nth-child(6) { left: 79.5%; top: 48.5%; animation-delay: -.5s; }
.ul-glow__lamp:nth-child(7) { left: 94.4%; top: 48.2%; animation-delay: -1.6s; }

/* Para iz šoljice na natpisu kafića */
.ul-steam { position: absolute; left: 12.6%; top: 30.5%; width: 1.6%; height: 5%; }
.ul-steam span {
  position: absolute;
  bottom: 0;
  left: 30%;
  width: 40%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,240,220,.5), rgba(255,240,220,0) 70%);
  filter: blur(2px);
  opacity: 0;
  animation: steam 3s ease-out infinite;
}
.ul-steam span:nth-child(1) { left: 0; }
.ul-steam span:nth-child(2) { animation-delay: 1s; }
.ul-steam span:nth-child(3) { left: 60%; animation-delay: 2s; }

/* Kuvar izlazi ispred kafića i maše */
.actor--chef { left: var(--chef-x, 5%); bottom: var(--walk-y, 28%); height: var(--walk-h, 17%); filter: brightness(.9); }
.actor--chef img { transform-origin: 50% 100%; animation: sway 1.4s ease-in-out infinite alternate; }

/* Dostavljač: iza kamiona, preko ulice, do kuvara (ide "u dubinu" pa se smanjuje) */
.actor--courier { left: var(--courier-x, 10%); bottom: var(--walk-y, 27%); height: var(--walk-h, 17%); }

/* Prolaznici i konobar */
.actor--waiter { left: var(--waiter-x, 80%); bottom: var(--walk-y, 29%); height: var(--walk-h, 16%); }
.actor--couple { left: -10%; bottom: var(--walk-y, 28%); height: var(--walk-h, 16.5%); opacity: 0; }
/* par u slici gleda nalevo, a hoda nadesno, pa ga okrećemo */
.actor--couple img { transform: scaleX(-1); }
.actor--coffee { left: 105%; bottom: var(--walk-y, 28.5%); height: var(--walk-h, 16%); opacity: 0; transform: scaleX(-1); }
.actor--waiter img,
.actor--couple img,
.actor--coffee img { transform-origin: 50% 100%; } /* hod je u samoj slici (animirani WebP) */

.scene--ulica.is-arrived .truck { animation: truckIn 2.4s cubic-bezier(.2,.65,.25,1) .5s both; }
.scene--ulica.is-arrived .truck__wheel { animation: wheelSpinOnce 2.4s cubic-bezier(.2,.65,.25,1) .5s both; }
.scene--ulica.is-arrived .truck__body { animation: truckBrake .7s ease-out 2.7s both; }
.scene--ulica.is-arrived .truck__beam,
.scene--ulica.is-arrived .truck__tail { animation: lightsOff .5s ease 3.4s both; }
.scene--ulica.is-arrived .actor--chef { animation: chefIn .8s ease-out 3s both; }
.scene--ulica.is-arrived .actor--courier { animation: courierWalk 5.5s linear 3.4s both; }
/* dostavljač gleda u pravcu hoda: na širokom ekranu ide ulevo, na telefonu udesno */
.actor--courier img { transform: scaleX(var(--courier-dir, 1)); }
/* kad stigne do kuvara, hod se zameni mirnom slikom */
.actor--courier .actor__stand { position: absolute; left: 0; top: 0; opacity: 0; }
.scene--ulica.is-arrived .actor--courier .actor__walk { animation: boxHide .01s 8.9s both; }
.scene--ulica.is-arrived .actor--courier .actor__stand { animation: boxShow .01s 8.9s both; }
.scene--ulica.is-arrived .actor--waiter { animation: waiterWalk 9s linear 1.2s infinite both; }
.scene--ulica.is-arrived .actor--couple { animation: coupleWalk 26s linear 4s infinite both; }
.scene--ulica.is-arrived .actor--coffee { animation: coffeeWalk 30s linear 12s infinite both; }

/* ===== Polazak (scene 1–3) ===== */
.scene.is-departing .truck { animation: truckOut 1.1s cubic-bezier(.55,0,.85,.4) both; }
.scene.is-departing .truck__wheel { animation: wheelSpin .3s linear infinite; }
.scene.is-departing .truck__body { animation: none; }

/* Magacin: kamion prvo slajfuje u mestu (gume se vrte, dim, kabina se trese), pa naglo krene */
.scene--magacin.is-departing .truck { animation: truckOut 1.1s cubic-bezier(.55,0,.85,.4) .85s both; }
.scene--magacin.is-departing .truck__wheel { animation: wheelSpin .14s linear infinite; }
.scene--magacin.is-departing .truck__body { animation: truckRev .85s linear both; }
.scene--magacin.is-departing .truck__smoke span { animation: smoke .7s ease-out infinite; }
.scene--magacin.is-departing .truck__smoke span:nth-child(2) { animation-delay: .14s; }
.scene--magacin.is-departing .truck__smoke span:nth-child(3) { animation-delay: .28s; }
.scene--magacin.is-departing .truck__smoke span:nth-child(4) { animation-delay: .42s; }
.scene--magacin.is-departing .truck__smoke span:nth-child(5) { animation-delay: .56s; }

/* =====================================================================
   Uspravni ekrani (telefon): pozadine 9:16, set je traka u donjem delu kadra
   ===================================================================== */
@media (max-aspect-ratio: 1/1) {
  .scene__stage { width: max(100%, 56.25svh); aspect-ratio: 9 / 16; }
  .scene__set {
    inset: auto;
    left: 50%;
    bottom: var(--set-y, 12%);
    width: 130%;
    aspect-ratio: 16 / 9;
    transform: translateX(-50%);
  }
  /* na telefonu je pozadina krupnija (ide po visini ekrana), pa su kamion i mašine bili sitni u odnosu
     na pozadinu: cela scena (kamion, kran, viljuškar) se uvećava oko linije poda. scale/translate su posebna svojstva, pa ne smetaju transform animacijama. */
  .scene__set { --k: 1.3; transform: none; translate: -50% 0; scale: var(--k); transform-origin: 50% 86%; }
  /* za sada bez ljudi na telefonu – samo kamion, mašine i pozadina */
  .scene__set .actor { display: none; }
  .scene__shade {
    background:
      linear-gradient(to bottom, rgba(0,0,0,.82) 0%, rgba(0,0,0,.5) 28%, rgba(0,0,0,0) 46%),
      linear-gradient(to top, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 14%);
  }

  /* Put: posebna pločica 9:16 (slika + odraz), sporije jer je kadar uži */
  .scene__track {
    width: calc(100% * 1080 / 1910 / .5625 * 2);
    background-image: url("../slike/mobile/scena-put-petlja.jpg");
    background-image: image-set(url("../slike/mobile/scena-put-petlja.webp") type("image/webp"), url("../slike/mobile/scena-put-petlja.jpg") type("image/jpeg"));
    animation-duration: 5.5s;
  }
  /* luka: kamion je na sredini kao u ostalim scenama, set ostaje centriran */

  .scene--put { --set-y: 13.5%; --lane: 48%; --roadside: 61%; }
  .scene--luka { --set-y: 17%; }
  .put-sky { inset: 0 0 58% 0; }
  .put-flies { top: 38%; height: 17%; }
  .put-clouds span:nth-child(1) { top: 24%; }
  .put-clouds span:nth-child(2) { top: 31%; }
  .put-clouds span:nth-child(3) { top: 16%; }
  .put-fg {
    bottom: -1%;
    height: 9%;
    width: calc(100% * 9.7175 * .09 / .5625 * 2);
    animation-duration: 4.2s;
  }

  /* Magacin: kapija, lampe i sat na mestima iz uspravne pozadine */
  .mg-gate { left: 91.5%; top: 21%; width: 8.5%; height: 26%; }
  .mg-clock { left: 46%; top: 28%; width: 7%; }
  /* likovi u dubini magacina stoje dalje (više u kadru) */
  .actor--tablet { bottom: 80%; height: 16%; }
  .mg-beams span:nth-child(1) { left: 11%; top: 11.8%; width: 26%; height: 45%; }
  .mg-beams span:nth-child(2) { left: 23%; top: 18.5%; width: 14%; height: 30%; }
  .mg-beams span:nth-child(3) { left: 59.6%; top: 18.5%; width: 14%; height: 30%; }
  .mg-beams span:nth-child(4) { left: 61%; top: 11.8%; width: 26%; height: 45%; }

  /* Ulica: trotoar je visoko u kadru, pa ljudi hodaju iznad kamiona i krupniji su */
  .scene--ulica {
    --walk-y: 73%;
    --walk-h: 30%;
    --chef-x: 26%;
    --courier-x: 33%;
    --courier-dir: -1;
    --waiter-x: 70%;
    --waiter-x0: 60%;
    --waiter-x1: 82%;
  }
  .ul-glow__garland { top: 22%; height: 10%; }
  .ul-glow__oven { left: 82.6%; top: 48.8%; width: 14%; }
  .ul-glow__lamp { width: 10%; }
  .ul-glow__lamp:nth-child(3) { left: 2.3%; top: 41%; }
  .ul-glow__lamp:nth-child(4) { left: 46.4%; top: 41%; }
  .ul-glow__lamp:nth-child(5) { left: 97.7%; top: 41%; }
  .ul-glow__lamp:nth-child(6),
  .ul-glow__lamp:nth-child(7) { display: none; }
  .ul-steam { left: 22.2%; top: 30%; width: 3.5%; height: 4%; }
}

/* ===== Animacije ===== */
@keyframes roadScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes truckIn { from { transform: translateX(-175%); } to { transform: translateX(0); } }
@keyframes truckOut { from { transform: translateX(0); } to { transform: translateX(260%); } }
@keyframes wheelSpin { to { transform: rotate(360deg); } }
@keyframes wheelSpinOnce { from { transform: rotate(0deg); } to { transform: rotate(1100deg); } }
@keyframes truckBump { from { transform: translateY(0); } to { transform: translateY(-.6%); } }
@keyframes truckBrake {
  0% { transform: rotate(0deg); }
  35% { transform: rotate(.9deg); }
  70% { transform: rotate(-.3deg); }
  100% { transform: rotate(0deg); }
}
@keyframes truckRev {
  0% { transform: none; }
  10% { transform: rotate(-.5deg) translateY(.25%); }
  20% { transform: rotate(-.9deg) translateY(-.15%); }
  30% { transform: rotate(-.6deg) translateY(.25%); }
  40% { transform: rotate(-1deg) translateY(-.15%); }
  50% { transform: rotate(-.7deg) translateY(.25%); }
  60% { transform: rotate(-1.1deg) translateY(-.15%); }
  70% { transform: rotate(-.8deg) translateY(.25%); }
  80% { transform: rotate(-1.2deg) translateY(-.15%); }
  90% { transform: rotate(-.9deg) translateY(.2%); }
  100% { transform: rotate(-1.4deg); }
}
@keyframes smoke {
  0% { opacity: .85; transform: translate(0, 0) scale(.4); }
  100% { opacity: 0; transform: translate(-150%, -60%) scale(2.6); }
}
@keyframes dust {
  0% { opacity: .9; transform: translateX(0) scale(.4); }
  100% { opacity: 0; transform: translateX(-160%) scale(1.6); }
}
@keyframes lightsOn {
  0% { opacity: 0; }
  20% { opacity: 1; }
  32% { opacity: .15; }
  48%, 100% { opacity: 1; }
}
@keyframes lightsOff { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .15; } }

/* Luka */
@keyframes hoistMove { from { left: 16.08%; } to { left: 28.97%; } }
@keyframes hoistLoad {
  0% { top: 4%; animation-timing-function: cubic-bezier(.35,.05,.3,1); }
  51% { top: 47.47%; }
  58% { top: 47.47%; animation-timing-function: ease-in-out; }
  90%, 100% { top: 4%; }
}
@keyframes boxHide { from { opacity: 1; } to { opacity: 0; } }
@keyframes boxShow { from { opacity: 0; } to { opacity: 1; } }

/* Magacin */
@keyframes gateUp { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes clockH { from { transform: rotate(165deg); } to { transform: rotate(195deg); } }
@keyframes clockM { from { transform: rotate(180deg); } to { transform: rotate(540deg); } }
@keyframes beam { from { opacity: .75; } to { opacity: 1; } }
@keyframes mote {
  0% { opacity: 0; transform: translate(0, 0); }
  20% { opacity: var(--o, .7); }
  80% { opacity: var(--o, .7); }
  100% { opacity: 0; transform: translate(var(--dx, 20px), var(--dy, -30px)); }
}
@keyframes breathe { from { transform: scaleY(1); } to { transform: scaleY(1.008); } }
@keyframes walkBob {
  from { transform: translateY(0) rotate(-.6deg); }
  to { transform: translateY(-1.6%) rotate(.6deg); }
}
@keyframes idleShake { from { transform: translateY(0); } to { transform: translateY(-.3%); } }
@keyframes beacon { from { opacity: .35; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
@keyframes boxWalk {
  0% { left: -10%; opacity: 1; }
  88% { left: 37%; opacity: 1; }
  100% { left: 41%; opacity: 0; }
}
@keyframes liftUnload {
  0% { left: -30%; animation-timing-function: cubic-bezier(.3,.6,.4,1); }
  28% { left: 11%; }
  33% { left: 11%; animation-timing-function: ease-in-out; }
  47% { left: 2%; }
  55% { left: 2%; animation-timing-function: cubic-bezier(.5,0,.7,.6); }
  100% { left: -30%; }
}
@keyframes palletOut {
  0%, 28% { opacity: 0; transform: translateY(-22%); }
  28.5%, 47% { opacity: 1; transform: translateY(-22%); }
  55%, 100% { opacity: 1; transform: translateY(0); }
}
@keyframes mgLights {
  0%, 22% { opacity: 1; }
  26%, 92% { opacity: 0; }
  94% { opacity: 1; }
  95% { opacity: .2; }
  97%, 100% { opacity: 1; }
}
@keyframes thumbIn { from { opacity: 0; transform: translateX(-60%); } to { opacity: 1; transform: none; } }
@keyframes thumbNod { from { transform: none; } to { transform: rotate(-2deg) translateY(-1%); } }

/* Put */
@keyframes cloudDrift { from { left: 110%; } to { left: -50%; } }
@keyframes twinkle { from { opacity: .12; } to { opacity: var(--o, .9); } }
@keyframes meteor {
  0% { opacity: 0; transform: rotate(-18deg) translateX(0); }
  1% { opacity: 1; }
  8%, 100% { opacity: 0; transform: rotate(-18deg) translateX(-320%); }
}
@keyframes firefly {
  0% { opacity: 0; transform: translate(0, 0); }
  25% { opacity: var(--o, .9); }
  50% { opacity: .1; }
  75% { opacity: var(--o, .9); }
  100% { opacity: 0; transform: translate(var(--dx, -40px), var(--dy, -20px)); }
}
@keyframes signPass { 0% { left: 104%; } 50%, 100% { left: -12%; } }
@keyframes boardPass { 0% { left: 104%; } 58%, 100% { left: -30%; } }
@keyframes oncoming { 0% { left: 105%; } 22%, 100% { left: -55%; } }

/* Ulica */
@keyframes flicker {
  0% { opacity: 1; }
  30% { opacity: .72; }
  45% { opacity: 1; }
  70% { opacity: .85; }
  100% { opacity: 1; }
}
@keyframes fire {
  from { opacity: .6; transform: translate(-50%, -50%) scale(.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@keyframes steam {
  0% { opacity: 0; transform: translateY(30%) scale(.6); }
  30% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-90%) scale(1.6, 1.2); }
}
@keyframes chefIn { from { opacity: 0; transform: translateY(4%); } to { opacity: 1; transform: none; } }
@keyframes sway { from { transform: rotate(-1deg); } to { transform: rotate(1deg); } }
@keyframes courierWalk {
  0% { left: 23%; bottom: 9.5%; height: 23%; opacity: 0; }
  4% { opacity: 1; }
  100% { left: var(--courier-x, 10%); bottom: var(--walk-y, 27%); height: var(--walk-h, 17%); opacity: 1; }
}
@keyframes waiterWalk {
  0% { left: var(--waiter-x0, 72%); opacity: 0; }
  4%, 42% { opacity: 1; }
  45%, 100% { left: var(--waiter-x1, 93%); opacity: 0; }
}
@keyframes coupleWalk { 0% { left: -10%; opacity: 1; } 62%, 100% { left: 105%; opacity: 1; } }
@keyframes coffeeWalk { 0% { left: 105%; opacity: 1; } 57%, 100% { left: -10%; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .scene--put .truck,
  .scene--ulica .truck { transform: none; }
}

/* Bilbord: reklame se smenjuju – svaki put kad bilbord prođe, prikaže se sledeća
   (proizvodi po kategorijama, pa logo). Menja ih js/main.js (animationiteration). */
.put-board__ad .put-ad {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(.35 * var(--u));
}
.put-board__ad .put-ad.is-on { display: flex; }
/* reklama ima fotografiju kao pozadinu (zatamnjenu), a lampe bilborda je osvetljavaju odozgo */
.put-board__ad .put-ad { isolation: isolate; }
.put-board__ad .put-ad > img.put-ad__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.put-board__ad .put-ad::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 30% 70% at 22% 0%, rgba(255,214,140,.3), rgba(255,214,140,0) 70%),
    radial-gradient(ellipse 30% 70% at 75% 0%, rgba(255,214,140,.3), rgba(255,214,140,0) 70%),
    linear-gradient(90deg, rgba(8,7,5,.2) 0%, rgba(8,7,5,.5) 60%, rgba(8,7,5,.85) 100%);
}
.put-board__ad .put-ad:not(.put-ad--prod)::before { background: radial-gradient(ellipse 30% 70% at 22% 0%, rgba(255,214,140,.3), transparent 70%), radial-gradient(ellipse 30% 70% at 75% 0%, rgba(255,214,140,.3), transparent 70%), rgba(8,7,5,.7); }
.put-board__ad .put-ad > img:not(.put-ad__bg) { height: 46%; width: auto; }
.put-board__ad .put-ad--prod { flex-direction: row; gap: calc(.7 * var(--u)); padding: 0 calc(.4 * var(--u)); }
.put-ad__prods { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; height: 100%; }
.put-board__ad .put-ad__prods img {
  flex: 1 1 0;
  min-width: 0;
  height: 112%;
  object-fit: contain;
  margin-left: calc(-.9 * var(--u));
  filter: drop-shadow(0 calc(.2 * var(--u)) calc(.3 * var(--u)) rgba(0,0,0,.6));
}
.put-board__ad .put-ad__prods img:first-child { margin-left: 0; }
.put-ad--prod span { flex: none; padding-right: calc(.6 * var(--u)); text-align: left; font-size: calc(1.05 * var(--u)); text-shadow: 0 calc(.1 * var(--u)) calc(.4 * var(--u)) rgba(0,0,0,.9); }
.put-ad--prod small { font-size: calc(.5 * var(--u)); }

/* Bilbord: jedan logo partnera po reklami, na svetloj "odštampanoj" ploči preko zatamnjene fotografije */
.put-board__ad .put-ad__plate {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 80%;
  max-width: 78%;
  padding: calc(.45 * var(--u)) calc(.9 * var(--u));
  border: calc(.1 * var(--u)) solid rgba(201,162,75,.7);
  border-radius: calc(.35 * var(--u));
  background: #fff;
  box-shadow: 0 calc(.3 * var(--u)) calc(.9 * var(--u)) rgba(0,0,0,.55);
}
.put-ad--dark .put-ad__plate { background: #0d0b08; }
.put-board__ad .put-ad__plate img { display: block; min-width: 0; max-width: 100%; height: 100%; width: auto; object-fit: contain; }
.put-ad--dark .put-ad__plate { height: auto; padding: calc(.9 * var(--u)) calc(1.2 * var(--u)); }
.put-ad--dark .put-ad__plate img { height: auto; width: calc(15 * var(--u)); }


/* Petlje puta bez "seckanja": traka je tačno DVE pločice slike (aspect-ratio), pa pomak od -50%
   uvek pada na isti kadar. Ranije je na telefonu (i za biljke svuda) traka imala jednu pločicu,
   pa je slika na kraju svakog kruga skakala za pola pločice. */
.scene__track { width: auto; aspect-ratio: 7780 / 1100; }
.put-fg { width: auto; aspect-ratio: 7774 / 200; animation-duration: 5.6s; }
@media (max-aspect-ratio: 1/1) {
  .scene__track { width: auto; aspect-ratio: 4320 / 1910; animation-duration: 11s; }
  .put-fg { width: auto; animation-duration: 8.4s; }
}

/* ===== Bilbordi i putokaz u traci puta =====
   Deo su .scene__track (iste pločice kao pozadina), pa se kreću TAČNO kao lampe i ne "klize" po putu.
   Mesto: --x (računar, px na pločici od 3890) i --xm (telefon, px na pločici od 2160); --t = 1 za kopiju na drugoj pločici. */
.scene__track { container-type: size; }
.put-road { position: absolute; inset: 0; }
.put-spot { left: calc((var(--x) + var(--t, 0) * 3890) / 7780 * 100%); right: auto; animation: none; transform: translateX(-50%); }
.put-road .put-board { bottom: 32%; height: 30%; aspect-ratio: 676 / 500; container-type: inline-size; --u: 4.38cqi; }
.put-road .put-board > img:not(.dec) { width: 100%; height: 100%; }
.put-road .put-board > img.dec { height: auto; }
.put-road .put-board > img.dec--snow-board { width: 104%; }
.put-road .put-board > img.dec--board-garland { width: 96%; }
.put-road .put-sign { bottom: 31.5%; --u: 1.78cqh; }
@media (max-aspect-ratio: 1/1) {
  .put-spot { left: calc((var(--xm) + var(--t, 0) * 2160) / 4320 * 100%); }
  .put-spot--desk { display: none; }
  .put-road .put-board { bottom: 42.5%; height: 18%; }
  .put-road .put-sign { bottom: 42%; --u: .8cqh; }
}

/* Brža početna: pozadina puta (CSS) se ne skida dok js/ambijent.js ne učita scenu (.is-loaded) */
.scene--put:not(.is-loaded) .scene__track,
.scene--put:not(.is-loaded) .put-fg { background-image: none !important; }
