/* The home speaks the park's language: rounded type, flat enclosure colours,
   chunky buttons with a solid shadow, banknotes as the heroes. */
:root {
  --ink: #24527e;
  --ink-soft: #345267;
  --paper: #fffdf6;
  font-family:
    "Arial Rounded MT Bold", "Arial Rounded MT", ui-rounded, "Trebuchet MS",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
}
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100dvh;
}
.home-text {
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 64px);
  max-width: 640px;
  justify-self: end;
  align-self: center;
}
h1 {
  margin: 0 0 24px;
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
h1 .subtitle {
  display: block;
  margin-top: 10px;
  font-size: 0.5em;
  letter-spacing: 0;
  color: #397d31;
}
p {
  margin: 0 0 14px;
  font-family:
    ui-rounded,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
p.lead {
  font-size: 1.18rem;
  color: var(--ink);
}
strong {
  font-family: "Arial Rounded MT Bold", ui-rounded, sans-serif;
  color: var(--ink);
}
.cta {
  display: inline-block;
  margin-top: 12px;
  padding: 16px 30px;
  border-radius: 14px;
  background: #ffdc58;
  color: #725211;
  box-shadow: 0 5px 0 #d3ac33;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}
.cta:hover {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #d3ac33;
}
.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.home-footer {
  margin-top: 40px;
  font-family:
    ui-rounded,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9rem;
  color: #6b7f8f;
}
.home-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid #cfd8df;
}
.home-footer a:hover {
  color: var(--ink);
  border-color: currentColor;
}

/* The stage: an enclosure's flat colour, one or two notes, the animals below. */
.stage {
  position: relative;
  overflow: hidden;
  /* Horizontal swipes change the scene; vertical ones still scroll the page. */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto auto;
}
.stage-color {
  position: absolute;
  inset: 0;
  background: #ffdc58;
  transition: background-color 1s ease;
}
.stage-color + .stage-color {
  left: 100%;
  transition:
    background-color 1s ease,
    left 0.9s cubic-bezier(0.6, 0, 0.3, 1);
}
.stage.is-pair .stage-color + .stage-color {
  left: 50%;
}
.stage-notes {
  position: relative;
  align-self: end;
  display: flex;
  justify-content: center;
  gap: clamp(24px, 8vw, 80px);
  padding-top: 8vh;
  perspective: 900px;
}
.hero-card {
  opacity: 0;
}
/* Dealt from above: a quick drop with a spin, an overshoot, and it settles. */
.stage-notes.is-entering .hero-card {
  animation: note-in 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.stage-notes.is-entering .hero-card:nth-child(2) {
  animation-delay: 0.2s;
}
.stage-notes.is-entering .hero-card:nth-child(3) {
  animation-delay: 0.4s;
}
/* Several notes of the same value fan out like a hand of cards. `rotate` is its own property,
   so it composes with the entrance, exit and float transforms. */
.stage-notes.is-stack {
  gap: 0;
}
.stage-notes.is-stack .hero-card + .hero-card {
  margin-left: calc(clamp(120px, 17vw, 220px) * -0.55);
}
.stage-notes.is-stack .hero-card:nth-child(1) {
  rotate: -9deg;
}
.stage-notes.is-stack .hero-card:nth-child(2):not(:last-child) {
  rotate: 1deg;
  translate: 0 -10px;
}
.stage-notes.is-stack .hero-card:last-child:not(:first-child) {
  rotate: 9deg;
}
@keyframes note-in {
  0% {
    opacity: 0;
    transform: translateY(-70vh) rotate(-28deg) rotateY(80deg) scale(0.7);
  }
  55% {
    opacity: 1;
    transform: translateY(18px) rotate(6deg) rotateY(0) scale(1.04);
  }
  78% {
    transform: translateY(-8px) rotate(-3deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
/* Following the animals out: a little crouch, a leap, one turn and away. */
.stage-notes.is-leaving .hero-card {
  animation: note-out-right 1.3s cubic-bezier(0.5, 0, 0.75, 0) both;
}
.stage-notes.is-leaving .hero-card:nth-child(2) {
  animation-delay: 0.1s;
}
.stage-notes.is-leaving .hero-card:nth-child(3) {
  animation-delay: 0.2s;
}
@keyframes note-out-right {
  0% {
    opacity: 1;
    transform: none;
  }
  18% {
    opacity: 1;
    transform: translateY(10px) scale(1.03, 0.96);
  }
  100% {
    opacity: 0;
    transform: translate(85vw, -30vh) rotate(260deg) rotateY(40deg) scale(0.55);
  }
}
.hero-note {
  --w: clamp(120px, 17vw, 220px);
  position: relative;
  width: var(--w);
  aspect-ratio: 1 / 1.41421356;
  border-radius: 4px;
  background: var(--fill) var(--art) center / 100% 100% no-repeat;
  box-shadow:
    4px 6px 0 #00000022,
    0 0 1px #23384b80;
  color: var(--tone);
  animation: float 4.5s ease-in-out infinite;
}
.stage.is-pair .hero-note {
  --w: clamp(96px, 12vw, 170px);
}
.hero-nest {
  display: block;
  width: clamp(150px, 20vw, 260px);
  height: auto;
  filter: drop-shadow(4px 6px 0 #00000022);
  animation: float 4.5s ease-in-out infinite;
}
.stage.is-nest .stage-caption {
  max-width: 34em;
  justify-self: center;
}
.hero-card:nth-child(2) .hero-note {
  animation-delay: -1.5s;
}
.hero-card:nth-child(3) .hero-note {
  animation-delay: -3s;
}
.hero-note-value {
  position: absolute;
  top: 3%;
  left: 6%;
  right: 6%;
  height: 26%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-size: calc(var(--w) * 0.36);
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 1px 0 #ffffff60;
}
.hero-note-value small {
  font-size: 0.36em;
  letter-spacing: 0;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-14px) rotate(2deg);
  }
}
.stage-ground {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 440;
}
.stage-ground svg {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: visible;
}
.stage-caption {
  position: relative;
  margin: 0;
  padding: 0 24px 7vh;
  min-height: 3.2em;
  text-align: center;
  font-family: "Arial Rounded MT Bold", ui-rounded, sans-serif;
  font-size: 1.05rem;
  color: #00000088;
}

@media (max-width: 820px) {
  .home {
    grid-template-columns: 1fr;
  }
  .stage {
    order: -1;
    min-height: 72dvh;
  }
  .home-text {
    justify-self: stretch;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-note,
  .hero-nest {
    animation: none;
  }
  .stage-color {
    transition: none;
  }
  .stage-notes .hero-card {
    opacity: 1;
    animation: none !important;
  }
}

/* Error pages: the home's stage with other words. */
.error-brand {
  margin: 0 0 18px;
  font-family: "Arial Rounded MT Bold", ui-rounded, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.error-brand a {
  color: #397d31;
  text-decoration: none;
}
.is-error h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.error-link {
  margin-top: 12px;
  color: var(--ink);
  text-underline-offset: 4px;
}
