/* Jam in the Van music player: the van itself (used by the homepage dock
   and the van.html pop-out window), plus the parked mini van + dock. */

/* =============== the van =============== */
.van {
  position: relative; width: 500px; height: 350px; margin-top: 34px;
  color: #13092D;
  font: 16px/1.5 "Courier New", Courier, monospace;
  text-align: left;
}
.van button { font: inherit; color: inherit; cursor: url('/images/ui/cursor-link.png') 1 1, pointer; }
.van input[type=range] { cursor: url('/images/ui/cursor-link.png') 1 1, pointer; }
.van button:focus-visible, .van input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* scrolling title */
.van .title { overflow: hidden; white-space: nowrap; }
.van .title span { display: inline-block; padding-left: 100%; animation: van-scroll 14s linear infinite; }
@keyframes van-scroll { to { transform: translateX(-100%); } }

/* roof rack */
.van .rack {
  position: absolute; left: 70px; top: 0; width: 350px; height: 34px;
  display: flex; align-items: flex-end; gap: 6px;
}
/* surfboard strapped to the roof: pointed-ish nose at the front (left),
   rounder tail at the back, gold rails, fin sticking up near the nose */
.van .board { position: relative; flex: 1; min-width: 0; }   /* min-width: long titles scroll, board never stretches */
.van .sign {
  position: relative; z-index: 1;   /* board covers the fin base */
  padding: 3px 26px 3px 34px;
  background: #13092D;
  border: 3px solid #feb028;
  border-radius: 70px 24px 24px 70px / 14px 14px 14px 14px;
  box-shadow: 0 0 0 2px #3a3275;
  color: #feb028; font-size: 13px; font-weight: bold;
}
/* hooked fin, tip pointing forward (left), about 2x the board's thickness */
.van .fin {
  position: absolute; left: 16px; top: -31px; width: 44px; height: 36px;
  transform: rotate(-6deg); transform-origin: 50% 100%;   /* follow the nose curve */
  overflow: visible;
}
.van .strap {
  position: absolute; top: -2px; bottom: -6px; width: 7px; z-index: 2;
  background: #3a3275; border-left: 2px solid #6f64b3;
}
.van .strap.a { left: 96px; }
.van .strap.b { right: 40px; }
.van .luggage {
  width: 40px; height: 30px; padding: 0;
  background: #9d93e0; border: 3px outset #fceaff; border-radius: 4px;
  color: #13092D; font-weight: bold;
}
.van .luggage:disabled { cursor: default; }
.van .rails {
  position: absolute; left: 140px; top: 34px; width: 290px; height: 6px;
  border: 3px solid #3a3275; border-bottom: 0;
}

