.arrival-plate { opacity: 0; }
.arrival-hole { position: absolute; pointer-events: none; visibility: hidden; }
#title[data-arrival] .arrival-hole,
#title[data-arrival-rest] .arrival-hole { visibility: visible; }
#title:is([data-arrival-primed], [data-arrival-rest]) .arrival-backdrop img { opacity: 1; }

.arrival-flight, .arrival-hole-body, .arrival-hole-wave, .arrival-reaction, .arrival-stream {
  position: absolute;
  inset: 0;
}
.arrival-hero {
  display: block;
  width: 100%;
  height: 100%;
}
.arrival-shadow {
  position: absolute;
  inset: 27% -10% -3%;
  background: radial-gradient(ellipse, #38202177, transparent 69%);
  opacity: 0;
}
.arrival-hole-wave {
  border: 2px solid #ffe3bf;
  border-radius: 50%;
  box-shadow: 0 0 9px #ffb6fa;
  opacity: 0;
}
.arrival-hole-face {
  position: absolute;
  inset: 2% 1.8% 2.5%;
  overflow: hidden;
  border-radius: 50%;
}
.arrival-reaction { opacity: 0; }
.arrival-reaction::before {
  content: "";
  position: absolute;
  inset: 47% 14% -10%;
  background: radial-gradient(ellipse at 53% 6%, #190b37 30%, #221348 72%, #3d2667);
  mask-image: radial-gradient(ellipse 51% 63% at 50% 58%, #000 78%, transparent);
}
.arrival-reaction img {
  position: absolute;
  left: 27%;
  bottom: 2%;
  width: 46%;
  transform: translateY(31%);
  opacity: 0;
}

.arrival-prop, .arrival-paper {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  opacity: 0;
}
.arrival-prop {
  width: var(--size);
  transform-origin: 50% 75%;
  filter: drop-shadow(2px 5px 5px #38202150);
}
@media (min-aspect-ratio: 4/5) {
  .arrival-hat { --hat-lane: -38%; }
}
.arrival-paper {
  width: var(--size);
  height: calc(var(--size) * .57);
  background: var(--paper);
  border-radius: 18% 40% 20% 30%;
  box-shadow: 0 1px 3px #4b2a4555;
}

@media (prefers-reduced-motion: no-preference) {
  #title[data-arrival]:not([data-arrival-primed]) .arrival-backdrop img { animation: arrive-plate 260ms ease both; }
  #title[data-arrival] .arrival-stream { animation: arrive-stream-in 230ms ease both; }
  #title[data-arrival] .paint { animation: arrive-garden var(--arrival-duration) both; }
  #title[data-arrival] .arrival-flight { animation: arrive-flight var(--flight-duration) both; }
  #title[data-arrival] .arrival-shadow { animation: arrive-shadow var(--flight-duration) both; }
  #title[data-arrival] .arrival-hole-body { animation: arrive-hole-grow var(--body-duration) var(--flight-duration) both; }
  #title[data-arrival] .arrival-prop { animation: arrive-prop var(--travel) var(--delay) both; }
  #title[data-arrival] .arrival-cup { animation: arrive-cup 770ms calc(var(--flight-duration) - 90ms) both; }
  #title[data-arrival] .arrival-ball { animation: arrive-ball 1010ms calc(var(--flight-duration) + 65ms) both; }
  #title[data-arrival] .arrival-car { animation: arrive-car var(--gulp-duration) var(--flight-duration) both; }
  #title[data-arrival] .arrival-hat { animation: arrive-hat var(--arrival-duration) both; }
  #title[data-arrival] .arrival-paper { animation: arrive-paper var(--travel) var(--delay) both; }
  #title[data-arrival] .arrival-hole-wave { animation: arrive-wave 450ms calc(var(--arrival-duration) * .85) forwards; }
  #title[data-arrival] .arrival-reaction { animation: arrive-reaction var(--arrival-duration) both; }
  #title[data-arrival] .arrival-look { animation: arrive-look var(--arrival-duration) both; }
  #title[data-arrival] .arrival-squeeze { animation: arrive-squeeze var(--arrival-duration) both; }
  #title[data-arrival] .arrival-grin { animation: arrive-grin var(--arrival-duration) both; }
}

@keyframes arrive-plate { to { opacity: 1; } }
@keyframes arrive-stream-in { 0%, 20% { opacity: 0; } }
@keyframes arrive-garden {
  0% { transform: scale(1.025); }
  19% { transform: scale(1.105) translate(-.85%, .45%) rotate(-.45deg); }
  26% { transform: scale(1.073) translate(.25%, -.3%) rotate(.25deg); }
  34% { transform: scale(1.08); }
  61% { transform: scale(1.055); }
  71% { transform: scale(1.07) translate(0, -.65%); }
  77%, 81% { transform: translateY(-2.5%) scale(1.165); }
  86% { transform: translateY(-3%) scale(1.205); }
  90% { transform: translateY(-2%) scale(1.13); }
  100% { transform: none; }
}
@keyframes arrive-flight {
  0%, 4% { opacity: 0; transform: translate(77%, calc(var(--rise) * -1.05)) rotate(21deg) scale(.12, .19); }
  22% { opacity: 1; transform: translate(85%, calc(var(--rise) * -.89)) rotate(21deg) scale(.35, .46); }
  53% { transform: translate(-44%, calc(var(--rise) * -.53)) rotate(-16deg) scale(.76, .96); animation-timing-function: cubic-bezier(.42,.09,.73,.65); }
  72% { transform: translate(-7%, 6%) rotate(-3deg) scale(1.12, .81); }
  85% { transform: translate(2%, -6%) rotate(2deg) scale(.985, 1.08); }
  100% { opacity: 1; transform: none; }
}
@keyframes arrive-shadow {
  0% { opacity: 0; transform: scale(.36); }
  48% { opacity: .18; transform: translateX(-14%) scale(.64); }
  72% { opacity: .83; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes arrive-prop {
  0% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--pose)); }
  13% { transform: translate(calc(var(--x) * 1.035), calc(var(--y) + 3px)) rotate(calc(var(--pose) - var(--turn) * .10)); animation-timing-function: cubic-bezier(.55,.07,.77,.45); }
  53% { opacity: 1; transform: translate(calc(var(--x) * .67 + var(--bend) * .42), calc(var(--y) * .68 - var(--lift))) rotate(calc(var(--pose) + var(--turn) * .36)) scale(.88); animation-timing-function: cubic-bezier(.38,.03,.7,.47); }
  81% { opacity: 1; transform: translate(calc(var(--x) * .23 + var(--bend) * .29), calc(var(--y) * .22 - var(--lift) * .32)) rotate(calc(var(--pose) + var(--turn) * .79)) scale(.62); }
  100% { opacity: 0; transform: translate(0, 12%) rotate(calc(var(--pose) + var(--turn))) scale(.06); }
}
@keyframes arrive-paper {
  0% { opacity: .95; transform: translate(var(--x), var(--y)) rotate(var(--pose)) scale(1, .68); }
  27% { opacity: 1; transform: translate(calc(var(--x) * .88 + var(--bend) * .28), calc(var(--y) * .89 - var(--lift) * .62)) rotate(calc(var(--pose) + var(--turn) * .38)) scale(.94, .87); }
  66% { opacity: 1; transform: translate(calc(var(--x) * .40 + var(--bend) * .69), calc(var(--y) * .43 - var(--lift))) rotate(calc(var(--pose) + var(--turn) * .75)) scale(.75, .36); }
  100% { opacity: 0; transform: translate(0, 8px) rotate(calc(var(--pose) + var(--turn))) scale(.13); }
}
@keyframes arrive-cup {
  0% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--pose)); }
  16% { transform: translate(calc(var(--x) * 1.026), calc(var(--y) - 8px)) rotate(-7deg); animation-timing-function: cubic-bezier(.6,.08,.79,.51); }
  67% { transform: translate(-137%, -32%) rotate(48deg); }
  84% { opacity: 1; transform: translate(-55%, 3%) rotate(82deg) scale(.76); }
  100% { opacity: 0; transform: translate(4%, 22%) rotate(122deg) scale(.08); }
}
@keyframes arrive-ball {
  0% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--pose)); }
  13% { transform: translate(calc(var(--x) * 1.025), var(--y)) rotate(-39deg); animation-timing-function: cubic-bezier(.56,.08,.78,.51); }
  65% { transform: translate(-151%, 67%) rotate(65deg); }
  83% { opacity: 1; transform: translate(-69%, -9%) rotate(125deg); }
  100% { opacity: 0; transform: translate(1%, 26%) rotate(192deg) scale(.12); }
}
@keyframes arrive-car {
  0%, 14% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--pose)); }
  24% { opacity: 1; transform: translate(110%, 3%) rotate(0); }
  34%, 37% { opacity: 1; transform: translate(67%, 1%) rotate(-12deg); }
  42% { opacity: 1; transform: translate(77%, 1%) rotate(4deg); }
  48% { opacity: 1; transform: translate(73%, 0) rotate(-3deg); }
  56% { opacity: 1; transform: translate(49%, -3%) rotate(-18deg); }
  65% { opacity: 1; transform: translate(24%, 11%) rotate(-42deg) scale(.82); }
  70% { opacity: .8; transform: translate(5%, 18%) rotate(-65deg) scale(.47); }
  74%, 100% { opacity: 0; transform: translate(0, 23%) rotate(-89deg) scale(.08); }
}
/* Land the hat on the lip after the car clears it, then pull it into the close-up. */
@keyframes arrive-hat {
  0%, 53% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--pose)); }
  61% { opacity: 1; transform: translate(calc(var(--x) * .86 - 32%), calc(var(--y) * .79 - 9%)) rotate(31deg); }
  71% { opacity: 1; transform: translate(calc(-77% + var(--hat-lane, 0%)), -64%) rotate(-30deg) scale(.94); }
  75%, 78% { opacity: 1; transform: translate(calc(-52% + var(--hat-lane, 0%)), -47%) rotate(-12deg) scale(.92); }
  81% { opacity: 1; transform: translate(calc(-36% + var(--hat-lane, 0%) * .55), -44%) rotate(26deg) scale(.84); animation-timing-function: cubic-bezier(.47,.05,.75,.56); }
  84% { opacity: 1; transform: translate(-12%, -8%) rotate(83deg) scale(.61); }
  87%, 100% { opacity: 0; transform: translate(0, 17%) rotate(141deg) scale(.09); }
}
@keyframes arrive-hole-grow {
  0%, 27% { transform: scale(1); }
  31% { transform: scale(1.055, 1.04); }
  37% { transform: scale(1.055); }
  44.35% { transform: scale(1.29, 1.23); }
  55% { transform: scale(1.24, 1.22); }
  63.5% { transform: scale(1.28, 1.15); }
  70%, 76% { transform: scale(1.22, 1.22); }
  81% { transform: scale(1.31, .93); }
  87% { transform: scale(1.19, 1.25); }
  100% { transform: scale(1); }
}
@keyframes arrive-wave {
  from { opacity: 0; transform: scale(1.15, 1.09); }
  22% { opacity: .66; }
  to { opacity: 0; transform: scale(1.52, 1.43); }
}
@keyframes arrive-reaction {
  0%, 69%, 100% { opacity: 0; }
  72%, 97% { opacity: 1; }
}
@keyframes arrive-look {
  0%, 79% { opacity: 1; }
  81%, 100% { opacity: 0; }
}
@keyframes arrive-squeeze {
  0%, 79%, 89%, 100% { opacity: 0; }
  82%, 87% { opacity: 1; }
  86% { transform: translateY(34%) scale(1.045, .86); }
}
@keyframes arrive-grin {
  0%, 87% { opacity: 0; }
  90%, 100% { opacity: 1; }
}

