/* Scene 5 · Arrival: sunrise over the sea, the family out of the car, the trip
   summary, trust points and coming soon. Base styles are the poster frame. */
.scene--5 {
  --pin: 340vh;
}

.scene--5 > .stage {
  --scene-bg: var(--ink-sunken);
}

/* Its own layer: Chrome dropped near layers on some frames while the scroll
   timeline repainted the art with the page. */
.s5-art {
  will-change: transform;
}

/* ---------- Art ---------- */
.s5-cam,
.s5-sunx,
.s5-land,
.s5-carstage,
.s5-rise,
.s5-rise-ring,
.s5-ringwrap,
.s5-roll,
.s5-door,
.s5-arm,
.s5-kidhop,
.s5-hop {
  transform-box: view-box;
}

.s5-cam {
  transform-origin: 900px 700px;
  transform: scale(1.08);
}

.s5-ringwrap {
  transform-origin: 980px 330px;
}

.s5-spin {
  transform-box: fill-box;
  transform-origin: center;
}

/* The poster car stands still: sharp spokes, no smear. */
.s5-wb-smear {
  opacity: 0;
}

/* The door matrices and the mirror's translate are built about the car's own origin. */
.s5-door,
.s5-skin,
.s5-mirror {
  transform-origin: 0 0;
}

.s5-rays {
  opacity: 0.32;
}

.s5-veil,
.s5-inside,
.s5-kid-a,
.s5-kid-b,
.s5-eyes-open,
.s5-voice {
  opacity: 0;
}

/* The driver's free arm swings up from the shoulder into a stretch. */
.s5-arm-r {
  transform-origin: 242px -133px;
  transform: rotate(-156deg);
}

/* ---------- Trip summary phone ---------- */
.s5-phone {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  top: 50%;
  translate: 0 -56%;
  font-size: clamp(11px, 1.46vh, 14.5px);
  width: 15.6em;
  padding: 0.5em;
  border-radius: 2.5em;
  background: linear-gradient(160deg, #3a4a58, #0b131c 30%, #0b131c 70%, #26323e);
  box-shadow:
    0 0 0 1px rgb(255 240 214 / 0.18),
    -0.2em -0.2em 0.6em rgb(255 226 170 / 0.25),
    0 2.5em 4em -1em rgb(4 8 12 / 0.65);
}

.s5-screen {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  padding: 0.75em 1em 1.1em;
  border-radius: 2em;
  background: linear-gradient(var(--ink) 0, var(--ink-deep) 100%);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
}

.s5-screen p,
.s5-screen ul {
  margin: 0;
}

.s5-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 0.7em/1 var(--font);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

.s5-status svg {
  width: 2.6em;
  height: auto;
}

.s5-island {
  width: 5.2em;
  height: 1.55em;
  border-radius: 1em;
  background: #000;
}

.s5-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.3em;
}

.s5-glyph {
  width: 2.1em;
  height: 2.1em;
  flex: none;
}

.s5-eyebrow {
  font: 600 0.82em/1.2 var(--font);
  color: var(--teal-hi);
}

.s5-when {
  font: 500 0.66em/1.3 var(--mono);
  color: var(--fg-3);
}

.s5-dur {
  font: 600 0.95em/1 var(--font);
  color: var(--fg-2);
}

