/* The car drives. Shared by the original Daydream and its variants; loaded after their own styles.
   Everything is measured in the hero art's width (cqw), so the road, the wheels and the bubbles keep
   their relations at any size. Inputs, set per layout on .hero-art:
     --cl, --ct, --cw  the car's left, top and width (cqw, unitless)
     --dash, --dash-t  the center line's period (cqw, unitless) and the time one period takes to pass.
   The wheels turn at exactly the road's speed: one turn per (2π × tire radius) of road. */
.hero-art { container-type: inline-size; --cl: 28; --ct: 49.46; --cw: 72; --dash: 11; --dash-t: .55s; --tire: .08; }

.hero-art .hero-car { position: absolute; left: calc(var(--cl) * 1cqw); top: calc(var(--ct) * 1cqw); width: calc(var(--cw) * 1cqw); right: auto; bottom: auto; z-index: 2; }
.hero-car img { display: block; width: 100%; height: auto; }

/* Wheels: a circle of faint spokes over each rim, squeezed into the rim's ellipse, turning backwards as the car goes forward. */
.wheel { position: absolute; border-radius: 50%; overflow: hidden; }
.wheel--front { left: 31.69%; top: 72.78%; width: 12.375%; height: 24.38%; transform: scaleX(.869); }
.wheel--rear { left: 83.13%; top: 48.03%; width: 10%; height: 19.7%; transform: scaleX(.675); }
.wheel b { position: absolute; inset: 8%; border-radius: 50%;
  background: repeating-conic-gradient(from 12deg, color-mix(in srgb, var(--ink) 34%, transparent) 0 8deg, transparent 8deg 72deg);
  animation: spin calc(6.2832 * var(--tire) * var(--cw) / var(--dash) * var(--dash-t)) linear infinite; }
@keyframes spin { to { rotate: -360deg; } }

/* Road: asphalt laid along the line through both tires (16.6°). The far lane is deep enough for the car's whole
   footprint (its hidden far-side wheels sit well above the near ones); the center line runs just in front of it. */
.road { position: absolute; z-index: 0; width: 110cqw; height: calc(.62 * var(--cw) * 1cqw);
  left: calc((var(--cl) + .40 * var(--cw) - 55) * 1cqw); top: calc((var(--ct) + .246 * var(--cw)) * 1cqw);
  rotate: -16.6deg; background: #44474f; border-block: calc(.012 * var(--cw) * 1cqw) solid var(--cloud);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent); mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent); }
.road i { position: absolute; left: 0; right: 0; top: 50%; height: calc(.024 * var(--cw) * 1cqw); translate: 0 -50%;
  background: repeating-linear-gradient(90deg, #ffd447 0 calc(var(--dash) * .55cqw), transparent 0 calc(var(--dash) * 1cqw));
  animation: road var(--dash-t) linear infinite; }
@keyframes road { to { background-position-x: calc(var(--dash) * 1cqw); } }

/* Thought bubbles rise from the car's roof into the cloud like a fish's: one smooth eased climb, growing,
   with a slow side-to-side sway on an inner layer so the two motions never fight. */
.bubbles { position: absolute; left: 30%; top: 37%; width: 22%; height: 17%; container-type: size; pointer-events: none; z-index: 1; }
.bubbles i { position: absolute; right: 0; bottom: 0; width: clamp(14px, 24cqw, 34px); aspect-ratio: 1; opacity: 0;
  animation: rise 4.2s cubic-bezier(.37, 0, .63, 1) infinite; }
.bubbles i:nth-child(2) { animation-delay: 1.4s; }
.bubbles i:nth-child(3) { animation-delay: 2.8s; }
.bubbles b { position: absolute; inset: 0; border-radius: 50%; background: var(--cloud); border: 3px solid var(--ink);
  box-shadow: 4px 5px 0 color-mix(in srgb, var(--sky) 80%, transparent); animation: sway 1.4s ease-in-out infinite alternate; }
@keyframes rise {
  0% { translate: 0 0; scale: .35; opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { translate: calc(-100cqw + 100%) -100cqh; scale: 1.3; opacity: 0; }
}
@keyframes sway { from { translate: -5px 0; } to { translate: 5px 0; } }

@media (prefers-reduced-motion: reduce) {
  .bubbles i { opacity: 1; }
  .bubbles i:nth-child(1) { translate: -80cqw -80cqh; }
  .bubbles i:nth-child(2) { translate: -40cqw -40cqh; scale: .7; }
  .bubbles i:nth-child(3) { scale: .45; }
}

/* The cloud breathes: a slow, slight swell and settle, layered on whatever entrance or bob the design gives it. */
.hero-art .hero-cloud { transform-origin: 50% 60%; animation: breathe 4.5s ease-in-out infinite; }
body:not(.v) .hero-art .hero-cloud, .mo-bob .hero-art .hero-cloud, .mo-drift.bg-plain .hero-art .hero-cloud {
  animation: bob 6s ease-in-out infinite, breathe 4.5s ease-in-out infinite; }
.mo-pop .hero-art .hero-cloud { animation: pop .7s cubic-bezier(.3, 1.6, .5, 1) both .15s, breathe 4.5s ease-in-out .85s infinite; }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }

/* Narrow screens: the art sits above the copy; leave room for the road's near edge. */
@media (max-width: 820px) { .hero-art { margin-bottom: 12vw; } }