/* The original wordmark cartoon plays at its own pace alongside the garden. */
.title-wordmark { --wordmark-duration: 1810ms; }
.title-mouth{
  position:absolute;left:38.9%;top:46.5%;width:13.4%;height:20.4%;opacity:0;
  background:radial-gradient(ellipse at 50% 10%,#412670,#281c54 80%);
  clip-path:polygon(15% 10%,85% 10%,95% 30%,100% 55%,96% 77%,85% 94%,62% 100%,34% 100%,13% 94%,3% 76%,0 55%,5% 30%);
}
.title-mouth .title-eyes{inset:23% 6% auto;width:88%;height:auto;opacity:0}
#logo .title-prop{inset:auto;left:46%;top:52%;width:20%;height:auto;margin:-10%;opacity:0}
#logo .title-hat{width:27%;margin:-13.5%}
.title-spark{
  position:absolute;left:46%;top:54%;width:3.3%;aspect-ratio:1;
  border-radius:40%;background:var(--spark-colour,#fff1b7);box-shadow:0 0 6px #ffb54e;opacity:0;
}
.title-spark:nth-of-type(1){--spark-x:-570%;--spark-y:-360%;--spark-colour:#ffdc68}
.title-spark:nth-of-type(2){--spark-x:495%;--spark-y:-235%;--spark-colour:#ffd1ec}
.title-spark:nth-of-type(3){--spark-x:65%;--spark-y:-830%}
.title-spark:nth-of-type(4){--spark-x:-340%;--spark-y:-650%;--spark-colour:#fa8d8b}
.title-spark:nth-of-type(5){--spark-x:430%;--spark-y:-565%;--spark-colour:#a6e7fa}
.title-spark:nth-of-type(6){--spark-x:-65%;--spark-y:495%;--spark-colour:#fbd776}
.title-burp{
  position:absolute;inset:30% auto auto 34%;width:25%;height:46%;
  border:2px solid #ffe8ac;border-radius:50%;opacity:0;
}

@media(prefers-reduced-motion:no-preference){
  #title[data-arrival] .title-wordmark{animation:wordmark-logo var(--wordmark-duration) both}
  #title[data-arrival] .title-mouth{animation:wordmark-mouth var(--wordmark-duration) both}
  #title[data-arrival] .title-eyes.amazed{animation:wordmark-look var(--wordmark-duration) both}
  #title[data-arrival] .title-eyes.gulp{animation:wordmark-squeeze var(--wordmark-duration) both}
  #title[data-arrival] .title-eyes.happy{animation:wordmark-happy var(--wordmark-duration) both}
  #title[data-arrival] .title-sweet{animation:wordmark-sweet var(--wordmark-duration) both}
  #title[data-arrival] .title-cupcake{animation:wordmark-cupcake var(--wordmark-duration) both}
  #title[data-arrival] .title-hat{animation:wordmark-hat var(--wordmark-duration) both}
  #title[data-arrival] .title-spark{animation:wordmark-spark 335ms calc(var(--wordmark-duration) * .79) forwards}
  #title[data-arrival] .title-burp{animation:wordmark-burp 260ms calc(var(--wordmark-duration) * .79) forwards}
}

@keyframes wordmark-logo{
  0%{transform:translateY(-9%) scale(.87) rotate(-4deg);animation-timing-function:cubic-bezier(.23,1,.32,1)}
  20%{transform:translateY(6%) scale(1.10,1.06) rotate(2deg)}
  32%{transform:translateY(9%) scale(1.09,.95) rotate(-3deg)}
  43%{transform:translateY(6%) scale(1.04,1.10) rotate(2deg)}
  55%{transform:translateY(5%) scale(1.06) rotate(3deg)}
  66%{transform:translateY(8%) scale(1.13,.91) rotate(-5deg)}
  74%{transform:translateY(4%) scale(1.06,1.13) rotate(2deg)}
  81%{transform:translateY(9%) scale(1.15,.88)}
  89%{transform:translateY(2%) scale(.99,1.06)}
  100%{transform:none}
}
@keyframes wordmark-mouth{0%,9%,100%{opacity:0}14%,94%{opacity:1}}
@keyframes wordmark-look{
  0%,10%,41%,67%,100%{opacity:0}
  16%{opacity:1;transform:translateX(-6%)}
  30%{opacity:1;transform:translateX(7%)}
  35%{opacity:1;transform:translateX(0)}
  46%,63%{opacity:1;transform:translateY(-9%) scale(1.03)}
  75%{opacity:1;transform:translateY(1%) scale(.89,1.03)}
  80%{opacity:0}
}
@keyframes wordmark-squeeze{
  0%,34%,45%,73%,87%,100%{opacity:0}
  39%,81%{opacity:1;transform:translateY(9%) scale(1.05,.82)}
}
@keyframes wordmark-happy{
  0%,81%,100%{opacity:0}
  87%,96%{opacity:1;transform:translateY(-4%)}
}
@keyframes wordmark-sweet{
  0%,4%{opacity:0;transform:translate(-255%,-35%) rotate(-40deg) scale(.65)}
  15%{opacity:1;transform:translate(-183%,-111%) rotate(5deg)}
  27%{opacity:1;transform:translate(-55%,-49%) rotate(42deg) scale(.84)}
  39%,100%{opacity:0;transform:translate(0,17%) rotate(100deg) scale(.12)}
}
@keyframes wordmark-cupcake{
  0%,10%{opacity:0;transform:translate(240%,-36%) rotate(30deg) scale(.65)}
  21%{opacity:1;transform:translate(170%,-90%) rotate(-4deg)}
  34%{opacity:1;transform:translate(41%,-38%) rotate(-25deg) scale(.8)}
  46%,100%{opacity:0;transform:translate(-5%,14%) rotate(-85deg) scale(.12)}
}
@keyframes wordmark-hat{
  0%,40%{opacity:0;transform:translate(52%,-224%) rotate(32deg) scale(.86)}
  50%{opacity:1;transform:translate(40%,-143%) rotate(12deg) scale(1.04)}
  61%,65%{opacity:1;transform:translate(15%,-27%) rotate(-38deg)}
  71%{opacity:1;transform:translate(6%,-64%) rotate(17deg) scale(1.1)}
  78%{opacity:1;transform:translate(-5%,-9%) rotate(92deg) scale(.62)}
  83%,100%{opacity:0;transform:translate(0,19%) rotate(135deg) scale(.14)}
}
@keyframes wordmark-spark{
  from{opacity:.94;transform:scale(.35)}
  38%{opacity:1}
  to{opacity:0;transform:translate(var(--spark-x),var(--spark-y)) rotate(65deg) scale(.55)}
}
@keyframes wordmark-burp{from{opacity:.85;transform:scale(.18)}to{opacity:0;transform:scale(1.75)}}
