:root {
  color-scheme: dark;
  --night: #07050c;
  --ink: #0b0507;
  --gold: #ffcf4a;
  --cream: #fff1c9;
  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cg stroke='%230b0507' stroke-width='6'%3E%3Ccircle cx='20' cy='20' r='11'/%3E%3Cpath d='M20 2v9M20 29v9M2 20h9M29 20h9'/%3E%3C/g%3E%3Cg stroke='%23ffcf4a' stroke-width='2.5'%3E%3Ccircle cx='20' cy='20' r='11'/%3E%3Cpath d='M20 2v9M20 29v9M2 20h9M29 20h9'/%3E%3C/g%3E%3Ccircle cx='20' cy='20' r='2' fill='%23ff5e00' stroke='%230b0507' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E") 20 20, crosshair;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--night);
  cursor: var(--cursor);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transform: scale(1.05);
  transition: transform 1.8s cubic-bezier(.16, .84, .24, 1);
}
.scene.ready { transform: none; }
/* The fade in from black is a curtain over the scene rather than the scene's own opacity,
   so its pictures count as painted from the start (Largest Contentful Paint skips
   anything at opacity 0). */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--night);
  pointer-events: none;
  transition: opacity .9s ease;
}
.scene.ready::after { opacity: 0; }
.scene img, .scene video { -webkit-user-drag: none; }
/* <picture> only chooses the format; its image keeps the container's sizing. */
.scene picture { display: contents; }

.layer { position: absolute; inset: 0; pointer-events: none; }

/* Room for the parallax to move without showing an edge. */
.backdrop { inset: -3%; will-change: transform; }
.backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; display: block; }

/* The sky's own stars twinkle as compositor animations: no script, a few pixels each. */
.sky { position: absolute; left: 0; top: 0; width: 100%; height: 62%; pointer-events: none; will-change: transform; }
.twinkle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf5 0 20%, rgba(236, 232, 255, .5) 36%, transparent 70%);
  opacity: .2;
  animation: twinkle 3s ease-in-out infinite;
}
.twinkle.warm { background: radial-gradient(circle, #fff6e0 0 20%, rgba(255, 214, 160, .5) 36%, transparent 70%); }
@keyframes twinkle { 50% { opacity: 1; transform: scale(1.6); } }
.shooting {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  transform-origin: 100% 50%;
  background: linear-gradient(to right, rgba(255, 220, 170, 0), rgba(255, 248, 230, .95));
}
.shooting::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff8e6;
  box-shadow: 0 0 8px 3px rgba(255, 230, 190, .75);
}

.moon {
  position: absolute;
  left: 0;
  top: 0;
  width: 40vmin;
  aspect-ratio: 1;
  pointer-events: none;
  will-change: transform;
}
.moon img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 2.2vmin rgba(255, 176, 64, .55));
}
.moon-glow {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(255, 196, 92, .5) 0%, rgba(255, 128, 48, .2) 38%, rgba(255, 60, 120, .07) 64%, transparent 100%);
  will-change: transform, opacity;
}

.hero {
  position: absolute;
  left: 50%;
  bottom: -3svh;
  height: min(97svh, 69vw);
  aspect-ratio: 1404 / 1080;
  transform: translateX(-50%);
  pointer-events: none;
}
.hero-inner { position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform; }
.hero-still, .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.hero-video { opacity: 0; transition: opacity .25s linear; }
.hero.playing .hero-video { opacity: 1; }
.hero.playing .hero-still { visibility: hidden; transition: visibility 0s .3s; }

/* Portrait: bigger riders, the tail runs off the left edge. */
@media (max-aspect-ratio: 1/1) {
  .hero { height: auto; width: 140vw; left: 40%; bottom: -2svh; }
}

.weeds { overflow: hidden; }
.weed { position: absolute; left: 0; top: 0; will-change: transform; }
.weed img { display: block; width: 100%; height: auto; }
.weeds-far .weed { filter: brightness(.55) saturate(.8); }

/* Placed by script over the riders' upper part, where the smoke and flashes happen. */
.fx { position: absolute; left: 0; top: 0; pointer-events: none; }

.yees { overflow: hidden; }
.yee { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.yee svg { display: block; width: 100%; height: auto; overflow: visible; }
.yee-word { position: relative; }
.yee-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128%;
  aspect-ratio: 1.75;
  translate: -50% -50%;
}
.yee-burst svg { width: 100%; height: 100%; }
.yee-lines { position: absolute; top: 0; height: 100%; width: 90%; }
.yee-lines.trail-left { right: 96%; }
.yee-lines.trail-right { left: 96%; }
.yee-lines svg { width: 100%; height: 100%; }

.grade {
  background:
    linear-gradient(to top, rgba(7, 5, 12, .5), transparent 14%),
    radial-gradient(ellipse 125% 95% at 50% 42%, transparent 58%, rgba(3, 1, 8, .62) 100%);
}

.sound {
  position: fixed;
  right: max(16px, calc(env(safe-area-inset-right) + 12px));
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
  width: 54px;
  height: 54px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink), 0 0 24px rgba(255, 176, 64, .35);
  cursor: pointer;
  z-index: 10;
  transition: transform .15s ease, background-color .2s ease;
}
.sound[hidden] { display: none; }
.sound:hover { transform: translate(-1px, -1px) rotate(-6deg); }
.sound:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sound:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; }
.sound svg { width: 32px; height: 32px; overflow: visible; }
.sound .speaker { fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.sound .waves path, .sound .cross path { fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; }
.sound .waves path { transform-origin: 26px 24px; }
.sound .cross { display: none; }
.sound[data-state="playing"] .waves path { animation: wave 1s ease-in-out infinite; }
.sound[data-state="playing"] .waves path:nth-child(2) { animation-delay: .15s; }
.sound[data-state="playing"] .waves path:nth-child(3) { animation-delay: .3s; }
.sound:not([data-state="playing"]) .waves { display: none; }
.sound:not([data-state="playing"]) .cross { display: inline; }
.sound[data-state="blocked"]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  animation: ring 1.6s ease-out infinite;
}
@keyframes wave { 50% { opacity: .35; } }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .scene { transform: none; transition: none; }
  .scene::after { transition-duration: .4s; }
  .sound[data-state="blocked"]::after, .sound[data-state="playing"] .waves path { animation: none; }
  .twinkle { animation: none; opacity: .7; }
}
