/* Spud & Root: town/index.html, Town: the park. Loaded after hub.css,
   which has the map, the buttons and the frame of the scene. This has the
   park's colours for the time of day (hub.js sets data-time on .hub), the
   pigeons, and what moves in the park. The scene is drawn by
   scripts/draw-town.py. See docs/pages/town.md. */

.hub {
  --sky0: #7fb6e4;
  --sky1: #b9dcf1;
  --sky2: #e8f2e6;
  --cloud: #ffffff;
  --cloud-shade: #dfe6ee;
  --moon-cut: #0d1533;
  --glass: #3f4d6a;
  --shopglass: #56627c;
  --cglass: #4f5f88;
  --lamp: #e9e4d2;
  --water: #6fa8cf;
  --water-light: #86bbdc;
  --water-glint: #d8eef8;
}
.hub[data-time="dusk"] {
  --sky0: #52548f;
  --sky1: #d98a86;
  --sky2: #ffcf8f;
  --cloud: #f7c6b0;
  --cloud-shade: #cf8f93;
  --water: #7d8fb2;
  --water-light: #c99aa2;
  --water-glint: #ffd6a8;
}
.hub[data-time="night"] {
  --sky0: #0d1533;
  --sky1: #1d2a55;
  --sky2: #34406e;
  --cloud: #4a5578;
  --cloud-shade: #39436a;
  --water: #3d5378;
  --water-light: #4a6189;
  --water-glint: #a9b7d6;
}

.hub[data-time="dusk"] .tint {
  fill: #5a2f5f;
  opacity: 0.2;
}
.hub[data-time="night"] .tint {
  fill: #0b1436;
  opacity: 0.56;
}

/* Everybody's at Russet's by dark */
.hub[data-time="night"] .day-only {
  display: none;
}

/* Russet's sign, in the map's picture of it */
.neon__core {
  font-family: var(--font-script);
  font-size: 27px;
  fill: #ffe2b4;
  stroke: #ff8a2a;
  stroke-width: 1.2;
}

.pigeons {
  cursor: pointer;
}
.pigeons:focus {
  outline: none;
}
.pigeons:focus-visible .pigeon__body {
  stroke: var(--logo-yellow);
}

/* ---------- Falling leaves ---------- */

.falling {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.falling i {
  position: absolute;
  top: -30px;
  width: 16px;
  height: 11px;
  background: #e8742a;
  border: 2px solid var(--ink);
  border-radius: 0 80% 0 80%;
  opacity: 0;
}
.falling i:nth-child(1) { left: 12%; background: #d9472e; }
.falling i:nth-child(2) { left: 31%; background: #f2b63a; }
.falling i:nth-child(3) { left: 52%; background: #e8742a; }
.falling i:nth-child(4) { left: 68%; background: #c8342a; }
.falling i:nth-child(5) { left: 84%; background: #f08c2c; }
.falling i:nth-child(6) { left: 92%; background: #f5c94e; }

/* ---------- Things that move ---------- */

@media (prefers-reduced-motion: no-preference) {
  .cloud {
    animation: drift 90s linear infinite alternate;
  }
  .cloud.c2 {
    animation-duration: 120s;
    animation-direction: alternate-reverse;
  }
  .cloud.c3 {
    animation-duration: 75s;
  }
  .spray path {
    stroke-dasharray: 7 5;
    animation: flow 0.7s linear infinite;
  }
  .duck__bob {
    animation: bob 3.2s ease-in-out infinite;
  }
  .duck.d2 .duck__bob {
    animation-delay: -1.1s;
  }
  .duck.d3 .duck__bob {
    animation-delay: -2.2s;
  }
  .duck {
    transform-box: view-box;
  }
  .duck.d1 {
    animation: paddle 26s ease-in-out infinite alternate;
  }
  .duck.d3 {
    animation: paddle 32s ease-in-out infinite alternate-reverse;
  }
  .person.hop image {
    animation: hop 2.6s ease-in-out infinite;
  }
  .pigeon__head {
    transform-box: fill-box;
    transform-origin: 20% 80%;
    animation: peck 2.8s ease-in-out infinite;
  }
  .p1 .pigeon__head { animation-delay: -0.7s; animation-duration: 3.4s; }
  .p2 .pigeon__head { animation-delay: -1.9s; }
  .p3 .pigeon__head { animation-delay: -1.2s; animation-duration: 2.3s; }
  .pigeons.is-flying .pigeon__fly {
    animation: fly-off 4.5s ease-in-out both;
  }
  .pigeons.is-flying .p1 .pigeon__fly { animation-delay: 0.08s; }
  .pigeons.is-flying .p2 .pigeon__fly { animation-delay: 0.15s; }
  .pigeons.is-flying .p3 .pigeon__fly { animation-delay: 0.04s; }
  .lit circle[fill^="#ff"],
  .lit circle[fill^="#fff"] {
    animation: twinkle 3s ease-in-out infinite alternate;
  }
  .falling i {
    animation: fall 13s linear infinite;
  }
  .falling i:nth-child(2) { animation-delay: -3s; animation-duration: 16s; }
  .falling i:nth-child(3) { animation-delay: -7s; animation-duration: 11s; }
  .falling i:nth-child(4) { animation-delay: -10s; animation-duration: 15s; }
  .falling i:nth-child(5) { animation-delay: -5s; animation-duration: 12s; }
  .falling i:nth-child(6) { animation-delay: -12s; animation-duration: 17s; }
}

@keyframes drift {
  to { translate: 120px 0; }
}
@keyframes flow {
  to { stroke-dashoffset: -12; }
}
@keyframes bob {
  50% { translate: 0 1.5px; }
}
@keyframes paddle {
  to { translate: 60px 6px; }
}
@keyframes hop {
  0%, 60%, 100% { translate: 0 0; }
  70% { translate: 0 -10px; }
  80% { translate: 0 0; }
  88% { translate: 0 -6px; }
}
@keyframes peck {
  0%, 55%, 100% { rotate: 0deg; }
  62% { rotate: 38deg; }
  70% { rotate: 0deg; }
  78% { rotate: 38deg; }
  86% { rotate: 0deg; }
}
@keyframes fly-off {
  0% { translate: 0 0; opacity: 1; }
  35% { translate: 260px -420px; opacity: 1; }
  36% { opacity: 0; }
  70% { translate: -200px -420px; opacity: 0; }
  71% { opacity: 1; }
  100% { translate: 0 0; opacity: 1; }
}
@keyframes twinkle {
  to { opacity: 0.55; }
}
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  5% { opacity: 1; }
  25% { transform: translate(-40px, 25vh) rotate(120deg); }
  50% { transform: translate(20px, 50vh) rotate(220deg); }
  75% { transform: translate(-30px, 75vh) rotate(330deg); }
  92% { opacity: 1; }
  100% { transform: translate(10px, 105vh) rotate(420deg); opacity: 0; }
}