.s5-dur b {
  font: 600 2.2em/1 var(--mono);
  color: var(--fg);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.s5-dose {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5em;
  padding: 0.6em 0.7em;
  border: 1px solid var(--ink-3);
  border-radius: 0.8em;
  background: var(--ink-2);
}

.s5-k {
  font: 600 0.56em/1.2 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.s5-v {
  margin-top: 0.25em !important;
  white-space: nowrap;
  font: 600 1.45em/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.s5-v small {
  font: 500 0.45em/1 var(--font);
  color: var(--fg-2);
}

.s5-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.25em 0.7em 0.25em 0.3em;
  border-radius: 999px;
  background: #3a2706;
  color: var(--moderate-ink);
  font: 600 0.66em/1 var(--font);
  letter-spacing: 0.04em;
}

.s5-chip-g {
  display: inline-grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: var(--moderate);
  color: #000;
  font: 700 0.8em/1 var(--mono);
}

.s5-card {
  padding: 0.65em 0.6em 0.5em;
  border: 1px solid var(--ink-3);
  border-radius: 0.8em;
  background: var(--ink-2);
}

.s5-spark {
  display: block;
  width: 100%;
  height: auto;
}

.s5-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35em !important;
  font: 500 0.56em/1 var(--mono);
  color: var(--fg-3);
}

.s5-said ul {
  display: grid;
  gap: 0.4em;
  margin-top: 0.45em !important;
  padding: 0;
  list-style: none;
  font: 500 0.68em/1.3 var(--font);
  color: var(--fg-2);
}

.s5-said li {
  position: relative;
  padding-left: 1em;
}

.s5-said li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--teal-hi-2);
}

.s5-saved {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-top: 0.2em !important;
  align-self: center;
  padding: 0.45em 0.85em;
  border-radius: 999px;
  background: rgb(111 207 217 / 0.1);
  color: var(--teal-hi-2);
  font: 600 0.68em/1 var(--font);
}

.s5-saved svg {
  width: 1.15em;
  height: 1.15em;
}

/* ---------- Copy, trust row, CTA ---------- */
.s5-copy {
  max-width: 38rem;
}

/* Soft ink pool behind the text block only; the art stays warm around it. */
.s5-copy::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -1.5rem 3rem -4rem -7rem;
  border-radius: 3rem;
  background: rgb(8 16 26 / 0.7);
  filter: blur(26px);
  pointer-events: none;
}

.s5-copy .lede,
.s5-copy .s5-t {
  color: var(--fg);
}

/* The eyebrow sits on the sunlit hillside: a light teal on a faint ink tab
   keeps it AA at every size. */
.s5-copy .chapter {
  display: inline-block;
  padding: 0.35em 0.6em;
  border-radius: 0.4em;
  color: var(--teal-hi-2);
  background: rgb(8 16 26 / 0.62);
}

.s5-copy .chapter span {
  color: var(--fg-2);
}

.s5-copy h2,
.s5-copy .chapter,
.s5-copy .lede {
  text-shadow: 0 0.1em 1.2em rgb(8 16 26 / 0.6);
}

.s5-trust {
  --s5-rule: rgb(244 239 230 / 0.14);

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 34rem;
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--s5-rule);
  list-style: none;
}

/* stylelint-disable-next-line no-descending-specificity -- the copy colour wins by specificity; the caption keeps its own block */
.s5-t {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--fg-2);
}

.s5-ico {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--teal-hi);
}

.s5-cta {
  margin-top: 1.6rem;
}

.s5-soon {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--paper-0);
  text-wrap: balance;
}

.s5-testing {
  margin: 0.7rem 0 0;
}

/* Short landscape screens lift the copy into the sky band, so the pool rises
   with the chapter line. */
@media (max-height: 760px) and (min-aspect-ratio: 81/100) {
  .s5-copy::before {
    top: -3.5rem;
  }
}

/* Wider than 16:10 the whole viewBox shows at a smaller scale while the copy
   keeps its rem width, so the family moves right to keep clear of it. */
@media (min-aspect-ratio: 17/10) {
  .s5-carstage {
    transform: translateX(50px);
  }

  .s5-land {
    transform: translateX(40px);
  }
}

/* Narrower desktops and tablets: the copy column and trust grid tighten and
   the family moves right, so the trust row never lands on the child. */
@media (max-width: 1300px) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    max-width: 31rem;
  }

  .s5-trust {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem 1.2rem;
    max-width: 27rem;
  }

  .s5-t {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }

  .s5-ico {
    flex: none;
  }

  .s5-phone {
    right: 1.5rem;
  }
}

@media (max-aspect-ratio: 3/2) and (min-aspect-ratio: 81/100) {
  .s5-carstage {
    transform: translateX(110px);
  }

  .s5-land {
    transform: translateX(60px);
  }
}

