/* truck.css — scroll-driven truck scene (pinned) */
.truck-scene{position:relative;height:420vh;background:#0b1220;direction:ltr}
.ts-sticky{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden}
.ts-bg{position:absolute;inset:0 -4%;background:url(assets/truck/road-bg.webp) center/cover no-repeat;will-change:transform}
.ts-bg:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(7,10,18,.18),rgba(7,10,18,0) 30%,rgba(7,10,18,0) 70%,rgba(7,10,18,.28))}
.ts-truck{position:absolute;left:0;bottom:11.5vh;width:clamp(460px,72vw,1180px);aspect-ratio:1756/730;transform-origin:50% 100%;will-change:transform,rotate;transform:translate3d(-110%,0,0)}
.ts-body{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:2;pointer-events:none;user-select:none}
.ts-wheel{position:absolute;z-index:1;width:10.71%;aspect-ratio:1;top:calc(621/730*100% - 12.88%);will-change:transform;pointer-events:none;user-select:none}
.ts-wheel.rear{left:calc(391/1756*100% - 5.355%)}
.ts-wheel.front{left:calc(1462/1756*100% - 5.355%)}
.ts-shadow{position:absolute;left:2%;right:2%;bottom:-1%;height:5%;background:radial-gradient(ellipse at center,rgba(0,0,0,.72),transparent 70%);filter:blur(6px);z-index:0}
@media(prefers-reduced-motion:reduce){
  .truck-scene{height:auto}
  .ts-sticky{position:relative;height:70vh}
  .ts-truck{left:50%;transform:translateX(-50%)!important}
}

/* ===== parallax layers + sky headline ===== */
.ts-bg{inset:-3% -6%}
.ts-clouds{position:absolute;left:-20%;width:140%;pointer-events:none;will-change:transform}
.ts-clouds i{position:absolute;display:block;border-radius:50%;filter:blur(18px);
  background:radial-gradient(ellipse at 50% 55%,rgba(255,255,255,.85),rgba(255,255,255,.35) 45%,transparent 72%)}
.ts-clouds.far{top:2vh;height:34vh;opacity:.55}
.ts-clouds.far i:nth-child(1){left:6%;top:14%;width:26vw;height:9vh}
.ts-clouds.far i:nth-child(2){left:38%;top:4%;width:32vw;height:11vh}
.ts-clouds.far i:nth-child(3){left:66%;top:20%;width:24vw;height:8vh}
.ts-clouds.far i:nth-child(4){left:88%;top:6%;width:20vw;height:7vh}
.ts-clouds.near{top:6vh;height:30vh;opacity:.5;z-index:1}
.ts-clouds.near i{filter:blur(26px)}
.ts-clouds.near i:nth-child(1){left:-2%;top:30%;width:34vw;height:12vh}
.ts-clouds.near i:nth-child(2){left:44%;top:46%;width:40vw;height:13vh}
.ts-clouds.near i:nth-child(3){left:82%;top:24%;width:30vw;height:11vh}

.ts-sky{position:absolute;left:0;right:0;top:calc(5vh + 78px);z-index:1;display:flex;flex-direction:column;align-items:center;gap:clamp(6px,1.2vh,12px);
  text-align:center;pointer-events:none;will-change:transform,opacity;padding-inline:5vw;
  opacity:var(--sky-o,1);transform:translate3d(var(--sky-x,0px),var(--sky-y,0px),0)}
.ts-kicker{display:inline-flex;align-items:center;gap:14px;font:800 clamp(8px,.85vw,11px) Montserrat,Inter,sans-serif;letter-spacing:.34em;color:rgba(255,255,255,.92);
  text-shadow:0 1px 10px rgba(10,40,120,.55);opacity:var(--k-o,1);direction:ltr}