/* diver-down flag on a pole at the back, flapping while we drive */
.van .pole {
  position: absolute; left: 444px; top: -14px; width: 4px; height: 90px;
  background: #fceaff; border: 1px solid #3a3275;
}
.van .flag {
  position: absolute; left: 448px; top: -12px; width: 46px; height: 32px;
  background: linear-gradient(to top right, #e0242b 41%, #fff 41% 59%, #e0242b 59%);
  border: 2px solid #13092D;
  transform-origin: left center;
}
@keyframes van-flap { 50% { transform: skewY(5deg) scaleX(.94); } }

/* body */
.van .shell {
  position: absolute; left: 0; top: 40px; width: 460px; height: 250px;
  background: #fc7557;
  border: 4px outset #ffa58f;
  border-radius: 110px 26px 18px 30px / 130px 26px 18px 30px;
  box-shadow: 0 10px 18px rgba(0,0,0,.35);
}
/* two-tone 70s stripe along the side */
.van .stripe {
  position: absolute; left: 0; right: 0; top: 150px; height: 26px;
  background: linear-gradient(#feb028 0 45%, transparent 45% 60%, #9d93e0 60%);
}
.van .windshield {
  position: absolute; left: 10px; top: 14px; width: 70px; height: 90px;
  background: linear-gradient(135deg, #6f64b3, #2a1f6b 60%);
  border: 4px inset #b8423a;
  border-radius: 90px 6px 6px 16px / 100px 6px 6px 16px;
}
/* front door = control panel */
.van .door {
  position: absolute; left: 88px; top: 10px; width: 70px; height: 226px;
  border: 2px solid #b8423a; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 8px;
}
.van .chan {
  width: 54px; text-align: center; font-size: 12px; font-weight: bold;
  background: #13092D; border: 2px inset #b8423a; color: #feb028;
}
.van .knob {
  position: relative; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  background: radial-gradient(circle at 35% 35%, #fceaff, #9d93e0 60%, #3a3275);
  border: 2px solid #3a3275; font-size: 12px; color: #13092D; font-weight: bold;
}
.van .knob:active { transform: rotate(40deg); }
.van .power { background: radial-gradient(circle at 35% 35%, #fff4c8, #feb028 60%, #7a4d00); }
.van .door input { position: relative; z-index: 1; width: 56px; accent-color: #feb028; }
/* side window = YouTube player (YouTube needs it visible and at least 200x200) */
.van .glass {
  position: absolute; left: 172px; top: 12px;
  padding: 8px; background: #2a1f6b;
  border: 4px inset #b8423a; border-radius: 12px;
}
.van .screen { width: 240px; height: 200px; border-radius: 6px; overflow: hidden; background: #000; }
.van .screen iframe { display: block; width: 100%; height: 100%; border: 0; }
/* lights: D-shaped, bulging out off the front and back at belt height */
.van .headlight {
  position: absolute; left: -17px; top: 136px; width: 17px; height: 30px;
  background: radial-gradient(circle at 70% 40%, #fff4c8, #feb028 70%);
  border: 2px solid #7a4d00; border-right: 0;
  border-radius: 15px 0 0 15px / 15px 0 0 15px;
}
.van .tail {
  position: absolute; right: -14px; top: 138px; width: 14px; height: 26px;
  background: radial-gradient(circle at 30% 40%, #ffc08a, #ff7a2f 70%);
  border: 2px solid #13092D; border-left: 0;
  border-radius: 0 13px 13px 0 / 0 13px 13px 0;
}
.van .bumper {
  position: absolute; top: 270px; height: 11px;
  background: #9d93e0; border: 2px solid #3a3275;
}
.van .bumper.f { left: -5px;  width: 40px; border-radius: 6px 2px 2px 6px; }
.van .bumper.r { left: 428px; width: 37px; border-radius: 2px 6px 6px 2px; }
.van .arch {
  position: absolute; top: 246px; width: 96px; height: 48px;
  background: #13092D; border-radius: 48px 48px 0 0;
}
.van .wheel {
  position: absolute; top: 254px; width: 76px; height: 76px; border-radius: 50%;
  box-sizing: border-box;
  background:
    radial-gradient(circle, #feb028 0 6px, transparent 7px),
    repeating-conic-gradient(#9d93e0 0 15deg, #fceaff 15deg 30deg) content-box,
    #13092D;
  padding: 14px;
  border: 3px solid #3a3275;
  animation: van-roll .9s linear infinite paused;
}
.van .arch.f { left: 34px; }  .van .wheel.f { left: 44px; }
.van .arch.r { left: 318px; } .van .wheel.r { left: 328px; }
@keyframes van-roll { to { transform: rotate(-360deg); } }   /* van faces left */
.van .road {
  position: absolute; left: -20px; right: -20px; top: 334px; height: 6px;
  /* one dash + one gap per 56px tile, so the pattern repeats seamlessly */
  background: linear-gradient(90deg, #feb028 0 30px, transparent 30px) 0 0 / 56px 100% repeat-x;
  animation: van-road .6s linear infinite paused;
}
@keyframes van-road { to { background-position: 56px 0; } }
.van .body-bounce { position: absolute; inset: 0; }
@keyframes van-bounce { 50% { transform: translateY(-2px); } }

/* driving: only while music plays */
.van.playing .wheel, .van.playing .road,
.van.driving .wheel, .van.driving .road { animation-play-state: running; }
.van.playing .body-bounce, .van.driving .body-bounce { animation: van-bounce .45s steps(2) infinite; }
.van.playing .flag { animation: van-flap .5s steps(2) infinite; }

@media (prefers-reduced-motion: reduce) {
  .van .title span { animation: none; padding-left: 0; }
  .van .wheel, .van .road,
  .van.playing .body-bounce, .van.playing .flag, .van.driving .body-bounce { animation: none; }
}

/* =============== parked mini van (homepage corner) =============== */
#van-mini {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  display: block; line-height: 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  transition: transform .1s ease;
  cursor: url('/images/ui/cursor-link.png') 1 1, pointer;
}
#van-mini svg { display: block; width: 110px; height: 77px; }
#van-mini:hover { transform: translateY(-3px); }
#van-mini:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#van-mini .mini-wheel { transform-box: fill-box; transform-origin: center; }
#van-mini:hover .mini-wheel { animation: van-roll .9s linear infinite; }
#van-mini[hidden] { display: none; }
@media (max-width: 539px) {
  #van-mini { right: 10px; bottom: 10px; }
  #van-mini svg { width: 72px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) { #van-mini:hover .mini-wheel { animation: none; } }

/* =============== open dock =============== */
#van-dock {
  position: fixed; left: 0; top: 0; z-index: 9999;
  will-change: transform;
}
/* grab the van by its body (controls and the video keep working normally) */
#van-dock .van { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#van-dock .van button, #van-dock .van input { touch-action: manipulation; }
#van-dock.dragging .van { cursor: grabbing; }
#van-dock.dragging .screen { pointer-events: none; }   /* keep the drag when passing over the video */
/* turning: rotate (and flip to face right) around the van's middle */
#van-dock .van-holder { transform-origin: 50% 55%; transition: transform .4s ease-in-out; }
/* dashed outline showing where the van will park */
#van-ghost {
  position: fixed; left: 0; top: 0; z-index: 9998;
  border: 3px dashed #feb028; border-radius: 26px;
  background: rgba(254,176,40,.08);
  pointer-events: none;
}
#van-ghost[hidden] { display: none; }
#van-dock[hidden] { display: none; }
#van-dock .park {
  position: absolute; left: 0; top: 0; z-index: 3;
  padding: 2px 8px;
  background: #13092D; border: 4px ridge #6f64b3;
  color: #feb028; font: bold 13px/1.4 "Courier New", Courier, monospace;
  cursor: url('/images/ui/cursor-link.png') 1 1, pointer;
}
#van-dock .park:hover { filter: brightness(1.2); }
#van-dock .park:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