/* Short landscape screens: at the page end the footer pushes the pinned stage
   up by its own height, so the copy compacts to stay whole on screen and
   clear of the family. */
@media (max-height: 50rem) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    bottom: clamp(1rem, 4vh, 2.5rem);
  }

  .s5-copy::before {
    right: -2.5rem;
    bottom: -2rem;
    background: rgb(8 16 26 / 0.82);
  }

  .s5-copy h2 {
    margin: 0.45rem 0 0.6rem;
    font-size: clamp(1.7rem, 6.2vh, 3.4rem);
  }

  .s5-copy .lede {
    font-size: clamp(0.92rem, 2.4vh, 1.15rem);
    line-height: 1.42;
  }

  .s5-trust {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1.2rem;
    max-width: 30rem;
    margin-top: 0.9rem;
    padding-top: 0.65rem;
  }

  .s5-t {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .s5-ico {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
  }

  .s5-cta {
    margin-top: 0.8rem;
  }

  .s5-soon {
    font-size: clamp(1.1rem, 3.4vh, 1.6rem);
  }

  .s5-testing {
    margin-top: 0.25rem;
  }
}

/* Short and wide enough to show the family beside the copy: keep the copy
   column clear of the child. */
@media (max-height: 50rem) and (min-width: 900px) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    max-width: min(34rem, 46vw);
  }
}

/* Short screens up to 17:10 show less of the viewBox's width, so the family
   moves right to keep clear of the copy column. */
@media (max-height: 50rem) and (min-width: 900px) and (min-aspect-ratio: 81/100) and (max-aspect-ratio: 17/10) {
  .s5-carstage {
    transform: translateX(160px);
  }
}

/* Short tablets in landscape: narrower copy, family further right. */
@media (max-height: 50rem) and (max-width: 899px) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    max-width: 56vw;
  }

  .s5-carstage {
    transform: translateX(190px);
  }
}

@media (max-height: 40rem) and (max-width: 899px) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    max-width: 31rem;
  }
}