.ts-kicker b{display:block;height:1px;width:calc(var(--k-w,1) * clamp(24px,5vw,70px));background:linear-gradient(90deg,transparent,rgba(255,255,255,.9))}
.ts-kicker b:last-child{transform:scaleX(-1)}
.ts-title{margin:0;display:flex;flex-direction:column;align-items:center;gap:.05em;font-family:Vazirmatn,Inter,sans-serif;font-weight:900;
  font-size:clamp(26px,3.9vw,60px);line-height:1.25;color:#fff;
  text-shadow:0 2px 0 rgba(8,35,110,.28),0 10px 40px rgba(8,40,130,.55),0 0 60px rgba(255,255,255,.25)}
.ts-line{display:flex;flex-wrap:wrap;justify-content:center;gap:0 .32em;direction:rtl}
.ts-line.accent{font-size:1.1em}
.ts-w{display:inline-block;will-change:transform,opacity,filter;
  opacity:var(--o,1);transform:translate3d(0,var(--y,0px),0) scale(var(--s,1));filter:blur(var(--b,0px))}
.ts-line.accent .ts-w{text-shadow:none;background:linear-gradient(180deg,#ffffff 8%,#ffe08a 50%,#ffa51f 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:blur(var(--b,0px)) drop-shadow(0 3px 12px rgba(10,30,80,.38))}
.ts-rule{display:block;height:3px;border-radius:3px;width:calc(var(--r,1) * clamp(120px,22vw,320px));background:linear-gradient(90deg,transparent,#ffb43a,transparent);box-shadow:0 0 18px rgba(255,170,50,.7)}

.ts-ground{position:absolute;left:0;right:0;bottom:0;height:13vh;z-index:1;pointer-events:none;overflow:hidden}
.ts-ground:before{content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(18,20,28,0) 0%,rgba(16,18,26,.92) 16%,#14161e 46%,#0e1016 100%);
  box-shadow:inset 0 1px 0 rgba(255,190,120,.16),inset 0 10px 24px rgba(0,0,0,.4)}
.ts-ground:after{content:"";position:absolute;left:-14vw;right:-14vw;height:4px;top:34%;border-radius:2px;opacity:.85;
  background:repeating-linear-gradient(90deg,rgba(255,214,120,.95) 0 5vw,transparent 5vw 13vw);
  transform:translate3d(var(--dash,0px),0,0);will-change:transform}
/* near lane dashes — closer to camera, so they slide faster */
.ts-roadline{position:absolute;left:0;right:0;bottom:1.5vh;height:3px;z-index:1;pointer-events:none;overflow:hidden;opacity:.4;filter:blur(1px)}
.ts-roadline:before{content:"";position:absolute;left:-28vw;right:0;height:3px;
  background:repeating-linear-gradient(90deg,rgba(255,255,255,.8) 0 9vw,transparent 9vw 23vw);
  transform:translate3d(var(--dash2,0px),0,0);will-change:transform}
.ts-streaks{position:absolute;left:0;right:0;bottom:0;height:9vh;z-index:3;pointer-events:none;overflow:hidden;opacity:var(--st-o,0)}
.ts-streaks:before{content:"";position:absolute;inset:0 -20%;
  background:
   linear-gradient(90deg,transparent,rgba(255,255,255,.35) 50%,transparent) 0 22%/18vw 1px repeat-x,
   linear-gradient(90deg,transparent,rgba(255,255,255,.28) 50%,transparent) 6vw 52%/26vw 1px repeat-x,
   linear-gradient(90deg,transparent,rgba(255,255,255,.22) 50%,transparent) 12vw 78%/14vw 1px repeat-x;
  transform:translate3d(var(--sx,0px),0,0)}

@media(max-width:700px){
  .ts-sky{top:calc(4vh + 72px)}
  .ts-title{font-size:clamp(24px,7.4vw,38px)}
  .ts-kicker{letter-spacing:.22em}
}
@media(prefers-reduced-motion:reduce){
  .ts-sky{top:12%}
}

/* ===== realism pack: dusk grade, sun, birds, suspension, exhaust, dust, headlight ===== */

/* warm dusk grade over the photo */
.ts-bg{filter:saturate(1.08) contrast(1.04)}
.ts-bg:before{content:"";position:absolute;inset:0;z-index:1;
  background:linear-gradient(180deg,rgba(10,18,44,.42) 0%,rgba(30,34,60,.14) 34%,rgba(255,128,48,.14) 62%,rgba(16,12,26,.34) 100%);
  mix-blend-mode:soft-light}

/* low sun + soft bloom + faint slow rays */
.ts-sun{position:absolute;z-index:0;right:16%;top:14%;width:11vmin;height:11vmin;border-radius:50%;
  background:radial-gradient(circle,#fff7e0 0 18%,#ffd98f 40%,rgba(255,160,70,.35) 62%,transparent 72%);
  box-shadow:0 0 10vmin rgba(255,190,110,.5),0 0 26vmin rgba(255,150,70,.22);
  animation:tsSunBreath 9s ease-in-out infinite}
.ts-sun:before{content:"";position:absolute;left:-150%;right:-150%;top:50%;height:2px;
  background:linear-gradient(90deg,transparent,rgba(255,224,175,.35) 50%,transparent);filter:blur(1px)}
.ts-sun:after{content:"";position:absolute;left:50%;top:50%;width:560%;height:560%;transform:translate(-50%,-50%);border-radius:50%;
  background:repeating-conic-gradient(rgba(255,205,130,.04) 0 6deg,transparent 6deg 17deg);
  -webkit-mask-image:radial-gradient(circle,rgba(0,0,0,.85) 0 10%,transparent 30%);
  mask-image:radial-gradient(circle,rgba(0,0,0,.85) 0 10%,transparent 30%);
  animation:tsRays 110s linear infinite}
@keyframes tsSunBreath{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}
@keyframes tsRays{to{transform:translate(-50%,-50%) rotate(360deg)}}

/* distant birds drifting against the truck direction */
.ts-birds{position:absolute;inset:0;z-index:0;pointer-events:none;color:rgba(20,24,40,.75)}
.ts-birds i{position:absolute;top:16%;left:104%;width:26px;height:10px;display:block;
  animation:tsFly linear infinite}
.ts-birds i svg{width:100%;height:100%;display:block;stroke:currentColor;animation:tsFlap .7s ease-in-out infinite alternate}
.ts-birds i:nth-child(1){top:15%;--dur:34s;animation-duration:var(--dur)}
.ts-birds i:nth-child(2){top:20%;width:20px;--dur:42s;animation-delay:-16s;animation-duration:var(--dur)}
.ts-birds i:nth-child(3){top:11%;width:16px;--dur:50s;animation-delay:-33s;animation-duration:var(--dur)}
.ts-birds i:nth-child(2) svg{animation-duration:.55s}
.ts-birds i:nth-child(3) svg{animation-duration:.85s}
@keyframes tsFly{from{transform:translateX(0) translateY(0)}50%{transform:translateX(-55vw) translateY(2.4vh)}to{transform:translateX(-114vw) translateY(-.6vh)}}
@keyframes tsFlap{from{transform:scaleY(1)}to{transform:scaleY(.28)}}

/* clouds keep drifting even when the page is idle (sky lives on its own) */
.ts-clouds.far i{animation:tsCloudFar 46s ease-in-out infinite alternate}
.ts-clouds.far i:nth-child(2){animation-duration:58s;animation-delay:-9s}
.ts-clouds.far i:nth-child(3){animation-duration:64s;animation-delay:-22s}
.ts-clouds.far i:nth-child(4){animation-duration:52s;animation-delay:-31s}
@keyframes tsCloudFar{from{transform:translateX(0)}to{transform:translateX(5vw)}}
.ts-clouds.near i{animation:tsCloudNear 34s ease-in-out infinite alternate}
.ts-clouds.near i:nth-child(2){animation-duration:41s;animation-delay:-12s}
.ts-clouds.near i:nth-child(3){animation-duration:47s;animation-delay:-25s}
@keyframes tsCloudNear{from{transform:translateX(0)}to{transform:translateX(-7vw)}}

/* suspension: the body bounces on the road, wheels stay planted.
   NOTE: no filter at all on the truck PNG — .ts-shadow (ellipse under the truck) does the grounding.
   Any filter here gets rasterized once, then the depth-scale stretches that raster → blur, and
   filters tint the anti-aliased edge pixels → halo. Sharpest possible cutout = zero filters. */
.ts-body{animation:tsBob .82s ease-in-out infinite;transform-origin:50% 100%}
@keyframes tsBob{0%,100%{transform:translateY(0) rotate(0deg)}28%{transform:translateY(-2.6px) rotate(-.22deg)}64%{transform:translateY(-1.2px) rotate(.18deg)}}

/* dusk grade ON the truck — masked to the truck silhouette so nothing shows around the cutout */
.ts-grade{position:absolute;inset:0;z-index:2;pointer-events:none;mix-blend-mode:soft-light;
  background:linear-gradient(100deg,rgba(12,20,45,.34) 0%,transparent 30%,transparent 58%,rgba(255,150,66,.30) 100%);
  -webkit-mask-image:url(assets/truck/truck.webp);-webkit-mask-size:100% 100%;-webkit-mask-repeat:no-repeat;
  mask-image:url(assets/truck/truck.webp);mask-size:100% 100%;mask-repeat:no-repeat}

/* exhaust: low behind the underbody, trailing back and slightly up */
.ts-exhaust{position:absolute;z-index:3;left:24%;top:54%;width:18%;height:36%;pointer-events:none}
.ts-exhaust i{position:absolute;left:18%;bottom:10%;width:24%;aspect-ratio:1;border-radius:50%;
  background:radial-gradient(circle,rgba(232,236,246,.42),rgba(222,228,242,.16) 55%,transparent 74%);
  filter:blur(5px);opacity:0;animation:tsPuff 1.8s linear infinite}
.ts-exhaust i:nth-child(2){animation-delay:-.45s}
.ts-exhaust i:nth-child(3){animation-delay:-.9s}
.ts-exhaust i:nth-child(4){animation-delay:-1.35s}
@keyframes tsPuff{
  0%{transform:translate(0,0) scale(.3);opacity:0}
  16%{opacity:.42}
  100%{transform:translate(-3.6vw,-2.6vh) scale(3);opacity:0}}

/* dust kicked up behind the rear wheel */
.ts-dust{position:absolute;z-index:0;left:6%;bottom:-3%;width:21%;height:15%;pointer-events:none;
  background:radial-gradient(ellipse at 68% 58%,rgba(202,176,142,.52),rgba(190,168,138,.26) 48%,transparent 70%);
  filter:blur(6px);animation:tsDust .5s ease-in-out infinite alternate}
@keyframes tsDust{from{transform:translateX(0) scale(1);opacity:.75}to{transform:translateX(-15%) scale(1.26);opacity:1}}

/* headlight beam for the dusk run */
.ts-headlight{position:absolute;z-index:3;right:-1%;top:36%;width:17%;height:13%;pointer-events:none;
  background:linear-gradient(90deg,rgba(255,244,205,.6),rgba(255,240,190,.16) 55%,transparent 88%);
  clip-path:polygon(0 42%,100% 0,100% 100%,0 58%);filter:blur(3px);
  animation:tsBeam 2.6s ease-in-out infinite}
.ts-headlight:after{content:"";position:absolute;right:0;top:44%;width:7%;aspect-ratio:1;border-radius:50%;
  background:radial-gradient(circle,#fffbe8,rgba(255,240,190,.4) 60%,transparent 75%)}
@keyframes tsBeam{0%,100%{opacity:.75}50%{opacity:1}}

/* mobile tweaks — max crispness on phone GPUs: no blend layer, no scale stretch */
@media(max-width:700px){
  .ts-sun{right:9%;top:11%;width:15vmin;height:15vmin}
  .ts-birds i:nth-child(3){display:none}
  .ts-exhaust{left:22%;top:52%}
  .ts-headlight{width:14%}
  .ts-grade{display:none}
}
@media(prefers-reduced-motion:reduce){
  .ts-sun,.ts-sun:after,.ts-birds i,.ts-birds i svg,.ts-clouds.far i,.ts-clouds.near i,
  .ts-body,.ts-exhaust i,.ts-dust,.ts-headlight{animation:none}
  .ts-exhaust i{opacity:0}
}
