:root {
  color-scheme: light;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2c2432;
  background: #faf8ef;
  --gutter: clamp(16px, 3.6vw, 57px);
  --bottom: max(env(safe-area-inset-bottom), clamp(20px, 4.5vh, 50px));
}

* { box-sizing: border-box; }
body, h1, p { margin: 0; }
body { min-width: 0; }
summary, a { -webkit-tap-highlight-color: transparent; }

.sheet {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #faf8ef url("assets/meadow-paper.webp") repeat;
  background-size: 320px 320px;
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent 0 39px, rgb(97 133 162 / 9%) 39px 40px);
  background-position: center;
}

.stage, canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage {
  --sprite-width: min(230px, 36vw, 32vh);
  --sprite-height: calc(var(--sprite-width) * .869318);
  --root-x: calc(var(--sprite-width) * .543633);
  --root-y: calc(var(--sprite-height) * .429176);
  --circle-size: calc(var(--sprite-width) * 1.4);
  --hero-x: 74%;
  --hero-y: 24%;
  pointer-events: none;
}
canvas, .still-trail { z-index: 0; }
.stage[data-ready] .still-trail { display: none; }
.runner {
  position: absolute;
  left: var(--hero-x);
  top: var(--hero-y);
  z-index: 1;
}
.stage[data-ready] .runner { left: 0; top: 0; }
.dash-circle, .stride {
  position: absolute;
  overflow: hidden;
}
.dash-circle {
  width: var(--circle-size);
  height: var(--circle-size);
  left: calc(var(--circle-size) * -.5);
  top: calc(var(--circle-size) * -.5);
  transform: rotate(-33deg);
}
.stride {
  width: var(--sprite-width);
  height: var(--sprite-height);
  left: calc(0px - var(--root-x));
  top: calc(0px - var(--root-y));
  transform-origin: var(--root-x) var(--root-y);
}
.dash-circle img, .stride img { display: block; width: 400%; max-width: none; }
.dash-circle img { height: 100%; }
.stride img { height: 300%; }

.still-trail {
  position: absolute;
  left: var(--hero-x);
  top: var(--hero-y);
  width: min(39vw, 410px);
  height: calc(var(--sprite-width) * .25);
  transform-origin: right center;
  transform: translate(-100%, -52%) rotate(-25deg);
  clip-path: polygon(0 44%, 100% 0, 100% 100%, 0 56%);
  background: linear-gradient(#f94c69 0 16.67%, #ff9138 16.67% 33.33%, #ffda42 33.33% 50%, #3ccd64 50% 66.67%, #4179f5 66.67% 83.33%, #9f4ae8 83.33%);
  mask-image: linear-gradient(to right, transparent, black 76%);
}

header { pointer-events: none; }
h1 {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
}
.wordmark { display: block; width: clamp(552px, 66vw, 930px); max-width: calc(100vw - 24px); height: auto; }

.credits summary {
  pointer-events: auto;
  cursor: pointer;
  color: #514759;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.credits summary:hover { color: #28152f; }

footer {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  padding-bottom: var(--bottom);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.wishlist {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 1.25vw, 20px);
  padding: 10px clamp(19px, 2vw, 30px);
  color: #fff;
  background: #291f30;
  border: 2px solid #211825;
  border-radius: 17px 20px 17px 19px;
  box-shadow: 0 4px 0 #a694a3, 0 7px 15px -8px #59495975;
  font-size: clamp(1.1rem, 1.5vw, 1.32rem);
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.wishlist img { display: block; height: 50px; width: auto; }
@media (hover: hover) {
  .wishlist:hover {
    background: #3c2944;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #a694a3, 0 10px 17px -8px #59495975;
  }
}
.wishlist:active { transform: translateY(2px); box-shadow: 0 2px 0 #a694a3; }
:focus-visible { outline: 3px solid #6742a3; outline-offset: 5px; }

.credits {
  position: absolute;
  right: max(8px, env(safe-area-inset-right), calc(var(--gutter) - 6px));
  bottom: max(6px, env(safe-area-inset-bottom));
  pointer-events: auto;
}

.credits summary { list-style: none; border-radius: 50%; color: #766d74; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary span {
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font: bold 13px/1 Georgia, serif;
}
.credit-note {
  position: absolute;
  right: 0;
  bottom: 48px;
  width: min(19rem, calc(100vw - 32px));
  padding: 16px 18px;
  border: 1px solid #bdb6b1;
  border-radius: 10px;
  background: #fffcf5;
  font-size: .875rem;
  line-height: 1.5;
  box-shadow: 0 4px 14px #35263a15;
}

@media (max-width: 460px) {
  :root { --bottom: max(calc(env(safe-area-inset-bottom) + 19px), 43px); }
  .credits { right: max(4px, env(safe-area-inset-right)); bottom: env(safe-area-inset-bottom); }
  .wordmark { width: calc(100vw - 24px); }
}

@media (max-width: 340px) {
  .wishlist { padding-inline: 12px; gap: 9px; max-width: calc(100vw - 20px); flex-wrap: wrap; }
}

@media (max-height: 450px) {
  :root { --bottom: max(12px, env(safe-area-inset-bottom)); }
  .wordmark { width: min(540px, 90vw); }
  .wishlist { padding-block: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .wishlist { transition: none; }
}