/* Very short screens: the lede and trust row tighten further. */
@media (max-height: 40rem) and (min-aspect-ratio: 81/100) {
  .s5-copy {
    bottom: 0.6rem;
  }

  .s5-copy .chapter {
    font-size: 0.68rem;
  }

  .s5-copy h2 {
    margin: 0.3rem 0 0.4rem;
    font-size: clamp(1.4rem, 5vh, 2.2rem);
  }

  .s5-copy .lede {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .s5-trust {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    gap: 0.2rem 1rem;
  }

  .s5-t {
    font-size: 0.72rem;
  }

  .s5-cta {
    margin-top: 0.5rem;
  }

  .s5-soon {
    font-size: 1.05rem;
  }

  .s5-testing {
    margin-top: 0.1rem;
    font-size: 0.7rem;
  }
}

/* ---------- Phone portrait ---------- */
@media (max-aspect-ratio: 4/5) {
  .s5-sunx {
    transform: translateX(-270px);
  }

  .s5-ringwrap {
    transform: scale(0.7);
  }

  .s5-land {
    transform: translateX(-330px);
  }

  .s5-pine {
    display: none;
  }

  /* High enough that the child's feet clear the copy's eyebrow at 390x844. */
  .s5-carstage {
    transform: translate(-128px, -72px) scale(0.92);
    transform-origin: 733px 762px;
  }

  .s5-phone {
    right: 0.9rem;
    top: 3.4rem;
    translate: none;
    font-size: 9.8px;
  }

  .s5-screen {
    min-height: 0;
  }

  .s5-said {
    display: none;
  }

  .s5-trust {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.9rem;
    margin-top: 0.9rem;
    padding-top: 0.75rem;
  }

  .s5-t {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .s5-ico {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
  }

  .s5-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin-top: 0.9rem;
  }

  .s5-soon {
    flex-basis: 100%;
    font-size: 1.2rem;
  }

  .s5-testing {
    margin: 0;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) and (min-height: 30rem) {
  @supports (animation-timeline: view()) {
    .s5-cam,
    .s5-morning,
    .s5-rise,
    .s5-rise-ring,
    .s5-glow,
    .s5-halo,
    .s5-rays,
    .s5-veil,
    .s5-glitter,
    .s5-clouds,
    .s5-birds,
    .s5-roll,
    .s5-spin,
    .s5-wb-sharp,
    .s5-wb-smear,
    .s5-inside,
    .s5-voice,
    .s5-door,
    .s5-skin,
    .s5-mirror,
    .s5-drv,
    .s5-eyes-open,
    .s5-eyes-shut,
    .s5-kidhop,
    .s5-kid-a,
    .s5-kid-b,
    .s5-kid-c,
    .s5-hop,
    .s5-ring,
    .s5-phone,
    .s5-spark-line,
    .s5-spark-area,
    .s5-spark-marks,
    .s5-spark-end,
    .s5-trust,
    .s5-copy > :not(.s5-trust, .s5-cta),
    .s5-t,
    .s5-cta {
      animation: linear both;
      animation-timeline: --s5;
      animation-range: contain 0% contain 100%;
    }

    .s5-cam {
      animation-name: s5-cam;
    }
    .s5-morning {
      animation-name: s5-morning;
    }
    .s5-rise,
    .s5-rise-ring {
      animation-name: s5-rise;
    }
    .s5-glow {
      animation-name: s5-glow;
    }
    .s5-halo {
      animation-name: s5-halo;
      transform-box: fill-box;
      transform-origin: center;
    }
    .s5-rays {
      animation-name: s5-rays;
    }
    .s5-veil {
      animation-name: s5-veil;
    }
    .s5-glitter {
      animation-name: s5-glitter;
    }
    .s5-clouds {
      animation-name: s5-clouds;
    }
    .s5-birds {
      animation-name: s5-birds;
    }
    .s5-roll {
      animation-name: s5-roll;
    }
    .s5-spin {
      animation-name: s5-spin;
    }
    .s5-wb-sharp {
      animation-name: s5-wb-sharp;
    }
    .s5-wb-smear {
      animation-name: s5-wb-smear;
    }
    .s5-inside {
      animation-name: s5-inside;
    }
    /* The boy's breakfast line plays as the car rolls in; the still's bubble is for the stills only. */
    .s5-voice {
      animation-name: s5-voice;
    }
    .s5-voice-still {
      opacity: 0;
    }
    .s5-door-f {
      animation-name: s5-door-f;
    }
    .s5-door-r {
      animation-name: s5-door-r;
    }
    .s5-skin {
      animation-name: s5-skin;
    }
    .s5-mirror {
      animation-name: s5-mirror;
    }
    .s5-drv {
      animation-name: s5-drv;
    }
    .s5-arm-r {
      animation: s5-arm-r linear both;
      animation-timeline: --s5;
      animation-range: contain 0% contain 100%;
    }
    .s5-eyes-open {
      animation-name: s5-eyes-open;
    }
    .s5-eyes-shut {
      animation-name: s5-eyes-shut;
    }
    .s5-kidhop {
      animation-name: s5-kidhop;
    }
    .s5-kid-a {
      animation-name: s5-kid-a;
    }
    .s5-kid-b {
      animation-name: s5-kid-b;
    }
    .s5-kid-c {
      animation-name: s5-kid-c;
    }
    .s5-hop {
      animation-name: s5-hop;
    }
    .s5-ring {
      animation-name: s5-ring;
    }
    /* Chapter, heading and lede arrive with the stage, as in scenes 3 and 4. */
    .s5-copy > :not(.s5-trust, .s5-cta) {
      animation-name: s5-up;
      animation-range: entry 50% entry 90%;
    }

    .s5-phone {
      animation-name: s5-phone;
      animation-range: contain 38% contain 56%;
    }

    @media (max-aspect-ratio: 4/5) {
      .s5-phone {
        animation-name: s5-phone-p;
      }
    }

    .s5-spark-line {
      animation-name: s5-draw;
      animation-range: contain 47% contain 60%;
    }

    .s5-spark-area {
      animation-name: s5-area;
      animation-range: contain 54% contain 61%;
    }

    .s5-spark-marks,
    .s5-spark-end {
      animation-name: s5-fade-in;
      animation-range: contain 58% contain 62%;
    }

    .s5-trust {
      animation-name: s5-rule;
      animation-range: contain 54% contain 60%;
    }

    .s5-t {
      animation-name: s5-up;
    }

    .s5-t1 {
      animation-range: contain 56% contain 63%;
    }
    .s5-t2 {
      animation-range: contain 60% contain 67%;
    }
    .s5-t3 {
      animation-range: contain 64% contain 71%;
    }
    .s5-t4 {
      animation-range: contain 68% contain 75%;
    }

    .s5-copy::before {
      animation: s5-fade-in linear both;
      animation-timeline: --s5;
      animation-range: entry 50% entry 90%;
    }

    /* "Coming soon" lands as the ring around the sun closes. */
    .s5-cta {
      animation-name: s5-up;
      animation-range: contain 80% contain 91%;
    }

    /* Ambient: the glitter path shimmers while the scene holds. */
    .s5-gl-a,
    .s5-gl-b {
      animation: s5-twinkle 3.2s ease-in-out infinite alternate;
    }

    .s5-gl-b {
      animation-delay: -1.6s;
    }
  }
}

@keyframes s5-cam {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes s5-morning {
  0% {
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes s5-rise {
  0% {
    transform: translateY(190px);
    animation-timing-function: cubic-bezier(0.3, 0.1, 0.3, 1);
  }
  22% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes s5-glow {
  0% {
    opacity: 0.2;
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes s5-halo {
  0% {
    transform: scale(0.55);
    opacity: 0.5;
  }
  24% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes s5-rays {
  0%,
  16% {
    opacity: 0;
  }
  40% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.34;
  }
}

@keyframes s5-veil {
  0% {
    opacity: 0.62;
  }
  24% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes s5-glitter {
  0%,
  4% {
    opacity: 0;
  }
  26% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

@keyframes s5-clouds {
  from {
    transform: translateX(-26px);
  }
  to {
    transform: translateX(26px);
  }
}

@keyframes s5-birds {
  from {
    transform: translate(-90px, 18px);
  }
  to {
    transform: translate(70px, -10px);
  }
}

@keyframes s5-roll {
  0% {
    transform: translateX(-900px);
    animation-timing-function: cubic-bezier(0.25, 0.55, 0.35, 1);
  }
  19% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes s5-spin {
  0% {
    transform: rotate(-1565deg);
    animation-timing-function: cubic-bezier(0.25, 0.55, 0.35, 1);
  }
  19% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Motion blur: the spokes show only once s5-roll's ease-out turns them under 0.4 of a spoke
   period per wheel notch (from 17%); faster, any spoke pose strobes. The two always sum to one. */
@keyframes s5-wb-sharp {
  0%,
  17% {
    opacity: 0;
  }
  19.5%,
  100% {
    opacity: 1;
  }
}

@keyframes s5-wb-smear {
  0%,
  17% {
    opacity: 1;
  }
  19.5%,
  100% {
    opacity: 0;
  }
}

@keyframes s5-inside {
  0%,
  21% {
    opacity: 1;
  }
  23% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* The doors swing on their hinges as matrices of the side view's oblique projection,
   sampled by car/doors.py; the mirror rides the front door's corner. */
/* gen:begin doors (s5/gen.py from car/doors.py) */
@keyframes s5-door-f {
  0% {
    transform: matrix(1, 0, 0, 1, 0, 0);
  }
  20% {
    transform: matrix(1, 0, 0, 1, 0, 0);
  }
  20.5% {
    transform: matrix(1.0006, -0.0008, 0, 1, -0.26, 0.35);
  }
  21% {
    transform: matrix(1.0032, -0.0055, 0, 1, -1.4, 2.41);
  }
  21.5% {
    transform: matrix(1.0049, -0.0162, 0, 1, -2.15, 7.1);
  }
  22% {
    transform: matrix(0.9959, -0.0325, 0, 1, 1.8, 14.23);
  }
  22.5% {
    transform: matrix(0.9637, -0.0529, 0, 1, 15.9, 23.17);
  }
  23% {
    transform: matrix(0.901, -0.0742, 0, 1, 43.36, 32.5);
  }
  23.5% {
    transform: matrix(0.812, -0.0933, 0, 1, 82.34, 40.87);
  }
  24% {
    transform: matrix(0.7124, -0.1081, 0, 1, 125.97, 47.35);
  }
  24.5% {
    transform: matrix(0.6234, -0.1179, 0, 1, 164.95, 51.64);
  }
  25% {
    transform: matrix(0.5617, -0.1233, 0, 1, 191.98, 54.01);
  }
  25.5% {
    transform: matrix(0.5331, -0.1255, 0, 1, 204.5, 54.97);
  }
  26% {
    transform: matrix(0.5283, -0.1258, 0, 1, 206.6, 55.1);
  }
  100% {
    transform: matrix(0.5283, -0.1258, 0, 1, 206.6, 55.1);
  }
}

@keyframes s5-door-r {
  0% {
    transform: matrix(1, 0, 0, 1, 0, 0);
  }
  20% {
    transform: matrix(1, 0, 0, 1, 0, 0);
  }
  20.5% {
    transform: matrix(1.0006, -0.0008, 0, 1, -0.16, 0.21);
  }
  21% {
    transform: matrix(1.0032, -0.0055, 0, 1, -0.83, 1.43);
  }
  21.5% {
    transform: matrix(1.0049, -0.0162, 0, 1, -1.27, 4.21);
  }
  22% {
    transform: matrix(0.9959, -0.0325, 0, 1, 1.07, 8.45);
  }
  22.5% {
    transform: matrix(0.9637, -0.0529, 0, 1, 9.44, 13.75);
  }
  23% {
    transform: matrix(0.901, -0.0742, 0, 1, 25.74, 19.29);
  }
  23.5% {
    transform: matrix(0.812, -0.0933, 0, 1, 48.88, 24.26);
  }
  24% {
    transform: matrix(0.7124, -0.1081, 0, 1, 74.78, 28.11);
  }
  24.5% {
    transform: matrix(0.6234, -0.1179, 0, 1, 97.92, 30.65);
  }
  25% {
    transform: matrix(0.5617, -0.1233, 0, 1, 113.96, 32.06);
  }
  25.5% {
    transform: matrix(0.5331, -0.1255, 0, 1, 121.39, 32.63);
  }
  26% {
    transform: matrix(0.5283, -0.1258, 0, 1, 122.64, 32.71);
  }
  100% {
    transform: matrix(0.5283, -0.1258, 0, 1, 122.64, 32.71);
  }
}

@keyframes s5-skin {
  0% {
    transform: translate(0px, 0px);
  }
  20% {
    transform: translate(0px, 0px);
  }
  20.5% {
    transform: translate(-0.06px, 0px);
  }
  21% {
    transform: translate(-0.44px, 0px);
  }
  21.5% {
    transform: translate(-1.27px, 0px);
  }
  22% {
    transform: translate(-2.56px, 0px);
  }
  22.5% {
    transform: translate(-4.15px, 0px);
  }
  23% {
    transform: translate(-5.83px, 0px);
  }
  23.5% {
    transform: translate(-7.33px, 0px);
  }
  24% {
    transform: translate(-8.5px, 0px);
  }
  24.5% {
    transform: translate(-9.26px, 0px);
  }
  25% {
    transform: translate(-9.69px, 0px);
  }
  25.5% {
    transform: translate(-9.86px, 0px);
  }
  26% {
    transform: translate(-9.89px, 0px);
  }
  100% {
    transform: translate(-9.89px, 0px);
  }
}

@keyframes s5-mirror {
  0% {
    transform: translate(24px, 8px);
  }
  20% {
    transform: translate(24px, 8px);
  }
  20.5% {
    transform: translate(24px, 8px);
  }
  21% {
    transform: translate(23.98px, 8.03px);
  }
  21.5% {
    transform: translate(23.97px, 8.1px);
  }
  22% {
    transform: translate(24.02px, 8.2px);
  }
  22.5% {
    transform: translate(24.22px, 8.32px);
  }
  23% {
    transform: translate(24.59px, 8.45px);
  }
  23.5% {
    transform: translate(25.13px, 8.56px);
  }
  24% {
    transform: translate(25.73px, 8.65px);
  }
  24.5% {
    transform: translate(26.26px, 8.71px);
  }
  25% {
    transform: translate(26.63px, 8.74px);
  }
  25.5% {
    transform: translate(26.8px, 8.75px);
  }
  26% {
    transform: translate(26.83px, 8.75px);
  }
  100% {
    transform: translate(26.83px, 8.75px);
  }
}
/* gen:end doors */
/* gen:begin voice (s5/gen.py from voice.py) */
@keyframes s5-voice {
  0%,
  3% {
    opacity: 0;
  }
  5%,
  19% {
    opacity: 1;
  }
  21%,
  100% {
    opacity: 0;
  }
}
/* gen:end voice */

/* The driver steps out of the front door, towards us (down a little) and back to his spot. */
@keyframes s5-drv {
  0%,
  23.99% {
    opacity: 0;
    transform: translate(44px, -6px);
  }
  24% {
    opacity: 1;
    transform: translate(44px, -6px);
    animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
  }
  33%,
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes s5-arm-r {
  0%,
  33% {
    transform: rotate(0deg);
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  42% {
    transform: rotate(-156deg);
  }
  100% {
    transform: rotate(-156deg);
  }
}

/* Eyes close in one step: a cross-fade would show both pairs at once. */
@keyframes s5-eyes-open {
  0%,
  39.99% {
    opacity: 1;
  }
  40%,
  100% {
    opacity: 0;
  }
}

@keyframes s5-eyes-shut {
  0%,
  39.99% {
    opacity: 0;
  }
  40%,
  100% {
    opacity: 1;
  }
}

/* One anchor for every child pose: he hops from the door sill to his spot,
   and the pose swaps happen in the air on a shared transform. */
@keyframes s5-kidhop {
  0%,
  24% {
    transform: translate(78px, -6px);
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }
  27%,
  30% {
    transform: translate(52px, 0);
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1);
  }
  34% {
    transform: translate(28px, -30px);
    animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4);
  }
  38%,
  100% {
    transform: translate(0, 0);
  }
}

@keyframes s5-kid-a {
  0%,
  23.99% {
    opacity: 0;
  }
  24%,
  32.99% {
    opacity: 1;
  }
  33%,
  100% {
    opacity: 0;
  }
}

@keyframes s5-kid-b {
  0%,
  32.99% {
    opacity: 0;
  }
  33%,
  36.49% {
    opacity: 1;
  }
  36.5%,
  100% {
    opacity: 0;
  }
}

@keyframes s5-kid-c {
  0%,
  36.49% {
    opacity: 0;
  }
  36.5%,
  100% {
    opacity: 1;
  }
}

@keyframes s5-hop {
  0%,
  39% {
    transform: translateY(0);
  }
  42% {
    transform: translateY(-12px);
  }
  45% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes s5-ring {
  0%,
  76% {
    stroke-dashoffset: 1;
    stroke-dasharray: 1 1;
    opacity: 0;
  }
  78% {
    opacity: 1;
  }
  91% {
    stroke-dashoffset: 0;
    stroke-dasharray: 1 1;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    stroke-dasharray: 1 1;
    opacity: 1;
  }
}

@keyframes s5-phone {
  0% {
    opacity: 0;
    transform: translateY(60vh);
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes s5-phone-p {
  0% {
    opacity: 0;
    transform: translateY(3rem);
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes s5-draw {
  from {
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
  }
  to {
    stroke-dasharray: 1 1;
    stroke-dashoffset: 0;
  }
}

@keyframes s5-area {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.12;
  }
}

@keyframes s5-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes s5-rule {
  from {
    border-top-color: transparent;
  }

  to {
    border-top-color: var(--s5-rule);
  }
}

@keyframes s5-up {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes s5-twinkle {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}
