/* Track E: downloads, car mode (voice, motion), onboarding.
   Motion: soft, near-critically damped (no overshoot). Reveals 400–550 ms with fade + small
   translate + blur-in, 35 ms stagger; page-level transitions 550–750 ms. */

:root {
  --e-soft: cubic-bezier(.25, .9, .3, 1);   /* ≈ critically damped spring: gentle start, long settle */
  --e-out: cubic-bezier(.4, 0, .6, 1);
}

@keyframes e-rise {
  from { opacity: 0; transform: translate3d(0, 10px, 0); filter: blur(6px); }
}
@keyframes e-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--brand-24); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

/* ── download jobs ─────────────────────────────────────────────────────── */
.job { animation: e-rise .5s var(--e-soft) both; animation-delay: calc(var(--i, 0) * 35ms); }
.job.leaving {
  opacity: 0; transform: translate3d(0, -6px, 0) scale(.98); filter: blur(4px); pointer-events: none;
  transition: opacity .42s var(--e-out), transform .42s var(--e-out), filter .42s var(--e-out);
}
/* Fill spans the track and is scaled: compositor-only, glides between progress ticks. */
.job .progress-fill {
  width: 100%; transform: scaleX(0); transform-origin: right center; will-change: transform;
  transition: transform .45s var(--e-soft), background-color .5s var(--e-soft);
}
[dir="ltr"] .job .progress-fill { transform-origin: left center; }
.job-meta { transition: color .4s var(--e-soft); }
.job-server { font-size: 12px; color: var(--ink-3); line-height: 1.2; margin-top: -3px; }
.job-server:empty { display: none; }

/* ── car mode ──────────────────────────────────────────────────────────── */
.car {
  filter: blur(6px);
  transition: opacity .6s var(--e-soft), transform .7s var(--e-soft), filter .6s var(--e-soft);
}
.car.show { filter: none; }
#car-bar { width: 100%; transform: scaleX(0); transform-origin: left center; will-change: transform; }
.car-mic {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(255 255 255 / .12); color: #fff; margin-inline-start: auto; margin-inline-end: 10px;
  transition: background-color .45s var(--e-soft), color .45s var(--e-soft), transform .3s var(--e-soft);
}
.car-mic .ic { width: 26px; height: 26px; }
.car-mic:active { transform: scale(.95); }
.car-mic.on { background: var(--brand); color: var(--on-brand); animation: e-pulse 1.8s ease-in-out infinite; }

/* ── onboarding ────────────────────────────────────────────────────────── */
.onb {
  position: fixed; inset: 0; z-index: calc(var(--z-banner) + 5);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 14px) 24px calc(var(--safe-b) + 24px);
  background:
    radial-gradient(70% 45% at 50% 22%, var(--brand-24), transparent 70%),
    var(--bg);
  opacity: 0; transform: scale(1.02); filter: blur(8px);
  transition: opacity .65s var(--e-soft), transform .7s var(--e-soft), filter .6s var(--e-soft);
}
.onb.show { opacity: 1; transform: none; filter: none; }
.onb-skip { align-self: flex-end; color: var(--ink-2); padding: 10px 4px; }
.onb-stage { position: relative; flex: 1; width: 100%; max-width: 440px; touch-action: pan-y; }
.onb-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
}
.onb-slide > * { animation: e-slide-in .55s var(--e-soft) both; animation-delay: calc(var(--i, 0) * 35ms + 60ms); }
.onb-slide.out { pointer-events: none; }
.onb-slide.out > * {
  animation: e-slide-out .42s var(--e-out) both; animation-delay: calc(var(--i, 0) * 25ms);
}
@keyframes e-slide-in {
  from { opacity: 0; transform: translate3d(calc(var(--dir, 1) * 28px), 6px, 0); filter: blur(8px); }
}
@keyframes e-slide-out {
  to { opacity: 0; transform: translate3d(calc(var(--dir, 1) * 28px), 0, 0); filter: blur(6px); }
}
.onb-hero {
  width: 132px; height: 132px; border-radius: 40px; display: grid; place-items: center; margin-bottom: 10px;
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 30px 80px -24px var(--brand), inset 0 1px 0 rgb(255 255 255 / .3);
}
.onb-hero .ic { width: 62px; height: 62px; }
.onb-title { font-size: clamp(26px, 7vw, 32px); font-weight: 700; line-height: 1.3; }
.onb-body { font-size: 16.5px; line-height: 1.75; color: var(--ink-2); max-width: 34ch; }
.onb-dots { display: flex; gap: 0; margin: 18px 0 22px; }
/* Fixed 22 px slots scaled down (transform, not width) so the active pill grows without layout. */
.onb-dots i {
  width: 22px; height: 7px; border-radius: 4px; background: var(--s3); margin: 0 -3px;
  transform: scaleX(.32); transition: transform .5s var(--e-soft), background-color .5s var(--e-soft);
}
.onb-dots i.on { transform: none; background: var(--brand); }
.onb-actions { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 10px; }
.onb-actions .btn { width: 100%; height: 54px; }
.install-guide { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.install-guide .btn { height: 52px; }

@media (prefers-reduced-motion: reduce) {
  .job, .job.leaving, .job .progress-fill, .car, .onb, .onb-slide > *, .onb-dots i, .car-mic { animation: none !important; transition: none !important; filter: none !important; }
}
