/* Fujidana theme: page tint, falling florets, butterflies and bees, and the raceme curtain. */

.view[data-theme="fujidana"] {
  --th: #8f7fc0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='%238f7fc0' fill-opacity='.055'%3E%3Cg id='r'%3E%3Cpath d='M0,0v8' stroke='%238f7fc0' stroke-opacity='.06' stroke-width='.8' fill='none'/%3E%3Ccircle cx='-3' cy='11' r='3.4'/%3E%3Ccircle cx='3.4' cy='13' r='3.4'/%3E%3Ccircle cx='-3.6' cy='18' r='3.2'/%3E%3Ccircle cx='3' cy='20' r='3.1'/%3E%3Ccircle cx='-2.8' cy='25' r='2.8'/%3E%3Ccircle cx='2.6' cy='27.4' r='2.7'/%3E%3Ccircle cx='-2' cy='32' r='2.4'/%3E%3Ccircle cx='2' cy='34.4' r='2.2'/%3E%3Ccircle cx='-1.2' cy='38.6' r='1.9'/%3E%3Ccircle cx='1.2' cy='41.4' r='1.6'/%3E%3Ccircle cx='0' cy='45' r='1.3'/%3E%3Ccircle cx='0' cy='48.4' r='1'/%3E%3C/g%3E%3Cuse href='%23r' transform='translate(52 20) rotate(5) scale(1.3)'/%3E%3Cuse href='%23r' transform='translate(88 34) rotate(-4) scale(.8)'/%3E%3Cuse href='%23r' transform='translate(214 150) rotate(-7) scale(1.1)'/%3E%3Cuse href='%23r' transform='translate(246 138) rotate(3) scale(1.5)'/%3E%3Cuse href='%23r' transform='translate(130 232) rotate(8) scale(.9)'/%3E%3C/g%3E%3Cg fill='%23c3b2ea' fill-opacity='.06'%3E%3Ccircle cx='170' cy='70' r='17'/%3E%3Ccircle cx='40' cy='190' r='24'/%3E%3Ccircle cx='282' cy='270' r='13'/%3E%3Ccircle cx='296' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- painting: a floret comes down swinging from side to side */
.fx-a.fx-fujidana-fall {
  animation-name: fx-fujidana-fall;
  animation-direction: normal;
  animation-timing-function: linear;
}
.fx-a.fx-fujidana-rock {
  animation-name: fx-fujidana-rock;
  animation-direction: normal;
}
@keyframes fx-fujidana-fall {
  0% { transform: translate(var(--x, 0px), var(--y, 0px)); opacity: 0; }
  10% { opacity: 1; }
  86% { opacity: 1; }
  100% { transform: translate(calc(var(--x, 0px) + var(--dx, -60px)), calc(var(--y, 0px) + var(--dy, 400px))); opacity: 0; }
}
@keyframes fx-fujidana-rock {
  0%, 100% {
    transform: translate(calc(var(--sw, 20px) * -1), calc(var(--up, 5px) * -1)) rotate(calc(var(--tilt, 30deg) * -1));
    animation-timing-function: cubic-bezier(.45, 0, .8, .7);
  }
  25%, 75% {
    transform: translate(0, var(--up, 5px)) rotate(0deg);
    animation-timing-function: cubic-bezier(.2, .3, .55, 1);
  }
  50% {
    transform: translate(var(--sw, 20px), calc(var(--up, 5px) * -1)) rotate(var(--tilt, 30deg));
    animation-timing-function: cubic-bezier(.45, 0, .8, .7);
  }
}

/* a butterfly wanders round a loose loop; a bee visits, hangs, moves on */
.fx-a.fx-fujidana-wander {
  animation-name: fx-fujidana-wander;
  animation-direction: normal;
  animation-timing-function: ease-in-out;
}
@keyframes fx-fujidana-wander {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  22% { transform: translate(var(--ax, -60px), var(--ay, -30px)) rotate(-28deg); }
  48% { transform: translate(var(--bx, -20px), var(--by, 30px)) rotate(18deg); }
  74% { transform: translate(var(--cx, 40px), var(--cy, -20px)) rotate(40deg); }
}
.fx-a.fx-fujidana-visit {
  animation-name: fx-fujidana-visit;
  animation-direction: normal;
  animation-timing-function: cubic-bezier(.6, 0, .3, 1);
}
@keyframes fx-fujidana-visit {
  0%, 24% { transform: translate(0, 0); }
  32%, 52% { transform: translate(var(--ax, -14px), var(--ay, -20px)); }
  60%, 76% { transform: translate(var(--bx, 8px), var(--by, 18px)); }
  84%, 94% { transform: translate(var(--cx, 20px), var(--cy, 8px)); }
  100% { transform: translate(0, 0); }
}
.fx-fujidana-flap { animation: fx-fujidana-flap .34s ease-in-out infinite alternate; }
@keyframes fx-fujidana-flap {
  from { transform: scaleX(1); }
  to { transform: scaleX(.3); }
}
.fx-fujidana-buzz { animation: fx-fujidana-buzz .12s linear infinite alternate; }
@keyframes fx-fujidana-buzz {
  from { transform: scaleY(1); }
  to { transform: scaleY(.6); }
}
.fx-paused .fx-fujidana-flap,
.fx-paused .fx-fujidana-buzz { animation-play-state: paused; }

/* ---- transition */
.fx-fujidana-veil,
.fx-fujidana-curtain { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-fujidana-veil { z-index: 1; }
.fx-fujidana-curtain { z-index: 3; pointer-events: none; }

/* violet light behind the racemes: morning sun from the upper right, a pale pool in the middle */
.fx-fujidana-veil {
  background-color: #d6ccf2;
  background-image:
    radial-gradient(48% 44% at 50% 50%, rgba(254, 251, 255, .95), rgba(250, 245, 255, .55) 58%, rgba(250, 245, 255, 0) 100%),
    radial-gradient(90% 80% at 100% 0%, rgba(255, 246, 220, .95), rgba(255, 244, 222, .5) 45%, rgba(255, 244, 222, 0) 78%),
    radial-gradient(70% 60% at 0% 100%, rgba(164, 148, 220, .5), rgba(164, 148, 220, 0) 72%),
    radial-gradient(64% 56% at 100% 100%, rgba(214, 186, 232, .5), rgba(214, 186, 232, 0) 72%),
    radial-gradient(60% 50% at 0% 0%, rgba(184, 188, 240, .5), rgba(184, 188, 240, 0) 70%),
    linear-gradient(170deg, #f1ebfb 0%, #ddd3f5 46%, #c4b6ec 100%);
}
.fx-fujidana-veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--fx-u-grain), var(--fx-u-fibre);
  opacity: .18;
}

/* caption: deep violet on the pale pool, gold hairlines round the label */
.fx-cap--fujidana .fx-cap-glyph {
  color: #5d4b9c;
  text-shadow:
    0 0 .05em rgba(255, 252, 255, .95),
    0 0 .28em rgba(255, 251, 255, .9),
    0 0 .8em rgba(250, 244, 255, .8),
    0 .04em .14em rgba(116, 92, 180, .32);
}
.fx-cap--fujidana .fx-cap-label {
  border-radius: 4px;
  color: #5d4b9c;
  background: linear-gradient(135deg, #fffdf7, #f8f2fb 58%, #ede4f8);
  box-shadow:
    inset 0 0 0 1px rgba(207, 174, 120, .95),
    inset 0 0 0 3px #fcf8f6,
    inset 0 0 0 4px rgba(207, 174, 120, .55),
    0 12px 26px -12px rgba(84, 62, 150, .6);
}

@media (prefers-reduced-motion: reduce) {
  .fx-a.fx-fujidana-fall,
  .fx-a.fx-fujidana-rock,
  .fx-a.fx-fujidana-wander,
  .fx-a.fx-fujidana-visit,
  .fx-fujidana-flap,
  .fx-fujidana-buzz { animation: none; }
  /* florets hang where they were mid-fall */
  .fx-a.fx-fujidana-fall {
    transform: translate(calc(var(--x, 0px) + var(--dx, 0px) * var(--f, .5)), calc(var(--y, 0px) + var(--dy, 0px) * var(--f, .5)));
  }
}
