/* The seasons: <html data-season="spring|summer|autumn|winter"> (js/season.js).
   Each season is a set of pale candy colours for the foliage, the bushes, the grass and the
   falling things, plus snow caps in winter. Everything that changes with the season reads these. */
:root, [data-season="spring"] {
  --leaf-1: #cdeec8; --leaf-2: #e6f8df; --leaf-edge: #a9d8a6;        /* round + tall trees */
  --leafb-1: #ffd6e0; --leafb-2: #fff0f3; --leafb-edge: #f4b8c7;     /* the "alt" trees: cherry blossom */
  --bush-1: #c9ecd0; --bush-2: #e4f7e6; --bush-edge: #a6d8b2;
  --grass-1: #dcf2df; --grass-2: #e8f8e8; --grass-edge: #c3e5c8;
  --flower-1: #ffd3dc; --flower-2: #e7dcff;
  --water: #d4effa; --water-hi: #e8f8fd; --water-edge: #a9d9ec;
  --fall-1: #ffd3da; --fall-2: #ffe1d6; --fall-3: #ffdde8; --fall-edge: #f6bccb;
  --ground-1: #d9f1e3; --ground-2: #e6f6ea; --ground-3: #f3faf1;     /* the spot views' ground */
  /* the far mountains (spot views and the path): fresh green, a few blossom patches, a thin cap */
  --mt-body: #e3f3de; --mt-edge: #c4e2c0; --mt-pa: #ffdce6; --mt-pb: #d6eed2; --mt-pc: #ffe9ef;
  --mt-patch: 1; --mt-snow: 0; --mt-snow-sm: 1;
}
[data-season="summer"] {
  --leaf-1: #bfe8c2; --leaf-2: #dcf5d8; --leaf-edge: #95cf9e;
  --leafb-1: #c4ead9; --leafb-2: #e2f7ee; --leafb-edge: #96d0b7;
  --bush-1: #bde6c6; --bush-2: #ddf4e0; --bush-edge: #93cda2;
  --grass-1: #d4efd9; --grass-2: #e2f6e3; --grass-edge: #b6dfbf;
  --flower-1: #e2d8ff; --flower-2: #d6f0ff;
  --water: #cdeefa; --water-hi: #e6f8fd; --water-edge: #9fd5ea;
  --fall-1: #c6ebbe; --fall-2: #d8f2c9; --fall-3: #bfe6c9; --fall-edge: #9fd3a5;
  --ground-1: #d3efdb; --ground-2: #e2f5e6; --ground-3: #f1faf0;
  --mt-body: #d6efe1; --mt-edge: #afd9c4; --mt-pa: #c2e5dc; --mt-pb: #c7e8cf; --mt-pc: #e2f5e7;
  --mt-patch: 1; --mt-snow: 0; --mt-snow-sm: 0;
}
[data-season="autumn"] {
  --leaf-1: #ffd7b8; --leaf-2: #ffeedd; --leaf-edge: #f1b897;           /* soft apricot */
  --leafb-1: #ffcfc4; --leafb-2: #ffe9e2; --leafb-edge: #eeaa9c;        /* soft peach maple */
  --bush-1: #f8e3aa; --bush-2: #fdf2cf; --bush-edge: #e5c97f;           /* pale yellow */
  --grass-1: #eef0d8; --grass-2: #f6f6e4; --grass-edge: #ddddb8;
  --flower-1: #ffd9c4; --flower-2: #f8e3aa;
  --water: #d6ecf6; --water-hi: #ebf6fb; --water-edge: #aed6e6;
  --fall-1: #ffc9b0; --fall-2: #ffe2a6; --fall-3: #ffd3c4; --fall-edge: #eeab92;
  --ground-1: #ecefd9; --ground-2: #f3f4e3; --ground-3: #f9f8ee;
  --mt-body: #fbe7d6; --mt-edge: #efc9aa; --mt-pa: #ffd4c0; --mt-pb: #f9e4ac; --mt-pc: #f8cfc2;
  --mt-patch: 1; --mt-snow: 0; --mt-snow-sm: 0;
}
[data-season="winter"] {
  --leaf-1: #dcebf0; --leaf-2: #f1f8fa; --leaf-edge: #b9d3dd;           /* frosty evergreen */
  --leafb-1: #e6e2f6; --leafb-2: #f6f4fd; --leafb-edge: #c9c1e8;
  --bush-1: #d9ece6; --bush-2: #eef7f4; --bush-edge: #b5d4ca;
  --grass-1: #f3f6fb; --grass-2: #fbfcff; --grass-edge: #dde3ef;        /* a whiter ground */
  --flower-1: transparent; --flower-2: transparent;
  --water: #e1eef8; --water-hi: #f2f8fc; --water-edge: #bcd5e6;
  --fall-1: #ffffff; --fall-2: #ffffff; --fall-3: #ffffff; --fall-edge: #d5d9ef;
  --ground-1: #eef2f9; --ground-2: #f5f7fc; --ground-3: #fbfcff;
  --mt-body: #dfe3f8; --mt-edge: #c9cfee; --mt-pa: transparent; --mt-pb: transparent; --mt-pc: transparent;
  --mt-patch: 0; --mt-snow: 1; --mt-snow-sm: 0;
}

