/* Andon theme: page tint, lantern-light motion, and the rising-lantern cover. */

/* page tint: faint pools of lantern light on the paper */
.view[data-theme="andon"] {
  --th: #c98a4a;
  background-image:
    radial-gradient(circle at 70px 80px, rgba(226, 160, 84, .075), transparent 52px),
    radial-gradient(circle at 280px 46px, rgba(240, 190, 120, .09), transparent 30px),
    radial-gradient(circle at 210px 230px, rgba(214, 140, 96, .06), transparent 64px),
    radial-gradient(circle at 370px 180px, rgba(240, 190, 120, .08), transparent 24px);
  background-size: 420px 300px;
}

/* ---- painting */
/* a candle behind paper: small, slow, never dark */
.fx-a.fx-andon-flick { animation-name: fx-andon-flick; }
@keyframes fx-andon-flick {
  0% { opacity: .8; }
  17% { opacity: .96; }
  33% { opacity: .86; }
  52% { opacity: 1; }
  69% { opacity: .9; }
  85% { opacity: .98; }
  100% { opacity: .84; }
}
/* a column of light on moving water */
.fx-a.fx-andon-waver {
  animation-name: fx-andon-waver;
  transform-box: fill-box;
  transform-origin: 50% 0;
}
@keyframes fx-andon-waver {
  from { transform: scaleX(.8) skewX(-6deg); opacity: .72; }
  to { transform: scaleX(1.18) skewX(6deg); opacity: 1; }
}
.fx-a.fx-andon-tail { animation-name: fx-andon-tail; }
@keyframes fx-andon-tail {
  from { transform: rotate(-9deg); }
  to { transform: rotate(13deg); }
}

/* ---- transition */
.fx-andon-cover,
.fx-andon-sky,
.fx-andon-grain,
.fx-andon-dawn,
.fx-andon-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-andon-cover { z-index: 1; background: #5a4379; }
.fx-andon-sky svg { display: block; width: 100%; height: 100%; }
.fx-andon-grain {
  background-image: var(--fx-u-grain), var(--fx-u-fibre);
  opacity: .32;
  mix-blend-mode: soft-light;
}
/* the dusk growing light as it lifts */
.fx-andon-dawn {
  background: linear-gradient(to top, rgba(255, 238, 210, .96), rgba(255, 218, 182, .8) 42%, rgba(248, 196, 176, .5));
  opacity: 0;
}
.fx-andon-cv { z-index: 3; pointer-events: none; }

/* caption: gold-cream brush glyph in a pool of lantern light, label between two gold hairlines */
.fx-cap--andon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(120vmin, 96vw);
  height: 84vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 196, 128, .26), rgba(255, 176, 120, .1) 55%, rgba(255, 176, 120, 0));
  animation: fx-andon-pool 420ms ease-out both;
}
@keyframes fx-andon-pool {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fx-cap--andon .fx-cap-glyph {
  position: relative;
  color: #fff1cf;
  text-shadow:
    0 0 .03em rgba(255, 246, 220, .8),
    0 .02em .07em rgba(58, 40, 86, .55),
    0 0 .1em rgba(255, 190, 116, .6);
}
.fx-cap--andon .fx-cap-label {
  position: relative;
  padding: .7em 1.2em .7em 1.62em;
  border-radius: 0;
  border-top: 1px solid rgba(246, 222, 170, .8);
  border-bottom: 1px solid rgba(246, 222, 170, .8);
  background: linear-gradient(90deg, rgba(60, 44, 92, 0), rgba(60, 44, 92, .34) 30%, rgba(60, 44, 92, .34) 70%, rgba(60, 44, 92, 0));
  box-shadow: none;
  color: #f8e3b4;
  text-shadow: 0 1px 6px rgba(48, 34, 76, .7), 0 0 14px rgba(255, 190, 120, .3);
}
.fx-cap--andon.fx-cap--tate .fx-cap-label {
  padding: 1.2em .7em .9em;
  border: 0;
  border-left: 1px solid rgba(246, 222, 170, .8);
  border-right: 1px solid rgba(246, 222, 170, .8);
  background: linear-gradient(180deg, rgba(60, 44, 92, 0), rgba(60, 44, 92, .34) 30%, rgba(60, 44, 92, .34) 70%, rgba(60, 44, 92, 0));
}

@media (prefers-reduced-motion: reduce) {
  .fx-a.fx-andon-flick,
  .fx-a.fx-andon-waver,
  .fx-a.fx-andon-tail,
  .fx-cap--andon::before { animation: none; }
}
