/* Karesansui: raked sand garden. Transition stage, caption, page tint. */

.fx-stage--karesansui { background: transparent; }

.fx-karesansui-sheet,
.fx-karesansui-stones,
.fx-karesansui-cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fx-karesansui-sheet svg,
.fx-karesansui-stones svg { display: block; width: 100%; height: 100%; }
.fx-karesansui-sheet { will-change: clip-path; }
.fx-karesansui-stones { pointer-events: none; }
.fx-karesansui-ring,
.fx-karesansui-grp { transform-box: fill-box; transform-origin: 50% 50%; }

.fx-karesansui-rake {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 0;
  will-change: transform;
  filter: drop-shadow(5px 8px 5px rgba(110, 92, 64, .3));
}

/* caption: ink on sand, with a thin gold-ruled label */
.fx-cap--karesansui .fx-cap-glyph {
  color: #4a3f44;
  text-shadow:
    0 0 .1em rgba(255, 250, 240, .95),
    0 0 .45em rgba(255, 250, 240, .8),
    .02em .035em .03em rgba(138, 122, 102, .35);
}
.fx-cap--karesansui .fx-cap-label {
  padding: .62em 1.2em .62em 1.62em;
  border-radius: 0;
  color: #75654f;
  background: linear-gradient(90deg, rgba(253, 248, 238, 0), rgba(253, 248, 238, .82) 18%, rgba(253, 248, 238, .82) 82%, rgba(253, 248, 238, 0));
  box-shadow: none;
  border-top: 1px solid rgba(207, 174, 120, .9);
  border-bottom: 1px solid rgba(207, 174, 120, .9);
}
.fx-cap--tate.fx-cap--karesansui .fx-cap-label {
  padding: 1.2em .5em .9em;
  border: 0;
  border-left: 1px solid rgba(207, 174, 120, .9);
  border-right: 1px solid rgba(207, 174, 120, .9);
  background: linear-gradient(180deg, rgba(253, 248, 238, 0), rgba(253, 248, 238, .82) 18%, rgba(253, 248, 238, .82) 82%, rgba(253, 248, 238, 0));
}

/* page tint: the faintest raked lines */
.view[data-theme="karesansui"] {
  --th: #8a7a66;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='16'%3E%3Cpath d='M0 8q70-5 140 0t140 0' fill='none' stroke='%238a7a66' stroke-opacity='.075'/%3E%3Cpath d='M0 9.2q70-5 140 0t140 0' fill='none' stroke='%23fffaf0' stroke-opacity='.5'/%3E%3C/svg%3E");
}

/* a petal that comes down, rests on the sand for a while, then fades */
.fx-karesansui-settle {
  animation: fx-karesansui-settle 20s linear infinite both;
}
@keyframes fx-karesansui-settle {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  4% { opacity: .95; }
  20% { transform: translate(calc(var(--dx, -60px) * .62), calc(var(--dy, 300px) * .5)) rotate(calc(var(--rot, 300deg) * .6)); }
  38% { transform: translate(var(--dx, -60px), var(--dy, 300px)) rotate(var(--rot, 300deg)) scaleY(.5); opacity: .95; animation-timing-function: step-end; }
  88% { transform: translate(var(--dx, -60px), var(--dy, 300px)) rotate(var(--rot, 300deg)) scaleY(.5); opacity: .95; animation-timing-function: ease-in; }
  100% { transform: translate(var(--dx, -60px), var(--dy, 300px)) rotate(var(--rot, 300deg)) scaleY(.5); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-karesansui-settle { animation: none; opacity: 0; }
}