/* the falling things are tiny drawings (inline SVG data, no image files): a sakura petal with its
   notch, a green leaf with a midrib, a five-lobed maple leaf with a stem and veins, a soft snowflake.
   Three tints per season, picked by :nth-child below. */
:root, [data-season="spring"] {
  --fall-img-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 22.4C5.2 18.6 3.6 10.4 7.6 3.4Q10 4.4 12 7.2Q14 4.4 16.4 3.4C20.4 10.4 18.8 18.6 12 22.4Z' fill='%23ffd3da' stroke='%23f2b3c2' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M12 19.6V12.4' fill='none' stroke='%23fff6f8' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --fall-img-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 22.4C5.2 18.6 3.6 10.4 7.6 3.4Q10 4.4 12 7.2Q14 4.4 16.4 3.4C20.4 10.4 18.8 18.6 12 22.4Z' fill='%23ffe1e6' stroke='%23f4bccb' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M12 19.6V12.4' fill='none' stroke='%23fff6f8' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --fall-img-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 22.4C5.2 18.6 3.6 10.4 7.6 3.4Q10 4.4 12 7.2Q14 4.4 16.4 3.4C20.4 10.4 18.8 18.6 12 22.4Z' fill='%23ffdde8' stroke='%23efb2c6' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M12 19.6V12.4' fill='none' stroke='%23fff6f8' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-season="summer"] {
  --fall-img-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M3.2 20.8C2.6 10.6 9.6 3.4 20.8 3.2C21 13.8 13.8 21.2 3.2 20.8Z' fill='%23c6ebbe' stroke='%2394cc98' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M4.6 19.4L16.6 7.4' fill='none' stroke='%23f4fbf2' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --fall-img-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M3.2 20.8C2.6 10.6 9.6 3.4 20.8 3.2C21 13.8 13.8 21.2 3.2 20.8Z' fill='%23d8f2c9' stroke='%23a2d39e' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M4.6 19.4L16.6 7.4' fill='none' stroke='%23f4fbf2' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --fall-img-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M3.2 20.8C2.6 10.6 9.6 3.4 20.8 3.2C21 13.8 13.8 21.2 3.2 20.8Z' fill='%23bfe6c9' stroke='%238fc9a0' stroke-width='1.4' stroke-linejoin='round'/%3E %3Cpath d='M4.6 19.4L16.6 7.4' fill='none' stroke='%23f4fbf2' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}
[data-season="autumn"] {
  --fall-img-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 15.4L12.6 22.6' fill='none' stroke='%23eba486' stroke-width='1.6' stroke-linecap='round'/%3E %3Cpath d='M12 1.4Q15 4.2 14.5 8.4Q18 5 21.8 7Q21.2 10.8 17.6 12.4Q20.8 14.6 20.2 18.6Q16.4 18.8 13.2 15.8Q12.6 16.5 12 16.7Q11.4 16.5 10.8 15.8Q7.6 18.8 3.8 18.6Q3.2 14.6 6.4 12.4Q2.8 10.8 2.2 7Q6 5 9.5 8.4Q9 4.2 12 1.4Z' fill='%23ffc9b0' stroke='%23eba486' stroke-width='1.3' stroke-linejoin='round'/%3E %3Cpath d='M12 15V5.6M12 12.4L16.4 9.4M12 12.4L7.6 9.4' fill='none' stroke='%23fff1e8' stroke-width='.8' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --fall-img-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 15.4L12.6 22.6' fill='none' stroke='%23e3bf72' stroke-width='1.6' stroke-linecap='round'/%3E %3Cpath d='M12 1.4Q15 4.2 14.5 8.4Q18 5 21.8 7Q21.2 10.8 17.6 12.4Q20.8 14.6 20.2 18.6Q16.4 18.8 13.2 15.8Q12.6 16.5 12 16.7Q11.4 16.5 10.8 15.8Q7.6 18.8 3.8 18.6Q3.2 14.6 6.4 12.4Q2.8 10.8 2.2 7Q6 5 9.5 8.4Q9 4.2 12 1.4Z' fill='%23ffe2a6' stroke='%23e3bf72' stroke-width='1.3' stroke-linejoin='round'/%3E %3Cpath d='M12 15V5.6M12 12.4L16.4 9.4M12 12.4L7.6 9.4' fill='none' stroke='%23fff8e4' stroke-width='.8' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
  --fall-img-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath d='M12 15.4L12.6 22.6' fill='none' stroke='%23eeab92' stroke-width='1.6' stroke-linecap='round'/%3E %3Cpath d='M12 1.4Q15 4.2 14.5 8.4Q18 5 21.8 7Q21.2 10.8 17.6 12.4Q20.8 14.6 20.2 18.6Q16.4 18.8 13.2 15.8Q12.6 16.5 12 16.7Q11.4 16.5 10.8 15.8Q7.6 18.8 3.8 18.6Q3.2 14.6 6.4 12.4Q2.8 10.8 2.2 7Q6 5 9.5 8.4Q9 4.2 12 1.4Z' fill='%23ffd6bd' stroke='%23eeab92' stroke-width='1.3' stroke-linejoin='round'/%3E %3Cpath d='M12 15V5.6M12 12.4L16.4 9.4M12 12.4L7.6 9.4' fill='none' stroke='%23fff4ec' stroke-width='.8' stroke-linecap='round' opacity='.85'/%3E%3C/svg%3E");
}

/* snow caps on roofs, lanterns, tree tops and the offering box: winter only. A custom property, so
   it also reaches the caps inside <use> copies (trees, bushes, lanterns), which selectors cannot. */
:root { --snow: none; }
[data-season="winter"] { --snow: inline; }
.snow { display: var(--snow); fill: #fff; stroke: #e3e6f3; stroke-width: 1.2; stroke-linejoin: round; }

/* ---------- falling petals / leaves / snow, over every view ---------- */
.fall { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
body[data-view="path"] .fall { z-index: 2; }        /* in front of the path, behind the header */
.fall i {
  position: absolute; top: -24px; display: block;
  width: 14px; height: 14px; opacity: .95;
  background: var(--fall-img-1) center / contain no-repeat;
  animation: fall 11s linear infinite;
}
.fall i:nth-child(1) { left: 6%; animation-delay: -1s; }
.fall i:nth-child(2) { left: 18%; animation-delay: -6s; animation-duration: 13s; background-image: var(--fall-img-2); }
.fall i:nth-child(3) { left: 31%; animation-delay: -3s; animation-duration: 15s; }
.fall i:nth-child(4) { left: 44%; animation-delay: -9s; animation-duration: 12s; background-image: var(--fall-img-3); }
.fall i:nth-child(5) { left: 56%; animation-delay: -4.5s; animation-duration: 14s; }
.fall i:nth-child(6) { left: 67%; animation-delay: -11s; animation-duration: 16s; background-image: var(--fall-img-2); }
.fall i:nth-child(7) { left: 77%; animation-delay: -7.5s; animation-duration: 12.5s; background-image: var(--fall-img-3); }
.fall i:nth-child(8) { left: 87%; animation-delay: -2.2s; animation-duration: 13.5s; }
.fall i:nth-child(9) { left: 94%; animation-delay: -12.5s; animation-duration: 15.5s; background-image: var(--fall-img-2); }
.fall i:nth-child(10) { left: 50%; animation-delay: -5.6s; animation-duration: 17s; background-image: var(--fall-img-3); }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(26px, 26vh) rotate(160deg); }
  50% { transform: translate(-16px, 52vh) rotate(300deg); }
  75% { transform: translate(22px, 78vh) rotate(470deg); }
  100% { transform: translate(-8px, 108vh) rotate(640deg); }
}
/* summer: only a few green leaves */
[data-season="summer"] .fall i { width: 15px; height: 15px; }
[data-season="summer"] .fall i:nth-child(n+5) { display: none; }
/* autumn: little maple leaves, a bit bigger so the five lobes read */
[data-season="autumn"] .fall i { width: 21px; height: 21px; }
[data-season="autumn"] .fall i:nth-child(3n) { width: 18px; height: 18px; }
/* winter: round snowflakes that drift, with a soft outline so they show on the pale sky */
[data-season="winter"] .fall i {
  width: 9px; height: 9px; border-radius: 50%; opacity: 1; background: #fff;
  box-shadow: 0 0 0 1.5px var(--fall-edge), 0 0 6px rgba(190, 196, 235, .8);
  animation-name: snow; animation-duration: 14s;
}
[data-season="winter"] .fall i:nth-child(3n) { width: 6px; height: 6px; }
[data-season="winter"] .fall i:nth-child(4n+1) { width: 11px; height: 11px; }
@keyframes snow {
  0% { transform: translate(0, 0); }
  25% { transform: translate(18px, 26vh); }
  50% { transform: translate(-12px, 52vh); }
  75% { transform: translate(14px, 78vh); }
  100% { transform: translate(-6px, 108vh); }
}

/* the spot views' ground follows the season */
.grounds .ground { background: linear-gradient(180deg, var(--ground-1) 0, var(--ground-2) 46px, var(--ground-3) 100%); }

@media (prefers-reduced-motion: reduce) {
  .fall { display: none; }
}
