/* Fern crystals grow from two edges of the opening glass. */
.ice-pane {
  position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:1;
  opacity:var(--start,1); contain:strict;
}
.ice-pane::before, .ice-pane::after, .ice-bloom {
  position:absolute; aspect-ratio:1024/704;
  background:url('media/kinetic/fern-frost.webp') center/contain no-repeat;
}
.ice-pane::before, .ice-pane::after {content:""}
.ice-pane::before {
  width:clamp(270px,38vw,650px); left:-4.5%; bottom:-8%;
  opacity:.78; transform:rotate(-9deg);
}
.ice-pane::after {
  width:clamp(220px,28vw,490px); right:-6%; top:-6%;
  opacity:.70; transform:rotate(173deg);
}
.ice-prints {position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:5}
html[data-portal-active] .ice-prints, #stage:not([data-chapter="0"]) .ice-prints {visibility:hidden}
html[data-portal-active] .ice-bloom.growing {animation-play-state:paused}
.ice-bloom {
  width:clamp(158px,24vmin,282px); left:0; top:0; opacity:0;
  transform-origin:8% 85%;
}
.ice-bloom.growing {
  animation:fern-formation 1.85s both;
}
@keyframes fern-formation {
  0% {opacity:0;clip-path:circle(0% at 8% 85%)}
  8% {opacity:.88}
  45% {clip-path:circle(84% at 8% 85%);opacity:1}
  64% {clip-path:circle(120% at 8% 85%);opacity:.94}
  100% {clip-path:circle(120% at 8% 85%);opacity:0}
}
#stage:not([data-chapter="0"]) :is(.ice-prints,.ice-pane),
html[data-portal-active] :is(.ice-prints,.ice-pane) {visibility:hidden}
@media (max-width:740px) and (orientation:portrait) {
  .ice-pane::before {left:-13%;bottom:2%;width:62vw;opacity:.69}
  .ice-pane::after {right:-19%;top:1%;width:62vw;opacity:.61}
}
@media (prefers-reduced-motion:reduce) {
  .ice-bloom {display:none}
}
